Skip to content

Releases: web-infra-dev/rspack

0.2.4

27 Jun 07:53
2d46fb6
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: 0.2.3...0.2.4

v0.2.3

20 Jun 05:16
Compare
Choose a tag to compare

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: 0.2.2...0.2.3

v0.2.2

13 Jun 04:11
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

  • feat: use immutable reference for process asset hook by @h-a-n-a in #3455
  • feat: zod schema for buliltins.postcss and deprecate buliltins.postcss by @hyf0 in #3458
  • feat: make plugin driver immutable by @h-a-n-a in #3464
  • feat: support asset generator data url and publicPath by @ahabhgk in #3422
  • feat(devServer): support override writeToDisk configuration by @9aoy in #3476
  • feat(splitChunks): support passing RegExp to splitChunks.chunks by @hyf0 in #3473
  • feat: support for partially enabled incremental rebuilds by @jerrykingxyz in #3472
  • feat(config): zod schema for resolve by @cheerioInf in #3487
  • feat: validate the passing object whether it's a RegExp by @hyf0 in #3495
  • feat(config): zod scheme for plugins by @nieyuyao in #3498
  • feat: support compilation.rebuildModule by @jerrykingxyz in #3496

Bug Fixes 🐞

Other Changes

  • chore: use latest npm version as snapshot prefix by @hardfist in #3450
  • chore(devServer): use webpack-dev-middleware instead of @rspack/dev-middleware by @9aoy in #3478
  • chore: trigger nightly ecosystem-ci after nightly release by @ahabhgk in #3480
  • chore(rust): bump rustc to v1.70.0 (nightly-2023-06-01) by @Boshen in #3490
  • ci: adjust timeout-minutes for CI because mac is too slow by @Boshen in #3491
  • test(splitChunks): migrate more tests at test/configCases/split-chunks by @hyf0 in #3509
  • chore: use snapshot to test hash and css modules classname by @ahabhgk in #3512

New Contributors

Full Changelog: 0.2.1...0.2.2

v0.2.1

07 Jun 05:03
Compare
Choose a tag to compare

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: update lock for ecosystem-ci by @ahabhgk in #3385
  • fix: metric recover by @IWANABETHATGUY in #3388
  • fix(rust): use jemallocator for linux gnu, mimalloc for everything else by @Boshen in #3350
  • fix: fix aarch64-unknown-linux-gnu not building jemallocator by @Boshen in #3405
  • fix: remove css updatedModulesList at hmr by @underfin in #3399
  • fix: shouldn't diff hot update chunk at hmr by @underfin in #3411
  • fix: support config version when emitAsset by @jerrykingxyz in #3415
  • fix: sourcemap as an empty string by @h-a-n-a in #3426
  • fix(types): export OptimizationSplitChunksOptions for compatibility and enable validating for optimization by @hyf0 in #3435
  • fix(types): type error for runtimeChunk by @hyf0 in #3442
  • fix(context_module_cache): fix cache directory bug by @suxin2017 in #3271

Other Changes

New Contributors

Full Changelog: 0.2.0...0.2.1

v0.2.0

02 Jun 05:31
Compare
Choose a tag to compare

Rspack 0.2.0 is out!

Read the announcement blog post: Announcing Rspack 0.2.

Overview

Official vue-loader support πŸŽ‰

And also

What's Changed

Breaking Changes πŸ› 

  • fix: align rspack-dev-middleware and rspack-plugin-html export with webpack by @hardfist in #3358

Performance Improvements ⚑

  • perf(core): improve cold startup performance by caching depended_modules function in code splitter by @Boshen in #2294
  • perf(rspack_core): reduce memory allocation when cloning RuntimeSpec by @Boshen in #2844
  • perf: avoid clone while matching import.meta.webpackHot by @hyf0 in #2857
  • perf: bailout if possible and ignore AstNode of type in ReactRefreshUsageFinder by @hyf0 in #2875
  • perf: compose loaders on the native side by @h-a-n-a in #2894
  • perf: πŸ€– optimize regex by @IWANABETHATGUY in #3113
  • perf: skip call chunkAsset hook when not in use by @jerrykingxyz in #3228
  • perf: emit_assets only emit changed assets by @jerrykingxyz in #3305

Exciting New Features πŸŽ‰

Read more

v0.1.12

23 May 09:30
Compare
Choose a tag to compare

Core features

Breaking Changes

