Skip to content

Releases: web-infra-dev/rspack

v2.0.0-rc.3

17 Apr 03:22

Choose a tag to compare

What's Changed

New Features 🎉

Bug Fixes 🐞

Refactor 🔨

  • refactor(browser)!: remove rspack_browser crate and require @rspack/browser to run in a Worker by @CPunisher in #13712

Document Updates 📖

Other Changes

Full Changelog: v2.0.0-rc.2...v2.0.0-rc.3

v2.0.0-rc.2

14 Apr 10:49

Choose a tag to compare

What's Changed

Performance Improvements ⚡

  • perf(code-splitting): reuse side effects evaluation state by @LingyuCoder in #13668
  • perf: trace hook interception only pays off once global tracing is already on by @SyMind in #13689

New Features 🎉

  • feat(create-rspack): modernize starter template configs by @chenjiahan in #13645
  • feat(split-chunks): support enforceSizeThreshold option by @jaehafe in #13576
  • feat(resolve): support #/ subpath alias import by @stormslowly in #13633
  • feat(create-rspack): reuse rspack config in rstest templates by @chenjiahan in #13666
  • feat: enforce macro-generated implemented_hooks in debug builds by @SyMind in #13677
  • feat: only apply require-* parser plugins to js-auto/js-dynamic by @SyMind in #13678
  • feat: skip building side-effect-only imports in make by @ahabhgk in #13688
  • feat: add compiler.hooks.shouldRecord for NoEmitOnErrorsPlugin by @stormslowly in #13630
  • feat(cli): use jiti to load typescript config by @hardfist in #13690

Bug Fixes 🐞

  • fix(browser): import napi symbols from binding by @CPunisher in #13641
  • fix(core): fix cjs export function tree shaking by @ahabhgk in #13643
  • fix(config): tighten rule loader/use typings by @kyungilcho in #13514
  • fix: add @emnapi/core and @emnapi/runtime as dependencies by @CPunisher in #13665
  • fix(loader): preserve additionalData in builtin loaders by @ahabhgk in #13661
  • fix(cli): disable hmr in preview by @chenjiahan in #13669
  • fix(hash): keep fullhash in sync with css-only content changes by @GiveMe-A-Name in #13491
  • fix(watcher): flush pending events on unpause to prevent stuck files_data by @stormslowly in #13603
  • fix(watcher): filter stale FSEvents with mtime baseline comparison by @stormslowly in #13610
  • fix(rstest): respect importFunctionName when importDynamic is disabled by @9aoy in #13673
  • fix: fix flaky wasm tests by @hardfist in #13655
  • fix: support module external type in array externals by @JSerFeng in #13663
  • fix(mf): resolve version from parent package for secondary entry points by @davidfestal in #13636
  • fix(wasm): fix browser e2e timeout by running @rspack/browser builds in a worker by @hardfist in #13687
  • fix: Revert rstest importFunctionName feature when importDynamic is disabled by @9aoy in #13699

Refactor 🔨

  • refactor(concatenated-module): reduce clone overhead by @LingyuCoder in #13642
  • refactor: replace expect("TODO") with descriptive error messages by @jaehafe in #13685

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2

v2.0.0-rc.1

08 Apr 06:25

Choose a tag to compare

Highlights 💡

🌳 Better tree shaking with side-effect-free function analysis

Rspack can now detect side-effect-free function calls through the #__NO_SIDE_EFFECTS__ notation and manual pureFunctions hints. With support for exported functions and cross-module analysis, unused calls can be identified more reliably, improving tree shaking results and making it easier to optimize both application code and third-party dependencies.

// lib.js
/*@__NO_SIDE_EFFECTS__*/ 
export function call() {
  console.log('hi')
}

// barrel.js
import { call } from './lib'

const value = call()

// if value is unused, call can be removed
export { value }
image

What's Changed

Breaking Changes 🛠

