Releases: web-infra-dev/rspack
v1.2.6
What's Changed
Performance Improvements β‘
- perf(loader-runner): memoize resolver creation for improved performance by @inottn in #9403
- perf: remove blocking for execute module hook by @ahabhgk in #9406
- perf: use partition_map to avoid clone by @JSerFeng in #9427
Exciting New Features π
- feat: render chunk runtime template with dojang by @GiveMe-A-Name in #9407
- feat: using dojang to render runtime_template by @GiveMe-A-Name in #9422
Bug Fixes π
- fix(incremental): enable incremental for full hash test by @ahabhgk in #9377
- fix: sort group by group index by @JSerFeng in #9394
- fix: sort order incorrect by @JSerFeng in #9404
- fix: strip
blob:
protocol when public path is auto by @stormslowly in #9303 - fix(type): Change the module in the LazyCompilationOptions from any to Module by @gaoachao in #9387
- fix: clean up deps at the beginning of compilation.finish by @jerrykingxyz in #9414
- fix(json): correctly escape unicode characters by @inottn in #9419
- fix: remove dynamic entry should re-build chunk graph by @ahabhgk in #9425
- fix: build error with reserved keywords in CSS modules by @inottn in #9439
- fix: update CLI flags to use camelCase consistently by @chenjiahan in #9442
- fix: use persistent cache with module federation by @jerrykingxyz in #9445
Other Changes
- chore(codeowners): removing deprecated package by @zackarychapple in #9395
- test: replace content hashes and full hashes to placeholders in css extract plugin cases by @LingyuCoder in #9398
- test(incremental): enable more webpack watch tests by @ahabhgk in #9392
- refactor: incremental rebuild make failed modules and dependencies by @jerrykingxyz in #9393
- chore: enable renovate webpack by @stormslowly in #9420
- chore(deps): update rspress to v1.42.0 by @renovate in #9417
- ci: use different shared key between normal build and codspeed build by @LingyuCoder in #9421
- test: do not snapshot the whole main file in css extract test cases by @LingyuCoder in #9408
- chore(codeowners): update code ownership to match repository structure by @chenjiahan in #9410
- ci: run codspeed build in parallel by @LingyuCoder in #9401
- chore: move modern module library finish_modules to finish_make by @ahabhgk in #9426
- chore(deps): update dependency @rslib/core to v0.5.1 by @renovate in #9416
- chore(workflow): no need to run pnpm cache in rust jobs by @chenjiahan in #9430
- ci: only install binding dependencies when building binary by @LingyuCoder in #9429
- chore(deps): update dependency postcss-loader to v8 by @renovate in #9418
- chore(deps): update npm dependencies by @renovate in #9366
- chore(deps): update dependency @swc/plugin-remove-console to ^6.3.2 by @renovate in #9435
- chore(deps): update dependency less-loader to v12 by @renovate in #9436
- chore(deps): update dependency typescript to v5 by @renovate in #9437
- chore(deps): update npm dev dependencies by @renovate in #9367
- chore(deps): bump
fast-glob
to v0.4.4 by @shulaoda in #9438 - test: should not call stats toJson if not necessary by @LingyuCoder in #9434
- test: remove hash test in sri plugin cases by @LingyuCoder in #9440
- refactor: remove duplicate static variable definitions by @inottn in #9443
Full Changelog: v1.2.5...v1.2.6
v1.2.5
Note π
Version 1.2.5 fixes compatibility issues caused by Glibc versions on Linux x86 systems in version 1.2.4.
What's Changed
Exciting New Features π
Bug Fixes π
- fix: revert linux x86_64 publish to docker by @hardfist in #9373
- fix: remove unnecessary path-to-URL conversion in html plugin by @inottn in #9348
- fix(splitChunks): splitChunks maxSize not work as expected if size of some type is small by @JSerFeng in #9285
Document Updates π
- docs: update release workflow by @chenjiahan in #9357
- docs: enhance compiler run hooks documentation by @chenjiahan in #9374
- docs: fix import SRI statement by @LingyuCoder in #9376
- docs: update Dll and SRI plugin status by @chenjiahan in #9384
Other Changes
- chore: add tests option for release full by @hardfist in #9360
- ci: add option to test when releasing canary by @LingyuCoder in #9363
- chore(deps): update rspress to v1.41.3 by @renovate in #9368
- chore(deps): update github-actions by @renovate in #9364
- chore(deps): update dependency prettier to v3.5.1 by @renovate in #9365
- chore(deps): update SWC to 14.0.1 by @GiveMe-A-Name in #9371
- Revert "perf: reuse js dependency" by @JSerFeng in #9389
Full Changelog: v1.2.4...v1.2.5
v1.2.4
Highlights π‘
Support for SRI
This release introduces a new built-in SubresourceIntegrityPlugin to provide support for Subresource Integrity (SRI).
SubresourceIntegrityPlugin
is a Rust rewrite of the webpack-subresource-integrity and is much more faster.
import { experiments } from '@rspack/core';
const { SubresourceIntegrityPlugin } = experiments;
export default {
plugins: [new SubresourceIntegrityPlugin()],
output: {
crossOriginLoading: 'anonymous',
},
};
Updated Roadmap
The Rspack roadmap has been updated with new targets such as Wasm build and Rstest, see Roadmap.
What's Changed
Performance Improvements β‘
- perf: one shot ref for class instance by @SyMind in #9267
- perf: revert opt-level to 3 by @hardfist in #9339
- perf: reuse js module between compilation by @SyMind in #9265
Exciting New Features π
- feat: split chunks overall filename by @ahabhgk in #9243
- feat: chunk graph get module hash by @ahabhgk in #9242
- feat: add
--config-loader
CLI option by @krutoo in #9210 - feat: support enabling builtin loaders in compiler builder by @h-a-n-a in #9262
- feat: support experiments.SubresourceIntegrityPlugin #9171 by @hardfist in #9311
- feat: supports chunkGraph and moduleGraph for cacheGroup.test by @JSerFeng in #9248
Bug Fixes π
- fix: use entry arg with match resource by @ahabhgk in #9235
- fix: introduce AsyncTask, make rebuildModule safer by @JSerFeng in #9244
- fix(core): fix module external not treated as async by @hardfist in #9247
- fix(css,assets): wrong "publicPath: auto" asset path in windows by @SoonIter in #9239
- fix(deps): govern graceful-fs sourcemap phantom dependencies by @SoonIter in #9259
- fix: has async chunks by @ahabhgk in #9263
- fix: dynamic entry dependency reuse by @ahabhgk in #9268
- fix(core): add sourceURL when devtool set to 'eval-source-map' by @hardfist in #9275
- fix: persistent cache remove non-existent modules from make_failed_module by @jerrykingxyz in #9309
- fix: build cli dev failed by @LingyuCoder in #9331
- fix: asset cached source size by @ahabhgk in #9310
- fix: force load all symbol by @hardfist in #9337
- fix: initialize lazy compilation backend earlier by @chenjiahan in #9342
- fix: allow loaderContext methods to be called independently of context by @inottn in #9326
- fix: clear module_execution_results every compilation by @JSerFeng in #9346
- fix: runtime chunk check full hash by @LingyuCoder in #9355
Document Updates π
- docs: update Rspack roadmap by @chenjiahan in #9241
- docs: display GitHub button on homepage by @chenjiahan in #9261
- docs: update plugin compatibility status by @chenjiahan in #9276
- docs: reuse antd from
@rstack-dev/doc-ui
by @chenjiahan in #9284 - docs: config-loader CLI option by @krutoo in #9291
- docs: add
SubresourceIntegrityPlugin
by @LingyuCoder in #9302 - docs: fix Chinese comment in English docs by @sadan4 in #9316
- docs: fix letter casing of Re.Pack by @jbroma in #9344
Other Changes
- chore: release packages v1.2.3 by @ahabhgk in #9240
- chore: enable no-dts-cache by default by @hardfist in #9162
- chore(deps): update dependency memfs to v4.17.0 by @renovate in #9249
- chore(deps): update dependency postcss to ^8.5.2 by @renovate in #9250
- chore(deps): update github-actions by @renovate in #9255
- chore: fix lint-staged failed when js/ts file staged by @stormslowly in #9246
- refactor: module diagnostic action move to
Diagnosable
trait by @jerrykingxyz in #9264 - refactor: format:js should be used without args by @stormslowly in #9266
- chore(deps): update pnpm to v9.15.5 by @renovate in #9256
- chore(deps): update dependency prettier to v3.5.0 by @renovate in #9251
- test: bump pug v3 and reduce npm dependencies by @chenjiahan in #9272
- test: remove copy-webpack-plugin v5 by @chenjiahan in #9274
- chore(workflow): update version scripts and reduce dependencies by @chenjiahan in #9277
- chore: simplify ci workflow by @hardfist in #9283
- chore(deps): update dependency @swc/plugin-remove-console to ^6.2.0 by @renovate in #9292
- chore(deps): update dependency yargs to v17.7.2 - autoclosed by @renovate in #9295
- chore(deps): update dependency is-ci to v4 by @renovate in #9297
- chore(deps): update dependency husky to ^9.1.7 by @renovate in #9293
- chore(deps): update dependency wast-loader to ^1.14.1 by @renovate in #9294
- refactor: move module_argument and exports_argument to BuildInfo struct by @inottn in #9260
- chore: pin codspeed version by @hardfist in #9300
- chore: use more semantic naming profile by @hardfist in #9288
- refactor(rust): improve
replace_all_placeholder
by @shulaoda in #9289 - chore: fix bench ci by @hardfist in #9301
- chore: add codspeed badge by @hardfist in #9312
- chore: continue clean up workflow by @hardfist in #9308
- chore(deps): update dependency semver to ^7.7.1 by @renovate in #9320
- chore(deps): update dependency sass-embedded to ^1.85.0 by @renovate in #9319
- chore(deps): update dependency core-js to v3.40.0 by @renovate in #9317
- chore(deps): update dependency enhanced-resolve to v5.18.1 by @renovate in #9318
- chore(deps): update dependency serve-static to v1.16.0 [security] by @renovate in #9315
- chore(deps): update dependency cross-spawn to v7.0.5 [security] by @renovate in #9314
- revert: Revert "refactor(rust): improve
replace_all_placeholder
" by @h-a-n-a in #9304 - chore(deps): update dependency vitest to v3 by @renovate in #9298
- refactor: rename Rspack to JsCompiler by @hardfist in #9327
- chore(deps): update rspress to v1.41.2 by @renovate in #9328
- chore(deps): update dependency terser to v5.39.0 by @renovate in #9329
- chore: remove justfile by @hardfist in #9332
- ci: cargo shear not found by @LingyuCoder in #9334
- refactor: NormalModule.source remove diagnostic data by @jerrykingxyz in #9281
- chore: run bench using release profile by @hardfist in #9338
- chore(deps): update dependency fastify-graceful-shutdown to v4 by @renovate in #9330
- chore(deps): update dependency date-fns to v4 by @renovate in #9351
- chore(deps): update dependency @monaco-editor/react to ^4.7.0 by @renovate in #9349
- chore(deps): update dependency markdown-to-jsx to ^7.7.4 by @renovate in https://github.com/web-infra-dev/rspac...
v1.2.3
What's Changed
Performance Improvements β‘
- perf(deps): update
swc_core
to v13 by @chenjiahan in #9133 - perf(storage): release pack contents after loading by @LingyuCoder in #9187
- perf: speedup compile by @hardfist in #9199
Exciting New Features π
- feat(create-rspack): create React 19 project by default by @chenjiahan in #9130
- feat: add rust benchmark case for code splitting by @JSerFeng in #9127
- feat: get block chunk group by @SyMind in #9165
- feat: support missing module graph js api by @SyMind in #9172
- feat: support missing module js api by @SyMind in #9177
- feat: add rsdoctor native plugin by @LingyuCoder in #8930
- feat: layer option support function by @SyMind in #9189
- feat: chunkGroup.childrenIterable & dependency.ids by @SyMind in #9195
- feat: add getResolver method for NormalModuleFactory by @inottn in #9202
- feat(lazy-compilation): support module id for LazyCompilationProxyModule by @JSerFeng in #9223
- feat(plugin-css): should handle css layer supports media by @JSerFeng in #9221
- feat: add native hook of real content hash plugin by @LingyuCoder in #9234
Bug Fixes π
- fix: dll manifest zod validation by @ahabhgk in #9112
- fix: amd require array by @ahabhgk in #9113
- fix: require local module and support new require by @ahabhgk in #9114
- fix: amd alias define renaming by @ahabhgk in #9117
- fix: correct lazy compilation backend options schema by @chenjiahan in #9138
- fix: should not tree shaking used ident accidentally in composes by @JSerFeng in #9161
- fix(types): prebundle
@swc/types
to fix missing dts files by @inottn in #9173 - fix: do not expose
build()
for level-2 options builder by @h-a-n-a in #9188 - fix: align default options with JS by @h-a-n-a in #9116
- fix(core): initialize resolverFactory early by @hardfist in #9193
- fix(core): don't swallowing exceptions in stats.toJson by @hardfist in #9208
- fix: incremental make rebuild removed entry module by @jerrykingxyz in #9209
- fix: ignore generator options for
asset/source
module type by @haocheng6 in #9216 - fix: lazy compilation request handler should filter lazy-compilation request by @JSerFeng in #9166
- fix: alias sequence order & merge result by @SyMind in #9206
- fix(incremental): build chunk graph not build new added entry by @ahabhgk in #9225
- fix: namedChunks / emitAsset js api by @SyMind in #9185
- fix: rspack sources perf bug by @SyMind in #9229
- fix(deps): β¬οΈ rspack_resolver 0.5.1 by @stormslowly in #9233
Document Updates π
- docs: add Khan Academy to who is using by @chenjiahan in #9120
- docs: add notes for injecting core-js polyfill by @chenjiahan in #9122
- docs: fix invalid
cacheGroups
example by @chenjiahan in #9129 - docs: add examples for all module parser and generator options by @chenjiahan in #9131
- docs: rewrite plugins usage guide by @chenjiahan in #9132
- docs: improve HtmlRspackPlugin docs and types by @grushetsky in #9144
- docs: add
compiler.hooks.finishMake
by @colinaaa in #9146 - docs: set Open Graph images based on page routes by @chenjiahan in #9148
- docs: add profile guide using samply by @hardfist in #9157
- docs: update rspress 1.41.0 and enable codeBlocks search by @chenjiahan in #9158
- docs(typo): Fix rspack.config typo in nestjs by @Codfisher in #9179
- docs: support for tabbed code blocks for ESM/CJS toggle by @chenjiahan in #9186
- docs: fix
output.workerChunkLoading
link by @9aoy in #9194 - docs: use ESM for simple configuration examples by @chenjiahan in #9190
- docs: update profiling guide by @hardfist in #9201
- docs: rewrite configure Rspack section by @chenjiahan in #9211
- docs: improve FlagDependencyExportsPlugin for large JSON by depth by @hai-x in #9215
- docs: correct splitChunks chunk.name by @JSerFeng in #9218
- docs: link to Tailwind CSS v4 documentation by @chenjiahan in #9220
- docs: migrate all configuration examples to ESM or dual format by @chenjiahan in #9238
Other Changes
- chore: release packages 1.2.2 by @ahabhgk in #9106
- chore(CI): split PR labeler workflow by @chenjiahan in #9102
- chore: update Rslib description in README.md by @Timeless0911 in #9110
- chore(deps): update rspress to v1.40.2 by @renovate in #9118
- chore(deps): update
swc_core
to v10.7.0 by @chenjiahan in #9125 - chore(workflow): remove duplicated issue label by @chenjiahan in #9140
- chore(ci): remove invalid field by @inottn in #9147
- ci: fix corepack key id mismatch by @chenjiahan in #9153
- chore: bump inventory 0.1 -> 0.3 by @CPunisher in #9159
- fix(type): export resource data with data type and add docs by @LonelySnowman in #9107
- test: add missing
findBundle
option to ensure test cases are executed by @haocheng6 in #9057 - refactor: path relative in source map plugin by @SyMind in #8903
- feat: add
EnableChunkLoadingPlugin.{setEnabled,checkEnabled}
by @colinaaa in #9092 - feat: add
chunk.getEntryOptions()
by @colinaaa in #9093 - chore(renovate): split npm updates into fine-grained PRs by @chenjiahan in #9164
- refactor: remove
NormalModule
last_successful_build_meta field by @jerrykingxyz in #9163 - chore(deps): update dependency @rslib/core to v0.4.0 by @renovate in #9167
- chore(deps): update dependency @rstack-dev/doc-ui to v1.6.0 by @renovate in #9168
- test(webpack-test): add back two test case by @stormslowly in #9152
- chore(deps-dev): bump vitest from 2.1.8 to 2.1.9 by @dependabot in #9174
- refactor: module.build directly updates build_info and build_meta by @jerrykingxyz in #9178
- chore(deps): update dependency create-rstack to v1.2.0 by @renovate in #9181
- chore(deps): update dependency cspell to ^8.17.3 by @renovate in #9182
- refactor(rust): use
cow_to_ascii_uppercase
andcow_to_ascii_lowercase
by @shulaoda in #9126 - chore(deps): update dependency zod to ^3.24.1 by @renovate in #9169
- chore(deps): update dependency acorn to ^8.14.0 by @renovate in #9196
- chore(deps): update dependency enhanced-resolve to v5.18.1 by @renovate in #9197
- chore(deps): update dependency memfs to v4.17.0 by @renovate in #9198
- chore(deps): update crate-ci/typos action to v1.29.5 by @renovate in #9156
- chore(workflow): let renovate pin GitHub Action digests by @ch...
v1.2.2
What's Changed
New Features π
- feat: add runtime plugin hooks by @LingyuCoder in #9084
- feat(incremental): don't use has_module_import_export_change when incremental code splitting enabled by @ahabhgk in #9062
- perf(options): replace
Regexp
withends_with
match by @h-a-n-a in #9081
Bug Fixes π
- revert: fix: align
amd
option behavior with webpack by @ahabhgk in #9103 - fix: resolve the inconsistent type issue in
JsModule
by @shulaoda in #8939 - fix: should not have warnings for cjs when using dll by @ahabhgk in #9091
- fix: should not cache tracing instance by @h-a-n-a in #9086
- fix: render module id as number if we can by @ahabhgk in #9099
Other Changes
Full Changelog: v1.2.1...v1.2.2
v1.2.1
What's Changed
New Features π
- feat: improve compatibility with compiler options by @h-a-n-a in #9067
- feat: integrate rspack_dojang for enhanced template rendering by @GiveMe-A-Name in #9079
Bug Fixes π
- fix: amd define in function params by @ahabhgk in #9088
- revert: rspack sources substring heuristic algorithm by @SyMind in #9082
Other Changes
- refactor: split compiler hook registers into multiple files by @LingyuCoder in #9061
- chore(deps): update dependency commander to v13 by @renovate in #9074
- chore(deps): update cargo-bins/cargo-binstall action to v1.10.22 by @renovate in #9071
- chore(deps): update pnpm to v9.15.4 by @renovate in #9073
- docs: polish some documentations by @chenjiahan in #9085
Full Changelog: v1.2.0...v1.2.1
v1.2.0
See Announcing Rspack 1.2 for more details.
What's Changed
Performance Improvements β‘
- perf: ignore watching files in node_modules by @chenjiahan in #8645
- 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
- perf: persistent cache regenerate artifact.*_dependencies from module_graph by @jerrykingxyz in #9004
- perf: persistent cache use multi-thread by @jerrykingxyz in #9010
- perf: add iterator consumer to improve performance by @jerrykingxyz in #9014
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: set default SWC minimizer passes to
2
to reduce bundle size by @chenjiahan in #8853 - feat: initialize compiler options builder by @h-a-n-a in #8857
- feat(storage): improve storage memory by @LingyuCoder in #8847
- feat: support set build info in js side by @SyMind in #8893
- feat: support invalidate persistent cache using
config.mode
andconfig.name
by @jerrykingxyz in #8920 - feat: support
devtool
to compiler options builder by @h-a-n-a in #8940 - feat(plugin-css-extract): add
enforceRelative
plugin option to preserve './' by @SoonIter in #8946 - feat: initialize builtin plugins in compiler options builder by @h-a-n-a in #8954
- feat: support externals in compiler builder options by @h-a-n-a in #8959
- feat: support chunkGroup.getModulePreOrderIndex by @JSerFeng in #8588
- feat(core): bump swc_core to 9.0.0 by @andersk in #8639
- feat(core): bump swc_core to 10.0.1 by @GiveMe-A-Name in #8967
- feat(core): add Yarn PnP support by @hardfist in #7639
- feat: support
optimization
in compiler options builder by @h-a-n-a in #8979 - feat: make builtin plugin options ordered in compiler options builder by @h-a-n-a in #8980
- feat: support custom parser for
json
type by @cbbfcd in #8947 - feat(core): bump swc_core to 10.1.0 by @GiveMe-A-Name in #8995
- feat: add tracing instrument for persistent cache by @jerrykingxyz in #9001
- feat: mark
@rspack/tracing
as peer dependency by @h-a-n-a in #9008 - feat: initial support for compiler builder by @h-a-n-a in #9015
- feat(plugin-asset): support
generator['asset'].importMode
for Rslib by @SoonIter in #8724 - feat: Add support for debug IDs by @timfish in #8943
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: incremental rebuild are compatible with empty artifact by @jerrykingxyz in #8758
- fix: correct type for
loaderContext.importModule
by @chenjiahan in #8766 - fix: allow empty persistent cache options by @h-a-n-a in #8813
- fix: use cgm hash to verify rename inline modules cache by @ahabhgk in #8820
- fix: Rspack cssParser will parse failed when url(' ') by @cbbfcd in #8824
- fix(diagnostic): improve diagnostics for swc wasm plugins when mismatch by @SyMind in #8001
- fix!: handle glob patterns ending with /** in CopyRspackPlugin by @inottn in #8803
- fix(exernals): add hash to distinguish conflict id by @fi3ework in #8834
- fix: importModule should recei...
v1.2.0-beta.0
What's Changed
Exciting New Features π
- feat: support set build info in js side by @SyMind in #8893
- feat: support invalidate persistent cache using
config.mode
andconfig.name
by @jerrykingxyz in #8920 - feat: support
devtool
to compiler options builder by @h-a-n-a in #8940 - feat(plugin-css-extract): add
enforceRelative
plugin option to preserve './' by @SoonIter in #8946
Bug Fixes π
- fix: rspack_version macro use json to parse package.json by @jerrykingxyz in #8883
- fix: channal error when using sync externals function by @LingyuCoder in #8884
- fix: add stdout draw target to multi progress by @LingyuCoder in #8889
- fix: source-map-devtool-plugin file context option by @SyMind in #8888
- fix: transform nested webpack require with innerGraph enabled by @JSerFeng in #8908
- fix: get resolved module by @SyMind in #8906
- fix: include versions in error message for version mismatch by @haocheng6 in #8899
- fix: allow custom
lazyCompilation.backend.client
by @colinaaa in #8934 - fix: lazy compilation use persistent cache restart failure by @jerrykingxyz in #8952
Document Updates π
- docs: update persistent cache available version and configuration by @jerrykingxyz in #8886
- docs: correct
avoidEntryIife
added version by @fi3ework in #8892 - docs: persistent cache example set root.cache to true by @jerrykingxyz in #8894
- docs: fix typo in builtin-plugin.md by @stormslowly in #8897
- docs: complete
WarnCaseSensitiveModulesPlugin
by @chenjiahan in #8898 - docs: add warning about hmr fails when filename has hash by @LingyuCoder in #8917
- docs: add loader API overview page by @chenjiahan in #8928
- docs(glossary): use "module specifier" instead of "request" by @chenjiahan in #8933
Other Changes
- ci: remove nightly release by @jerrykingxyz in #8885
- refactor(incremental): introduce mutation update module by @ahabhgk in #8891
- test: add persistent cache test by @jerrykingxyz in #8890
- ci: fix ecosystem-benchmark test pr failed by @jerrykingxyz in #8902
- refactor: better storage error format by @LingyuCoder in #8909
- chore(deps): update pnpm to v9.15.2 by @renovate in #8913
- chore(deps): update rspress to v1.39.3 by @renovate in #8914
- chore(deps): update github-actions by @renovate in #8912
- ci: fix documentation coverage check by @chenjiahan in #8907
- test: clean up unused dev dependencies by @chenjiahan in #8919
- fix(modern-module): skip the asset entry module concaten for Rslib by @SoonIter in #8837
- ci: ecosystem-benchmark checkout failed by @jerrykingxyz in #8923
- chore(deps): Upgrade and pin webpack to 5.95.0 by @andersk in #8918
- ci: use corepack instead of pnpm/action-setup by @jerrykingxyz in #8926
- ci: pnpm cache install pnpm/exe when node16 by @jerrykingxyz in #8929
- ci: add ecosystem ci by @jerrykingxyz in #8931
- ci: enable ecosystem-ci on main branch by @jerrykingxyz in #8932
- chore(deps): update crates by @renovate in #8911
- refactor: move compiler options builder to new crate by @h-a-n-a in #8941
New Contributors
- @haocheng6 made their first contribution in #8899
Full Changelog: v1.2.0-alpha.0...v1.2.0-beta.0
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: [email protected]
We will continue to follow and respond to community feedback.