In the previous release, Rspack incorrectly supported [ext] in output.filename, we are removing [ext] support in output.filename in 0.1.12 to align with webpack, which may be a breaking change for applications using [ext] in output.filename. see #3270 (comment) for migration guide from previous release.

Support resolve.exportsFields

Support set exportsFields in package.json that are used for resolving module requests

module.exports = {
  //...
  resolve: {
    exportsFields: ['source', '...'],
  },
};

Support https://github.com/TypeStrong/fork-ts-checker-webpack-plugin

you can use fork-ts-checker-webpack-plugin directly in rspack to typecheck your codebase.

Support dataURI

import a from 'data:text/javascript,export default "a";';
expect(a).toBe("a");

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat(core): support webpack-manifest-plugin by @hardfist in #3163
  • feat(library): support system.js by @suxin2017 in #3124
  • feat(resolve): support custom exports fields by @bvanjoi in #3186
  • feat: add output.hotUpdateMainFilename & output.hotUpdateChunkFilename by @underfin in #3188
  • feat: data uri support by @ahabhgk in #3220
  • feat(types): support string or object in copy.patterns array by @9aoy in #3218
  • feat: add scheme, mimetype, and resourceFragment rule condition by @ahabhgk in #3238
  • feat: normal module factory after resolve hooks by @IWANABETHATGUY in #3060
  • feat: add support for Rule.loader and Rule.options by @h-a-n-a in #3246
  • feat(module_optional): support require.resolve and require.resolveWeak by @suxin2017 in #3237
  • feat: add afterCompile hook by @edusperoni in #3235

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.1.11...v0.1.12

v0.1.11

16 May 09:05
Compare
Choose a tag to compare

Core features

Externals supports Array

module.exports = {
  //...
  externals: {
    subtract: ['./math', 'subtract'],
  },
};

subtract: ['./math', 'subtract'] allows you select part of a module, where ./math is the module and your bundle only requires the subset under the subtract variable.

see more

Support optimization.removeEmptyChunks

Tells Rspack to detect and remove chunks which are empty. Setting optimization.removeEmptyChunks to false will disable this optimization.

see more

Support splitChunks.{cacheGroup}.enforce

see more

What's Changed

Performance Improvements ⚑

Exciting New Features πŸŽ‰

  • feat(rust): support webpack_chunk_load module variable by @lippzhang in #3080
  • feat: support optimization.removeEmptyChunks config by @chenjiahan in #3076
  • feat(core): support custom dependency type internally by @hyf0 in #3068
  • feat(chunkId): care about Chunk#id_name_hints and generate more stable chunk id by @hyf0 in #3043
  • feat(minify-plugin): support minify-css for minify-plugin by @hardfist in #3093
  • feat(new_split_chunks): support splitChunks.{cacheGroup}.enforce by @hyf0 in #3086
  • feat(realContentHash): multi contenthash in filename by @ahabhgk in #3095
  • feat: add compatible compilation.chunks by @dgmachado in #3010
  • feat: add build meta exports type by @underfin in #3121
  • feat: add tree shaking 'module' to eliminate module which has no export used and sideEffects free. by @IWANABETHATGUY in #3034
  • feat(core): external supports array by @hardfist in #3141
  • feat(plugin-node-polyfill): add process & buffer to node-polyfill by @hardfist in #3154

Bug Fixes 🐞

Other Changes

  • refactor(hmr): change visit_node_children from macro to fn by @bvanjoi in #3075
  • chore: add svg-react-loader & node-loader example by @hardfist in #3030
  • chore: single workspace by @Boshen in #3035
  • chore(rspack): add github-actions-reporter to jest by @Boshen in #3081
  • chore: add test commands to x.mjs by @Boshen in #3082
  • chore: disable perfsee upload in ci environment by @hardfist in #3099
  • chore(rust): clean up dependencies via cargo-machete by @Boshen in #3106
  • chore: remove unused workspace dev dependencies by @Boshen in #3098
  • chore: add rust rebuild test function feature by @suxin2017 in #3091
  • chore: fix toml indentation by @Boshen in #3114
  • refactor: Remove impl Module for Box<dyn Module> in codebase by @sladyn98 in #2831
  • chore: placeholder options for stats nestedModules by @ahabhgk in #3115
  • ci: run x86_64-unknown-linux-gnu tests without docker by @Boshen in #3117
  • ci: run e2e tests in ubuntu-latest by @Boshen in #3122
  • chore(examples): remove unused eslint-loader from examples/eslint by @Boshen in #3123
  • chore: enable emitCss for svelte by @hardfist in #3136
  • chore(examples/plugin-compat): disable verbose log && add inline css by @hardfist in #3138
  • chore: clean up Cargo.toml for node_binding and rspack_binding_options by @Boshen in #3139
  • chore: upgrade ts-jest to 29.1.0 by @hardfist in #3146
  • chore: support debug rust in jest by @hardfist in #3149
  • chore(rspack-cli): run jest with --runInBand by @Boshen in #3140
  • chore: Upgraded webpack to 5.76.0 by @GarrisonD in #3156
  • refactor(rust): remove dead code by @Boshen in #3160
  • chore: fix version manually by @h-a-n-a in #3165

