Skip to content

Releases: web-infra-dev/rspack

v0.3.4

13 Sep 09:29
Compare
Choose a tag to compare

Highlight

Internal plugins

To further improve Rspack's compatibility with webpack ecosystem, we implemented internal plugins in Rspack.
For example, you can use rspack.XxxPlugin in your configuration.

const rspack = require('@rspack/core');

module.exports = {
  plugins: [
    new rspack.DefinePlugin({ 'process.env.NODE_ENV': "'production'", }),
    // In addition to webpack's existing plugins, some of the plugins implemented
    // in rust in Rspack are also exported by internal plugins
    new rspack.HtmlRspackPlugin({ template: './index.html' }),
  ],
};

Or use compiler.webpack.XxxPlugin in your plugin.

class ReactRefreshRspackPlugin {
  apply(compiler) {
    const reactRefreshPath = require.resolve("../client/reactRefresh.js");
    const reactRefreshEntryPath = require.resolve("../client/reactRefreshEntry.js");
    new compiler.webpack.EntryPlugin(compiler.context, reactRefreshEntryPath, {
      name: undefined
    }).apply(compiler);
    new compiler.webpack.ProvidePlugin({
      $ReactRefreshRuntime$: reactRefreshPath
    }).apply(compiler);
  }
};

See

@rspack/plugin-react-refresh

Thanks to the implementation of internal plugins, we can now easily implement the @rspack/plugin-react-refresh, which was coupled into @rspack/dev-server before.
Now, if you are using a custom dev server instead of @rspack/dev-server or @rspack/cli, you can easily enable react fast refresh by adding the @rspack/plugin-react-refresh plugin.
See

Compatible with html-webpack-plugin

Rspack is now html-webpack-plugin compatible!

const path = require("node:path")
const HtmlWebpackPlugin = require("html-webpack-plugin")

module.exports = {
  plugins: [
    new HtmlWebpackPlugin({
      template: "pug-loader!" + path.join(__dirname, "template.pug")
    })
  ]
}

See

builtin:swc-loader supports builtin transformations

These fields served as the alternative to the current builtin transform options, aiming to support transforming with respect to the certain module.

type RspackExperiments = {
  react?: ReactOptions;
  import?: PluginImportOptions;
  emotion?: EmotionOptions;
  relay?: RelayOptions;
};

For example, integrating emotion transformation in the project:

module.exports = {
  module: {
    rules: [
      {
         test: /\.jsx$/,
         exclude: /node_modules/,
         loader: "builtin:swc-loader",
         options: {
            jsc: {
              parser: {
                syntax: "ecmascript",
                jsx: true,
              }
            },
            rspackExperiments: {
              emotion: true
            }
         }
      }
    ]
  }
}

See

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat: flagDependencyUsagePlugin by @IWANABETHATGUY in #4114
  • feat(core): add cache hits info to stats by @LingyuCoder in #4140
  • feat: HarmonyExportImportedSpecifierDependency get mode by @underfin in #4141
  • feat: support builtin:swc-loader experimental transformers by @h-a-n-a in #4133
  • feat: support stats ids by @ahabhgk in #4148
  • feat: support function for BannerPlugin by @ahabhgk in #4151
  • feat: react refresh plugin by @ahabhgk in #4135
  • feat: expose keepFnNames and keepClassNames options of builtin swc minfier by @xinxinhe1810 in #4121
  • feat(config): warn while using experiments.newSplitChunks by @hyf0 in #4169
  • feat(config): only warn while experiments.newSplitChunks being explicitly setted by @hyf0 in #4174
  • feat: compatible with html-webpack-plugin by @ahabhgk in #4175
  • feat: combine three tree shaking related plugin, and add corresponding configuration. by @IWANABETHATGUY in #4147
  • feat: add externalsPresets webAsync target support by @lippzhang in #4184
  • feat: add boolean type for builtins.html[0].inject by @lippzhang in #3771

Bug Fixes 🐞

Other Changes

Full Changelog: v0.3.2...v0.3.4

v0.3.2

13 Sep 04:15
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.1...v0.3.2

v0.3.1

29 Aug 11:53
Compare
Choose a tag to compare

Highlight

Support option resolveLoader

With this option, you can specify the resolving strategy for each loader.

For example, if you are developing a loader and want to showcase its usage from a user's perspective in an example, you can write:

module.exports = {
  resolveLoader: {
    alias: {
      'amazing-loader': require.resolve('path-to-your-amazing-loader'),
    },
  },
};

Then, in the example code, you can write:

require('!!amazing-loader!./amazing-file.js');

See more

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

Full Changelog: v0.3.0...v0.3.1

v0.3.0

24 Aug 06:20
Compare
Choose a tag to compare

Rspack 0.3.0 is out!

Read the announcement blog post: Announcing Rspack 0.3.

Overview

