Releases: web-infra-dev/rspack
v2.0.5
Highlights
Support import.meta.glob
Rspack now supports import.meta.glob, a file-system import API already available in Vite and Turbopack. We chose to align with this ecosystem behavior.
const pages = import.meta.glob('./pages/**/*.tsx', {
eager: true,
import: 'default',
query: { layout: 'docs' },
base: './pages',
});More controllable CSS module parsing
CSS modules can now control parsing for @import, animations, custom idents, and dashed idents through module.parser, so projects can match existing CSS Modules behavior more closely while migrating to Rspack.
export default {
module: {
parser: {
'css/module': {
import: true,
animation: true,
customIdents: true,
dashedIdents: true,
},
},
},
};What's Changed
New Features 🎉
- feat(css): add supports import, animation, customIdents, and dashedIdents for CSS by @intellild in #14076
- feat: optimize generated getter for const export by @ahabhgk in #14045
- feat: implement import.meta.glob by @intellild in #13998
- feat: support import option for import.meta.glob by @intellild in #14123
- feat: support more import.meta.glob options by @intellild in #14129
- feat: inline const for default export by @ahabhgk in #14117
- feat: optimize getter for const export default by @ahabhgk in #14175
Performance 🚀
- perf: extend release opt-level s for cold-path crates by @hardfist in #14085
- perf: remove unnecessary async_trait usage by @hardfist in #14041
- perf: remove unused graph roots edge sorting by @intellild in #14101
- perf: reduce release binary size by @hardfist in #14103
- perf: reduce release binding size by @hardfist in #14108
- perf(javascript): reduce parser allocations by @hardfist in #14124
- perf: optimize find graph roots by @intellild in #14106
- perf: content into_string_lossy by @SyMind in #14121
- perf(core): use dense storage for dependency connections by @hardfist in #14148
- perf(resolver): reuse precomputed hash from rspack-resolver dependencies by @stormslowly in #14120
- perf(javascript): avoid cloning exports info during usage analysis by @hardfist in #14157
Bug Fixes 🐞
- fix(rsc): skip manifest runtime for worker entries by @SyMind in #14068
- fix: annotate generated JSON.parse as pure by @hardfist in #14110
- fix(rslib): align isolated dts diagnostics by @Timeless0911 in #14143
- fix(rspack_watcher): keep mtime baseline persistent across watch() cycles by @stormslowly in #14077
- fix(esm-library): split runtime chunk for async chunks by @JSerFeng in #14142
- fix: require swc helpers 0.5.22 by @JSerFeng in #14160
- fix(esm-library): move async runtime split logic by @JSerFeng in #14159
- fix(cli): block prototype-pollution payloads in --env parsing by @stormslowly in #14165
- fix: derive modern-module require external type from target by @JSerFeng in #14174
- fix: update peer dependency of @swc/helpers to ^0.5.23 by @JSerFeng in #14176
- fix: resolve external type in esm rendering by @JSerFeng in #14178
- fix: compat es5 for define property getters runtime by @ahabhgk in #14177
- fix(rstest): inject require.resolve origin by @9aoy in #14162
- fix(rstest): support new runtime template by @9aoy in #14181
Document 📖
- docs: add CSS module parser options by @intellild in #14096
- docs: split module config docs by @intellild in #14099
- docs: clarify module parser and generator options by @chenjiahan in #14111
- docs: align blog authors display with other rstack wbesite by @elecmonkey in #14125
- docs: invite @elecmonkey to Rspack core team by @chenjiahan in #14114
- docs: fix CSS module defaults by @intellild in #14136
- docs: document loader peer dependencies by @chenjiahan in #14137
- docs: document plugin peer dependencies by @chenjiahan in #14139
- docs(website): upgrade Tailwind CSS v4 with Rsbuild plugin by @chenjiahan in #14150
Other Changes
- test: remove jest-snapshot from test tools by @chenjiahan in #14112
- chore(deps): reduce peer dependency installs by @chenjiahan in #14115
- test: add swc-loader build module graph benchmark by @hardfist in #14128
- chore(deps): update patch npm dependencies by @renovate[bot] in #14132
- chore(deps): update dependency @module-federation/runtime-tools to v2.5.0 by @renovate[bot] in #14133
- test: satisfy socket.dev security by @intellild in #14138
- chore: upgrade swc_core from 66 to 67 by @hardfist in #14135
- revert: "feat: optimize generated getter for const export" by @ahabhgk in #14151
- revert: "revert: "feat: optimize generated getter for const export"" by @ahabhgk in #14153
- Revert "chore: upgrade swc_core from 66 to 67" by @JSerFeng in #14168
- Revert "fix: require swc helpers 0.5.22" by @JSerFeng in #14171
- chore(deps): upgrade pnpm to 11.3.0 by @chenjiahan in #14184
Full Changelog: v2.0.4...v2.0.5
v2.0.4
Highlights 💡
-
Inline const with module declarations (#14032): Previously, Rspack only inlined constant exports from leaf modules in the module graph. Now constant exports from any module can be inlined, even when that module also imports or re-exports other modules. In rare circular-reference cases this can make a TDZ error disappear, but we do not expect real projects to rely on TDZ errors, so Rspack prioritizes the optimization.
// constants.js import './setup'; export const ENABLE_EXPERIMENT = false; // entry.js import { ENABLE_EXPERIMENT } from './constants'; if (ENABLE_EXPERIMENT) { runExperiment(); } // Before: constants.js is not a leaf module, so the branch could keep // reading the imported binding. if (ENABLE_EXPERIMENT) { runExperiment(); } // Now: the constant can still be inlined, so dead branches are easier // to remove. if (false) { runExperiment(); }
-
Tree shake namespace default reexport (#13980): Previously, the
import * as a from './a'; export default a;pattern did not tree-shakeathrough the default export. Now Rspack further analyzes the default-exported namespace object and can remove unused exports from the original namespace module.// a.js export function used() {} export function unused() {} // bridge.js import * as a from './a'; export default a; // app.js import a from './bridge'; a.used(); // Before: both used and unused could be kept in the bundle. // Now: unused can be tree-shaken.
-
CSS global module type (#13988):
css/globalis useful when most selectors in a stylesheet should stay global, but you still want CSS Modules features for selected local selectors. This makes it easier to migrate existing global CSS gradually without turning every class name into a local scoped name.export default { module: { rules: [{ test: /\.global\.css$/i, type: 'css/global' }], }, };
/* style.global.css */ .button { color: red; } :local(.title) { font-weight: 600; }
.buttonstays global, while.titleis renamed as a local class. -
CSS Modules local ident options (#14009): CSS Modules now support local ident hash options such as hash function, digest, digest length, and salt. These options make generated class names more configurable and better aligned with webpack-compatible CSS Modules setups.
export default { module: { rules: [{ test: /\.module\.css$/i, type: 'css/module' }], generator: { 'css/module': { localIdentName: '[name]__[local]__[hash]', localIdentHashFunction: 'xxhash64', localIdentHashDigest: 'hex', localIdentHashDigestLength: 8, localIdentHashSalt: 'my-salt', }, }, }, };
What's Changed
New Features 🎉
- feat(css): add support for css/global module type by @intellild in #13988
- feat: tree shake namespace default reexport by @JSerFeng in #13980
- feat: inline const with module declarations by @ahabhgk in #14032
- feat(css): support CSS module local ident options by @intellild in #14009
- feat: circular modules info plugin by @ahabhgk in #14031
Performance 🚀
- perf: cache reserved name atom set by @LingyuCoder in #14014
- perf: optimize flag dependency usage by @LingyuCoder in #14052
- perf(cli): remove process title startup overhead by @chenjiahan in #14061
- perf(deps): unify duplicate Rust dependencies to reduce binary size by @intellild in #14012
- perf: improve split chunks cache group filtering by @LingyuCoder in #14067
- perf: optimize mangle exports plugin by @LingyuCoder in #14048
- perf(cli): lazy load json stream helpers by @chenjiahan in #14079
- perf: optimize named id assignment by @LingyuCoder in #14075
Bug Fixes 🐞
- fix(rsc): skip client entry mismatch without injections by @SyMind in #14018
- fix(cli): write logger trace output to file by default by @hardfist in #14022
- fix(ci): repair broken rustup shim chain on macos-latest by @stormslowly in #14040
- fix(stats): preserve sub-millisecond precision in logger time entries by @stormslowly in #14049
- fix: import.meta.filename/dirname escape on windows by @ahabhgk in #14050
- fix(rsc): group client chunks by server-entry ownership by @SyMind in #13880
- fix(rslib): emit type-only isolated dts dependencies by @Timeless0911 in #14037
- fix(copy-plugin): support JS input file system for glob copies by @intellild in #14023
- fix: keep buildHttp imports bundled for node target by @SyMind in #14086
Document 📖
- docs: update config option types by @chenjiahan in #14060
- docs: update runtime plugin hooks by @chenjiahan in #14069
- docs(plugin-api): document module factory hooks by @chenjiahan in #14070
- docs(cli): update cli option descriptions by @chenjiahan in #14071
- docs(website): update core team profile by @chenjiahan in #14093
Other Changes
- security(ci): remove PR title lint workflow by @chenjiahan in #14016
- chore: add local rust benchmark script by @hardfist in #14007
- chore(ci): replace archived actions-rs/cargo with bare cargo invocations by @stormslowly in #14017
- chore: release version 2.0.3 by @LingyuCoder in #14015
- chore: add draft release notes skill by @chenjiahan in #14028
- chore(build): fix empty napi-binding.d.ts on subsequent builds by @stormslowly in #14027
- chore: bump rslint to 0.5.3 by @fansenze in #14034
- chore(deps): update swc crates by @hardfist in #14036
- chore(skill): add rspack performance optimization skill by @LingyuCoder in #14047
- chore: upgrade swc from 64 to 66 by @hardfist in #14059
- chore(deps): update dependency @codspeed/vitest-plugin to ^5.4.0 by @renovate[bot] in #14057
- chore(deps): update patch npm dependencies by @renovate[bot] in #14055
- chore(deps): update dependency @playwright/test to v1.60.0 by @renovate[bot] in #14058
- chore: bump patch of swc_core and swc_typescript by @CPunisher in #14066
- test: add named ids codspeed benchmarks by @LingyuCoder in #14074
- chore(security): replace issues helper action by @chenjiahan in #14084
- chore(deps): bump rstack ecosystem ci action by @chenjiahan in #14092
Full Changelog: v2.0.3...v2.0.4
v2.0.3
What's Changed
Performance Improvements ⚡
- perf: reduce normal module creation and rule matching overhead by @LingyuCoder in #13926
- perf: disable perfetto tracing in release binding by @hardfist in #13932
- perf: reduce parser dependency bookkeeping overhead by @LingyuCoder in #13936
- perf: reduce code splitter allocation and lookup overhead by @LingyuCoder in #13968
New Features 🎉
- feat: expose dependency import attributes by @hardfist in #13947
- feat(rsc): support configurable CSS link props by @SyMind in #13945
- feat(externals): add modern-module externals type by @JSerFeng in #13861
- feat: support import.meta.rspackRsc by @SyMind in #13840
- feat: drop inactive branch dependencies for inlined booleans by @JSerFeng in #13863
- feat(sourcemap): support relative paths in inline source maps by @SyMind in #13974
Bug Fixes 🐞
- fix(cli): use rspack-merge for config extends by @intellild in #13869
- fix(deps): revert mimalloc update by @hardfist in #13942
- fix(hash): fix base64 digest and hash salt by @intellild in #13977
- fix: align sync module rule resource matching by @LingyuCoder in #13981
- fix(ci): avoid browser e2e watcher by @hardfist in #13987
Refactor 🔨
- refactor(rstest): expose injectDynamicImportOrigin.functionName and resolve callee once by @fi3ework in #13930
- refactor: use rspack util base64 by @intellild in #13978
- refactor(core): remove unused exports final name metadata by @LingyuCoder in #14003
Document Updates 📖
- docs: replace webpack-merge references with rspack-merge by @intellild in #13933
- docs: correct terminology spelling by @chenjiahan in #13964
- docs: update HTML plugin guide by @chenjiahan in #13970
- docs(externals): add modern-module externals example by @JSerFeng in #13979
- docs: update NestJS guide by @intellild in #13976
- docs: invite @intellild to Rspack core team by @chenjiahan in #13986
- docs: add Node app guide by @intellild in #13995
Other Changes
- chore: release v2.0.2 by @SyMind in #13922
- chore(benchmark): remove swc loader from threejs case by @hardfist in #13881
- ci: upload codspeed valgrind temp files by @hardfist in #13879
- chore: bump rslint to 0.5.2 by @fansenze in #13931
- chore: enable Rslint for more packages and fix lint issues by @chenjiahan in #13934
- chore: enable Rslint JS recommended rules by @chenjiahan in #13938
- chore: disable renovate updates for mimalloc by @hardfist in #13949
- ci: remove unused team label workflow by @chenjiahan in #13950
- test: configure rayon for codspeed benchmarks by @hardfist in #13954
- chore(deps): update patch npm dependencies by @renovate[bot] in #13959
- chore(deps): update rust crate tokio to 1.52.3 by @renovate[bot] in #13961
- chore(deps): update pnpm to v10.33.4 by @renovate[bot] in #13960
- chore: enable tsgo for dts generation by @chenjiahan in #13952
- test(benchmark): disable spawn blocking for codspeed by @hardfist in #13958
- chore: use mimalloc for codspeed benchmark allocator by @hardfist in #13966
- test: split compilation stage benchmarks by @hardfist in #13969
- test: split benchmark case entrypoints by @hardfist in #13971
- test: print benchmark compilation errors by @hardfist in #13984
- chore: bump swc from 65.0.1 to 65.0.4 by @CPunisher in #13985
- chore(deps): update dependency mermaid to v11.15.0 [security] by @renovate[bot] in #13997
- chore(deps): tighten pnpm install safeguards by @chenjiahan in #14005
- security(release): drop .npmrc NPM_TOKEN write, rely on npm trusted publishing by @stormslowly in #14011
- chore(ci): pin actions/{download,upload}-artifact to immutable SHAs by @stormslowly in #14001
Full Changelog: v2.0.2...v2.0.3
v2.0.2
What's Changed
Performance Improvements ⚡
- perf(split-chunks): lazily precompute sorted modules for compare by @LingyuCoder in #13854
- perf(split-chunks): batch split chunk runtime updates by @LingyuCoder in #13859
- perf(split-chunks): optimize module chunk lookup by @LingyuCoder in #13873
- perf(build): reduce binding size with size-optimized Wasmtime crates by @Timeless0911 in #13877
New Features 🎉
- feat: add logging for persistent cache validation info by @ahabhgk in #13855
- feat(rslib): support emit isolated declarations by @Timeless0911 in #13872
- feat(create-rspack): support rslint template mapping by @chenjiahan in #13882
- feat(rstest): inject source-module origin into dynamic imports by @fi3ework in #13849
Bug Fixes 🐞
- fix: handle weak dynamic imports without async chunks by @hardfist in #13848
- fix(source-maps): avoid loader request in lightningcss source maps by @zalishchuk in #13830
- fix(rsc): handle server component css by server entry scope by @SyMind in #13844
- fix: sort ConcatenatedModule export keys for deterministic builds by @mango766 in #13425
- fix: use index maps for concatenated export rendering by @JSerFeng in #13875
- fix(core): ignore optional hono type imports by @chenjiahan in #13883
- fix(rsc): scope server-entry CSS collection by entry by @SyMind in #13878
- fix(rslib): make isolated dts metadata relative by @Timeless0911 in #13884
- fix(deps): update http-proxy-middleware to 4.0.0-beta.6 by @Darshan808 in #13909
- fix(plugin-library): skip unused exports in ModuleLibraryPlugin by @SAY-5 in #13920
- fix: expose numeric chunk ids in JS APIs by @JSerFeng in #13839
- fix(rsc): support void onServerComponentChanges callbacks by @SyMind in #13885
- fix: align module external remapping with webpack by @JSerFeng in #13802
Document Updates 📖
- docs: Add Shakapacker to Ecosystem (Ruby on Rails) by @cody-elhard in #13866
- docs: sync Shakapacker ecosystem docs to zh by @chenjiahan in #13867
- docs: fix Modern.js links by @chenjiahan in #13868
- docs: add TanStack Router to ecosystem by @chenjiahan in #13870
- docs: sort config options sidebar by @chenjiahan in #13874
- docs(faq): remove outdated React Server Components support section by @lajczi in #13898
- docs: sync zh FAQ with RSC update by @chenjiahan in #13902
- docs: add webpack package replacements by @chenjiahan in #13910
- docs: replace storybook roadmap link with migration guide by @fi3ework in #13923
- docs: clarify splitChunks name function by @JSerFeng in #13928
Other Changes
- chore: move check source changed jobs to self-hosted runner by @hardfist in #13862
- chore: release version 2.0.1 by @intellild in #13860
- chore(benchmark): disable minimize for bundle codspeed by @LingyuCoder in #13871
- chore(deps): update dependency happy-dom to ^20.9.0 by @renovate[bot] in #13833
- chore(deps): update dependency toml to v4 by @renovate[bot] in #13892
- chore(deps): update dependency image-minimizer-webpack-plugin to v5 by @renovate[bot] in #13891
- chore(deps): update dependency lint-staged to ^16.4.0 by @renovate[bot] in #13887
- chore(deps): update dependency @module-federation/runtime-tools to v2.4.0 by @renovate[bot] in #13886
- chore(deps): update dependency cspell to v10 by @renovate[bot] in #13897
- chore(deps): update dependency @shikijs/transformers to v4 by @renovate[bot] in #13896
- chore(deps): update dependency mermaid to ^11.14.0 by @renovate[bot] in #13894
- chore(deps): update dependency terser-webpack-plugin to ^5.5.0 by @renovate[bot] in #13889
- chore(deps): update dependency ws to ^8.20.0 by @renovate[bot] in #13895
- chore(deps): update patch npm dependencies by @renovate[bot] in #13900
- build: replace webpack-merge with rspack-merge by @intellild in #13907
- chore(deps): update rust crate rayon to 1.12.0 by @renovate[bot] in #13904
- chore(deps): update rust crate oneshot to 0.2.1 by @renovate[bot] in #13903
- chore(deps): update dependency exit-hook to v5 by @renovate[bot] in #13906
- chore(deps): update yarn to v4.14.1 by @renovate[bot] in #13905
- chore(deps): update dependency memfs to v4.57.2 by @renovate[bot] in #13888
- chore(deps): update dependency watchpack to v2.5.1 by @renovate[bot] in #13890
- chore(deps): update dependency axios to ^1.16.0 by @renovate[bot] in #13911
- chore(deps): update rust crate hashlink to 0.11.0 by @renovate[bot] in #13912
- chore(deps): update rust crate indexmap to 2.14.0 by @renovate[bot] in #13913
- chore(deps): remove http-proxy-middleware dts patch by @chenjiahan in #13919
- chore(deps): update dependency @discoveryjs/json-ext to v1 by @renovate[bot] in #13916
- chore(deps): update napi by @renovate[bot] in #13899
New Contributors
- @zalishchuk made their first contribution in #13830
- @cody-elhard made their first contribution in #13866
- @mango766 made their first contribution in #13425
- @lajczi made their first contribution in #13898
- @Darshan808 made their first contribution in #13909
- @SAY-5 made their first contribution in #13920
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
Performance Improvements ⚡
- perf(concatenate): optimize scope-hoisting build hot paths by @LingyuCoder in #13759
- perf: reduce string churn across identifiers, ids, and runtime helpers by @LingyuCoder in #13788
- perf: reuse cached module dependency lists in finish_modules by @LingyuCoder in #13808
- perf: reduce code splitter and module reference overhead by @LingyuCoder in #13816
- perf: reduce split chunks allocation overhead by @LingyuCoder in #13842
New Features 🎉
- feat: rsc entry debug comments by @SyMind in #13812
- feat(pure-functions): accept any top-level binding and trust consumer-side hints by @JSerFeng in #13810
Bug Fixes 🐞
- fix: module hash exports type hash should stable by @ahabhgk in #13796
- fix: exports info update hash should stable by @ahabhgk in #13798
- fix(esm): rewrite evaluated in operator for externals by @JSerFeng in #13803
- fix(cli): bundle published declaration files by @chenjiahan in #13807
- fix: align http-proxy-middleware with @rspack/dev-server by @chenjiahan in #13822
- fix(cli): respect devServer port in preview by @Sylar-W in #13838
- fix: enable module static cache in development by @hardfist in #13856
Refactor 🔨
- refactor: make parser_and_generator readonly by @hardfist in #13785
- refactor: remove prefetch functions for exports info by @ahabhgk in #13817
- refactor: cache logging to use atomic logger counters by @ahabhgk in #13825
Document Updates 📖
- docs(blog): add Rspack 2.0 release posts by @LingyuCoder in #13703
- docs(blog): add Rsbuild 2.0 announcement links by @chenjiahan in #13789
- docs: enable announcement banner by @chenjiahan in #13790
- docs: refresh README docs and benchmark links by @chenjiahan in #13791
- docs(blog): upgrade rstack-doc-ui version by @SoonIter in #13792
- docs: update blog authors and member avatars by @chenjiahan in #13815
- docs: clarify resolve.roots migration guide by @chenjiahan in #13819
- docs: fix wrong nested module rule example for strict this context by @ahabhgk in #13824
- docs: clarify dev server usage by @chenjiahan in #13847
- docs: clarify externalsType defaults by @JSerFeng in #13845
Other Changes
- chore(watcher): log raw fs events from notify in disk watcher by @stormslowly in #13778
- chore(deps): bump Rslint to 0.5.0 by @fansenze in #13793
- chore(ci): remove bench result check from CI by @hardfist in #13800
- ci: disable Windows CPU hogs to speed up CI by @stormslowly in #13722
- test(bench): make fast_set synchronous under codspeed by @LingyuCoder in #13811
- chore: document loader getOptions query string parsing by @hardfist in #13823
- chore(ci): add 40min timeout to ecosystem CI per commit job by @stormslowly in #13809
- chore(deps): update pnpm to v10.33.2 by @renovate[bot] in #13829
- chore(deps): update patch npm dependencies by @renovate[bot] in #13828
- chore(deps): update github-actions by @renovate[bot] in #13826
- chore: Revert "chore: move check-changed job to namespace" by @hardfist in #13835
- chore: move wasm test to self-hosted runner by @hardfist in #13836
- chore: move bench job to github runner by @hardfist in #13837
- chore(deps): update patch npm dependencies by @renovate[bot] in #13831
- chore(deps): update dependency enhanced-resolve to v5.21.0 by @renovate[bot] in #13832
- chore(deps): update patch crates by @renovate[bot] in #13827
- chore: bump @rslint/core to 0.5.1 by @fansenze in #13850
- test: reduce persistent cache bench output variance by @hardfist in #13852
- chore: upgrade swc_core from 64 to 65 by @hardfist in #13857
New Contributors
Full Changelog: v2.0.0...v2.0.1
v2.0.0
⚡️ Rspack 2.0 Released! ⚡️
- 🚀 Read our announcement blog post for new features, and highlights
- 🛠️ Check out the step-by-step migration guide for upgrading from v1 to v2
What's Changed
Breaking Changes 🛠
- feat!: remove
experiments.SubResourceIntegrityPluginby @LingyuCoder in #12642 - feat!: remove
experiments.rspackFutureand movebundlerInfotooutputby @LingyuCoder in #12654 - feat!: remove
experiments.parallelLoaderby @LingyuCoder in #12658 - feat!: remove
profileandstats.profileby @LingyuCoder in #12662 - feat!: enable
verbatimModuleSyntaxofbuiltin:swc-loaderby default by @LingyuCoder in #12668 - feat!: remove
rspack.experiments.lazyCompilationMiddlewareby @LingyuCoder in #12736 - feat!: remove deprecated WarnCaseSensitiveModulesPlugin by @LingyuCoder in #12737
- feat!: remove deprecated draft option from LightningCSS minimizer by @LingyuCoder in #12740
- feat!: remove deprecated cssHeadDataCompression option by @LingyuCoder in #12741
- feat!: remove deprecated output library fields by @LingyuCoder in #12745
- feat!: make @rspack/dev-server an optional peer dependency by @LingyuCoder in #12750
- feat!: use rspackChunk as default value of chunkLoadingGlobal by @LingyuCoder in #12779
- feat!: disable requireAsExpression by default by @LingyuCoder in #12786
- feat!: use "rspack" as default trustedTypes policy name by @LingyuCoder in #12799
- feat!: remove sri option of HtmlRspackPlugin by @LingyuCoder in #12651
- feat!: remove
output.charsetby @LingyuCoder in #12660 - feat!: disable
.swcrcreading in JavaScript compiler by @CPunisher in #12667 - feat!: remove deprecated getHooks method from plugins by @LingyuCoder in #12738
- feat!: Rspack off modules and assets in normal stats by @SyMind in #12701
- feat!: default loader/plugin target by rspack target by @ahabhgk in #12752
- feat!: use rspackHotUpdate as default hotUpdateGlobal by @LingyuCoder in #12774
- feat!: enable css by default by @JSerFeng in #12744
- feat!: default targets for loader/plugin derived by rspack target, part 2 by @ahabhgk in #12780
- feat!: do not expose EsmLibraryPlugin to user directly, use modern-module instead by @JSerFeng in #12792
- feat!: revert enable verbatimModuleSyntax by @hardfist in #12846
- feat!: remove experiments.outputModule config by @JSerFeng in #12912
- feat!: change default value for devtool by @SyMind in #12934
- feat!: default resolve roots to empty array by @stormslowly in #13273
- feat!: remove .wasm from default js extensions by @hardfist in #13321
- feat!: remove 'webpack' from default CSS import conditions by @chenjiahan in #13348
- feat!: change exports presence default to true by @ahabhgk in #13002
- feat!: Add
pnp_manifestoption to resolver by @smeng9 in #12417 - feat(swc-loader)!: move rspackExperiments.import to top-level transformImport by @JSerFeng in #13345
- feat(pnp)!: drop multi yarn pnp project resolving by @stormslowly in #13389
- feat!: disable bundlerInfo force by default by @LingyuCoder in #13599
- feat(progress-plugin)!: replace handler rest args with structured info object by @chenjiahan in #13049
- fix!: remove unsafe cache by @SyMind in #12892
- fix!: remove debug hash algorithm by @chenjiahan in #12951
- fix!: remove deprecated readResourceForScheme hook by @chenjiahan in #13027
- fix!: remove unconsumed useless
optimization.removeAvailableModulesconfig option by @JSerFeng in #13317 - refactor!: remove default exports in hot modules by @Timeless0911 in #13213
- refactor!: drop support for Node 18 by @Timeless0911 in #12739
- refactor!: drop CommonJS build and transition to pure ESM package by @Timeless0911 in #12733
- refactor!: move incremental option from experiments to top-level config by @ahabhgk in #12793
- refactor(browser)!: remove
rspack_browsercrate and require@rspack/browserto run in a Worker by @CPunisher in #13712 - refactor!: use
strictThisContextOnImportsto control ns obj as this by @ahabhgk in #13234
Performance Improvements ⚡
- perf: remove ropey crate to reduce binary size by @SyMind in #12433
- perf: optimize require regex compilation using static LazyLock by @LingyuCoder in #12944
- perf: try fix mf performance regression by @hardfist in #12958
- perf: Cache default context regexp for parser plugins by @hardfist in #13024
- perf: Enable more Clippy performance checks and reduce redundant clones by @hardfist in #13069
- perf: remove unused env call by @hardfist in #13080
- perf: use slotmap for scope info by @CPunisher in #13101
- perf: optimize DependencyLocation computation with incremental caching by @SyMind in #13109
- perf: Convert dependent full hash hook to sync with rayon support by @hardfist in #13130
- perf: Replace OverlayMap with RollbackAtomMap in exports artifact by @hardfist in #13143
- perf: remove ProcessUnlazyDependenciesTask by @hardfist in #13151
- perf: reduce content hash and lazy filename tempate ctx compute by @SyMind in #13156
- perf: by json-escape-simd by @SyMind in #13183
- perf: Add smallvec-backed member chains by @hardfist in #13227
- perf: improve find_new_name by @LingyuCoder in #13209
- perf(regex): enable case-insensitive endsWith fast path by @LingyuCoder in #13232
- perf: reduce replace source string alloc by @SyMind in #13150
- perf: improve data structure by @LingyuCoder in #13259
- perf(core): cache ModuleId hash by @LingyuCoder in #13264
- perf: use UkeySet or IdentifierSet for graph and plugin collections by @LingyuCoder in #13266
- perf: remove ukey collections by @LingyuCoder in #13309
- perf: replace unnecessary usize and u64 with u32 by @hardfist in #13338
- perf: dyn lint for default hash by @SyMind in #13346
- perf: parser hook plugins by @SyMind in #13373
- perf(esm-lib): optimize ESM library rendering performance by @JSerFeng in #13334
- perf(build_chunk_graph): optimize data structures in code splitter by @JSerFeng in #13403
- perf: rspack_storage parallel write by @jerrykingxyz in #13407
- perf(core): reduce target resolution overhead by @LingyuCoder in #13513
- perf(javascript): cache non-nested export target lookups by @LingyuCoder in #13545
- perf(rspack-sources): perf potential tokens and source map to json by @SyMind in #13497
- perf: modules should use IdentifierHasher by @SyMind in #13601
- perf(code-splitting): reuse side effec...
v2.0.0-rc.3
What's Changed
New Features 🎉
- feat: expose jsonp template plugin by @ahabhgk in #13700
- feat(config): update default performance budgets by @chenjiahan in #13717
- feat: support relative output.path relative to context by @hardfist in #13718
- feat(create-rspack): add optional agent skills by @chenjiahan in #13729
- feat: persistent cache for swc js minimizer plugin by @ahabhgk in #13706
Bug Fixes 🐞
- fix: escape invalid chars anywhere in to_identifier_with_escaped by @JSerFeng in #13707
- fix: correct app type constraint in DevServerOptions by @chenjiahan in #13711
- fix(esm-library): deconflict module external helper names by @JSerFeng in #13695
- fix: render numeric chunk IDs as number literals by @JSerFeng in #13604
- fix: align logger timing with webpack by @hardfist in #13721
Refactor 🔨
- refactor(browser)!: remove
rspack_browsercrate and require@rspack/browserto run in a Worker by @CPunisher in #13712
Document Updates 📖
- docs(config): replace generic webpack references with Rspack by @chenjiahan in #13719
- docs: improve persistent cache documentation by @jerrykingxyz in #13720
Other Changes
- chore: enable pnpm dedupe peers by @chenjiahan in #13713
- chore(deps): update dependency lodash-es to ^4.18.1 [security] by @renovate[bot] in #13715
- test(benchmark): add compilation stage benchmark cases by @LingyuCoder in #13702
- chore: update rust toolchain from nightly-2025-11-13 to nightly-2026-04-16 by @CPunisher in #13723
Full Changelog: v2.0.0-rc.2...v2.0.0-rc.3
v2.0.0-rc.2
What's Changed
Performance Improvements ⚡
- perf(code-splitting): reuse side effects evaluation state by @LingyuCoder in #13668
- perf: trace hook interception only pays off once global tracing is already on by @SyMind in #13689
New Features 🎉
- feat(create-rspack): modernize starter template configs by @chenjiahan in #13645
- feat(split-chunks): support enforceSizeThreshold option by @jaehafe in #13576
- feat(resolve): support
#/subpath alias import by @stormslowly in #13633 - feat(create-rspack): reuse rspack config in rstest templates by @chenjiahan in #13666
- feat: enforce macro-generated implemented_hooks in debug builds by @SyMind in #13677
- feat: only apply require-* parser plugins to js-auto/js-dynamic by @SyMind in #13678
- feat: skip building side-effect-only imports in make by @ahabhgk in #13688
- feat: add compiler.hooks.shouldRecord for NoEmitOnErrorsPlugin by @stormslowly in #13630
- feat(cli): use jiti to load typescript config by @hardfist in #13690
Bug Fixes 🐞
- fix(browser): import napi symbols from binding by @CPunisher in #13641
- fix(core): fix cjs export function tree shaking by @ahabhgk in #13643
- fix(config): tighten rule loader/use typings by @kyungilcho in #13514
- fix: add
@emnapi/coreand@emnapi/runtimeas dependencies by @CPunisher in #13665 - fix(loader): preserve additionalData in builtin loaders by @ahabhgk in #13661
- fix(cli): disable hmr in preview by @chenjiahan in #13669
- fix(hash): keep fullhash in sync with css-only content changes by @GiveMe-A-Name in #13491
- fix(watcher): flush pending events on unpause to prevent stuck files_data by @stormslowly in #13603
- fix(watcher): filter stale FSEvents with mtime baseline comparison by @stormslowly in #13610
- fix(rstest): respect importFunctionName when importDynamic is disabled by @9aoy in #13673
- fix: fix flaky wasm tests by @hardfist in #13655
- fix: support module external type in array externals by @JSerFeng in #13663
- fix(mf): resolve version from parent package for secondary entry points by @davidfestal in #13636
- fix(wasm): fix browser e2e timeout by running @rspack/browser builds in a worker by @hardfist in #13687
- fix: Revert rstest importFunctionName feature when importDynamic is disabled by @9aoy in #13699
Refactor 🔨
- refactor(concatenated-module): reduce clone overhead by @LingyuCoder in #13642
- refactor: replace expect("TODO") with descriptive error messages by @jaehafe in #13685
Document Updates 📖
- docs: clarify v2 migration package upgrades by @chenjiahan in #13664
- docs: supplement preserveModules documentation by @JSerFeng in #13659
- docs: use detectSyntax in swc-loader examples by @chenjiahan in #13672
- docs: document package.json imports resolution by @chenjiahan in #13686
- docs: clarify externals configuration by @chenjiahan in #13692
- docs: correct several config option types by @chenjiahan in #13694
- docs: improve library.type and ESM output docs by @JSerFeng in #13648
Other Changes
- chore: release 2.0.0-rc.1 by @LingyuCoder in #13625
- chore(ci): reduce Linux Node.js matrix to save CI resources by @chenjiahan in #13657
- chore: bump @rslint/core to 0.4.0 by @fansenze in #13658
- chore(deps): update Rslib 0.21.0 by @Timeless0911 in #13650
- chore(ci): add node 24 to release canary and debug workflows by @stormslowly in #13656
- chore: using codspeed bench scan dependencies by @SyMind in #13400
- feat: Add support for assigning numbers in
beforeModuleIdshook by @hamlim in #13222 - test(swc-loader): use detectSyntax auto in test configs by @chenjiahan in #13667
- chore(ci): use unique job IDs in bench workflows to avoid CodSpeed data loss by @stormslowly in #13542
- chore(deps): update dependency create-rstack to v1.9.1 by @renovate[bot] in #13676
- chore(deps): update dependency axios to ^1.15.0 by @renovate[bot] in #13675
- chore(deps): update dependency cspell to ^9.8.0 by @renovate[bot] in #13682
- chore(deps): update dependency heading-case to ^1.1.0 by @renovate[bot] in #13683
- chore(deps): update patch npm dependencies by @renovate[bot] in #13681
- chore(deps): update taiki-e/install-action digest to 0abfcd5 by @renovate[bot] in #13679
- chore(deps): update dependency jest-diff to ^30.3.0 by @renovate[bot] in #13684
- chore(deps): update dependency @rslint/core to v0.4.1 by @renovate[bot] in #13680
New Contributors
- @kyungilcho made their first contribution in #13514
- @davidfestal made their first contribution in #13636
Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2
v2.0.0-rc.1
Highlights 💡
🌳 Better tree shaking with side-effect-free function analysis
Rspack can now detect side-effect-free function calls through the #__NO_SIDE_EFFECTS__ notation and manual pureFunctions hints. With support for exported functions and cross-module analysis, unused calls can be identified more reliably, improving tree shaking results and making it easier to optimize both application code and third-party dependencies.
// lib.js
/*@__NO_SIDE_EFFECTS__*/
export function call() {
console.log('hi')
}
// barrel.js
import { call } from './lib'
const value = call()
// if value is unused, call can be removed
export { value }
What's Changed
Breaking Changes 🛠
- feat!: disable bundlerInfo force by default by @LingyuCoder in #13599
Performance Improvements ⚡
- perf(javascript): cache non-nested export target lookups by @LingyuCoder in #13545
- perf(rspack-sources): perf potential tokens and source map to json by @SyMind in #13497
- perf: modules should use IdentifierHasher by @SyMind in #13601
New Features 🎉
- feat: Implement HashedModuleIdsPlugin by @aancuta in #13197
- feat: add TryFutureConsumer with short-circuit cancellation by @jerrykingxyz in #13554
- feat(binding): add active-related APIs to ModuleGraphConnection by @JSerFeng in #13548
- feat: support optimize side effects free function calls by @JSerFeng in #12559
- feat(node-binding): add external wasm debug info for wasm dwarf debugging by @hardfist in #13638
Bug Fixes 🐞
- fix(cli): surface fatal errors and unhandled rejections on process exit by @briansilah in #13506
- fix: multicompiler devServer false support in serve by @LingyuCoder in #13572
- fix(cli): bundle lazy-loaded helper deps by @chenjiahan in #13587
- fix: cjs self reference mangle exports by @ahabhgk in #13588
- fix(esm-library): emit empty export for empty node chunks by @JSerFeng in #13462
- fix(wasm): avoid blocking-thread work under node:wasi by @hardfist in #13598
- fix(core): move connection states to ModuleGraphConnection by @JSerFeng in #13624
- fix(side-effects): respect DefinePlugin purity evaluation by @ahabhgk in #13628
- fix(externals): correct external type for aliased node builtin externals by @JSerFeng in #13627
Refactor 🔨
- refactor: rename rspack_futures to rspack_parallel by @jerrykingxyz in #13547
- refactor: Refactor build chunk graph artifact render state reset by @hardfist in #13569
- refactor(split-chunks): reduce module group allocation churn by @LingyuCoder in #13560
- refactor(watcher): clean up stale entries from watch_patterns after unwatch by @jaehafe in #13511
- refactor(storage): db switch to readonly mode when save failed by @jerrykingxyz in #13584
- refactor: persistent cache remove lock by @jerrykingxyz in #13589
- refactor: improve persistent cache load error handling by @jerrykingxyz in #13608
Document Updates 📖
- docs: improve docs for worker custom syntax by @ahabhgk in #13552
- docs: improve
import.metadocs by @ahabhgk in #13574 - docs: update image-minimizer-webpack-plugin compatibility status to compatible by @jaehafe in #13618
- docs: update import for React Refresh plugin by @chenjiahan in #13632
Other Changes
- chore(release): release 2.0.0-rc.0 by @LingyuCoder in #13537
- chore(security): use rspack scoped mocked react by @stormslowly in #13551
- chore: Update AGENTS concurrency guidance by @hardfist in #13553
- chore: Remove chunk graph DOT generation logic by @hardfist in #13549
- chore(deps): update dependency @rslint/core to v0.3.4 by @renovate[bot] in #13561
- chore(deps): update dependency @module-federation/runtime-tools to v2.3.1 by @renovate[bot] in #13562
- test: format rspack test configs with prettier by @chenjiahan in #13571
- chore: run
@rspack/cli,@rspack/teststests sequentially in wasm by @CPunisher in #13557 - chore(deps): update dependency lodash-es to v4.18.1 [security] by @renovate[bot] in #13585
- chore: switch codspeed official action by @CPunisher in #13582
- chore(deps): update dependency lodash to v4.18.1 [security] by @renovate[bot] in #13586
- chore: Update emnapi dependencies to 1.9.2 by @hardfist in #13590
- test: fix try_future_consumer test unstable by @jerrykingxyz in #13592
- chore(ci): migrate ecosystem CI to central rstack-ecosystem-ci repository by @fi3ework in #13522
- test(benchmark): add persistent cache codspeed cases by @LingyuCoder in #13594
- chore: bump
swc_corefrom 59 to 62 by @CPunisher in #13602 - ci: add contents:read permission for ecosystem CI commit comments by @fi3ework in #13605
- ci: use contents:write permission for ecosystem CI commit comments by @fi3ework in #13611
- chore(deps): update napi by @renovate[bot] in #13614
- chore(deps): update patch npm dependencies by @renovate[bot] in #13615
- chore(deps): update dependency @playwright/test to v1.59.1 by @renovate[bot] in #13616
- chore(deps): update github-actions by @renovate[bot] in #13613
- chore: upgrade node to 24 while releasing by @LingyuCoder in #13639
New Contributors
- @briansilah made their first contribution in #13506
- @aancuta made their first contribution in #13197
Full Changelog: v2.0.0-rc.0...v2.0.0-rc.1
v2.0.0-rc.0
Highlights 💡
Support import.meta.main
import.meta.main is a boolean flag used in ES modules to determine whether the current module is the program’s entry module. It evaluates to true when the module is executed as the main entry, and to false when it is imported by another module. You can think of it as the ESM equivalent of require.main === module in CommonJS. It is useful for running startup logic, initialization code, or CLI behavior only when a module is launched directly.
What's Changed
Performance Improvements ⚡
- perf(core): reduce target resolution overhead by @LingyuCoder in #13513
New Features 🎉
- feat: support
import.meta.mainby @ahabhgk in #13489 - feat: support expression in
import.meta.resolveargument by @ahabhgk in #13523 - feat: add ModuleGraph.getUsedExports to ModuleGraph by @SyMind in #13519
Bug Fixes 🐞
- fix(watcher): rename typo
recursiron_directoriestorecurse_parent_directoriesby @jaehafe in #13510 - fix: avoid spreading huge dependency iterables by @SyMind in #13517
- fix(types): allow partial jsc.parser config when detectSyntax is auto by @chenjiahan in #13531
- fix(swc-loader): fallback detectSyntax auto for virtual modules by @chenjiahan in #13529
- fix: reset chunk.rendered in incremental build by @hardfist in #13544
Refactor 🔨
- refactor(split-chunks): optimize get_combs lookups by @LingyuCoder in #13532
Document Updates 📖
- docs(migration): simplify v2 experimental changes by @LingyuCoder in #13479
Other Changes
- chore: update cargo shear and fix issues by @chenjiahan in #13503
- test(benchmark): add codspeed cases for compilation stages by @LingyuCoder in #13499
- chore: try namespace runner for wasm test by @hardfist in #13500
- release: 2.0.0-beta.9 by @chenjiahan in #13502
- chore(ci): move renovate schedule to saturday by @chenjiahan in #13512
- chore: bump emnapi from 1.8.1 to 1.9.1 by @CPunisher in #13516
- test(benchmark): add split chunks codspeed case by @LingyuCoder in #13520
- chore(deps): bump @rslib/core to 0.20.2 by @Timeless0911 in #13525
- chore: split wasm browser ci by @CPunisher in #13504
- chore: adds
-Zfmt-debug=nonefor non-browser wasm target by @CPunisher in #13527 - chore: remove
-Zfmt-debug=noneby @CPunisher in #13540 - chore:
useNapiCrossfor x64 linux gnu compilation by @CPunisher in #13539 - chore(crates): use OIDC to publish crates by @stormslowly in #13543
New Contributors
Full Changelog: v2.0.0-beta.9...v2.0.0-rc.0