New Contributors

Full Changelog: v0.1.10...v0.1.11

v0.1.10

09 May 09:54
Compare
Choose a tag to compare

Core features

builtins.minifyOptions.extractComments

You could extract the license using the configuration below:

module.exports = {
// ... snip
  builtins: {
     minifyOptions: {
       extractComments: true // by default, rspack will use regex `@preserve|@lic|@cc_on|^\**!`
     }
  }
}

or Using Regexp:

module.exports = {
// ... snip
  builtins: {
     minifyOptions: {
       extractComments: /@license/
     }
  }
}

inline match resource

For more details you could refer https://webpack.js.org/api/loaders/#inline-matchresource

optimization.realContentHash

By default, when you use the contenthash option in your output filename, Rspack will generate a hash based on the module's dependencies and other factors that can change even if the module's content has not changed. This means that the bundle will be invalidated and rebuilt even if the module's content has not changed.
However, by enabling the optimization.realContentHash option, Rspack will generate a hash based only on the actual content of the module. This ensures that the bundle is invalidated and rebuilt only when the module's content has actually changed.
For more details you could refer to optimization.realContentHash

What's Changed

Exciting New Features πŸŽ‰

Bug Fixes 🐞

Other Changes

  • chore: add hmr for loader example by @h-a-n-a in #2925
  • chore(rust): bump rustc to v1.69.0 (nightly-2023-04-20) by @Boshen in #2903
  • chore: add eslint support by @hardfist in #2904
  • refactor(new_split_chunks): remove unused code and add more comments by @hyf0 in #2947
  • chore: setup ./x script using zx by @Boshen in #2933
  • refactor: clean up dependencies around swc for improving compile time by @Boshen in #2962
  • refactor(plugin): asyncify optimize_chunks hook by @hyf0 in #2958
  • chore(rust): bump dependencies by @Boshen in #2968
  • ci: 🎑 trigger test when examples change by @IWANABETHATGUY in #2971
  • refactor: extract comments by @IWANABETHATGUY in #2970
  • refactor(split_chunks_new): asyncify prepare_module_group_map by @hyf0 in #2975
  • chore: πŸ€– disable css erorr by @IWANABETHATGUY in #2964
  • docs: pnpm install command fix based on engine by @thedeveloperpotato in #2992
  • refactor(core): use directory for chunk_graph module by @hyf0 in #2998
  • chore: add node shims example by @hardfist in #2997
  • test(split_chunks): add test of extract-css-to-single-chunk by @hyf0 in #2996
  • chore: remove clap by @IWANABETHATGUY in #2967
  • chore: add add loader_name to loader_sync_call in trace by @hardfist in #2999
  • chore: fine grained tracing by @IWANABETHATGUY in #3002
  • chore: make release profile the same for Cargo.toml and node_binding/Cargo.toml by @Boshen in #3004
  • ci: remove manual symbol stripping from build steps by @Boshen in #3007
  • chore: πŸ€– bump napi cli by @IWANABETHATGUY in #3008
  • chore: πŸ€– recover check on save by @IWANABETHATGUY in #3013
  • chore(rust): bump sass-embedded and remove protobuf requirement by @Boshen in #3021
  • chore: link to rspack-dev-guide and make content more general in CONTRIBUTING.md by @Boshen in #3020
  • refactor: external module for http request by @ahabhgk in #3023
  • refactor: remove dependency parent module identifier by @underfin in #3024
  • refactor(chunk_graph): split methods of ChunkGraph into different files by @hyf0 in #3031
  • chore: πŸ€– add alias cargo test no fail fast by @IWANABETHATGUY in #3032
  • test(split_chunks): Migrate test/configCases/split-chunks-common of Webpack by @hyf0 in #3018
  • refactor(rust...
Read more

v0.1.9

25 Apr 05:15
Compare
Choose a tag to compare

Core features

Loader compatibility

style-loader + css-loader is now supported experimentally.

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          {
            loader: "style-loader",
            options: {
              esModule: false, // only `esModule: false` is supported right now.
            },
          },
          "css-loader",
        ],
        type: "javascript/auto",
      },
    ],
  },
};