Performance Improvements ⚡

  • perf(javascript): cache non-nested export target lookups by @LingyuCoder in #13545
  • perf(rspack-sources): perf potential tokens and source map to json by @SyMind in #13497
  • perf: modules should use IdentifierHasher by @SyMind in #13601

New Features 🎉

  • feat: Implement HashedModuleIdsPlugin by @aancuta in #13197
  • feat: add TryFutureConsumer with short-circuit cancellation by @jerrykingxyz in #13554
  • feat(binding): add active-related APIs to ModuleGraphConnection by @JSerFeng in #13548
  • feat: support optimize side effects free function calls by @JSerFeng in #12559
  • feat(node-binding): add external wasm debug info for wasm dwarf debugging by @hardfist in #13638

Bug Fixes 🐞

  • fix(cli): surface fatal errors and unhandled rejections on process exit by @briansilah in #13506
  • fix: multicompiler devServer false support in serve by @LingyuCoder in #13572
  • fix(cli): bundle lazy-loaded helper deps by @chenjiahan in #13587
  • fix: cjs self reference mangle exports by @ahabhgk in #13588
  • fix(esm-library): emit empty export for empty node chunks by @JSerFeng in #13462
  • fix(wasm): avoid blocking-thread work under node:wasi by @hardfist in #13598
  • fix(core): move connection states to ModuleGraphConnection by @JSerFeng in #13624
  • fix(side-effects): respect DefinePlugin purity evaluation by @ahabhgk in #13628
  • fix(externals): correct external type for aliased node builtin externals by @JSerFeng in #13627

Refactor 🔨

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v2.0.0-rc.0...v2.0.0-rc.1

v2.0.0-rc.0

31 Mar 08:04

Choose a tag to compare

Highlights 💡

Support import.meta.main

import.meta.main is a boolean flag used in ES modules to determine whether the current module is the program’s entry module. It evaluates to true when the module is executed as the main entry, and to false when it is imported by another module. You can think of it as the ESM equivalent of require.main === module in CommonJS. It is useful for running startup logic, initialization code, or CLI behavior only when a module is launched directly.

What's Changed

Performance Improvements ⚡

New Features 🎉

  • feat: support import.meta.main by @ahabhgk in #13489
  • feat: support expression in import.meta.resolve argument by @ahabhgk in #13523
  • feat: add ModuleGraph.getUsedExports to ModuleGraph by @SyMind in #13519

Bug Fixes 🐞

  • fix(watcher): rename typo recursiron_directories to recurse_parent_directories by @jaehafe in #13510
  • fix: avoid spreading huge dependency iterables by @SyMind in #13517
  • fix(types): allow partial jsc.parser config when detectSyntax is auto by @chenjiahan in #13531
  • fix(swc-loader): fallback detectSyntax auto for virtual modules by @chenjiahan in #13529
  • fix: reset chunk.rendered in incremental build by @hardfist in #13544

Refactor 🔨

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v2.0.0-beta.9...v2.0.0-rc.0

v1.7.11

31 Mar 10:20

Choose a tag to compare

What's Changed

New Features 🎉

Other Changes

Full Changelog: v1.7.10...v1.7.11

v2.0.0-beta.9

27 Mar 13:39
33795f7

Choose a tag to compare

What's Changed

New Features 🎉

Bug Fixes 🐞

Refactor 🔨

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v2.0.0-beta.8...v2.0.0-beta.9

v2.0.0-beta.8

24 Mar 11:15

Choose a tag to compare

What's Changed

Performance Improvements ⚡

New Features 🎉

  • feat: tree shaking for inlined members access dynamic import by @ahabhgk in #13381
  • feat: add EsmNodeTargetPlugin for ESM-aware node builtin externals by @JSerFeng in #13370
  • feat(pnp)!: drop multi yarn pnp project resolving by @stormslowly in #13389
  • feat(rsdoctor): add support for dependency connections by @yifancong in #13384
  • feat: enable mangle exports for cjs reexport by @ahabhgk in #13413
  • feat(rstest): support unmockRequire methods by @9aoy in #13412

