Skip to content

Releases: web-infra-dev/rspack

v2.3.0-beta.1

v2.3.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@intellild intellild released this 22 Oct 09:24

What's Changed

Breaking Changes 🍭

Thefilter.code loader option (introduced in 2.3.0-beta.0) has been renamed tocodeFilter . If you are upgrading from 2.3.0-beta.0, replacefilter: { code: ... } withcodeFilter: ... in your loader config. No action is needed if you never usedfilter.code .

// 2.3.0-beta.0
{ loader: 'my-loader', filter: { code: 'customMacro(' } }

// 2.3.0-beta.1
{ loader: 'my-loader', codeFilter: 'customMacro(' }
  • fix!: rename loader filter.code to codeFilter by @SyMind in #16184

New Features 🎉

Performance 🚀

Bug Fixes 🐞

  • fix: release updated allocative crates to resolve napi feature mismatch by @intellild in #16171
  • fix(HMR): correct hot updated chunk path resolution in Node.js HMR by @hai-x in #16174
  • fix(release): synchronize workspace versions and CLI peer dependencies by @intellild in #16181
  • fix: inherit splitChunks request limits in cache groups by @hai-x in #16191
  • fix(css): calculate CSS module hashes from graph dependencies by @intellild in #16120

Refactor 🔨

Document 📖

Other Changes

Full Changelog: v2.3.0-beta.0...v2.3.0-beta.1

v2.3.0-beta.0

v2.3.0-beta.0 Pre-release
Pre-release

Choose a tag to compare

@intellild intellild released this 21 Oct 02:43

Highlights

JavaScript parsing with SWC Next

Rspack now uses SWC Next for JavaScript parsing. This beta also includes follow-up compatibility fixes for block-scoped functions, parser source types, and legacy parser behavior. See #16089.

Content-based loader filtering

