Releases: web-infra-dev/rspack
v1.2.0-alpha.0
Highlights π‘
Support for persistent cache
Rspack v1.2 introduced an experimental cache configuration that supports persistent caching, which can significantly improve hot startup speed.
When a build hits the cache, it can bring up to 60% performance improvement in real projects.
// rspack.config.js
module.exports = {
cache: true,
experiments: {
cache: {
type: 'persistent',
},
},
};
Note that the persistent cache is still in an early experimental stage and there is a lot of room for performance improvement.
No longer watching node_modules
Rspack v1.2 no longer watching the node_modules
directory by default. This can greatly reduce the number of files to watch and improve performance.
According to our benchmark repo, this change will:
- Reduce memory usage by 120MB.
- Increase dev startup speed by 40%.
- Increase HMR speed by 20~30%.
This change will not affect symlinked resources in monorepo, as symlinked resources are resolved to their real path by default.
Related PR: perf: ignore watching files in node_modules by @chenjiahan in #8645
Upgrade to SWC 9.0
The Rust crate swc_core
has been upgraded to 9.0.2
. Users of the SWC Wasm plugin need to ensure version consistency with the swc_core
being used, otherwise, it may lead to unforeseen issues.
For more details, see SWC Plugin Version Unmatched.
Related PR: feat(core)!: bump swc_core to 9.0.0 by @andersk in #8639
Reduced memory usage
We have optimized the data structure used to store strings during the rspack-sources
computation process. Throughout the computation, all string data points to the string heap memory of the root node, effectively avoiding the generation of new string allocations during the computation.
Related PR: perf: reduce memory consumption of CachedSource by @h-a-n-a in #8666
Reduced bundle size
Rspack v1.2.0 set default SWC minimizer passes
to 2 to reduce bundle size by 1%-7%.
passes
is the the maximum number of times to run compress. In some cases, more than one pass leads to further compressed code. Given Rspack's inherent speed, we've determined that using 2 passes
by default strikes an optimal balance between build performance and bundle size.
Related PR: feat: set default SWC minimizer passes to
2
to reduce bundle size by @chenjiahan in #8853
Parallelize side effects optimization
The implementation of side effects optimization has been refactored to be simpler and more parallelism-friendly. It can take full advantage of parallelism to improve performance. In tested projects, there is typically a 2x-3x performance improvement at this stage.
Related PR: perf: parallelize side effects optimization by @ahabhgk in #8781
Disable WarnCaseSensitiveModulesPlugin by default
The WarnCaseSensitiveModulesPlugin will check the paths of modules and issue warnings for modules that conflict when their paths are all in lowercase. We used to enable it by default, but since it is only a "linter" plugin and it has additional performance overhead especially in development mode. So now we disable it by default, and recommend to use WarnCaseSensitiveModulesPlugin
to add it to your own needs.
// rspack.config.js
module.exports = {
plugins: [new rspack.WarnCaseSensitiveModulesPlugin()],
};
Related PR: feat: export
WarnCaseSensitiveModulesPlugin
and disable it by default by @ahabhgk in #8697
What's Changed
Performance Improvements β‘
- perf: remove tokio-console to reduce binary size by @chenjiahan in #8681
- perf: bump miette v7 to reduce binary size by @chenjiahan in #8694
- perf(incremental): compute affected cgm incrementally by @ahabhgk in #8688
- perf: reduce memory consumption of
CachedSource
by @h-a-n-a in #8666 - perf: faster
substring
ofrspack-sources
by @h-a-n-a in #8731 - perf: side effects when there aren't too many optimizable dependencies by @ahabhgk in #8746
- perf: parallelize side effects optimization by @ahabhgk in #8781
- perf(deps): bump
fast-glob
to v0.4.1 by @shulaoda in #8800 - perf: improve FlagDependencyExportsPlugin for large JSON by depth by @hai-x in #8802
- perf(incremental): better parallel for side effects plugin rebuild by @ahabhgk in #8848
- perf(cli): remove Node.js semver checker by @chenjiahan in #8855
- perf(cli): lazy import rechoir and interpret by @chenjiahan in #8856
Exciting New Features π
- feat: pass compiler_path to rust Compiler by @jerrykingxyz in #8665
- feat: cache storage by @LingyuCoder in #8466
- feat(incremental): named chunk ids by @ahabhgk in #8652
- feat: support additional-pass hook by @SyMind in #8672
- feat: improve cache storage by @LingyuCoder in #8675
- feat: exports info binding API by @SyMind in #8677
- feat: chunkGraph.getModuleId binding API by @SyMind in #8680
- feat: persistent cache by @jerrykingxyz in #8687
- feat: support
size
option for optimization.chunkIds config by @inottn in #8642 - feat: do not cleanup Rust instance by @h-a-n-a in #8702
- feat: export
WarnCaseSensitiveModulesPlugin
and disable it by default by @ahabhgk in #8697 - feat: cache storage move lock file by @LingyuCoder in #8686
- feat: addInclude binding API by @SyMind in #8713
- feat: update experiments.cache signature by @jerrykingxyz in #8729
- feat(mf): bump @module-federation/runtime-tools to 0.8.4 by @chenjiahan in #8728
- feat!: align AssetGeneratorDataUrlFunction with webpack by @inottn in #8614
- feat: support module.generator.outputPath by @inottn in #8554
- feat: add macro to get rspack version by @jerrykingxyz in #8760
- feat: persistent cache expose error to compilation.diagnostic by @jerrykingxyz in #8765
- feat: persistent cache in production mode wait for save to complete by @jerrykingxyz in #8777
- feat: split big chunks based on modules path similarities by @JSerFeng in #8775
- feat: add help message for version check by @h-a-n-a in #8774
- feat: splitChunks.cacheGroups.filename supports function by @JSerFeng in #8779
- feat: bench js api by codspeed by @SyMind in #8808
- feat: support module graph connection js api by @SyMind in #8812
- feat: support
match_when_empty
for rule condition by @CPunisher in #8809 - feat: add context info issuer layer for external function by @ahabhgk in #8832
- feat: add new optimization.avoidEntryIife config by @fi3ework in #8814
- feat(incremental): side effects optimization by @ahabhgk in #8799
- feat: initialize compiler options builder by @h-a-n-a in #8857
- feat(storage): improve storage memory by @LingyuCoder in #8847
Bug Fixes π
- fix: external module move out initial chunk by @SyMind in #8644
- fix: escape css by @JSerFeng in #8698
- fix: the wrong filename was passed when calling the assetEmitted hook by @inottn in #8709
- fix: module concatenation for dynamic export info by @ahabhgk in #8730
- fix: duplicate move lock files by @LingyuCoder in #8732
- fix: fix nightly release compare-before-emit-disable test failed by @jerrykingxyz in #8739
- fix: mf parse range not compat with safari by @ahabhgk in #8749
- fix: increme...
v1.1.8
Security Vulnerability Report
Overview
This is a re-release version of v1.1.6
On 12/19/2024, 02:01 (UTC), we discovered that our npm packages @rspack/core
and @rspack/cli
were maliciously attacked. The attacker released v1.1.7
using a compromised npm token, which contained malicious code. We took immediate action upon discovering the issue.
Impact
- Affected versions:
@rspack/core
and@rspack/cli
v1.1.7
- Duration: 12/19/2024, 02:01 (UTC), lasting approximately 1 hour
- Malicious code impact: After npm install, the postinstall script in
package.json
runs malicious code indist/util/support.js
. See Malicious code analysis for more details.
Actions Taken
Upon discovery, we immediately deprecated the affected v1.1.7
, redirected the npm latest tag to v1.1.6
, and reset all related tokens.
Subsequently, we released a secure new version v1.1.8
.
Recommended Actions
If you installed v1.1.7
during the affected period, please:
- Update to the latest safe version immediately:
@rspack/core
and@rspack/cli
to>= 1.1.8
- Check your system for any unusual activity
Apology and Commitment
We deeply apologize for the risks caused by this incident. To prevent similar incidents from happening again, we will implement stricter token management protocols and enhance our security review processes.
If you have any questions or discover any suspicious activity, please create an issue or send an email to: web-infra-security@bytedance.com
We will continue to follow and respond to community feedback.
v1.1.6
What's Changed
Highlights π‘
Reduced memory usage
Rspack's memory usage in large projects has been significantly reduced since v1.1.6:
Related PRs:
- perf: improve cached source data struct by @SyMind in #8602
- perf: reduce heap allocations for
RuntimeModule
by @h-a-n-a in #8620 - perf: avoid heap allocation for getting connections by @ahabhgk in #8625
Performance Improvements β‘
Exciting New Features π
- feat: implement output.clean.keep: Option by @ClSlaid in #8479
- feat: support
output.trustedTypes.onPolicyCreationFailure
by @LingyuCoder in #8619 - feat(incremental): named module ids by @ahabhgk in #8593
- feat: support
getResolve
in external function context by @fi3ework in #8577 - feat: add intermediate file system by @LingyuCoder in #8631
- feat(persistent cache): add make occasion by @jerrykingxyz in #8586
Bug Fixes π
- fix: importModule should have err by @JSerFeng in #8590
- fix: trusted type should add module runtime requirements by @LingyuCoder in #8617
- fix: source map file should use contenthash itself by @LingyuCoder in #8623
- fix: sync minify file comments from SWC by @fi3ework in #8628
- fix: generate wrong chunk filename runtime code on win32 by @LingyuCoder in #8622
- fix: avoid unnamed module ids by @ahabhgk in #8634
- fix: passively rebuild modules imported by
importModule
by @CPunisher in #8595
Document Updates π
- docs: fix typo by @cbbfcd in #8607
- docs: rewrite
CopyRspackPlugin
documentation by @chenjiahan in #8621 - docs: fix error links by @xuexb in #8635
Other Changes
- chore: add release-check task by @hardfist in #8578
- refactor: remove compilation.built_module by @jerrykingxyz in #8589
- chore(deps): update github-actions by @renovate in #8610
- chore(deps): update rspress to v1.37.3 by @renovate in #8613
- chore(deps): update pnpm to v9.14.4 by @renovate in #8612
- chore: remove tracking subjects by @h-a-n-a in #8616
- test(snapshot): make snapshots cleaner and update path-serializer 0.3.4 by @SoonIter in #8161
- chore(deps): update napi by @renovate in #8611
- test: create issues for failed webpack test by @GiveMe-A-Name in #8618
- refactor: improve dependency location by @shulaoda in #8606
- chore(deps): update crates by @renovate in #8198
- chore(deps): update crates (major) by @renovate in #6926
- ci: run miri on main by @h-a-n-a in #8632
- chore: remove unnecessary code by @shulaoda in #8641
New Contributors
- @ClSlaid made their first contribution in #8479
- @cbbfcd made their first contribution in #8607
- @xuexb made their first contribution in #8635
Full Changelog: v1.1.5...v1.1.6
v1.1.5
What's Changed
Highlights π‘
refactor css loading
Since #7306, we have aligned with webpack's CSS loading strategy, which assumed that CSS finished loading before executing JavaScript, which is not true. Both Rspack and webpack have changed the CSS loading strategy to address this issue.
For more specific details on the original problem, please refer to this link.
Webpack fixed this in webpack/webpack#19021
Rspack fixed this in #8534
Performance Improvements β‘
- perf: create tsfn error resolver once by @h-a-n-a in #8540
- perf: mem cache for chunk render source by @ahabhgk in #8528
- perf: move from
Buffer
to zero-copyBufferSlice
by @h-a-n-a in #8574 - perf: register cleanup hook on global by @SyMind in #8564
- perf: reduce memory consumption of paths by @h-a-n-a in #8581
Exciting New Features π
- feat(mf): recursive search for versions of shared dependencies by @inottn in #8388
- feat: support output.environment.nodePrefixForCoreModules by @inottn in #8516
- feat(rspack_cacheable):
as
attr support use with dyn trait by @jerrykingxyz in #8535 - feat: support analysing AMD module format by @nilptr in #8389
- feat(cli): set default
process.title
by @chenjiahan in #8576 - feat: support chunksSortMode option to HtmlRspackPlugin by @inottn in #8585
Bug Fixes π
- fix: reset the progress bar in the correct hook by @inottn in #8429
- fix: get encoded asset content correctly by @inottn in #8545
- fix: missing dependencies type in Module class by @SyMind in #8552
- fix: chunk render cache panic on css extract diagnostics by @ahabhgk in #8562
- fix: should report errors if stats was being accessed after the compiler was closed by @h-a-n-a in #8561
- fix: add missing affectedHooks parameter to ProvidePlugin by @inottn in #8570
- fix: rule.issuerLayer by @SyMind in #8572
- fix: should have module-post-order-index when incremental build by @JSerFeng in #8559
- fix: rebuild should reset module.preOrderIndex by @JSerFeng in #8413
- fix(incremental): infer async modules test cases and add loggings for incremental by @ahabhgk in #8580
- fix: prevent from accessing outdated compilation by @SyMind in #8591
- fix(incremental): get affected modules with chunk graph perf regression by @ahabhgk in #8592
Document Updates π
- docs: add examples for watchOptions by @chenjiahan in #8532
- docs: polish Rule configuration by @chenjiahan in #8565
Other Changes
- refactor: remove unnecessary filesystem trait by @hardfist in #8525
- chore(deps): update dependency prettier to v3.4.1 by @renovate in #8544
- chore(deps): update github-actions by @renovate in #8542
- chore(deps): update pnpm to v9.14.2 by @renovate in #8543
- refactor: css loading by @JSerFeng in #8534
- test: create issues for webpack-test failures by @GiveMe-A-Name in #8551
- chore: update rspress to v1.37.2, fix sass test case warnings by @renovate in #8514
- refactor: remove unused cssHeadDataCompression config by @JSerFeng in #8555
- chore: bump rspack crate to 0.2.0 by @hardfist in #8573
- chore: fix crate publish problems by @hardfist in #8575
- refactor: CSS HMR by @JSerFeng in #8587
Full Changelog: v1.1.4...v1.1.5
v1.1.4
What's Changed
Exciting New Features π
- feat(cacheable): add AsOwned by @jerrykingxyz in #8500
- feat: rspack_cacheable support
as
attr by @jerrykingxyz in #8521 - feat: rspack_cacheable support rspack_sources::BoxSource by @jerrykingxyz in #8527
Bug Fixes π
- fix(incremental): wrong runtime module when rebuild by @ahabhgk in #8504
- fix:
WebWorkerTemplatePlugin
should generate import-scripts chunk loading runtime by @h-a-n-a in #8523 - fix: handle DataURI without base64 word by @inottn in #8380
- fix: variable name conflict with concatenate and runtime code by @inottn in #8386
Document Updates π
- docs: add examples for ESM loader by @chenjiahan in #8498
- docs: chunk level incremental by @ahabhgk in #8505
- docs: remove wrong short argument -w for --json in cli.mdx by @stefanseeger in #8507
- docs: update plugin compatible table by @chenjiahan in #8526
Other Changes
- chore(deps): update dependency @swc/plugin-remove-console to v5 by @renovate in #8515
- test: create issues for webpack-test failure cases by @GiveMe-A-Name in #8491
- refactor: rename FileSystem to SyncFileSystem by @hardfist in #8520
- refactor: unify to filesystem in rspack_core by @hardfist in #8522
- chore: update error message for task loop by @wtlin1228 in #8418
New Contributors
- @stefanseeger made their first contribution in #8507
- @wtlin1228 made their first contribution in #8418
Full Changelog: v1.1.3...v1.1.4
v1.1.3
What's Changed
Performance Improvements β‘
- perf: reduce source map json stringify by @SyMind in #8468
- perf: move matching logic in source map plugin to rust side by @inottn in #8481
Exciting New Features π
Bug Fixes π
- fix: unstable stats test snapshot by @ahabhgk in #8482
- fix(incremental): disappeared chunk panic in chunks render by @ahabhgk in #8492
- fix: css escape when consume string by @ahabhgk in #8495
Other Changes
- chore(ci): add rust bench ci by @SoonIter in #8476
- chore(deps): update cargo-bins/cargo-binstall action to v1.10.13 by @renovate in #8477
- chore(deps): update pnpm to v9.14.1 by @renovate in #8478
- test: move e2e to the test folder by @chenjiahan in #8486
Full Changelog: v1.1.2...v1.1.3
v1.1.2
What's Changed
π‘ Highlights
DefinePlugin destructuring optimization
Rspack v1.1.2 improved the output of DefinePlugin
by eliminating unused object properties from the final bundle, resulting in a smaller output size:
Exciting New Features π
- feat(externals): support 'commonjs-import' type by @fi3ework in #8414
- feat(incremental): chunk level incremental by @ahabhgk in #8367
- feat: unify js dependency by @SyMind in #8394
- feat: support attributes for ESM external module by @fi3ework in #8422
- feat: align webpack DefinePlugin for destructuring optimization by @inottn in #8452
- feat(incremental): render chunk manifest by @ahabhgk in #8440
- feat(persistent cache): add snapshot module by @jerrykingxyz in #8424
Bug Fixes π
- fix: output should be consistent when using splitChunks by @JSerFeng in #8425
- fix(core): remove hang risk caused by coop budget in tokio by @hardfist in #8434
- fix: should not free native compiler while compiler is running by @h-a-n-a in #8437
- fix: align bytes ptr address for
cacheable::from_byte
by @jerrykingxyz in #8450 - fix: correct favicon path when output.publicPath is set to
auto
by @inottn in #8415 - fix(lightningcss): align type with lightningcss by @GiveMe-A-Name in #8456
- fix: the attribute values of HTML tags should not be converted to lowercase by @inottn in #8443
- fix: should respect max size correctly by @JSerFeng in #8442
- fix(modern-module): remove extra import statement for star reexport by @fi3ework in #8457
- fix: set the correct asset_info when extracting css by @inottn in #8454
- fix: linux musl resolve failed by @jerrykingxyz in #8467
- fix: modify css loading runtime panic by @ahabhgk in #8475
Document Updates π
- docs: polish module methods documentation by @chenjiahan in #8448
- docs: update Prefetching link by @xiaohp in #8449
- docs: invite @inottn to Rspack core team by @chenjiahan in #8462
- docs: add more JavaScript runtimes by @chenjiahan in #8464
Other Changes
- test: delete test.filter.js if test is pass in tests/webpack-test by @GiveMe-A-Name in #8409
- test: add miri testing by @h-a-n-a in #8426
- chore(deps): update github-actions by @renovate in #8416
- chore(rspack-cli): add strip-ansi in dev deps by @stormslowly in #8432
- refactor: rename async_run to background_run & sync_run to main_run by @hardfist in #8385
- test: replace strip-ansi with Node.js builtin util by @chenjiahan in #8439
- test: fix some unstable test cases for layer stats by @easy1090 in #8453
- build(windows): static linking VS CRT on aarch64 msvc !windows by @h-a-n-a in #8465
- chore(deps): update napi by @renovate in #8417
- ci(release): fix release pull request by @h-a-n-a in #8472
New Contributors
- @stormslowly made their first contribution in #8432
- @xiaohp made their first contribution in #8449
Full Changelog: v1.1.1...v1.1.2
v1.1.1
π‘ Highlights
Support for DllPlugin
This release introduced rspack.DllPlugin and rspack.DllReferencePlugin in #8296 to be compatible with webpack's DLLPlugin and DllReferencePlugin.
DLL plugins help you improve build performance by separating rarely-changed code (like vendor dependencies) into separate bundles. The term "DLL" stands for Dynamic-link library. See here for more information.
What's Changed
Exciting New Features π
- feat: add memory fs by @jerrykingxyz in #8372
- feat: support rspack.DllPlugin & rspack.DllReferencePlugin by @GiveMe-A-Name in #8296
Bug Fixes π
- fix(cli): Run config function before looking for
--config-name
by @andersk in #8363 - fix: items_to_regexp for chinese by @SyMind in #8368
- fix: allow passing Infinity to parser.asset.dataUrlCondition.maxSize by @inottn in #8344
- fix(side effects): should optimize for same target export by @ahabhgk in #8371
- fix: tapable run in wrong closure by @SyMind in #8376
- fix: required amd in umd external object by @LingyuCoder in #8369
- fix: panic in sort of chunk combination bucket by @LingyuCoder in #8392
- fix: compile time evaluation of
__webpack_layer__
by @inottn in #8381 - fix: panic when imported json file is empty by @LingyuCoder in #8397
- fix: css runtime should have hmr handler when lazy-compilation by @JSerFeng in #8400
- fix: fix
Compiler
not getting freed after use by @h-a-n-a in #8268
Document Updates π
- docs: announcing v1.1 by @LingyuCoder in #8332
- docs: add guide for TypeScript configuration file by @chenjiahan in #8370
- docs: add bluesky file by @chenjiahan in #8373
Other Changes
- refactor: rspack_fs use
Utf8Path
andFileMetadata
by @jerrykingxyz in #8366 - chore: bump to napi@3 by @h-a-n-a in #8359
- refactor(napi): prevent depend on ClassInstance by @SyMind in #8377
- refactor(napi): rm unreachable FromNapiValue by @SyMind in #8378
- build: use symlinked executables instead of command shims by @h-a-n-a in #8382
- refactor: reuse AssetConditions for banner plugin by @inottn in #8350
- test: add missing dev dependencies back by @LingyuCoder in #8398
Full Changelog: v1.1.0...v1.1.1
v1.1.0
See Announcing Rspack 1.1 for more details.
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 - perf: remove unnecessary regex by @shulaoda in #8320
- perf(cli): enable Node.js compile cache by @chenjiahan in #8331
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
- feat(rspack/stats): support the option groupModulesByLayer of stats by @easy1090 in #8283
- feat: unify js module by @SyMind in #8210
- feat(core): improve progress plugin for multi compiler by @hardfist in #8301
- feat: unify module in loader context by @SyMind in #8262
- feat(core): bump swc to 4.0.2 by @hardfist in #8322
- feat: use lightningcss v1.0.0-alpha.60 stead of lightningcss_rs by @GiveMe-A-Name in #8324
- feat: throw error for outdated compilation by @SyMind in #8315
- feat: support compilation.modules[i].dependencies by @inottn in #8050
- feat(core): bump swc to 5.0.0 by @hardfist in #8354
- feat: improve description, types and JSDoc for entry options by @chenjiahan in #8361
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 - fix(core): remove unused source files by @chenjiahan in #8285
- fix: types and docs of umd external object by @LingyuCoder in #8286
- fix(test-tools): update peer dependency @rspack/core to v1 by @renovate in #8289
- fix(type): Patch rollup-plugin-dts bug that broke prebundled zod by @andersk in #8306
- fix: hotUpdate chunk should have correct runtime by @JSerFeng in #8273
- fix: error for set user request by @SyMind in #8307
- fix: falsy rule should be filtered by @LingyuCoder in #8297
- fix: use incremental in production build by @ahabhgk in #8311
- fix: correct usage of
pnpm --filter
in package scripts by @shulaoda in #8319 - fix: runtime chunk hash should respect their reference order by @ahabhgk in #8303
- fix(ci): pkg.pr.preview not work by @SoonIter in #8325
- fix: file dependencies are lost when css module fails by @LingyuCoder in #8328
- fix: code auto merging error by @SyMind in #8341
- fix(cli): missing
exports.types
field by @chenjiahan in #8355 - fix(tests): layer-stats snapshot problem by @easy1090 in #8356
- fix: correct split-chunks tests by @JSerFeng in #8357
- fix(experiments css): should preserve keywords decl and compose ident for self reference by @Austaras in #8225
- fix: import order change should re-seal by @JSerFeng in #8358
- fix(core): bump swc to 5.0.1 by @hardfist in #8362
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
- docs: fix inline match resource typo by @9aoy in #8292
- docs: add docs for incremental by @ahabhgk in #8293
- docs: add swc cacheRoot guide by @9aoy in #8308
- docs: add Docusaurus to ecosystem by @chenjiahan in #8336
- docs: add Nuxt to ecosystem by @chenjiahan in #8338
- docs: improve default value, types and examples for
optimization
by @chenjiahan in #8339 - docs: fix missing internal plugins by @chenjiahan in #8343
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 htt...
v1.1.0-beta.0
π‘ Highlights
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...