npm @rspack/cli 2.0.6
v2.0.6

5 hours ago

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 module

Expose 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 🎉

Performance 🚀

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 📖

Other Changes

Full Changelog: v2.0.5...v2.0.6

Don't miss a new cli release

NewReleases is sending notifications on new releases.