Repository navigation
v2.3.0-beta.0
Pre-releaseHighlights
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 馃帀
- feat: integrate allocative snapshots and profiling skill into Rspack by @intellild in #16046
- feat: support module.parser.javascript.dynamicUrl by @HashemKhalifa in #15933
- feat(watcher): expose watchpack times API on native and node watch file systems by @stormslowly in #15754
- feat(javascript): migrate parser to SWC Next by @LingyuCoder in #16089
- feat: add loader codeFilter prefilter by @SyMind in #16073
Performance 馃殌
- perf(size): box hot async entry futures to shrink binding size by @stormslowly in #16085
- perf(sources): avoid retaining serialized source maps by @LingyuCoder in #16072
- perf(loader): schedule loader chains as execution units by @intellild in #15401
- perf(loader-runner): read process.env.WASM once by @guru-irl in #16127
- perf: avoid creating untouched loader buildInfo by @guru-irl in #16077
Bug Fixes 馃悶
- fix: skip build dependency collection after fatal compilation errors by @ahabhgk in #16074
- fix(resolver): resolve tsconfig
extendsthrough 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 馃摉
- docs: update renamed crates in project architecture by @Jarvis636431 in #16087
- docs: add parallel loader section to loader guide by @intellild in #16092
- docs: add memory diagnostics guide by @intellild in #16080
- docs: explain hot update manifest fields by @chenjiahan in #16114
- docs: clarify Rsdoctor capabilities and simplify setup guide by @chenjiahan in #16125
- docs(resolve): explain resolve.tsConfig.references matching rules by @stormslowly in #16099
- docs: clarify Rsbuild and Rspack CLI in quick start by @chenjiahan in #16155
Other Changes
- chore(deps): update patch npm dependencies by @renovate[bot] in #16029
- chore(deps): upgrade swc-next to 0.2.4 by @LingyuCoder in #16094
- chore(deps): upgrade Rspress to 2.1.0-beta.1 by @SoonIter in #16104
- chore(deps): update dependency acorn to ^8.19.0 by @renovate[bot] in #16030
- chore(docs): update Rsdoctor 2.0 usage guides by @yifancong in #16090
- chore(deps): upgrade swc-next to 0.3.0 by @LingyuCoder in #16113
- chore(deps): update dependency playwright to v1.64.1 by @renovate[bot] in #16031
- chore(deps): update swc by @renovate[bot] in #16131
- chore(deps): update patch npm dependencies by @renovate[bot] in #16130
- chore(deps): update dependency ts-checker-rspack-plugin to ^1.7.1 by @renovate[bot] in #16137
- chore(deps): update dependency @swc/plugin-remove-console to v17 by @renovate[bot] in #16139
- chore(deps): update dependency happy-dom to v21 by @renovate[bot] in #16140
- chore(deps): update dependency cac to ^7.1.0 by @renovate[bot] in #16135
- chore(deps): update dependency mermaid to ^12.2.0 by @renovate[bot] in #16136
- chore(deps): update dependency watchpack to v2.6.1 by @renovate[bot] in #16138
- chore(deps): upgrade SWC Next to 0.3.1 by @CPunisher in #16151
- Revert "fix(mf): make deterministic IDs independent of project paths" by @LingyuCoder in #16161
New Contributors
- @orgads made their first contribution in #15718
- @Jarvis636431 made their first contribution in #16087
Full Changelog: v2.2.9...v2.3.0-beta.0