Skip to content

chore(deps): move the repo to @rspack/core 2 - #5126

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
chore/rspack-2
Sep 26, 2026
Merged

ScriptedAlchemy merged 3 commits into
mainfrom
chore/rspack-2

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Why

The runtime pruning RFC reads compiler.platform, which only exists in Rspack 2. The repo still develops and tests @module-federation/rspack against @rspack/core 1.3.9, so that work cannot be built or tested here. This PR moves the repo's own toolchain to Rspack 2. It does not change what users may install: the @rspack/core peer range of @module-federation/rspack stays ^0.7.0 || ^1.0.0 || ^2.0.0-0.

Version

@rspack/core and @rspack/cli 2.1.10, the newest patch on the 2.1 line. The rstack packages in the repo are on Rspack 2.1: @rsbuild/core 2.1.4 depends on @rspack/core ~2.1.2, and @rstest/core 0.11.6 pulls @rsbuild/core 2.1.10, which depends on ~2.1.8. Both ranges accept 2.1.10, so the lockfile keeps a single Rspack 2.1 copy. Rspack 2.2.x (latest 2.2.7) is outside both ranges and would need an @rsbuild/core 2.2 bump.

Bumps

  • Root devDependencies: @rspack/core and @rspack/cli 1.3.9 to 2.1.10. @rspack/dev-server 1.1.1 to 2.2.1, because @rspack/cli 2 no longer installs the dev server and peers on @rspack/dev-server 2.
  • packages/rspack devDependencies: @rspack/core ^1.0.2 to 2.1.10.
  • apps/manifest-demo/3010-rspack-provider: @rspack/core ^1.0.2 to 2.1.10. The 3011 and 3012 providers and react-ts-remote use the root copy.

Other packages are unchanged. packages/modernjs-v3 already pins @rspack/core 2.0.6.

Lockfile side effects:

  • Every @rsbuild/core 2.1.x consumer now resolves @rspack/core 2.1.10 instead of 2.1.8 or 2.1.2. Both are within their ranges.
  • The registry copies of @module-federation/runtime-tools and its dependencies that the rstack packages peer on moved from 2.9.0 to 2.9.1. This matches the workspace version.
  • @rspack/core 1.3.9, 2.1.2, 2.1.8, and the dev server 1.x dependency tree are gone.

Fallout and fixes

packages/rspack and packages/rsbuild-plugin needed no source changes. Both type-check and build against Rspack 2.1.10. All fallout was in app configs:

  • 3010-rspack-provider set experiments.css: true, which Rspack 2 removed. The build failed on stuff.module.css with a JavaScript parse error. The fix replaces the option with a { test: /\.css$/, type: 'css/auto' } rule, as the migration guide prescribes.
  • rspack serve in @rspack/cli 2 enables lazyCompilation: { imports: true } for web targets when the config does not set it. In a remote, the lazy-compilation proxy sends its request to the page origin. For a remote, the page origin is the host, so the request returns HTTP 404 ("Problem communicating active modules to the server"). This failed the manifest dev e2e (preload.cy.ts) when the host loaded the 3011 and 3012 providers. The fix sets lazyCompilation: false in the four remotes built with rspack serve: 3010, 3011, 3012, and react-ts-remote. No CI job serves react-ts-remote; it gets the same fix because pnpm app:ts:dev hits the same 404.

Testing

On 2.1.10:

  • pnpm exec turbo run build --filter=@module-federation/rspack... --filter=@module-federation/enhanced... --filter=@module-federation/rsbuild-plugin...: 17 of 17 tasks passed.
  • tsc --noEmit -p packages/rspack/tsconfig.lib.json: no errors.
  • pnpm --filter @module-federation/rspack run test: 6 of 6 tests passed.
  • pnpm --filter @module-federation/rsbuild-plugin run test: 39 of 39 tests passed.
  • pnpm run ci:local --only=e2e-manifest: exit 0. The dev e2e passed 8 of 8 specs, and the prod e2e passed 8 of 8.

On 2.1.8, the first revision of this PR:

  • CI passed every job, including e2e-manifest, e2e-router, e2e-runtime, e2e-rstest, e2e-modern, e2e-modern-ssr, e2e-node, e2e-next-dev, e2e-next-prod, e2e-treeshake, e2e-metro, devtools, and node20-compat.
  • prepare-node20-compat-packages.mjs and verify-node20-compat.mjs ran on Node 20.19.0 with the exact-version guard removed, because 20.19.5 was not installed locally. The fixture ran build:rspack successfully. All 37 tarballs verified.