The new loader filter.code option accepts a string or regular expression and checks the loader's current input before running its normal transform. Loaders can skip files that do not contain the syntax or markers they need to process, avoiding unnecessary transformation work. For example, a loader that transforms customMacro() calls can use filter: { code: 'customMacro(' } to skip inputs without that marker. Pitch functions are unaffected. See #16073.

Better SplitChunks output

Named cache groups now remove redundant module copies from source chunks connected to the same shared chunk, reducing duplicate code in affected builds. Rspack also supports splitChunks.minRemainingSize to avoid splits that leave undersized chunks, bringing JavaScript and extracted CSS output closer to webpack. For example, an affected asynchronous CSS import now retains its expected controls.css filename in production. See #16075 and #15594.

Better watcher compatibility

Native and Node watch file systems now expose watchpack-compatible getTimes(), getTimeInfoEntries(), and collectTimeInfoEntries() APIs. With experiments.nativeWatcher, compiler.fileTimestamps, compiler.contextTimestamps, and the watcher's getInfo() now return real timestamp entries, improving compatibility with plugins that rely on watch metadata, such as ts-loader, webpack-virtual-modules, and vue-loader. The Node watcher also merges time-info entries deterministically so directory timestamps are preserved regardless of dependency iteration order. See the WatchFileSystem API documentation, #15754 and #16126.

Memory improvements and diagnostics

Rspack avoids retaining serialized source maps, reducing memory retained by source objects. Source handling also uses a source-wide UTF-16 index and removes its object pool. See #16072 and #16083.

New allocative-based memory diagnostics help identify which Rust data structures retain memory during builds and HMR updates. See the memory diagnostics guide to capture and analyze snapshots.

What's Changed

New Features 🎉

Performance 🚀

Bug Fixes 🐞

  • fix: skip build dependency collection after fatal compilation errors by @ahabhgk in #16074
  • fix(resolver): resolve tsconfig extends through the real path by @orgads in #15718
  • fix(split-chunks): deduplicate remaining copies in named groups by @JSerFeng in #16075
  • fix(css): align CSS Modules behavior with webpack css-loader fixtures by @intellild in #15816
  • fix(tracing): convert JavaScript trace nanoseconds to microseconds by @LingyuCoder in #16103
  • fix: stabilize module rendering order across platforms by @hai-x in #16100
  • fix(binding): avoid shared property leak warnings on process exit by @SoonIter in #16117
  • fix: use the module exports argument for the AMD exports dependency by @LingyuCoder in #16122
  • fix: respect module arguments in AMD code generation by @hai-x in #16148
  • fix(mf): make deterministic IDs independent of project paths by @LingyuCoder in #16152
  • fix(watch): make node watch time info entries deterministic by @LingyuCoder in #16126
  • fix(javascript): reuse parser source type by @CPunisher in #16102
  • fix: link import bindings inside define callbacks by @hai-x in #16159
  • fix(javascript): respect block function scope by @CPunisher in #16162
  • fix(css): localize type-first nested selectors by @intellild in #16011
  • fix(javascript): preserve legacy parser behavior by @CPunisher in #16164
  • fix(lazy-compilation): avoid barrel reloads on activation by @JSerFeng in #16026
  • fix(split-chunks): support minRemainingSize by @JSerFeng in #15594

Refactor 🔨

  • refactor(binding): retain DependencyRef in JavaScript wrappers by @SyMind in #16061
  • refactor(sources): use a source-wide UTF-16 index and remove object pool by @SyMind in #16083
  • refactor(javascript): remove redundant ESTree AST wrappers by @CPunisher in #16098
  • refactor: reuse current module in dependency templates by @hai-x in #16149
  • refactor(javascript): emit mangled destructuring keys as strings by @CPunisher in #16147
  • refactor(cache): reuse persistent cache options for newCache by @ahabhgk in #16160

Document 📖

Other Changes

Read more

v2.2.9

Choose a tag to compare

@intellild intellild released this 13 Oct 08:50

Highlights

Less duplicate code. Smaller bundles. 📦

Rspack's chunking algorithm has been improved to reduce duplicate modules across chunks. (#15885)

rspack-chunking.mp4

Smaller package size

Rspack upgrades browserslist-rs and enables deflate compression for its browser data, reducing native binary by 2.13 MB (3.08%). (#16009)

What's Changed

New Features 🎉

  • feat: propagate available module growth during code splitting by @JSerFeng in #15885

Performance 🚀

  • perf(binding): query compilation modules lazily by @SyMind in #15906
  • perf: avoid transferring unused NormalModuleFactory dependencies by @ahabhgk in #15931
  • perf(sources): compact retained source storage by @SyMind in #15944
  • perf(stats): cache item type strings in StatsFactory by @stormslowly in #15779
  • perf: use a hash set to deduplicate extracted comments by @CoderSerio in #15967
  • perf(watcher): avoid per-node concurrent sets in the root analyzer by @guru-irl in #15965
  • perf: share Module and KnownBuildInfo accessors by @LingyuCoder in #15883
  • perf: optimize placeholder and Node external matching by @intellild in #15808
  • perf(sources): profile allocations and trim source map capacity by @SyMind in #16014
  • perf(sources): release generated value after static source map by @SyMind in #16022
  • perf(core): cache assetEmitted source and content per info object by @guru-irl in #15963
  • perf(binding): share NormalModule accessors by @LingyuCoder in #16039
  • perf: share equal factorize path lists by content by @LingyuCoder in #16036
  • perf(split-chunks): reuse function chunks filter results per chunk set by @guru-irl in #15964
  • perf(binding): materialize module source maps lazily by @LingyuCoder in #15882
  • perf: share compilation log entry accessors by @LingyuCoder in #16052
  • perf(cache): restore cached modules off the make main task by @guru-irl in #16050
  • perf(core): share file counter dependency lists by interned content by @LingyuCoder in #16043

Bug Fixes 🐞

  • fix(types): allow void returns in needAdditionalPass hooks by @chenjiahan in #15908
  • fix(types): accept falsy loaders and child compiler plugins by @chenjiahan in #15912
  • fix(types): allow single loader returns from rule use functions by @chenjiahan in #15920
  • fix: preserve interned path sharing in cache serialize by @ahabhgk in #15910
  • fix(types): correct Compilation.getAsset return type by @chenjiahan in #15932
  • fix(binding): scope importModule publicPath callbacks to compiler by @chenjiahan in #15928
  • fix(binding): release transient TSFN callbacks by @SyMind in #15938
  • fix(types): allow omitting child compiler plugins by @chenjiahan in #15948
  • fix(css): load async stylesheets with a shared runtime by @intellild in #15869
  • fix(deps): upgrade lightningcss to 1.0.0-alpha.72 by @chenjiahan in #15991
  • fix: propagate async status through lazy barrel re-exports by @dmchoi77 in #15905
  • fix(copy): register a missing glob base dir as a missing dependency by @BleedingDev in #15901
  • fix(css): end unterminated url() at EOF as a url token by @IShinji in #15911
  • fix: preserve statement boundaries in modern-module output by @LingyuCoder in #16008
  • fix(ids): rehash identical keys in compact-hashed ids by @n0th1ng-else in #15915
  • fix(deps): upgrade swc_core to 82.0.0 by @LingyuCoder in #16009
  • fix: resolve aliases in import.meta.glob patterns by @aryan1306 in #15898
  • fix: only source map JS and CSS assets from devtool, matching webpack by @Paca-Vaca in #16018
  • fix: support deferred imports introduced by hot updates by @LingyuCoder in #16015
  • fix: concatenate empty CommonJS modules without export access by @JSerFeng in #15913
  • fix(core): ignore source map directives in JavaScript strings by @Tiancheng-Xu in #15969
  • fix(css-extract): preserve relative paths from publicPath callbacks by @chenjiahan in #15923
  • fix(lazy-compilation): keep import attributes and phase when building activated modules by @stormslowly in #16023
  • fix(lazy-compilation): keep activated modules across rebuilds by @stormslowly in #15134
  • fix(lazy-compilation): keep issuer and resolve options when building activated modules by @stormslowly in #16024
  • fix(watcher): report watched files inside directories that appear by @guru-irl in #15966
  • fix(mf): honor singleton options for shared prefixes in manifests by @LingyuCoder in #16012
  • fix(watcher): report recreated files by their final state by @guru-irl in #16040
  • fix: preserve pure exports during module concatenation by @LingyuCoder in #16053
  • fix(resolver): keep RegExp restrictions in ResolverFactory cache key by @stormslowly in #16054

Document 📖

Read more

v2.2.8

Choose a tag to compare

@JSerFeng JSerFeng released this 28 Sep 14:55

What's Changed

New Features 🎉

  • feat: support JavaScript URL entries with factory type probes by @intellild in #15666
  • feat: resolver cache in the new cache system by @ahabhgk in #15839

Performance 🚀

Bug Fixes 🐞

Document 📖

  • docs: clarify externals usage and consolidate function reference by @chenjiahan in #15866

Other Changes

New Contributors

Full Changelog: v2.2.7...v2.2.8

v2.2.7

Choose a tag to compare

@chenjiahan chenjiahan released this 23 Sep 02:17

Highlights

Smaller bundles with improved code splitting

The new optimization.splitChunks.dedupDepth option lets Rspack spend more build time finding shared code and reducing duplication, giving you more control over the balance between bundle size and build time. In one application with many routes, this option reduced total output size by 9.9%.

It defaults to 1 in production and 0 in development. #15497

Build performance improvements

This release reduces repeated work and allocations during chunk graph construction and CSS Modules class name generation. JavaScript loaders also avoid copying their input content on each invocation, further reducing processing overhead.

  • Optimize chunk graph construction: #15278, #15805.
  • Reuse metadata and template values when generating CSS Modules class names: #15783, #15804.
  • Avoid cloning JavaScript loader content: #15817.

What's Changed

New Features 🎉

Performance 🚀

Bug Fixes 🐞

  • fix: keep shadowing exports bindings in nested runtime deconfliction by @LingyuCoder in #15742
  • fix(binding): release loader TSFNs on compiler close by @SyMind in #15735
  • fix: render CommonJS externals directly in modern-module output by @JSerFeng in #15238
  • fix: skip entry modules without JavaScript in the chunk startup by @cezaraugusto in #15767
  • fix(html): keep the doctype when a comment is above it by @LingyuCoder in #15778
  • fix(types): allow RslibPlugin without options by @chenjiahan in #15801
  • fix: ignore fragment-only CSS URL dependencies by @intellild in #15800
  • fix(bench): exclude compiler teardown from runtime requirements by @intellild in #15813
  • fix(types): declare code generation Sources.get and migrate configs by @chenjiahan in #15814
  • fix(types): allow RegExp resolve restrictions and migrate configs by @chenjiahan in #15819
  • fix(cli): initialize profiling once for multiple configs by @chenjiahan in #15829

Document 📖

Other Changes

Full Changelog: v2.2.6...v2.2.7

v2.2.6

Choose a tag to compare

@intellild intellild released this 17 Sep 11:25

What's Changed

New Features 🎉

  • feat(loader): support buildInfo custom fields in parallel loaders by @stormslowly in #15629

Performance 🚀

Bug Fixes 🐞

  • fix: retain mf manifest expose assets shared with providers by @LingyuCoder in #15700
  • fix(core): make module source maps context independent by @SyMind in #15671
  • fix(loader): revert native loader hook invocation by @intellild in #15719

Document 📖

Other Changes

New Contributors

Full Changelog: v2.2.5...v2.2.6

v2.2.5

Choose a tag to compare

@chenjiahan chenjiahan released this 16 Sep 02:19

What's Changed

New Features 🎉

  • feat: expose new cache options and enable cache store in rebuild by @ahabhgk in #15690

Performance 🚀

Bug Fixes 🐞

Refactor 🔨

  • refactor(core): share BuildContext across module graph tasks by @intellild in #15674

Other Changes

Full Changelog: v2.2.4...v2.2.5

v2.2.4

Choose a tag to compare

@LingyuCoder LingyuCoder released this 14 Sep 12:39

Highlights

CSS-only entry bundling

CSS-only entries using native CSS support now emit standalone stylesheets without an unnecessary JavaScript bundle. Standalone runtime chunks are also omitted when no JavaScript entry needs them, making it easier to build CSS assets directly. See #14879.

Ignore magic comments in CSS

Native CSS support now recognizes webpackIgnore and its rspackIgnore alias for @import, url(), and image-set() dependencies. This lets you leave selected references for the browser to load instead of resolving and bundling them. See #15314.

Reliable persistent caching for child compilers

With experiments.newCache, parent and child compilers now coordinate access to shared persistent cache storage while keeping their entries separate. This prevents conflicting writes and cleanup from losing cached data, and allows both parent and child modules to be restored across compiler restarts. See #15616.

What's Changed

New Features 🎉

Performance 🚀

  • perf(sources): upgrade simd-utf16-len to 0.2.0 by @SyMind in #15562
  • perf(binding): share hook registration code across hook types by @intellild in #15619

Bug Fixes 🐞

  • fix(mf): infer shared module exports from fallback by @LingyuCoder in #15582
  • fix: prevent duplicate exports renaming in modern-module output by @LingyuCoder in #15559
  • fix: preserve shared connections during module concatenation by @LingyuCoder in #15578
  • fix(binding): expose original source in succeedModule hooks by @SyMind in #15600
  • fix: normalize HttpUriPlugin allowedUris before matching by @SyMind in #15604
  • fix(javascript): do not terminate the enclosing scope after a do-while loop by @nest-aka-swan in #15618
  • fix(loader): invoke loader hooks through the native hook by @intellild in #15591
  • fix: enforce HttpUriPlugin lockfile integrity in frozen builds by @SyMind in #15609
  • fix: drop trailing comma when rewriting require.resolve calls by @perbergland in #15656
  • fix(loader): preserve string BOM across native boundaries by @intellild in #15632

Refactor 🔨

  • refactor: remove BuildResult.optimization_bailouts by @hardfist in #15545
  • refactor: let modules own dependencies and async blocks by @hardfist in #15550
  • refactor: derive module dependency IDs from references by @hardfist in #15556
  • refactor: clarify dependency accessors by @hardfist in #15575
  • refactor: share built modules with the module cache by @hardfist in #15527
  • refactor: stream new cache writes directly into database batches by @ahabhgk in #15638
  • refactor(loader): replace should-yield hooks with execution kind by @intellild in #15592

Document 📖

Other Changes

New Contributors

Full Changelog: v2.2.3...v2.2.4

v2.2.3

Choose a tag to compare

@SyMind SyMind released this 08 Sep 09:10
62bd14f

Highlights

CSS Import and Asset URL Externals

Rspack now supports asset, asset-url, and css-import external types, allowing CSS to reference stylesheets and assets hosted elsewhere. External @import statements preserve layer, supports, and media conditions, so conditional styles stay conditional in the emitted CSS. #15431, #15522.

More Flexible and Reliable Native Watching

With experiments.nativeWatcher enabled, watchOptions.ignored now accepts a function, making it easier to reuse existing ignore rules when switching to the native watcher. File event processing has also been improved to reduce event loss during large bursts of changes on Linux. #15254.

Lower Resolution Overhead for TypeScript Projects

Relative imports such as ./utils and ../shared no longer trigger unnecessary tsconfig loading or tracking of its project-reference tree. This reduces configuration reads and dependency tracking, especially in large TypeScript projects with many project references. #15492.

What's Changed

New Features 🎉

Performance 🚀

Bug Fixes 🐞

Refactor 🔨

Document 📖

Other Changes

Full Changelog: v2.2.2...v2.2.3

v2.2.2

Choose a tag to compare

@intellild intellild released this 01 Sep 13:19

What's Changed

New Features 🎉

  • feat(cache): add intrastructure logging to the new cache by @ahabhgk in #15338
  • feat(javascript): add JavascriptModulesPlugin.getChunkFilenameTemplate by @kakiuwang-ui in #15280

Performance 🚀

Bug Fixes 🐞

Refactor 🔨

  • refactor(loader): reuse filesystem snapshots for cache dependencies by @intellild in #15366
  • refactor(core): remove BuildInfo clone by @hardfist in #15377

Document 📖

Other Changes

New Contributors

Full Changelog: v2.2.1...v2.2.2