Skip to content

Releases: web-infra-dev/rspack

v1.5.8

29 Sep 08:42
Compare
Choose a tag to compare

Highlights 💡

Enhanced Tree Shaking for Nested Exports in Destructuring

Rspack now supports more precise tree shaking for nested exports accessed through destructuring assignments.

// lib.js
export * as a from "./a";
export * as b from "./b";

// index.js
import * as lib from "./lib";
// Before: All exports under `lib.a` were retained, only `lib.b` was tree-shaken
// Now: Only the specific property `inner` from `lib.a` is kept; everything else is removed
const { a: { inner } } = lib;

What's Changed

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

  • fix: cjs export require tree shaking by @ahabhgk in #11758
  • fix: should always walk import then arguments by @ahabhgk in #11760
  • fix: should update alias resolution when a higher-priority file is created in watch mode by @SyMind in #11643
  • fix: should analyze correct variable for dynamic import by @ahabhgk in #11768
  • fix: URLPlugin in child compiler by @SyMind in #11785

Refactor 🔨

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v1.5.7...v1.5.8

v1.5.7

24 Sep 07:15
Compare
Choose a tag to compare

Highlights 💡

Improved Tree Shaking for Dynamic Import .then()

This release enhances tree shaking capabilities specifically for the .then() callbacks of dynamic imports. Rspack can now statically analyze and eliminate unused exports when destructuring is performed on the resolved module within promise chains:

// Tree shaking now works for destructuring in .then() callbacks
import('./utils').then(module => {
  const { usedFunction } = module; // Only usedFunction will be included
  usedFunction();
  // unusedFunction will be tree-shaken out
});

JSX Preserve Support

Rspack now supports parsing and preserving JSX syntax. This allows JSX syntax to be parsed without transformation, making it compatible with external JSX transformers.

// rspack.config.js
export default {
  module: {
    parser: {
      javascript: {
        jsx: true // Enable JSX parsing
      }
    },
    rules: [
      {
        test: /\.jsx?$/,
        use: {
          loader: 'swc-loader',
          options: {
            jsc: {
              parser: { jsx: true },
              transform: {
                // Preserve JSX syntax
                react: { runtime: 'preserve' }
              }
            }
          }
        }
      }
    ]
  }
};

What's Changed

New Features 🎉

  • feat: static analyze destructuring assignment dynamic import variable for tree shaking by @ahabhgk in #11731
  • feat: parser support jsx by @fi3ework in #11664

Bug Fixes 🐞

Document Updates 📖

Other Changes

Full Changelog: v1.5.6...v1.5.7

v1.5.6

22 Sep 11:06
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

  • fix: align context module element dependence resource identifer with webpack by @stormslowly in #11674
  • fix: inline value condition connection active for re-export by @ahabhgk in #11701
  • fix: support non-ascii paths in dirname by @hardfist in #11686
  • fix(rslib): only treat "module" as normal variable when module have ESM syntax by @fi3ework in #11634
  • fix: remove serde feature of lightningcss by @colinaaa in #11706
  • fix(browser): inject Buffer by @CPunisher in #11714

Refactor 🔨

Document Updates 📖

Other Changes

New Contributors

Full Changelog: v1.5.5...v1.5.6

v1.5.5

17 Sep 07:34
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Document Updates 📖

Other Changes

Full Changelog: v1.5.4...v1.5.5

v1.5.4

16 Sep 01:21
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚡

New Features 🎉

  • feat: add inline value condition for reexport by @ahabhgk in #11628
  • feat: throw specified error to indicate undefined factory case in HMR by @stormslowly in #11584

Bug Fixes 🐞

Refactor 🔨

  • refactor: remove expect for lazy barrel pending forwarded ids by @ahabhgk in #11646
  • refactor: use temporary data to replace unsupported Module by @jerrykingxyz in #11652

Document Updates 📖

  • docs: remove Preview with stackblitz section by @CPunisher in #11614
  • docs(browser): update BrowserHttpImportEsmPlugin and add "Using Module Federation" by @CPunisher in #11640
  • docs: correct dynamic call to writeModule example by @stormslowly in #11650

Other Changes

New Contributors

Full Changelog: v1.5.3...v1.5.4

v1.5.3

10 Sep 02:49
Compare
Choose a tag to compare

Highlights 💡

Advanced tree-shaking

Rspack v1.5.3 ships advanced tree-shaking for dynamic imports via member expression analysis.

Ongoing improvements are in progress, and upcoming releases will continue to improve static analysis to cover more syntax patterns, such as dynamic import with a subsequent .then().

image

What's Changed

Performance Improvements ⚡

New Features 🎉

  • feat(browser): support ModuleFederationPlugin by @CPunisher in #11558
  • feat: simplify mock logic, dynamic import based hoist by @fi3ework in #11521
  • feat: add css field support in Experiments configuration by @ityuany in #11548
  • feat: add start time parameter to NativeWatcher by @GiveMe-A-Name in #11570
  • feat: tree shake statically analyse-able dynamic import by @ahabhgk in #11457
  • feat: static analyze in operator for esm import specifier by @ahabhgk in #11613
  • feat(browser): add postprocess and ResolvedRequest to BrowserHttpImportEsmPlugin by @CPunisher in #11571

Bug Fixes 🐞

Refactor 🔨

Document Updates 📖