What's Changed

Performance Improvements ⚑

  • perf: reduce memory size of const dependency and dependency type by @underfin in #3972

Exciting New Features πŸŽ‰

  • feat: add profile switch in cli by @ahabhgk in #3937
  • feat(chunkIds): support optimization.chunkIds: 'deterministic' by @nebarf in #3053
  • feat: add logging when RSPACK_PROFILE enabled by @ahabhgk in #3965
  • feat(core): expose RuntimeGlobals by @lippzhang in #3973
  • feat: support dispatching builtin loaders on Node by @h-a-n-a in #3980
  • feat: add timestamp on profile dist by @ahabhgk in #3985
  • feat: support builtin loader with inline loader syntax by @h-a-n-a in #3988
  • feat: support resolving builtin loaders in Rust tests by @h-a-n-a in #3998

Bug Fixes 🐞

  • fix: getHash occasionally panic when rebuild by @ahabhgk in #3970

Other Changes

New Contributors

Full Changelog: v0.2.12...v0.3.0

v0.2.12

15 Aug 06:45
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

  • perf: reduce compilation.getAssets overhead by @h-a-n-a in #3934

Exciting New Features πŸŽ‰

  • feat: support minifyOptions.asciiOnly by @9aoy in #3915
  • feat: add more logger.time in plugins by @ahabhgk in #3916
  • feat: support configuration.profile by @ahabhgk in #3924
  • feat(chunkIds): align chunkIds: 'named' with Webpack by @hyf0 in #3923
  • feat: support minifyOptions.comments by @9aoy in #3927
  • feat: support more predefined processAssets stage on js side by @ahabhgk in #3942

Bug Fixes 🐞

Other Changes

Full Changelog: v0.2.11...v0.2.12

v0.2.11

08 Aug 06:09
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: render library runtime for include entry chunks by @underfin in #3876
  • fix: modify Configuration type to support MultiRspackOptions by @suica in #3831
  • fix(core): add resove failing reason for import in esm file by @hardfist in #3884
  • fix: HarmonyImportSpecifierDependency interop should scan xxx.xxx by @underfin in #3910
  • fix: fix a panic issue of get_hash if assertion is failed by @h-a-n-a in #3907
  • fix: should generate diffrent name for chunk asset at hmr by @underfin in #3912

Other Changes

New Contributors

Full Changelog: v0.2.10...v0.2.11

v0.2.10

01 Aug 04:25
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: export imported a import declaration with all as. by @IWANABETHATGUY in #3847
  • fix: banner shouldn't be injected to asset by @hardfist in #3809
  • fix: generate correct name for library umd define by @underfin in #3856
  • fix: should replace _webpack_require to _nested_webpack_require at … by @underfin in #3857

Other Changes

New Contributors

Full Changelog: v0.2.9...v0.2.10

v0.2.9

25 Jul 12:00
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

  • feat(splitChunks): support splitChunks.{cacheGroup}.idHint by @hyf0 in #3783
  • feat(core): add test/include/exclude options to builtins.minifyOptions by @LingyuCoder in #3775
  • feat: support stats option "source" by @suxin2017 in #3682
  • feat(packages/rspack): add version check for binding by @lippzhang in #3717
  • feat: nested import tree shaking by @IWANABETHATGUY in #3800
  • feat: implement statsFactory and simplified DefaultStatsFactoryPlugin by @9aoy in #3805

Bug Fixes 🐞

Other Changes

  • ci: release canary without debug mode because binary size is too big to upload (>1G) by @Boshen in #3788
  • chore: fix canary release by @h-a-n-a in #3792
  • chore: support passing ref to reusable build by @h-a-n-a in #3793
  • chore: bump swc version by @h-a-n-a in #3791
  • chore: enable some runtime & context module webpack test by @underfin in #3796
  • ci: split cargo check and cargo test into two jobs by @Boshen in #3807
  • chore: remove rspack_build by @Boshen in #3806
  • refactor: assign dep id for each symbol. by @IWANABETHATGUY in #3808
  • chore: use v0.x.y instead of 0.x.y for release tag by @hardfist in #3819
  • test: basic webpack side effects and treeshaking tests by @IWANABETHATGUY in #3833
  • chore(types): should not return null when only called rspack with one parameter by @9aoy in #3835

New Contributors

Full Changelog: 0.2.8...v0.2.9

0.2.8

18 Jul 04:48
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

Full Changelog: 0.2.7...0.2.8

0.2.7

13 Jul 06:57
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

  • perf: convert to RawSource in devtool to reduce one time source map calculation when convert to JsCompatSource by @ahabhgk in #3748

Exciting New Features πŸŽ‰

  • feat(ast_viewer): support contexting in ast viewer by @h-a-n-a in #3756

Bug Fixes 🐞

Other Changes

Full Changelog: 0.2.6...0.2.7