thread-loader(requires pitching loader) and eslint-loader (can be used with enforce: 'pre') are also supported.

For more loader-compat examples, please visit example-loader-compat.

Inline loader

// Prefixing with ! will disable all configured normal loaders
require("!postcss-loader!less-loader!./style.less")

// Prefixing with !! will disable all configured loaders (preLoaders, loaders, postLoaders)
require("!!postcss-loader!less-loader!./style.less")

// Prefixing with -! will disable all configured preLoaders and loaders but not postLoaders
require("-!postcss-loader!less-loader!./style.less")

Pitching loader

module.exports = function() {}
module.exports.pitch = function (remainingRequest, previousRequest, data) {
   if (someCondition) {
      return `require("!!${remainingRequest}")`
   }
};

What's Changed

Performance Improvements ⚑

  • perf(rspack_core): reduce memory allocation when cloning RuntimeSpec by @Boshen in #2844
  • perf: avoid clone while matching import.meta.webpackHot by @hyf0 in #2857
  • perf: bailout if possible and ignore AstNode of type in ReactRefreshUsageFinder by @hyf0 in #2875
  • perf: compose loaders on the native side by @h-a-n-a in #2894

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix: preset env use unresolved_mark by @underfin in #2807
  • fix: πŸ› fix ci a is undefined by @IWANABETHATGUY in #2810
  • fix: error snap should be ordered by @IWANABETHATGUY in #2811
  • fix: support magic comment import( /* webpackChunkName: "/user/[id]/page" */ './foo') containing [id] by @GiveMe-A-Name in #2835
  • fix: use webworker instead of web-worker in AvailableTarget type by @9aoy in #2834
  • chore: bump resolver and fix resolve.alias with resource query by @Boshen in #2817
  • fix: sourcemap lost when enable builtins.banner by @ahabhgk in #2858
  • fix: undefined reasons with stats.toJson by @ahabhgk in #2859
  • fix(resolve): return query and fragment when alias target had by @bvanjoi in #2869
  • fix: remove.d.ts from the default resolve.extensions by @lippzhang in #2861
  • fix: react refresh runtime inject for nest function call by @underfin in #2874
  • fix: optimize tree shaking swc/helpers by @IWANABETHATGUY in #2871
  • fix(resolve): delay the directory check in exportsFieldPlugin by @bvanjoi in #2883
  • fix: fix loader arguments by @h-a-n-a in #2898
  • fix: HMR scanner should only visit dependencies related to HMR by @h-a-n-a in #2911

Other Changes

New Contributors

Full Changelog: v0.1.8...v0.1.9

v0.1.8

18 Apr 11:08
Compare
Choose a tag to compare

What's Changed

Infrastructure βš™οΈ

  • Rspack has nightly release now! npm i -D @rspack/cli@nightly
  • Rspack Ecosystem CI has been successfully set up and running

Performance Improvements ⚑

  • perf(core): improve cold startup performance by caching depended_modules function in code splitter by @Boshen in #2294

Exciting New Features πŸŽ‰

Bug Fixes 🐞

  • fix(html): html inject public path incorrect by @jerrykingxyz in #2707
  • fix: extend chunkGroup name from EsmDynamicImportDependency by @ahabhgk in #2712
  • fix(progress): should not display empty progress bar by @chenjiahan in #2725
  • fix: panic hook failed to restore after being suppressed by @h-a-n-a in #2734
  • fix: template literal dynamic import by @faga295 in #2732
  • fix(react-refresh): lazily access module.exports to prevent unexpected/potential TDZ error by @hyf0 in #2714
  • fix(cli): fix default NODE_ENV of command by @hardfist in #2724
  • fix: πŸ› fix crash in multiCompiler by @JSerFeng in #2744
  • fix(css): should generate css assets even if the imported css file is empty by @suxin2017 in #2759
  • fix(builtins.provide): should only replace exactly matched expression by @suxin2017 in #2721
  • fix: redirect name_for_condition in BoxModule by @hyf0 in #2778

Other Changes

New Contributors

Full Changelog: v0.1.7...v0.1.8