Highlights 💡
Enhanced Tree Shaking for Nested Exports in Destructuring
Rspack now supports more precise tree shaking for nested exports accessed through destructuring assignments.
// lib.js
export * as a from "./a";
export * as b from "./b";
// index.js
import * as lib from "./lib";
// Before: All exports under `lib.a` were retained, only `lib.b` was tree-shaken
// Now: Only the specific property `inner` from `lib.a` is kept; everything else is removed
const { a: { inner } } = lib;
What's Changed
Performance Improvements ⚡
- perf: rspack sources buffer function by @SyMind in #11749
- perf: avoid unnecessary source map creation by @CPunisher in #11773
New Features 🎉
- feat: should retain source error name by @SyMind in #11762
- feat(parser): add
commonjs
options by @fi3ework in #11744 - feat: transform url in new URL without runtime by @JSerFeng in #11765
- feat: add experimental EsmLibraryPlugin for better esm output by @JSerFeng in #10350
- feat: tree shaking nested exports for destructuring assignment by @ahabhgk in #11781
Bug Fixes 🐞
- fix: cjs export require tree shaking by @ahabhgk in #11758
- fix: should always walk import then arguments by @ahabhgk in #11760
- fix: should update alias resolution when a higher-priority file is created in watch mode by @SyMind in #11643
- fix: should analyze correct variable for dynamic import by @ahabhgk in #11768
- fix: URLPlugin in child compiler by @SyMind in #11785
Refactor 🔨
- refactor: remove unused parameters and clean up code by @chenjiahan in #11756
- refactor: file counter save the resource id which used the file by @jerrykingxyz in #11757
Document Updates 📖
- docs: add commonjsMagicComments docs by @stormslowly in #11752
- docs: document parser jsx option by @fi3ework in #11767
- docs: add Snap to who is using section by @chenjiahan in #11777
- docs(style): remove unexpected borders on code block focus by @ritoban23 in #11784
Other Changes
- test: remove simple tester by @LingyuCoder in #11751
- chore(deps): update dependency memfs to v4.46.0 by @renovate[bot] in #11721
- test: close compiler by @LingyuCoder in #11764
- chore(deps): lock file maintenance by @renovate[bot] in #11726
- test: add persistent cache symlink test case by @jerrykingxyz in #11769
- chore(deps): update swc by @renovate[bot] in #11747
New Contributors
- @ritoban23 made their first contribution in #11784
Full Changelog: v1.5.7...v1.5.8