rspack

A fast Rust-based web bundler πŸ¦€οΈ

MIT License

Downloads
4.7M
Stars
7.4K
Committers
191

Bot releases are hidden (Show)

rspack - v1.0.0 Latest Release

Published by chenjiahan about 2 months ago

image

See Announcing Rspack 1.0 for more details πŸŽ‰

What's Changed

Breaking Changes πŸ› 

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.5...v1.0.0

rspack - v1.0.0-rc.2

Published by chenjiahan about 2 months ago

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-rc.1...v1.0.0-rc.2

rspack - v1.0.0-rc.1

Published by chenjiahan about 2 months ago

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-rc.0...v1.0.0-rc.1

rspack - v1.0.0-rc.0

Published by chenjiahan about 2 months ago

πŸ’‘ Highlights

Faster eval-source-map

eval-source-map is now 80% faster than the previous version, see https://github.com/web-infra-dev/rspack/pull/7630.

image

HtmlRspackPlugin Escape Syntax

Now HtmlRspackPlugin uses the same syntax as html-webpack-plugin to escape a value. This can help you migrate from html-webpack-plugin to HtmlRspackPlugin more smoothly.

  • Before: Use <%= to escape the value, <%- does not escape the value.
  • After: Use <%- to escape the value, <%= does not escape the value.

For example, if a template value is <div>Rspack</div>, the current output will be:

<!-- Input -->
<%= value %>
<%- value %>

<!-- Output -->
<div>Rspack</div>
&lt;div&gt;Rspack&lt;/div&gt

PR: https://github.com/web-infra-dev/rspack/pull/7661

What's Changed

Breaking Changes πŸ› 

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.5...v1.0.0-rc.0

rspack - v1.0.0-beta.5

Published by chenjiahan 2 months ago

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: https://github.com/web-infra-dev/rspack/pull/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 πŸ› 

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.4...v1.0.0-beta.5

rspack - v1.0.0-beta.4

Published by chenjiahan 2 months ago

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.3...v1.0.0-beta.4

rspack - v1.0.0-beta.3

Published by chenjiahan 2 months ago

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: https://github.com/web-infra-dev/rspack/pull/7444

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.2...v1.0.0-beta.3

rspack - v1.0.0-beta.2

Published by chenjiahan 3 months ago

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.1...v1.0.0-beta.2

rspack - v1.0.0-beta.1

Published by chenjiahan 3 months ago

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: https://github.com/web-infra-dev/rspack/pull/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: https://github.com/web-infra-dev/rspack/pull/7330

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-beta.0...v1.0.0-beta.1

rspack - v1.0.0-beta.0

Published by chenjiahan 3 months ago

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:

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: https://github.com/web-infra-dev/rspack/pull/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: https://github.com/web-infra-dev/rspack/pull/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: https://github.com/web-infra-dev/rspack/pull/7307

All Changes

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.5...v1.0.0-beta.0

rspack - v1.0.0-alpha.5

Published by SyMind 3 months ago

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.4...v1.0.0-alpha.5

rspack - v1.0.0-alpha.4

Published by SyMind 3 months ago

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.3...v1.0.0-alpha.4

rspack - v1.0.0-alpha.3

Published by chenjiahan 3 months ago

Highlights πŸ’‘

Rust Fat LTO

Rspack v1.0.0-alpha.3 enabled Rust 'fat' LTO to improve performance (https://github.com/web-infra-dev/rspack/pull/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: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.2...v1.0.0-alpha.3

rspack - v1.0.0-alpha.2

Published by chenjiahan 3 months ago

What's Changed

Breaking Changes πŸ› 

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.1...v1.0.0-alpha.2

rspack - v1.0.0-alpha.1

Published by chenjiahan 4 months ago

What's Changed

Breaking Changes πŸ› 

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.0.0-alpha.0...v1.0.0-alpha.1

rspack - v1.0.0-alpha.0

Published by chenjiahan 4 months ago

What's Changed

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

Breaking Changes πŸ› 

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.5...v1.0.0-alpha.0

rspack - v0.7.5

Published by chenjiahan 4 months ago

What's Changed

Bug Fixes 🐞

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.4...v0.7.5

rspack - v0.7.4

Published by LingyuCoder 4 months ago

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 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.3...v0.7.4

rspack - v0.7.3

Published by h-a-n-a 4 months ago

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.2...v0.7.3

rspack - v0.7.2

Published by jerrykingxyz 4 months ago

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.7.1...v0.7.2