Skip to content

Releases: web-infra-dev/rspack

v0.4.0

22 Nov 09:47
Compare
Choose a tag to compare

Rspack 0.4.0 is out!

Read the announcement blog post: Announcing Rspack 0.4.

Overview

Migrating from v0.3

Check out our migration guide for in-depth migration details.

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

Full Changelog: v0.3.14...v0.4.0

v0.3.14

17 Nov 10:07
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

Other Changes

Full Changelog: v0.3.13...v0.3.14

v0.3.13

15 Nov 13:30
Compare
Choose a tag to compare

Highlight

This version contains a hotfix of #4643

What's Changed

Exciting New Features πŸŽ‰

  • feat: support library for instance unique name by @nyqykk in #4628

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.12...v0.3.13

v0.3.12

14 Nov 10:34
Compare
Choose a tag to compare

Highlight

Caution

Don't use this version, use 0.3.13 instead, this version contains a serious bug related to #4643

support EntryDescription.library

Bundling this entry as a library, and allows you to configure the library format through this option, enabling the generation of different module formats (CommonJS, global variable, ESModule, etc.). This flexibility ensures that your code can be easily used in various environments. Additionally, this feature serves as a prerequisite for Module Federation.

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.11...v0.3.12

v0.3.11

07 Nov 10:39
Compare
Choose a tag to compare

Highlights

Support WarnCaseSensitiveModulesPlugin

support WarnCaseSensitiveModulesPlugin

Fix issue when optional expression has an imported variable

The bug fix in this release ensures that optional chaining works flawlessly. For more details, you could refer to #4502

support asset info source filename

Now compilation.getAsset(chunkFile) can return sourceFilename correctly.

bump swc

Bump swc-core from 0.86.9 to 0.86.33

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.10...v0.3.11

v0.3.10

02 Nov 08:10
Compare
Choose a tag to compare

Highlights

monaco-editor-webpack-plugin support

Support monaco-editor-webpack-plugin, you can see example using monaco-editor-webpack-plugin in example-monaco-editor-webpack-plugin
WebWorkerTemplatePlugin and LimitChunkCountPlugin are supported at the same time. Really appreciate for @SyMind 's great work!

Optimized performance for builtin:swc-loader

builtin:swc-loader can now pass AST back to rspack core. Check out performance between legacy transforming and transforming with builtin:swc-loader

Support Compiler.compile()

We have implemented support for Compiler.compile to ensure smooth operation of ο»ΏchildCompiler

Support dynamicImportMode: "eager"

For runtime that does not support dynamically loading JavaScript chunks, module.parser.javascript.dynamicImportMode: "eager" is exactly what you're looking for.

What's Changed

Exciting New Features πŸŽ‰

  • feat: support reuse AST passed from builtin loaders by @h-a-n-a in #4367
  • feat: support passing query to loader by @h-a-n-a in #4418
  • feat: enable deprecation warnings by default by @h-a-n-a in #4247
  • feat: to support the monaco-editor-webpack-plugin by @SyMind in #4384
  • feat: support weak of import.meta.wabpackContext by @bvanjoi in #4466
  • feat: support Compiler.compile by @bvanjoi in #4499
  • feat: support module.parser.javascript.dynamicImportMode: "eager" by @bvanjoi in #4510
  • feat: replace top-level this in esm by @Austaras in #4497

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.8...v0.3.10

v0.3.8

24 Oct 06:41
Compare
Choose a tag to compare

Highlights

Top-level await

Support top-level await and enabled by default, or you can disable this by experiments.topLevelAwait = false.
Top-level await can only be used in ECMAScript Module (type: "javascript/esm"), with this feature you can use await at top-level, await resources, await import, etc.

const db = await import('./db.js');
const connection = await db.connect();

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.7...v0.3.8

v0.3.7

17 Oct 12:03
24cca4f
Compare
Choose a tag to compare

Highlights

experiments.rspackFuture.newResolver

This feature enables the new resolver implementation provided by oxc, which is 5 times faster than the previous resolver implementation.
The new resolver also supports tsconfig project references defined in tsconfig-paths-webpack-plugin, which handles the support of nested paths alias inside project references.
To fully opt-in this feature, use the following configuration or see resolve.tsConfig for details.

module.exports = {
  resolve: {
    tsconfig: {
      configFile: path.resolve(__dirname, './tsconfig.json'),
      references: 'auto'
    },
  }
  experiments: {
    rspackFuture: {
      newResolver: true
    }
  }
}

styled-components support

This feature enables the builtin:swc-loader to provide compile-time support for styled-components. Now you can configure it through options.rspackExperiments.styledComponents.

/** @type {import('@rspack/core').Configuration}*/
module.exports = {
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        loader: "builtin:swc-loader",
        options: {
          jsc: {
            parser: {
              syntax: "ecmascript",
              jsx: true
            }
          },
          rspackExperiments: {
            styledComponents: {
              displayName: true,
              ssr: true,
              fileName: true,
              meaninglessFileNames: ["index", "styles"],
              namespace: "rspack-test",
              topLevelImportPaths: [
                "@xstyled/styled-components",
                "@xstyled/styled-components/*"
              ],
              transpileTemplateLiterals: true,
              minify: true,
              pure: true,
              cssProps: true
            }
          }
        }
      }
    ]
  }
};