Bug Fixes 🐞

  • fix(esm-lib): avoid exporting webpack_require and useless runtime when runtimeChunk is false by @JSerFeng in #13374
  • fix: optimize concatenated module code generation hot paths by @LingyuCoder in #13375
  • fix: avoid analyze cjs tree shaking for user defined require by @ahabhgk in #13401
  • fix(esm-lib): replace panics in get_module_chunk with Result-based error handling by @JSerFeng in #13396
  • fix(rsc): should compile css without use server-entry by @SyMind in #13402
  • fix: deduplicate source name stable by @SyMind in #13416
  • fix(esm-library): deduplicate external module import identifiers in ESM output by @JSerFeng in #13418
  • fix(esm-lib): use package name for node_modules short name in dynamic imports by @JSerFeng in #13406
  • fix: add coverage for esm library linking, and fix linking errors by @JSerFeng in #13424
  • fix: should enforce orphan:false for concatenated module by @JSerFeng in #10317
  • fix: lightningcss with previous loader source maps by @SyMind in #13436
  • fix: duplicate-sources-order by @SyMind in #13438
  • fix(core): implement new Map methods on Compilation.entries by @chenjiahan in #13444
  • fix(core): preserve external namespace access in esm externals by @JSerFeng in #13442

Refactor 🔨

Document Updates 📖

Other Changes

Full Changelog: v2.0.0-beta.7...v2.0.0-beta.8

v1.7.10

24 Mar 05:04

Choose a tag to compare

What's Changed

New Features 🎉

  • feat(backport): support regex flags and JavaScript lookaheads in extractComments condition by @CPunisher in #13437

Other Changes

Full Changelog: v1.7.9...v1.7.10

v2.0.0-beta.7

17 Mar 12:06

Choose a tag to compare

What's Changed

Breaking Changes 🛠

  • feat!: default resolve roots to empty array by @stormslowly in #13273
  • feat!: remove .wasm from default js extensions by @hardfist in #13321
  • feat!: remove 'webpack' from default CSS import conditions by @chenjiahan in #13348
  • fix!: remove unconsumed useless optimization.removeAvailableModules config option by @JSerFeng in #13317
  • feat(swc-loader)!: move rspackExperiments.import to top-level transformImport by @JSerFeng in #13345

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

  • fix: restore panic backtrace for macOS arm64 bindings by @hardfist in #13283
  • fix(collections): use FxHasher for Ukey by @hardfist in #13293
  • fix(esm-lib): tree-shake unused exports, fix property_access name collision and get_binding panic by @JSerFeng in #13288
  • fix: cjs tree shaking used with named export by @ahabhgk in #13303
  • fix: huge file dependencies cause range error by @SyMind in #13305
  • fix: dynamic import tree shaking used with named export by @ahabhgk in #13307
  • fix: correct dev server types by @chenjiahan in #13313
  • fix(rstest): prevent the re-exports optimization for mocked modules by @9aoy in #13262
  • fix(esm-lib): render init fragments after import source by @JSerFeng in #13308
  • fix: normal runtime use should not contains require function by @JSerFeng in #13190
  • fix: strict this context for dynamic import and cjs require by @ahabhgk in #13328
  • fix(javascript): preserve live code after labeled breaks by @LingyuCoder in #13325
  • fix: WorkerPlugin should be inherented in children compiler by @stormslowly in #13310
  • fix(parser): avoid treating require.resolve chains as require by @Timeless0911 in #13341

Refactor 🔨

Document Updates 📖

Other Changes

Full Changelog: v2.0.0-beta.6...v2.0.0-beta.7

v1.7.9

17 Mar 09:18

Choose a tag to compare

What's Changed

New Features 🎉

Bug Fixes 🐞

Other Changes

Full Changelog: v1.7.8...v1.7.9