Skip to content

Releases: web-infra-dev/rspack

v1.0.0-beta.5

15 Aug 14:18
5b9ef93
Compare
Choose a tag to compare

Highlights

Improved HtmlRspackPlugin

rspack.HtmlRspackPlugin has a lot of improvements to be more in line with the html-webpack-plugin.

  • [Feat] Support hash to append compilation hash
  • [Feat] Support base to inject base tag
  • [Feat] Support scriptLoading=systemjs-module
  • [Feat] Support [templatehash] in filename template, same as [contenthash]
  • [Breaking] Rename excludedChunks to excludeChunks, aligned with html-webpack-plugin
  • [Breaking] Minify html by default when mode=production
  • [Fix] No doctype parsing error
  • [Fix] Win32 relateive path
  • [Fix] Relative favicon path
  • [Fix] Wrong & escaping in script.src and link.href
  • [Test] Passed html-webpack-plugin basic cases from 45 to 85

PR: #7577

Removed SwcCssMinimizerRspackPlugin

The rspack.SwcCssMinimizerRspackPlugin has been removed to reduce binary size, please use LightningCssMinimizerRspackPlugin instead:

module.exports = {
  optimization: {
    minimizer: [
-     new rspack.SwcCssMinimizerRspackPlugin({
+     new rspack.LightningCssMinimizerRspackPlugin({
        // options
      }),
    ],
  },
};

Rspack also supports using css-minimizer-webpack-plugin.

What's Changed

Breaking Changes πŸ› 

  • feat!: improve HtmlRspackPlugin by @LingyuCoder in #7577
  • refactor!: disable css minify in html minify and remove SwcCssMinimizerRspackPlugin by @ahabhgk in #7547

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat: second param for loader hook by @SyMind in #7537
  • feat(create-rspack): configure Lightning CSS targets by default by @chenjiahan in #7579
  • feat(core): don't inject bundlerInfo in library mode by @hardfist in #7567
  • feat: extract-css-plugin supports layer by @JSerFeng in #7583

Bug Fixes 🐞

  • fix: use intersection runtime for concat module code gen by @ahabhgk in #7523
  • fix: chunk hash unstable by @JSerFeng in #7534
  • fix: should insert semi after import, export, debugger and class field by @CPunisher in #7529
  • fix: check SuperProp in walk_call_expression by @CPunisher in #7530
  • fix: remove useless "module" external runtime by @fi3ework in #7533
  • fix(rust-core): no need to pass resolve_factory when using rust api by @hardfist in #7539
  • fix(cli): wrong entry defaults from cli by @xc2 in #7541
  • fix: source map plugin module should enable by default by @ahabhgk in #7545
  • fix: avoid inner graph top level symbol for nested webpack_require by @ahabhgk in #7584

Document Updates πŸ“–

Other Changes

  • refactor(typescript): packages/rspack/src/node/NodeWatchFileSystem by @wxiaoyun in #7528
  • chore(infra): improve the configuration of justfile by @shulaoda in #7526
  • chore: polish some words on introduction by @hardfist in #7557
  • chore(deps): update cargo-bins/cargo-binstall action to v1.10.2 by @renovate in #7564
  • test(plugin): test html plugin with basic cases of html-webpack-plugin by @LingyuCoder in #7571
  • chore(deps): bump plugin-react-refresh and lite-tapable to v1.0.0 by @chenjiahan in #7580
  • refactor: improve esm harmony dependencies structure by @shulaoda in #7576
  • refactor: module hash by @ahabhgk in #7569

Full Changelog: v1.0.0-beta.4...v1.0.0-beta.5

v1.0.0-beta.4

10 Aug 02:11
9102876
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: patch asset info in update asset by @ahabhgk in #7464
  • fix!: reuseExistingChunk should be false by default by @JSerFeng in #7489
  • fix(modern-module): export syntax detect more invalid chars by @fi3ework in #7493
  • fix: concatenation should merge module’s chunk init fragments by @fi3ework in #7504
  • fix(modern-module): correct use bailout reason by @fi3ework in #7513
  • fix: maxInitialRequests should exists in cache groups by @JSerFeng in #7512
  • fix(hmr): replacement of optionalChain is compatible with legacy versions by @wChenonly in #7510

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.0.0-beta.3...v1.0.0-beta.4

v1.0.0-beta.3

06 Aug 12:26
Compare
Choose a tag to compare

What's Changed

Breaking Changes πŸ› 

SwcJsMinimizerRspackPlugin

Move all SWC options to minimizerOptions:

  • The compress option has been moved to minimizerOptions.compress.
  • The mangle option has been moved to minimizerOptions.mangle.
  • The format option has been moved to minimizerOptions.format.
  • The module option has been moved to minimizerOptions.module.
module.exports = {
  optimization: {
    minimizer: [
      new rspack.SwcJsMinimizerRspackPlugin({
-       format: {
-         ecma: 6,
-       },
+       minimizerOptions: {
+         format: {
+           ecma: 6,
+         },
+       },
      }),
    ],
  },
};

LightningCssMinimizerRspackPlugin

  • The browserslist option has been renamed to minimizerOptions.targets.
module.exports = {
  optimization: {
    minimizer: [
      new rspack.LightningCssMinimizerRspackPlugin({
-       browserslist: 'Chrome >= 53',
+       minimizerOptions: {
+         targets: 'Chrome >= 53',
+       },
      }),
    ],
  },
};

PR: #7444

Performance Improvements ⚑

  • perf: rule matcher allocates only if resource_path is not a valid UTF-8 sequence by @h-a-n-a in #7441
  • perf: bump lightningcss to remove duplicated browerslist-rs by @chenjiahan in #7461

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

  • test: enable inner graph and concat modules for runtime condition diff test by @ahabhgk in #7416
  • ci: fix git clean wrong by filename too long by @SyMind in #7425
  • chore(deps): update dependency sass-loader to v16 by @renovate in #7370
  • refactor(type): increase type-coverage by @SoonIter in #7437
  • chore(infra/biome): enable noParameterAssign by @shulaoda in #7430
  • refactor(typescript): increase typescript type coverage to 100% for rspack-plugin-react-refresh by @shulaoda in #7448
  • chore: remove log in mf test by @ahabhgk in #7451
  • chore: documentation chores, typo, format, links, etc by @AkatQuas in #7457
  • refactor!: redesign minimizer plugin options by @ahabhgk in #7444

Full Changelog: v1.0.0-beta.2...v1.0.0-beta.3

v1.0.0-beta.2

02 Aug 09:27
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat: better diagnostic report for harmony residual dependencies by @shulaoda in #7374
  • feat: add memory cache of javascript plugins by @LingyuCoder in #7389
  • feat: add partial lazyOptions.backend options by @tatchi in #7273
  • feat: support compilation.chunkGroup[].isInitial() by @LingyuCoder in #7406
  • feat(diagnostic): improve diagnostics for swc wasm plugins by @h-a-n-a in #7391

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.0.0-beta.1...v1.0.0-beta.2

v1.0.0-beta.1

30 Jul 13:20
4cb4479
Compare
Choose a tag to compare

Highlights πŸ’‘

Import Attributes

Rspack now supports Import Attributes by defaults:

import json from "./foo.json" with { type: "json" };

import("foo.json", { with: { type: "json" } });

PR: #7333

Layers

Rspack now supports module and chunk layers. This feature can be used by frameworks like Rsnext (The Rspack-based Next.js) to implement React Server Components.

  • Example: build modern and legacy bundles at the same time:
export default {
  entry: {
    index: {
      import: './src/index.js',
      layer: 'modern',
    },
    'index-legacy': {
      import: './src/index.js',
      layer: 'legacy',
    },
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        issuerLayer: 'modern',
        use: [
          {
            loader: 'builtin:swc-loader',
            options: {
              env: {
                targets: 'Chrome >= 87',
              },
            },
          },
        ],
      },
      {
        test: /\.js$/,
        issuerLayer: 'legacy',
        use: [
          {
            loader: 'builtin:swc-loader',
            options: {
              env: {
                targets: 'ie >= 11',
              },
            },
          },
        ],
      },
    ],
  },
  experiments: {
    layers: true,
  },
};
  • Example: Customize rules and resolve options for RSC modules
export default {
  module: {
    rules: [
      // set `layer` for some modules
      {
        test: /rsc-modules/,
        layer: 'rsc',
      },
      // set resolve options for specified layer
      {
        issuerLayer: 'rsc',
        resolve: {
          conditionNames: ['react-server', '...'],
        },
      },
      {
        // set loaders for specified layer
        oneOf: [
          {
            issuerLayer: 'rsc',
            test: /\.tsx?$/,
            use: ['some-rsc-loader'],
          },
          {
            test: /\.tsx?$/,
            use: ['some-normal-loader'],
          },
        ],
      },
    ],
  },
  experiments: {
    layers: true,
  },
};

PR: #7330

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat: experiments layers by @ahabhgk in #7330
  • feat(css-extract): avoid reloading all CSS when hot load by @shulaoda in #7314
  • feat(modern-module): force concaten single module by @fi3ework in #7317
  • feat: better diagnostic report for harmony dependency by @shulaoda in #7337
  • feat: support parser.importMeta and output.importMetaName by @xc2 in #7231

Bug Fixes 🐞

  • fix: lightningcss-loader targets array not work as expected by @chenjiahan in #7331
  • fix(rspack_plugin_asset): repect user environment config when inlining svg by @SoonIter in #7347
  • fix: rspack errors don't support the correct location by @shulaoda in #7328
  • fix: add runtime condition for harmony reexport checked by @ahabhgk in #7353
  • fix: remove nonsensical intersection types by @colinaaa in #7360
  • fix: builtin:lightningcss-loader shuold keep loader query by @JSerFeng in #7363

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.0.0-beta.0...v1.0.0-beta.1

v1.0.0-beta.0

26 Jul 05:10
Compare
Choose a tag to compare

Performance Improvements ⚑

In version 1.0.0-beta.0 we have made a number of performance optimizations, which together add up to significant performance gains. According to benchmark data, Rspack's dev startup is 4.7% faster, and its prod build is 11% faster.

Detailed changes:

  • perf: reduce allocation for Stats by @h-a-n-a in #7124
  • perf: reduce allocation for parsing by @h-a-n-a in #7219
  • perf: use Set as Queue to solve the duplication by @JSerFeng in #7233
  • perf: reduce allocation for ModuleRule matching by @h-a-n-a in #7249
  • perf: reduce large pre-allocations for JavascriptParser::new by @h-a-n-a in #7286
  • perf: faster hasher for Ukeys by @ahabhgk in #7287
  • perf: a bunch of small improvement for ConcatenatedModule by @CPunisher in #7257
  • perf: reduce allocation for adding dependencies by @h-a-n-a in #7301

Breaking Changes πŸ› 

Upgraded to latest SWC

@rspack/core now depends on swc_core v0.99 (previously v0.96).

If your project is using the SWC Wasm plugin, this will be a breaking change, and you will need to upgrade the SWC Wasm plugin to the latest version.

PR: #7292

Upgraded to webpack-dev-server v5

@rspack/cli now depends on webpack-dev-server v5 (previously v4).

If you are using @rspack/cli, please be aware of the following breaking changes:

PR: #7130

Deprecated @rspack/plugin-minify

rspack/plugin-minify has been deprecated as it was a temporary package to support Terser.

Now Rspack has full support for terser-webpack-plugin. If you need to use Terser as the minimizer, we recommend using terser-webpack-plugin instead of @rspack/plugin-minify:

// rspack.config.js
- const MinifyPlugin = require('@rspack/plugin-minify');
+ const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
-    new MinifyPlugin({ minifier: 'terser' }),
+    new TerserPlugin(),
    ],
  },
};

PR: #7307

All Changes

Exciting New Features πŸŽ‰

  • feat: support built-in lightningcss-loader by @JSerFeng in #7214
  • feat: support tree shaking with awaiting dynamic import by @LingyuCoder in #7230
  • feat: support output.charset and output.chunkLoadTimeout by @xc2 in #7189
  • feat: support __webpack_get_script_filename__ by @LingyuCoder in #7203
  • feat: support webpack_exports_info by @LingyuCoder in #7205
  • feat: external callbacks receive contextInfo.issuer by @fi3ework in #7210
  • feat: support destructuring of import.meta by @LingyuCoder in #7229
  • feat: align publicPath options with webpack by @xc2 in #7216
  • feat: support compilation.chunkGroups and compilation.namedChunkGroups by @LingyuCoder in #7254
  • feat(create-rspack): add vanilla templates by @chenjiahan in #7295
  • feat: support EntryPlugin filename function by @9aoy in #7297
  • feat: support test, include and exclude options for LightningCssMinimizerRspackPlugin by @simonxabris in #7290

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

  • refactor: allows minimal/detailed/summary stats presets in configuration by @xc2 in #7186
  • chore(deps): add check-dependency-version for devDependencies by @SoonIter in #6323
  • refactor: allow passing function type to assets generator.filename by @xc2 in #7206
  • chore(deps): unify dependencies with check-depedency-version by @SoonIter in #7208
  • test: full enable some webpack stats test cases by @LingyuCoder in #7213
  • test: enable webpack test cases of webpackHot.data by @LingyuCoder in #7217
  • ci(website/infra): lint-staged issue in website by @SoonIter in #7224
  • test: enable preact refresh snapshot test by @LingyuCoder in #7232
  • test: enable more available tests by @JSerFeng in #7234
  • test: enable inner graph basic webpack test case by @LingyuCoder in #7237
  • chore(deps): typescript phantom dependence by @SoonIter in #7235
  • ci: speedup free disk space job by @xc2 in #7241
  • refactor: change ansiHTML to ts and esm by @wxiaoyun in #7244
  • refactor(typescript): refactor packages/rspack/src/util from js to ts and esm by @jithyan in #7246
  • refactor: remove duplicated extract member expression info by @LingyuCoder in #7248
  • chore(deps): update zod to ^3.23.8 by @colinaaa in #7253
  • test: add test case for runtime condition by @LingyuCoder in #7250
  • refactor(typescript): packages/rspack/src/config from js to ts/esm by @jithyan in #7255
  • refactor(typescript): loader runner to ts by @wxiaoyun in #7247
  • chore(infra/biome): rule useEnumInitializers by @shulaoda in #7260
  • chore(infra/biome): rule useLiteralKeys by @shulaoda in #7261
  • chore(infra/biome): rule noSvgWithoutTitle by @shulaoda in #7262
  • chore(infra/biome): rule noDoubleEquals by @shulaoda in #7265
  • chore(infra/biome): rule noForEach by @shulaoda in #7266
  • chore(infra/biome): rule useSelfClosingElements by @shulaoda in #7267
  • chore(infra/biome): rule useButtonType by @shulaoda in #7268
  • refactor(typescript): packages/rspack/src/template from js to ts and esm by @shulaoda in #7258
  • ci(fix): jest error in rspack-dev-server by @SoonIter in #7282
  • ci: fix jest error of rspack-dev-server by @SoonIter in #7284
  • chore(infra/biome): ...
Read more

v1.0.0-alpha.5

17 Jul 10:47
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

  • perf: reduce allocation for filename render by @h-a-n-a in #7138
  • perf: optimize JS communication with lazy getters by @SyMind in #7163
  • perf: reduce allocation for TraceableError by @h-a-n-a in #7192

Exciting New Features πŸŽ‰

  • feat: align part of compile time binary evaluation with webpack by @LingyuCoder in #7187
  • feat: align StatsAsset with webpack by @LingyuCoder in #7190
  • feat: add support for function types to output.assetModuleFilename by @xc2 in #7191
  • feat: support webpackExports in magic comments by @LingyuCoder in #7198

Bug Fixes 🐞

  • fix: eval condition expr range by @ahabhgk in #7184
  • fix: pattern with wildcard and globstar can't match correctly when using glob_match by @shulaoda in #6668
  • fix: update resource in nmf resolve hook by @ahabhgk in #7200
  • fix: panic in hmr cause by auxiliary_assets by @SyMind in #7197

Document Updates πŸ“–

Other Changes

Full Changelog: v1.0.0-alpha.4...v1.0.0-alpha.5

v1.0.0-alpha.4

16 Jul 09:20
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: remove all unused local variables by @chenjiahan in #7134
  • fix: unset cjs exports type on access exports directly by @ahabhgk in #7143
  • fix: avoid type error when skipLibCheck is not enabled by @CPunisher in #7155
  • fix: align resolverFactory resolveOptions parameter with resolve options by @9aoy in #7154
  • fix: invalid "javascript/auto" rule.type in getRawGeneratorOptions by @9aoy in #7164
  • fix: should merge parser.javascript by @ahabhgk in #7152
  • fix(cli): update peerDep of rspack-cli by @hardfist in #7173
  • fix(release): alpha peerDependencies in @rspack/cli by @SoonIter in #7175
  • fix: resource within scheme context by @ahabhgk in #7166

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.0.0-alpha.3...v1.0.0-alpha.4

v1.0.0-alpha.3

11 Jul 10:52
Compare
Choose a tag to compare

Highlights πŸ’‘

Rust Fat LTO

Rspack v1.0.0-alpha.3 enabled Rust 'fat' LTO to improve performance (#7088):

  • Build performance (according to benchmark): 1% ~ 3% faster
  • Smaller binary size (rspack.darwin-arm64.node): 55.4 MB -> 51.7 MB

Breaking Changes πŸ› 

Other Changes

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.0.0-alpha.2...v1.0.0-alpha.3

v1.0.0-alpha.2

08 Jul 08:36
Compare
Choose a tag to compare

What's Changed

Breaking Changes πŸ› 

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: v1.0.0-alpha.1...v1.0.0-alpha.2