Highlights
React Server Components: enforce server-only / client-only boundaries
RSC builds now validate the server-only and client-only marker packages. Importing a client-only module from a server-graph module (or a server-only module from a client-graph module) is reported as a diagnostic. This marker-package validation always runs and is independent of disableClientApiChecks, which now only scopes the React client-API checks.
// server component (server graph)
import 'client-only'; // ❌ reported: client-only imported in a server module
// client component (client graph)
import 'server-only'; // ❌ reported: server-only imported in a client moduleExpose DeterministicModuleIdsPlugin
The webpack-compatible deterministic module id plugin is now exposed through the JS API as rspack.ids.DeterministicModuleIdsPlugin, giving you fine-grained control over module ids for long-term caching. It supports the webpack options test, maxLength, salt, fixedLength, and failOnConflict.
const rspack = require('@rspack/core');
module.exports = {
optimization: { moduleIds: false },
plugins: [
new rspack.ids.DeterministicModuleIdsPlugin({
maxLength: 5,
failOnConflict: true,
}),
],
};CSS Modules: preserve composes cascade order
CSS Modules now use a shared topological sort to keep the source order of composes, so composed declarations land in the output cascade in the order you authored them. This fixes subtle specificity surprises when composing local class names across modules.
What's Changed
New Features 🎉
- feat(rsc): validate server-only and client-only imports by @SyMind in #14190
- feat(css): ensure CSS compose module order by @intellild in #14156
- feat: expose DeterministicModuleIdsPlugin by @intellild in #14214
Performance 🚀
- perf: reduce sourcemap benchmark overhead by @hardfist in #14186
- perf(sources): lazily compute CachedSourceChunks source by @SyMind in #14202
- perf(deps): bump rspack_resolver to 0.9.2 by @stormslowly in #14192
- perf(core): cache resolved module rule options by @intellild in #14158
Bug Fixes 🐞
- fix: remove wasmtime threads feature by @hardfist in #14199
- fix: limit tsfn lifecycle to prevent memory leak by @SyMind in #13565
- fix(pure-functions): keep deferred local dependencies by @JSerFeng in #14191
- fix(lazy-compilation): clean up stale entry proxies on dynamic entry removal by @stormslowly in #14170
- fix: respect resolved external type in ESM rendering by @JSerFeng in #14180
- fix(esm-library): support context chunk loading by @JSerFeng in #14144
- fix(rspack_watcher): scan after registering the disk watcher to close a startup race by @stormslowly in #14210
- fix(esm-library): reuse inline export bindings by @JSerFeng in #14152
- fix: infer modern-module cjs externals from target by @Timeless0911 in #14215
Document 📖
- docs: recommend import.meta.glob for new code by @chenjiahan in #14220
Other Changes
- test(rsc): migrate RSC transform fixtures by @SyMind in #14183
- chore: release version 2.0.5 by @JSerFeng in #14155
- chore: migrate rspack_sources into rspack monorepo by @SyMind in #14193
- chore(perf): isolate rspack_sources codspeed benchmark target by @SyMind in #14204
- chore(deps): update dependency @ast-grep/napi to ^0.43.0 by @renovate[bot] in #14223
- chore(deps): update dependency @rstest/adapter-rspack to ^0.10.3 by @renovate[bot] in #14225
- chore(deps): update patch npm dependencies by @renovate[bot] in #14222
- chore(deps): update patch crates by @renovate[bot] in #14056
- chore(deps): update dependency @rslib/core to ^0.22.0 by @renovate[bot] in #14224
- chore: add Rust CodSpeed walltime benchmark by @hardfist in #14216
- chore(dep): css-module-lexer 0.0.16 → 0.0.15 by @stormslowly in #14240
- chore:Route Rust benchmarks to exclusive physical runner by @hardfist in #14245
- chore: bump
swc_expandswc_corefrom 66 to 68 by @CPunisher in #14241
Full Changelog: v2.0.5...v2.0.6