Not tested

  • Locally, only e2e-manifest ran on 2.1.10. The other e2e suites build through @rsbuild/core, which now resolves Rspack 2.1.10. CI reruns them on this revision.
  • The packages/modernjs-v3 tests were not run. That package pins its own @rspack/core 2.0.6.
  • The full build-and-test job was not run locally.

Changeset

None. This PR changes only devDependencies, private apps, and the lockfile. No published package changes its behavior or its peer range.

Known leftovers

  • pnpm install warns that root @swc/helpers 0.5.13 does not satisfy the ^0.5.23 peer of @rspack/core 2.1.x. modernjs-v3 already has the same warning with 0.5.17. The builds above pass.
  • Users of @module-federation/rspack who serve a remote with rspack serve from @rspack/cli 2 hit the same lazy-compilation 404. The fix here covers only the demo apps. Supporting lazy compilation in remotes is tracked in Lazy compilation fails in remotes served with rspack serve (Rspack 2) #5129.
  • The DTS step of 3010 logs TYPE-001, because its tsconfig references typings/cssmodule.d.ts and typings/image.d.ts, and neither file exists. The cause does not depend on the Rspack version, and the error does not fail the build.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 582760f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T01:14:48.050631Z e2c4e12 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with ☁️ Zephyr Cloud

The latest preview deployments for this pull request.

Status Name Latest Commit Version URL Updated (UTC)
✅ Deployment successful!
View deployment
website-new 582760f Version ↗ 25 Sept 2026, 04:29

Affected deployment targets

Application Type Target
website-new Environment latest ↗
website-new Tag latest ↗
website-new Tag web_chore-rspack-2_nestor_lopez ↗

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@582760f

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@582760f

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@582760f

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@582760f

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@582760f

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@582760f

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@582760f

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@582760f

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@582760f

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@582760f

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@582760f

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@582760f

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rock@582760f

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@582760f

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@582760f

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@582760f

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@582760f

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@582760f

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@582760f

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/@module-federation/observability-plugin@582760f

@module-federation/playground

pnpm add https://pkg.pr.new/@module-federation/playground@582760f

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@582760f

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@582760f

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@582760f

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@582760f

@module-federation/rstest

pnpm add https://pkg.pr.new/@module-federation/rstest@582760f

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@582760f

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@582760f

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@582760f

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@582760f

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@582760f

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@582760f

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@582760f

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@582760f

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@582760f

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@582760f

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@582760f

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@582760f

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@582760f

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@582760f

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@582760f

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@582760f

commit: 582760f

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Report

13 package(s) changed, 30 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/inject-external-runtime-core-plugin 5.2 kB +26 B (+0.5%) 519 B no change
@module-federation/managers 70.7 kB no change 243 B -1 B (-0.4%)
@module-federation/modern-js 201.0 kB no change 1.2 kB +1 B (+0.1%)
@module-federation/playground 16.08 MB -706 B (-0.0%) 45.8 kB no change
@module-federation/runtime-tools 7.8 kB +65 B (+0.8%) 142 B no change
@module-federation/treeshake-frontend 626.5 kB -5 B (-0.0%) 0 B no change
@module-federation/treeshake-server 774.2 kB -5 B (-0.0%) 124 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -5 B (-0.2%) 2.4 kB -32 B (-1.3%)
@module-federation/core 1.0 kB no change 1.0 kB -33 B (-3.0%)
@module-federation/devtools 30.3 kB -10 B (-0.0%) 30.3 kB -32 B (-0.1%)
@module-federation/enhanced 2.7 kB +6 B (+0.2%) 2.8 kB -43 B (-1.5%)
@module-federation/metro-plugin-rnc-cli 416 B +1 B (+0.2%) 435 B -26 B (-5.6%)
@module-federation/modern-js 5.1 kB +1 B (+0.0%) 5.1 kB +1 B (+0.0%)
@module-federation/node 9.1 kB +2 B (+0.0%) 9.1 kB -27 B (-0.3%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 22.3 kB -7 B (-0.0%) 23.8 kB -16 B (-0.1%) +1.6 kB -9 B

Total dist (raw): 23.41 MB (-625 B (-0.0%))
Total ESM gzip: 111.7 kB (no change)
Total web bundle (gzip): 253.3 kB (-5 B (-0.0%))
Total node bundle (gzip): 255.5 kB (-192 B (-0.1%))
Tracked ./bundler entry gzip: 563 B (no change)
Tracked ./bundler web bundle (gzip): 4.9 kB (no change)
Tracked ./bundler node bundle (gzip): 4.9 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant