Skip to content

Releases: web-infra-dev/rspack

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

v1.0.0-alpha.1

04 Jul 13:02
58ca484
Compare
Choose a tag to compare

What's Changed

Breaking Changes πŸ› 

  • refactor!: move global trace export to experiments by @ahabhgk in #7019

Performance Improvements ⚑

  • perf: make picking concatenable modules parallel by @JSerFeng in #7003

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

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

v1.0.0-alpha.0

28 Jun 10:41
32c0982
Compare
Choose a tag to compare

What's Changed

See πŸ‘‰ Announcing Rspack v1.0 Alpha for more details

Breaking Changes πŸ› 

  • fix!: change default value of css to false, align with webpack by @JSerFeng in #6910
  • feat!: enable lightning css minimizer as default css minimizer by @ahabhgk in #6960
  • feat: deprecate JavaScript API (part 2) by @h-a-n-a in #6859
  • fix: compilation errors and warnings should be RspackError by @h-a-n-a in #6900
  • feat: upgrade swc to latest version by @hardfist in #6887
  • refactor: remove profile integration timestamp by @LingyuCoder in #6947
  • feat: remove fields of SwcJsMinimizerRspackPluginOptions by @h-a-n-a in #6950
  • fix!: align optimization.moduleIds and optimization.chunkIds when mode=none by @LingyuCoder in #6956
  • feat!: remove output.amdContainer from config by @fi3ework in #6958
  • feat!: revert default values of SwcJsMinimizer by @h-a-n-a in #6970
  • fix!: set default value of concatenateModules to true in production mode by @JSerFeng in #6959
  • refactor!: remove resolve tsConfigPath by @ahabhgk in #6872
  • fix!: align devtool default value by @SyMind in #6904

Performance Improvements ⚑

  • perf(rspack_plugin_javascript): use Rayon to parse modules parallelly by @fi3ework in #6864

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: ci wrong in github runner by @SyMind in #6852
  • fix: export default when environment supports const by @ahabhgk in #6861
  • fix: pre walk class blocks by @ahabhgk in #6867
  • fix: should not eval exports in harmony by @ahabhgk in #6883
  • fix: clean up dependencies and types for emotion / relay by @chenjiahan in #6892
  • fix: fix type of CssExtractRspackPluginOptions.{filename,chunkFilename} by @xc2 in #6882
  • fix: missing bailout reason after introducing css extract plugin by @xc2 in #6875
  • fix: sources in source map when use EvalSourceMapDevToolPlugin by @SyMind in #6901
  • fix: CopyRspackPlugin transform option type by @9aoy in #6908
  • fix: devtool plugin cache conflict !macos by @SyMind in #6912
  • fix: fix release build by @h-a-n-a in #6921
  • fix: use entrypoint.options.runtime as key for chunk_graph.runtime_ids map if possible by @escaton in #6928
  • fix: context passed into the ModuleFactory is not correct by @h-a-n-a in #6946
  • fix!: align webpack defaults by @SyMind in #6949
  • fix: sources types by @SyMind in #6944
  • fix: should not using single line match in data url regex by @JSerFeng in #6952
  • fix: fix duplicated harmony exports with named exports and re-exports star by @h-a-n-a in #6962

Document Updates πŸ“–

Other Changes

Read more

v0.7.5

26 Jun 00:19
116e7da
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Full Changelog: v0.7.4...v0.7.5

v0.7.4

19 Jun 02:26
Compare
Choose a tag to compare

What's Changed

Highlights

LightningCSS minimizer

In v0.7.4 Rspack provides a new CSS minimizer which uses Lightning CSS under the hood, for now you can enable it by optimization.minimizer, and in Rspack v1.0, it will be enabled by default.

And here are two very useful features powered by the new LightningCSS minimizer:

  • removeUnusedLocalIdents: during minification, it removes the CSS declarations corresponding to the unused-symbols. This allows Rspack to work with CSS modules' tree shaking to remove unused CSS declarations corresponding to exports (previously, it would only remove the JS exports).
  • browserslist: with this options minification will also performs downgrading. If the postcss-loader was previously used only for downgrading, it can be removed.

Checkout our docs for more details.

Compatible with worker-loader

In v0.7.4 Rspack is compatible with worker-loader, which is usually used by some older projects, so this is provided only as a temporary solution to facilitate these older projects migration to Rspack, checkout our docs for more details.

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix(mf): avoid error webpack_require.f.consume after hmr by @ahabhgk in #6796
  • fix: css modules composes same ident with local class by @ahabhgk in #6815
  • fix: fix segmentation fault with custom loader by @h-a-n-a in #6824
  • fix: basically same codegen of arco-pro by @ahabhgk in #6826
  • fix: parse url dependency for minimized css by @ahabhgk in #6827
  • fix: should be able to add loader resolver dependencies by @h-a-n-a in #6828
  • fix: generate suggestions if api-extractor failed the test by @h-a-n-a in #6834
  • fix(cli): should close compiler after building by @chenjiahan in #6835
  • fix: docs ci wrong in node 16 by @SyMind in #6840
  • fix: source map wrong when columns is false by @SyMind in #6841
  • fix: sourceMapFilename default value by @SyMind in #6845
  • fix: panic of module_graph.get_depth by @LingyuCoder in #6846

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v0.7.3...v0.7.4