Skip to content

feat: upgrade swc_core to v77.1.2 for Rspack 2.2 compatibility - #5

Open
guangzan wants to merge 1 commit into
kmijs:mainfrom
guangzan:feat/upgrade-swc-core-77
Open

guangzan wants to merge 1 commit into
kmijs:mainfrom
guangzan:feat/upgrade-swc-core-77

Conversation

@guangzan

@guangzan guangzan commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

@kmijs/swc-plugin-auto-css-modules is a wasm plugin, and its ABI is tied to the swc_core version of the host (Rspack's builtin:swc-loader). The 0.2.0 release was built against swc_core 65.0.1 (plugin ABI 27.0.0), which only works with Rspack 2.0.1 – 2.0.5. Since kmi declares @rspack/core: ^2.0.0, installs resolve to the latest 2.x (2.2.3, swc_core 77.1.2 / plugin ABI 34.0.0), and builds fail with:

failed to run Wasm plugin transform ... swc_plugin_runner: 34.0.0
The `swc_core` version of the current `rspack_core` is 77.1.2.

See kmijs/kmi#53 for the full analysis. Consumed by kmijs/kmi#54.

This PR rebuilds the plugin against swc_core 77.1.2, so it works with Rspack 2.2.x (all 2.2.x releases use plugin ABI 34.0.0).

Changes

Item Old New
swc_core (plugin + transform) 65.0.1 77.1.2
@swc/core (example) 1.14.0 1.16.2
package version 0.2.0 0.3.0
  • Rebuilt swc_plugin_auto_css_modules.wasm with wasm32-wasip1
  • Bumped example's @swc/core to 1.16.2 — the plugin ABI must match the host @swc/core as well, and 1.14.0 can no longer load the plugin
  • No source changes needed: the swc_core 65 → 77 APIs used by src/lib.rs and transform/ are compatible

Test

$ pnpm test          # cargo test + example node tests
# corejs.ts / index.ts / issues/optional-chaining.ts — all pass

Also verified end-to-end against @rspack/core@2.2.3 in a kmi workspace (plugin wired in via pnpm overrides):

Scenario Result
e2e/max build success
pnpm test:e2e (e2e/max) 11 passed
pnpm test:e2e (e2e/with-qiankun-slave) 10 passed

- Upgrade swc_core from 65.0.1 to 77.1.2 (plugin ABI 27.0.0 -> 34.0.0)
- Rebuild wasm plugin for wasm32-wasip1
- Bump @swc/core in example to 1.16.2 to match the new plugin ABI
- Bump package version to 0.3.0
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1db62b85-7979-4305-8e83-f134d83386fe


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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