SWC's support for styled-components is essentially aligned with the official Babel plugin, so you can visit babel-plugin-styled-components for more information.

Vue2 css extract support

Finished support for experiments.css for Vue2, you can extract css with our custom vue-loader (@rspack/loader-vue2).
First, add our custom vue-loader to package.json

{
  "devDependencies": {
    "vue": "2.7.14",
    "vue-loader": "npm:@rspack/loader-vue2@15.10.1-alpha.0"
  }
}

Then, enable vue-loader with experimentalInlineMatchResource just like how you did with Vue3:

const { VueLoaderPlugin } = require("vue-loader");
module.exports = {
  plugins: [new VueLoaderPlugin()],
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          {
            loader: "vue-loader",
            options: {
              // to extract css, you should enable this
              experimentalInlineMatchResource: true
            }
          }
        ]
      }
    ]
  },
  experiments: {
    css: true
  }
};

Check out the example for details.

Rspress 1.0

Rspress is a static site generator based on Rspack and mdx-rs. It is 5~10 times faster than Docusaurus/Nextra and supports lots of nice features out of the box, such as i18n, full-text search, component preview and etc.
See detail in https://github.com/orgs/web-infra-dev/discussions/5

What's Changed

Exciting New Features πŸŽ‰

  • feat: implement styled_components visitor by @Asuka109 in #4228
  • feat: handle react-refresh resolving in @rspack/plugin-react-refresh by @h-a-n-a in #4267
  • feat: support Compilation.namedChunks by @h-a-n-a in #4255
  • feat: source order for harmony import dependency by @ahabhgk in #4262
  • feat(rspack_core): configurable tsconfig project references by @Boshen in #4290
  • feat(split chunks): split chunks should consider chunk combinations by @JSerFeng in #4280
  • feat: Adding runtime param when executing codegen by @IWANABETHATGUY in #4263
  • feat: comment test markdown for webpack-test by @ahabhgk in #4316
  • feat(plugin-copy): support info option by @JSerFeng in #3949

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.6...v0.3.7

v0.3.6

02 Oct 08:30
Compare
Choose a tag to compare

What's Changed

Bug Fixes 🐞

  • fix: fix Rule.oneOf and Rule.rules by @h-a-n-a in #4254
  • fix(rspack_loader_swc): Fail the build when jsc.target and env are used together for the SWC loader by @Hamzakh777 in #4257
  • fix: type error when use builtins:swc-loader and disableTransformByDefault by @JSerFeng in #4256
  • fix: css chunk loading missing chunkIds by @JSerFeng in #4266

Other Changes

  • chore: change nightly release notification to discord other than github issue by @hardfist in #4271

Full Changelog: v0.3.5...v0.3.6

v0.3.5

27 Sep 01:21
Compare
Choose a tag to compare

Highlights

rspackFuture.disableTransformByDefault

Default transformation was a default strategy for transform introduced v0.1.x. This introduced ton of problems during our daily development. For example, excluding node_modules for certain libraries are not supported, thus, which results in some mis-transformations.
From now on, you can opt-in experiments.rspackFuture.disableTransformByDefault = true to disable the internal transformations. This greatly aligns Rspack with Webpack architecture. By enabling this option, these few options are not able to use anymore:

Builtin types(Rule.type) are removed in favor of webpack's web-standard bundling:

  • jsx, jsx/auto, jsx/esm, jsx/dynamic
  • ts, tsx

We will come up a new strategy to add back these DX friendly features in the future.
Instead, builtin:swc-loader is added for fine-grained transformation.
Please refer to this guide for the migration and details.

react-refresh migration

In this version, we'd like to introduce a better way to enable react fast refresh with @rspack/plugin-react-refresh, which is more powerful and flexible than builtins.react.refresh = true, now you can use it with builtin:swc-loader, swc-loader, or babel-loader.
Checkout docs for more details

Deprecating builtin:sass-loader

builtin:sass-loader is deprecated in favor of sass-loader. You can still use it in this and the next minor version. It will be officially removed in v0.5.0. See this for our deprecation stages.

Optimize the progress bar style

  • Thinner and shorter lines
  • Removed progress text
  • Green color

Preview:

Screen.Recording.2023-09-15.at.17.44.51.mov

What's Changed

Something

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: shouldn't always apply react refresh plugin by @ahabhgk in #4194
  • fix: fix module source-map by @h-a-n-a in #4200
  • fix: remove react from rspackExperiments of builtin:swc-loader by @h-a-n-a in #4221
  • fix: merge disableReactRefreshByDefault to disableTransformByDefault by @ahabhgk in #4220
  • fix: missing rspack-only plugins on compiler.webpack by @ahabhgk in #4223
  • fix: filter export imported specifier used name . by @IWANABETHATGUY in #4229
  • fix: fix react-refresh self is not defined by @h-a-n-a in #4232
  • fix: react refresh test windows failed by @ahabhgk in #4242
  • fix: avoid double react refresh transform in rspack-dev-server by @ahabhgk in #4243
  • fix: passing option as &str caused memory leak in builtin:swc-loader by @h-a-n-a in #4235
  • fix(chore): fix node path compatible problem & add express example by @hardfist in #4248
  • fix: $RefreshReg$ is not defined error in node_modules by @ahabhgk in #4251

Other Changes

Full Changelog: v0.3.4...v0.3.5