rspack v2.2.0-beta.1

v2.2.0-beta.1Pre-release
Added 3
  • 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
Changed 9
  • 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
Fixed 6
  • 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
Removed 1
  • 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 🍭
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.10...v2.2.0-beta.1

View original

Upgraded? How did it go?

Discussion