Other Changes

  • chore(deps): update dependency @rsbuild/plugin-sass to ^1.4.0 by @renovate[bot] in #11564
  • chore(deps): update dependency @shikijs/transformers to ^3.12.1 by @renovate[bot] in #11566
  • chore(deps): update dependency @rspack/plugin-react-refresh to ^1.5.0 by @renovate[bot] in #11565
  • chore: use pnpm in package.json scripts by @ahabhgk in #11520
  • chore: use local package for scripts by @ahabhgk in #11572
  • chore(workflow): allow renovate to update SWC related crates by @chenjiahan in #11580
  • chore(deps): update crate swc_core to v38.0.1 by @renovate[bot] in #11586
  • chore: update Rspress to beta.31 to use JSON schemas by @chenjiahan in #11596
  • chore(deps): update dependency memfs to v4.38.2 by @renovate[bot] in #11603
  • chore(deps): update swc (major) by @renovate[bot] in #11606

New Contributors

Full Changelog: v1.5.2...v1.5.3

v1.5.2

01 Sep 14:38
3612aaf
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

  • fix: enhance PathManager to handle relative paths and set base directory by @GiveMe-A-Name in #11516
  • fix: import.meta.prop with define plugin by @ahabhgk in #11525
  • fix: incremental not update exports info when lazyBarrel enabled by @ahabhgk in #11539
  • fix: css infinite reload when module chunk enabled by @stormslowly in #11536
  • fix: should handle import.meta.webpackHot in production by @JSerFeng in #11546
  • fix: should update initial css link with correct url by @JSerFeng in #11544
  • fix: should check http url using link.href for extract-css runtime by @JSerFeng in #11547
  • fix: extend modify event handling to include metadata changes by @GiveMe-A-Name in #11519
  • fix: should not lazy-barrel import-then-export by @JSerFeng in #11550

Refactor 🔨

  • refactor: disable incremental buildChunkGraph by default by @JSerFeng in #11533
  • refactor: use real_hi for evaluation range by @ahabhgk in #11549

Document Updates 📖

  • docs(browser): add docs for response header settings and known issues by @CPunisher in #11523

Other Changes

  • chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] by @renovate[bot] in #11542

Full Changelog: v1.5.1...v1.5.2

v1.5.1

28 Aug 11:49
94faf92
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚡

  • perf(browser): disable ProgressPlugin, RsdoctorPlugin and RstestPlugin by @CPunisher in #11484
  • perf: improve data structures of bundle splitting by @LingyuCoder in #11506

Bug Fixes 🐞

  • fix: build chunk graph when dynamic entry with depend-on chain by @SyMind in #11486
  • fix: wrong match object logic in SwcJsMinimizerRspackPlugin by @CPunisher in #11496
  • fix: asset info related source map can set null by @SyMind in #11497
  • fix: source map sources in node modules should convert to absolute path by @SyMind in #11501
  • fix: add tsEnumIsMutable option to SWC loader schema by @chenjiahan in #11499
  • fix: inline value with properties access by @ahabhgk in #11508
  • fix(types): allow async loader to return void by @chenjiahan in #11511
  • fix: code splitting incremental missing module to update by @ahabhgk in #11510

Refactor 🔨

  • refactor: commonjs export parser plugin by @ahabhgk in #11488
  • refactor: use Module.needBuild to trigger lazy modules compile by @JSerFeng in #11507

Document Updates 📖

Other Changes

Full Changelog: v1.5.0...v1.5.1

v1.5.0

26 Aug 10:58
Compare
Choose a tag to compare
rspack-banner-v1-5

🎉 See Announcing Rspack 1.5 for more details.

What's Changed

Breaking changes 💡

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

Read more

v1.5.0-rc.0

21 Aug 11:11
06b6e61
Compare
Choose a tag to compare
v1.5.0-rc.0 Pre-release
Pre-release

What's Changed

Breaking Changes 🛠

  • feat(cli): use SWC to do TS config transformamation by @hardfist in #11411

Performance Improvements ⚡

New Features 🎉

Bug Fixes 🐞

  • fix: NormalModuleReplacementPlugin doesn't update path, query and fragment by @CPunisher in #11407
  • fix(browser): fix @rspack/browser building by @CPunisher in #11417
  • fix: bailout optimize if there are external modules in other concate scope by @JSerFeng in #11430
  • fix: native watcher fails to work correctly with persistent cache by @GiveMe-A-Name in #11420
  • fix: define plugin can rename by @ahabhgk in #11435
  • fix(ci): should check package name in pre-release check by @JSerFeng in #11438
  • fix: update node inspector import and remove workaround by @chenjiahan in #11444
  • fix: lazy compilation with only loader module by @SyMind in #11443

Refactor 🔨

  • refactor: add module pre walk by @ahabhgk in #11416
  • refactor: only collect destructuring assignment properties for specific expression by @ahabhgk in #11433
  • refactor: clean paren ast for analyzing dependencies by @ahabhgk in #11447

Document Updates 📖

Other Changes

  • chore: bump swc_core from 35.0.0 to 36.0.0 by @CPunisher in #11419
  • chore: update swc types and docs by @ahabhgk in #11423
  • chore: release 1.5.0-beta.1 by @stormslowly in #11415
  • chore(deps): update dependency mermaid to v11.10.0 [security] by @renovate[bot] in #11428
  • chore(deps): update dependency @shikijs/transformers to ^3.11.0 by @renovate[bot] in #11429
  • chore(ci): prevent prerelease published to lastest by @stormslowly in #11424
  • test: remove legacy Node version helpers by @chenjiahan in #11442
  • docs: fix various documentation errors including grammar, terminology and typos by @Copilot in #11445
  • chore: add Claude local config to gitignore by @h-a-n-a in #11452
  • ci: enable parallel execution of npm and crates releases by @h-a-n-a in #11450

New Contributors

  • @Copilot made their first contribution in #11445

Full Changelog: v1.5.0-beta.1...v1.5.0-rc.0