- CSS Modules coverage expands to local/global modes, generator options, ICSS @value, custom identifiers, and warning order
- Implement generation-based memory cache eviction
- Add idle cache compaction with interruption handling
- Client Component CSS now uses Flight preinit instead of being injected by wrapping exports with generated link elements, preserving client-reference identity
- Upgrade swc_core from 76 to 77, which changes the serialized AST encoding across the SWC Wasm plugin boundary and requires plugins to be rebuilt
- CSS identifier escaping and unescaping now follow the CSS Syntax standard, emitting Unicode identifiers directly instead of with unnecessary backslashes
- Move dependency collection for CSS modules into css-module-lexer so stylesheets are no longer rescanned with regular expressions after parsing
- Cache converted module original source in binding for performance
- Batch splitChunks JavaScript callbacks for performance
- Avoid parsing concatenated module codegen
- Preallocate identifier path buffers
- Move css-module-lexer into workspace
- Pass HMR error to Preact refresh recovery handler
- Limit shutdown compaction to a single pass
- Add missing stats fields to types
- Strip BOM from module content before concatenation in css-extract
- Decouple incremental artifacts from cache
- Preserve ESM imports in module output for preserve importMode
- Export-wrapper behavior for Client Component stylesheets is removed in favor of preinitialization from the React Flight payload
From rspack
Highlights
RSC: Client Component CSS now uses Flight preinit
Rspack now emits Client Component exports as registered client references directly. CSS imported by a Client Component is no longer injected by wrapping its exports with generated <link> elements; the stylesheet is preinitialized from the React Flight payload instead. This preserves client-reference identity, including default, named, CommonJS, and non-component exports. Explicit link generation remains available through import.meta.rspackRsc.loadCss().
This is a breaking change for RSC framework integrations. Upgrade react-server-dom-rspack to 0.1.0 and update any code that relies on the previous export-wrapper behavior.
SWC 77: Wasm plugins must be rebuilt
swc_core is upgraded from 76 to 77, which changes the serialized AST encoding across the SWC Wasm plugin boundary. Plugins compiled against an earlier SWC schema no longer load and the build fails with The version of the SWC Wasm plugin you're using might not be compatible with 'builtin:swc-loader'. Rebuild your plugin, or upgrade to an SWC 77 compatible release .
Use plugins.swc.rs to find the plugin version matching your Rspack release, and see SWC plugin version mismatch for details. SWC 77 also introduces dedicated FunctionBody and ArrowFunctionBody::FunctionBody AST nodes, a breaking change for Rust-side consumers of the SWC AST.
CSS Modules: standards-aligned Unicode identifiers
CSS identifier escaping and unescaping now follow the CSS Syntax standard, so Unicode identifiers are emitted directly instead of carrying unnecessary backslashes.
.😍 {
color: red;
}
now generates .style_modules_css-😍 rather than .style_modules_css-\😍.
CSS Modules coverage also expands to more webpack cases — local/global modes, generator options, ICSS @value, custom identifiers, and warning order — and dependency collection moves into css-module-lexer, so stylesheets are no longer rescanned with regular expressions after parsing.
What's Changed
Breaking Changes 🍭
- refactor!(rsc): emit client references directly and preinit CSS by @SyMind in https://github.com/web-infra-dev/rspack/pull/14974
- chore: bump SWC dependencies by @hardfist in https://github.com/web-infra-dev/rspack/pull/15217
New Features 🎉
- feat: implement generation-based memory cache eviction by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15181
- feat: add idle cache compaction with interruption handling by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15182
- feat(css): improve unicode handling and support more css modules cases, boost performance by @intellild in https://github.com/web-infra-dev/rspack/pull/14809
Performance 🚀
- perf(binding): cache converted module original source by @SyMind in https://github.com/web-infra-dev/rspack/pull/15174
- perf: batch splitChunks JavaScript callbacks by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/15147
- perf(binding): exclude test loaders from release builds by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15209
- perf(binding): exclude perfetto from release WASI builds by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15221
- perf(binding): align release WASI optimizations by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15227
- perf(binding): optimize React Compiler crates for size by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15230
- perf: avoid parsing concatenated module codegen by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/14852
- perf: preallocate identifier path buffers by @intellild in https://github.com/web-infra-dev/rspack/pull/15220
Bug Fixes 🐞
- fix: pass HMR error to Preact refresh recovery handler by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15179
- fix(cache): limit shutdown compaction to a single pass by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15188
- fix(types): add missing stats fields by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15206
- fix(css-extract): strip BOM from module content before concatenation by @doxxx93 in https://github.com/web-infra-dev/rspack/pull/15169
- fix(core): decouple incremental artifacts from cache! by @hardfist in https://github.com/web-infra-dev/rspack/pull/15229
- fix(asset): preserve ESM imports in module output for "preserve" importMode by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/15165
Refactor 🔨
- refactor(css): move css-module-lexer into workspace by @intellild in https://github.com/web-infra-dev/rspack/pull/15218
- refactor(core): clarify persistent cache item naming by @hardfist in https://github.com/web-infra-dev/rspack/pull/15231
Document 📖
- docs: align stats JSON types with implementation by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15207
Other Changes
- chore: migrate rspack_resolver crate into the workspace by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15161
- chore: release version 2.1.10 by @intellild in https://github.com/web-infra-dev/rspack/pull/15172
- chore(deps): upgrade Rstack CLI to v0.6.0 by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15176
- chore(ci): use unified Rstack checks by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15184
- chore(resolver): tidy crate root layout by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15180
- chore: format TOML with Rstack CLI by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/15185
- chore(deps): upgrade pnp to 0.12.11 by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15186
- chore(ci): gate binary size on main pushes by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15178
- chore: upgrade Wasmtime and wasmparser dependencies by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15187
- chore(deps): update patch npm dependencies by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15196
- chore(deps): update dependency toml to v5 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15204
- chore(deps): update rust crate regex to 1.13.1 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15200
- chore(deps): update dependency @shikijs/transformers to ^4.4.3 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15197
- chore(deps): update dependency terser to v5.50.0 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15198
- chore(deps): update dependency diff to v9 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15201
- chore(deps): update dependency glob to v13 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15202
- chore(deps): update dependency sass-loader to v17 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15203
- chore(deps): update dependency less to v4.9.0 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15210
- chore(deps): update rust crate anymap to 1.1.0 by @renovate[bot] in https://github.com/web-infra-dev/rspack/pull/15211
New Contributors
- @doxxx93 made their first contribution in https://github.com/web-infra-dev/rspack/pull/15169
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.10...v2.2.0-beta.1