Repository navigation
Highlights
Breaking change: webpack-compatible HTTP lockfiles
HTTP module lockfiles and content cache filenames now match webpack, allowing existing webpack lockfiles and cached resources to be reused together. The previous Rspack format is no longer supported: delete the old HTTP lockfile and content cache, rebuild with experiments.buildHttp.frozen: false, then review and commit the regenerated files before re-enabling frozen builds. See #16656.
Better tree shaking for dynamic imports
Rspack now tracks member usage through destructured dynamic-import namespaces, allowing unused nested exports to be removed more precisely. This covers awaited imports, destructured .then() parameters, and Promise.all() results. See #16574.
Faster HMR-enabled builds with repeated dynamic imports
Projects with many import() expressions targeting the same module avoid repeated chunk-group scans during HMR-enabled compilation. Rspack now caches loading-chunk lookups and reuses sibling chunk lists, addressing a compilation bottleneck that grew rapidly with the number of imports. See #16674.
Shared loader cache across compilers
Rspack now shares loader cache results between compilers in the same process. For example, in an SSR build, the client and server compilers can reuse loader transformations for shared source files, avoiding repeated work. Compilers can share results when using memory cache or the same persistent cache directory. See #16558.
What's Changed
Breaking Changes 🍭
New Features 🎉
- feat(ids): support salt for deterministic chunk and compact-hashed ids by @LingyuCoder in #16537
- feat(tree-shaking): narrow destructured dynamic import namespaces by @JSerFeng in #16574
- feat(externals): support interop hints for object externals by @JSerFeng in #16529
Performance 🚀
- perf(limit-chunk-count): keep chunk combinations in an ordered set by @guru-irl in #16466
- perf: reduce chunk filename runtime size by @chenjiahan in #16598
- perf: reduce dynamic chunk filename runtime size by @chenjiahan in #16602
- perf(core): avoid serializing hook register arrays by @chenjiahan in #16628
- perf(stats): avoid splitting loader chains when grouping modules by @chenjiahan in #16631
- perf(stats): reuse split error details when truncating output by @chenjiahan in #16632
- perf(stats): count diagnostic details without intermediate arrays by @chenjiahan in #16630
- perf(core): lazily cache log type bit flags by @chenjiahan in #16629
- perf(core): streamline runtime global reverse mapping by @chenjiahan in #16634
- perf(stats): avoid splitting hierarchical hook names by @chenjiahan in #16635
- perf(sri): avoid unnecessary path separator conversions by @chenjiahan in #16636
- perf(sri): avoid allocating hash match results by @chenjiahan in #16637
- perf(sri): avoid copying asset keys before lookup by @chenjiahan in #16638
- perf(core): avoid splitting stacks to remove loader frames by @chenjiahan in #16642
- perf(stats): collect printable contents in one pass by @chenjiahan in #16643
- perf(hmr): avoid cubic HMR loading chunk resolution by @JSerFeng in #16674
Bug Fixes 🐞
- fix: isolate module build cache sessions by graph by @ahabhgk in #16540
- fix(resolver): respect tsconfig extends array precedence by @stormslowly in #16554
- fix(split-chunks): prune source types below minSizeReduction by @JSerFeng in #16573
- fix: preserve Rule.as path delimiters and portable resources by @intellild in #16551
- fix: initialize build-time runtime globals in both runtime modes by @LingyuCoder in #16577
- fix(cache): serialize shared consumption dependencies by @ahabhgk in #16561
- fix(cache): filter source map assets before lookup by @ahabhgk in #16562
- fix(cache): normalize context resource dependency paths by @ahabhgk in #16563
- fix(cache): reuse restored remote modules by @ahabhgk in #16565
- fix(lazy-compilation): reject imports after HMR failure by @ScriptedAlchemy in #15947
- fix(ci): preserve clang during Linux disk cleanup by @LingyuCoder in #16588
- fix: mark modules with a top-level await using as async by @hai-x in #16442
- fix(split-chunks): keep named groups that narrowing would remove by @guru-irl in #16487
- fix: handle HTTP module response stream errors by @JSerFeng in #16233
- fix(sri): carry lazy hashes in the chunk that makes the import() call by @sd2k in #16420
- fix(css-extract): find stylesheets whose filename has a query by @ebidel in #16346
- fix(cache): track DefinePlugin definition keys by @ahabhgk in #16589
- fix(tree-shaking): avoid receivers for destructured dynamic import calls by @JSerFeng in #16593
- fix: preserve target major versions above 255 by @chenjiahan in #16601
- fix(cache): reuse loader output after a caught import cycle by @ahabhgk in #16583
- fix(cache): snapshot invalid Windows missing paths by @ahabhgk in #16584
- fix(cache): share loader cache across modes and SSR compilers by @intellild in #16558
- fix: finalize finishMake module rebuilds and artifacts by @LingyuCoder in #16580
- fix: resolve import() of self-accepting modules to their latest evaluation by @hai-x in #16595
- fix(cache): cache module-not-found resolution results by @ahabhgk in #16560
- fix(javascript): preserve outer ASI boundaries across nested statements by @LingyuCoder in #16613
- fix: annotate pure module initializers in ESM output by @JSerFeng in #16605
- fix(cache): keep lazy barrel state per compilation by @ahabhgk in #16609
- fix: cache extracted CSS modules with fresh input validation by @ahabhgk in #16618
- fix: count reused metadata for empty child compilers by @ahabhgk in #16620
- fix(cache): include loader configuration and versions in etags by @intellild in #16591
- fix(tree-shaking): resolve CommonJS default re-export to module.exports by @hai-x in #16639
- fix(binding): preserve normal module createData context by @SyMind in #16657
- fix(javascript): keep shorthand property keys when replacing identifiers by @hai-x in #16627
- fix(css): respect devtool for embedded source maps by @intellild in #16655
- fix(css): omit unused JavaScript modules for CSS URL assets by @intellild in #16654
- fix(swc-loader): migrate box patterns to deref patterns by @intellild in #16667
- fix(cache): invalidate newCache when configured build dependencies change by @ahabhgk in #16660
- fix(core): preserve factorization metadata for reused entries by @SyMind in #16668
- fix(resolver): make preferAbsolute try the absolute path first by @cezaraugusto in #16617
- fix(core): clean up loader error stacks by @chenjiahan in #16641
Refactor 🔨
- refactor(hmr): use the chunk content hash as its hmr version by @hai-x in #16585
- refactor(core): simplify property checks and iteration by @chenjiahan in #16644
Document 📖
- docs: clarify module rule as usage by @chenjiahan in #16564
- docs: add MDX example for reusing compilation rules by @chenjiahan in #16570
- docs: clarify rule as asset minification behavior by @chenjiahan in #16572
- docs: enable ESM output for website by @chenjiahan in #16600
- docs: fix the default devtool module filename templates by @ragib-mrb in #16658
- docs(resolver): exclude allocative from docs.rs features by @intellild in #16669
Other Changes
- test(cache): run cache checks before fixture cleanup by @ahabhgk in #16566
- chore(deps): update dependency table to v6.10.1 by @renovate[bot] in #16499
- chore(deps): update dependency webpack-sources to v3.7.0 by @renovate[bot] in #16500
- chore(deps): update rust crate html-escape to 0.3.1 by @renovate[bot] in #16501
- test: wait for activation instead of a fixed delay in hot cases by @hai-x in #16596
- chore(deps): update patch npm dependencies by @renovate[bot] in #16606
- chore(deps): update patch crates by @renovate[bot] in #16369
- chore(deps): update dependency enhanced-resolve to v5.27.0 by @renovate[bot] in #16611
- chore(deps): update dependency commander to v15.1.0 by @renovate[bot] in #16610
- chore(deps): update swc by @renovate[bot] in #16607
- test(cli): propagate watch startup errors by @chenjiahan in #16541
- test: expand persistent cache compatibility coverage by @ahabhgk in #16614
- test: include cached assets in filename assertions by @ahabhgk in #16619
- test: await child compilation in config fixtures by @ahabhgk in #16621
- test: validate circular warnings cache reuse separately from errors by @ahabhgk in #16623
- test: mark compilation-mutating loader as non-cacheable by @ahabhgk in #16624
- test: validate issuer stats across persistent cache builds by @ahabhgk in #16625
- ci(windows): fix flaky proc-macro DLL load via read-after-link by @stormslowly in #16648
- chore(deps): update swc-next to 0.7.0 by @CPunisher in #16650
New Contributors
- @ebidel made their first contribution in #16346
- @ragib-mrb made their first contribution in #16658
Full Changelog: v2.3.2...v2.3.3