Skip to content

Releases: web-infra-dev/rspack

v1.2.2

23 Jan 13:38
Compare
Choose a tag to compare

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 with ends_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

  • test(benchmark): add basic sourcemap bench case by @h-a-n-a in #9100

Full Changelog: v1.2.1...v1.2.2

v1.2.1

22 Jan 14:03
Compare
Choose a tag to compare

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

Full Changelog: v1.2.0...v1.2.1

v1.2.0

21 Jan 11:34
Compare
Choose a tag to compare

See Announcing Rspack 1.2 for more details.

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

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...
Read more

v1.2.0-beta.0

07 Jan 10:20
Compare
Choose a tag to compare

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 and config.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 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.2.0-alpha.0...v1.2.0-beta.0

v1.2.0-alpha.0

30 Dec 10:49
Compare
Choose a tag to compare

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 of rspack-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 πŸŽ‰

Bug Fixes 🐞

Read more

v1.1.8

19 Dec 08:23
Compare
Choose a tag to compare

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 in dist/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:

  1. Update to the latest safe version immediately: @rspack/core and @rspack/cli to >= 1.1.8
  2. 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.

v1.1.6

10 Dec 06:45
Compare
Choose a tag to compare

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 ⚑

  • perf: replace RawSource with smaller RawStringSource and RawBufferSource by @h-a-n-a in #8629

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.1.5...v1.1.6

v1.1.5

03 Dec 09:04
Compare
Choose a tag to compare

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 ⚑

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 πŸ“–

Other Changes

Full Changelog: v1.1.4...v1.1.5

v1.1.4

26 Nov 08:52
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

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 πŸ“–

Other Changes

New Contributors

Full Changelog: v1.1.3...v1.1.4

v1.1.3

21 Nov 08:35
Compare
Choose a tag to compare

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 🐞

Other Changes

Full Changelog: v1.1.2...v1.1.3