Highlight
New experiments.incremental
We are implementing a new incremental rebuild architecture that makes the HMR much faster. It's an experimental feature in v1.1 and we still have more work to do before we stabilize it, but for now we have implemented parts of it and seen significant performance boosts.
In a case of 10000 React components, the HMR becomes 38% faster:
Tip
Checkout our docs for more details, and it's still in early stage but we hope you can try it out and provide us with some bugs and feedback at #8106.
Faster output.hashFunction
Rspack's output.hashFunction now defaults to the faster xxhash64
, and the output.hashDigestLength now defaults to 16
(prev 20
).
In the very large projects, this change will bring a significant performance improvement:
hyperfine --warmup 1 --runs 3 'HASH_FUNCTION=md4 node --run build:rspack' 'HASH_FUNCTION=xxhash64 node --run build:rspack'
Benchmark 1: HASH_FUNCTION=md4 node --run build:rspack
Time (mean ± σ): 11.428 s ± 0.758 s [User: 83.504 s, System: 5.808 s]
Range (min … max): 10.892 s … 12.295 s 3 runs
Benchmark 2: HASH_FUNCTION=xxhash64 node --run build:rspack
Time (mean ± σ): 9.697 s ± 0.318 s [User: 79.664 s, System: 6.127 s]
Range (min … max): 9.374 s … 10.009 s 3 runs
Summary
HASH_FUNCTION=xxhash64 node --run build:rspack ran
1.18 ± 0.09 times faster than HASH_FUNCTION=md4 node --run build:rspack
Related PR: #8249
What's Changed
Performance Improvements ⚡
- perf: incremental build chunk graph by @JSerFeng in #7721
- perf: enable
xxhash64
hash function by default by @chenjiahan in #8249 - perf: enable SWC
disableAllLints
by default to reduce overhead by @chenjiahan in #8275 - perf(core): replace
neo-async
with a minimal helper by @chenjiahan in #8282
Exciting New Features 🎉
- feat: add setters for errors and warnings in Compilation by @inottn in #8115
- feat(CLI): make
@rspack/cli
dual package and bundle with Rslib by @chenjiahan in #8187 - feat: add rspack_cacheable lib by @jerrykingxyz in #8156
- feat: keep SWC types up to date by @chenjiahan in #8215
- feat: support wrappedContextRegExp by @inottn in #8149
- feat: introduce RemoveDuplicateModulesPlugin by @JSerFeng in #8128
- feat(html): support function filename and
[name]
in filename by @LingyuCoder in #7753 - feat: module.modules by @SyMind in #8192
- feat: support
output.compareBeforeEmit
by @LingyuCoder in #8245 - feat(incremental): free space for revoked modules by @ahabhgk in #8250
- feat(core): bump swc to 3.0.1 by @hardfist in #8264
- feat: add read API to output file system by @LingyuCoder in #8274
Bug Fixes 🐞
- fix: temporarily use
lightingcss_rs
to fix CSS property order by @GiveMe-A-Name in #8182 - fix(deps): upgrade rspack_resolver 0.3.5 to fix extensionAlias edge cases by @SoonIter in #8188
- fix: should correct cacheGroups test regex by @JSerFeng in #8204
- fix(type):
rspack
function type in cjs require by @SoonIter in #8169 - fix(modern-module): concatenate entry module regardless bail reasons by @fi3ework in #8165
- fix(ci): trigger
pkg-preview
when the needs are skipped by @shulaoda in #8216 - fix: incremental provided exports should rebuild clean exports info by @ahabhgk in #8221
- fix: module_executor support layer by @jerrykingxyz in #8212
- fix: expose incremental.buildChunkGraph by @JSerFeng in #8240
- fix: compile time evaluation of require.ensure by @LingyuCoder in #8242
- fix(cli): display the error which is thrown by the plugin during the starting of
rspack serve
by @LingyuCoder in #8244 - fix: preserve star export from external module by @fi3ework in #8217
- fix: sourceMapFilename is relative by @SyMind in #8269
- fix(type): Make iterators compatible with TS 5.6
--target ESNext
by @andersk in #8279
Document Updates 📖
- docs: update ContextModuleFactory hook by @9aoy in #8178
- docs: correct ES modules and some other spellings by @chenjiahan in #8191
- docs: add tips and examples for experiments configs by @chenjiahan in #8189
- docs: use ApiMeta specific label instead of Webpack specific chapter by @9aoy in #8186
- docs: update links in README by @chenjiahan in #8203
- docs: add layer examples and correct types by @chenjiahan in #8202
- docs: fix link is 404 in Guide by @nobuaki0331 in #8223
- docs: correct the format of defaultValue by @inottn in #8222
- docs: should enable swc
keepImportAttributes
configuration when useRule.with
by @9aoy in #8239 - docs: addedVersion should link to release tag by @9aoy in #8241
- docs: update Rspack roadmap by @chenjiahan in #8246
- docs: add license to website footer by @chenjiahan in #8261
- docs(swc-loader): add example for syntax lowering and polyfill by @chenjiahan in #8265
Other Changes
- refactor: add JSDoc to improve config.experiments types by @GiveMe-A-Name in #8184
- test: rename harmony to ESM by @chenjiahan in #8183
- chore(deps): update crates by @renovate in #6596
- chore(deps): update dependency exit-hook to v4 by @renovate in #8193
- chore(deps): update pnpm to v9.12.2 by @renovate in #8199
- refactor: collect rebuild modules mutations in make by @ahabhgk in #8196
- refactor: add JSDoc to improve config.wath types by @GiveMe-A-Name in #8201
- test: add
rspack.default
should not exist test by @SoonIter in #8207 - chore(typo): rename
lightningCssMiminizerPlugin.ts
file by @SoonIter in #8214 - refactor: add JSDoc to improve config.devServer type by @GiveMe-A-Name in #8213
- refactor: add JSDoc to improve config.ignoreWarnings, profile, bail types by @GiveMe-A-Name in #8230
- chore(deps): update npm dependencies by @renovate in #8200
- refactor: add JSDoc to improve config.performance by @GiveMe-A-Name in #8231
- refactor: add JSDoc to improve rspack config types by @GiveMe-A-Name in #8233
- ci: allow to use self-host runner when preview package by @LingyuCoder in #8236
- ci: allow to get label from self host runner by @LingyuCoder in #8237
- chore: add Debug trait for FileSystem and Make Task by @jerrykingxyz in #8252
- ci: allow aarch64 gnu compile on github runner in pkg preview by @LingyuCoder in #8253
- test: remove copy plugin build folder by @LingyuCoder in #8251
- ci: create prerelease pull request by @LingyuCoder in #8263
- ci: fix pretag default value by @LingyuCoder in #8266
- chore(deps): update pnpm to v9.12.3 by @renovate in #8256
- chore(deps): update github-actions by @renovate in #8255
- chore: remove arco-pro diff test case by @chenjiahan in #8270
- chore(ci): change repo owner of rspack-ecosystem-ci by @chenjiahan in #8272
- chore(ci): fix the syntax error by @inottn in #8278
- refactor: module.size fn should a option compilation by @SyMind in #8281
- test: keep test case stable with different version length by @LingyuCoder in #8287
New Contributors
- @nobuaki0331 made their first contribution in #8223
- @andersk made their first contribution in #8279
Full Changelog: v1.0.14...v1.1.0-beta.0