Skip to content

feat: upgrade Rspack to 2.2.1 and matching swc toolchain - #359

Merged
dgaponov merged 1 commit into
mainfrom
chore/upgrade-rspack-2.2.1
Sep 14, 2026
Merged

dgaponov merged 1 commit into
mainfrom
chore/upgrade-rspack-2.2.1

Conversation

@dgaponov

Copy link
Copy Markdown
Contributor

What

package before after
@rspack/core 2.1.2 2.2.1
@rspack/dev-server ^2.1.0 ^2.2.1
@swc/core 1.15.43 1.16.1
@swc/plugin-transform-imports 12.14.1 13.0.0
@rsdoctor/{rspack,webpack}-plugin 1.6.1 (exact) ^1.6.4

Also dropped the @rsdoctor/* entries from pnpm.overrides.

Why

Rspack 2.2.x embeds swc_core 77, so the swc toolchain has to move with it. Per the swc plugin compat range for 3012:

  • rspack 2.2.02.2.3@swc/core 1.16.01.16.1@swc/plugin-transform-imports 13.0.0

That is why @swc/core is pinned at 1.16.1 and not the newer 1.16.2 (already on swc_core 78), and why the wasm plugin is 13.0.0 and not 14.0.0 — a mismatched wasm plugin fails to load at build time.

The remaining rspack-adjacent deps (@rspack/plugin-react-refresh, ts-checker-rspack-plugin, rspack-manifest-plugin, worker-rspack-loader, swc-loader, @swc/cli) are already on caret ranges resolving to their latest versions, and all declare @rspack/core peers that accept ^2 — no manifest change needed.

Rsdoctor

Bumped to 1.6.4 alongside Rspack, and relaxed from an exact pin:

  • The pnpm.overrides entries were no-ops — nothing in the tree depends on rsdoctor transitively, only our own direct deps, and pnpm.overrides is not published to consumers.
  • Lockstep between the two plugins is guaranteed by rsdoctor itself: each plugin pins @rsdoctor/core|sdk|graph|types|utils to its own exact version.
  • An exact pin in dependencies of a published library forces a duplicate install on any consumer that also depends on rsdoctor.

Reviewer notes

  • The public rsdoctorConfig type in src/common/models/index.ts is derived from the RsdoctorRspackPlugin constructor options, so a future rsdoctor minor can shift app-builder's emitted .d.ts. Inside this repo the lockfile pins it; happy to restore the exact pin if that trade-off isn't wanted.
  • The @statoscope/webpack-stats-extension-package-info peer warning (unmet peer @rspack/core@^1.0.0: found 2.2.1) is pre-existing — statoscope already didn't declare rspack 2.x support before this PR.

Verification

  • pnpm typecheck — passes
  • pnpm test — 49/49 passing
  • examples/ssr (bundler: 'rspack') builds successfully against 2.2.1
  • Verified the @swc/plugin-transform-imports@13.0.0 wasm plugin actually loads and transforms under @swc/core@1.16.1

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread package.json
"overrides": {
"@swc/types": "0.1.28",
"@rsdoctor/rspack-plugin": "1.6.1",
"@rsdoctor/webpack-plugin": "1.6.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: 🔥

@dgaponov
dgaponov merged commit 93e7561 into main Sep 14, 2026
3 checks passed
@dgaponov
dgaponov deleted the chore/upgrade-rspack-2.2.1 branch September 14, 2026 14:06
@dgaponov dgaponov changed the title chore(deps): upgrade Rspack to 2.2.1 and matching swc toolchain feat: upgrade Rspack to 2.2.1 and matching swc toolchain Sep 14, 2026
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.

2 participants