Skip to content

v2.3.0-beta.0

Pre-release
Pre-release

Choose a tag to compare

@intellild intellild released this 21 Oct 02:43
· 4 commits to 2dcbcb5add2d4878281c8003271a52db3b8cb8e9 since this release

Highlights

JavaScript parsing with SWC Next

Rspack now uses SWC Next for JavaScript parsing. This beta also includes follow-up compatibility fixes for block-scoped functions, parser source types, and legacy parser behavior. See #16089.

Content-based loader filtering

The new loader filter.code option accepts a string or regular expression and checks the loader's current input before running its normal transform. Loaders can skip files that do not contain the syntax or markers they need to process, avoiding unnecessary transformation work. For example, a loader that transforms customMacro() calls can use filter: { code: 'customMacro(' } to skip inputs without that marker. Pitch functions are unaffected. See #16073.

Better SplitChunks output

Named cache groups now remove redundant module copies from source chunks connected to the same shared chunk, reducing duplicate code in affected builds. Rspack also supports splitChunks.minRemainingSize to avoid splits that leave undersized chunks, bringing JavaScript and extracted CSS output closer to webpack. For example, an affected asynchronous CSS import now retains its expected controls.css filename in production. See #16075 and #15594.

Better watcher compatibility

Native and Node watch file systems now expose watchpack-compatible getTimes(), getTimeInfoEntries(), and collectTimeInfoEntries() APIs. With experiments.nativeWatcher, compiler.fileTimestamps, compiler.contextTimestamps, and the watcher's getInfo() now return real timestamp entries, improving compatibility with plugins that rely on watch metadata, such as ts-loader, webpack-virtual-modules, and vue-loader. The Node watcher also merges time-info entries deterministically so directory timestamps are preserved regardless of dependency iteration order. See the WatchFileSystem API documentation, #15754 and #16126.

Memory improvements and diagnostics

Rspack avoids retaining serialized source maps, reducing memory retained by source objects. Source handling also uses a source-wide UTF-16 index and removes its object pool. See #16072 and #16083.

New allocative-based memory diagnostics help identify which Rust data structures retain memory during builds and HMR updates. See the memory diagnostics guide to capture and analyze snapshots.

What's Changed

New Features 馃帀

Performance 馃殌

Bug Fixes 馃悶

  • fix: skip build dependency collection after fatal compilation errors by @ahabhgk in #16074
  • fix(resolver): resolve tsconfig extends through the real path by @orgads in #15718
  • fix(split-chunks): deduplicate remaining copies in named groups by @JSerFeng in #16075
  • fix(css): align CSS Modules behavior with webpack css-loader fixtures by @intellild in #15816
  • fix(tracing): convert JavaScript trace nanoseconds to microseconds by @LingyuCoder in #16103
  • fix: stabilize module rendering order across platforms by @hai-x in #16100
  • fix(binding): avoid shared property leak warnings on process exit by @SoonIter in #16117
  • fix: use the module exports argument for the AMD exports dependency by @LingyuCoder in #16122
  • fix: respect module arguments in AMD code generation by @hai-x in #16148
  • fix(mf): make deterministic IDs independent of project paths by @LingyuCoder in #16152
  • fix(watch): make node watch time info entries deterministic by @LingyuCoder in #16126
  • fix(javascript): reuse parser source type by @CPunisher in #16102
  • fix: link import bindings inside define callbacks by @hai-x in #16159
  • fix(javascript): respect block function scope by @CPunisher in #16162
  • fix(css): localize type-first nested selectors by @intellild in #16011
  • fix(javascript): preserve legacy parser behavior by @CPunisher in #16164
  • fix(lazy-compilation): avoid barrel reloads on activation by @JSerFeng in #16026
  • fix(split-chunks): support minRemainingSize by @JSerFeng in #15594

Refactor 馃敤

  • refactor(binding): retain DependencyRef in JavaScript wrappers by @SyMind in #16061
  • refactor(sources): use a source-wide UTF-16 index and remove object pool by @SyMind in #16083
  • refactor(javascript): remove redundant ESTree AST wrappers by @CPunisher in #16098
  • refactor: reuse current module in dependency templates by @hai-x in #16149
  • refactor(javascript): emit mangled destructuring keys as strings by @CPunisher in #16147
  • refactor(cache): reuse persistent cache options for newCache by @ahabhgk in #16160

Document 馃摉

Other Changes

New Contributors

Full Changelog: v2.2.9...v2.3.0-beta.0