Releases: web-infra-dev/rspack
v0.4.4
Highlights
Allow passing function type to splitChunks.cacheGroups
//...
optimization: {
splitChunks: {
chunks: "all",
minSize: 0,
cacheGroups: {
splitLib2: {
chunks(chunk) {
console.log(chunk);
return chunk.name !== "lib1";
},
test: /shared\.js/,
name: "shared",
},
},
},
},
...
It gives you more flexibility to control code splitting behavior
Allow parse js hashbang syntax
Now rspack can process file like
#!/usr/bin/env node
import { foo } from "./lib";
console.log("index", foo);
A bunch of diagnostics improvement
more details you could refer:
What's Changed
Performance Improvements β‘
Exciting New Features π
- feat: πΈ json tree shaking by @IWANABETHATGUY in #4858
- feat: add script nonce by @LingyuCoder in #4975
- feat(es): allow parse js hashbang syntax by @magic-akari in #4970
- feat(runtime): support module.parser.url=relative by @LingyuCoder in #4988
- feat(runtime): support webpack_chunkname by @LingyuCoder in #4990
- feat: support webpack_runtime_id by @LingyuCoder in #4993
- feat: stats for childCompiler by @ahabhgk in #5007
- feat: add function type splitChunks chunks by @ahabhgk in #5019
- feat: support rgb colors for ansi-html by @h-a-n-a in #5020
- feat(cli): support to set output.path by @puppet-666 in #4979
- feat: align ExportImportedSpecifierDependency init fragments by @IWANABETHATGUY in #4995
- feat: support eval abstract equal by @bvanjoi in #5037
- feat: isomorphism mf 1.0 and 1.5 by @ahabhgk in #4959
- feat: eval array and regexp in binary expr by @bvanjoi in #5051
- feat(runtime): prefetch&preload by @LingyuCoder in #5031
- feat: support pseudo webpack extension and custom module type by @JSerFeng in #5061
- feat: eval template string in binary expr by @bvanjoi in #5064
- feat: diagnostics in overlay by @h-a-n-a in #5049
- feat: add module parse error by @h-a-n-a in #5062
- feat: eval if-else stmt by @bvanjoi in #5073
Bug Fixes π
- fix: add node modules to npmginore in templates by @burhanuday in #4976
- fix: align mangle exports comments by @IWANABETHATGUY in #4954
- fix(config): support pass false to plugins by @puppet-666 in #4949
- fix(@rspack/core): minify should be disabled when minimizer is an empty array by @xc2 in #4911
- fix: append builtin minify plugin for child compiler by @bvanjoi in #4987
- fix: π class memeber side effects by @IWANABETHATGUY in #4983
- fix: handle chunk relation by @JSerFeng in #4984
- fix(runtime): globals on require in runtime plugin by @LingyuCoder in #4998
- fix: parse left and right when eval failed for logic expr by @bvanjoi in #5000
- fix: license-webpack-plugin failed to generate license for some of module by @ahabhgk in #5003
- fix: stats childCompiler test by @ahabhgk in #5015
- fix: remove console.log by @LingyuCoder in #5018
- fix: runtime chunk order by @LingyuCoder in #5021
- fix: add "symlinks" option to resolve config validation by @bostondv in #5034
- fix(remove-parent-modules): only filter runtime chunk by @JSerFeng in #5036
- fix: π fix escape json by @IWANABETHATGUY in #5042
- fix: umd library integrate with newTreeshaking by @IWANABETHATGUY in #5043
- fix: remove available modules from ancestor by @JSerFeng in #4994
- fix: webpack-test/configCases/split-chunks/async-entries by @IWANABETHATGUY in #5050
- fix: extract_block_modules dependencies order by @IWANABETHATGUY in #5046
- fix: `ruleSetLogicalConditions.not should not just array by @bvanjoi in #5059
- fix: hmr css with filename by @ahabhgk in #5069
- fix: serialize path of stats on windows by @h-a-n-a in #5070
Other Changes
- ci: speed up CI by turning off sourcemap for arco-pro by @Boshen in #4985
- chore(runtime-diff): module chunk loading runtime module by @LingyuCoder in #4916
- chore: add comparator for diff tester by @LingyuCoder in #5002
- revert: "chore: add comparator for diff tester" by @LingyuCoder in #5009
- chore: run benchmark on main branch by @jerrykingxyz in #5011
- chore(diff): add more diff cases by @LingyuCoder in #5012
- chore(diff): scan diff cases by glob by @LingyuCoder in #5016
- chore: remove fast querystring just use node module querysting parse by @m1911star in #4749
- chore: update Readme.md by @hardfist in #5023
- refactor: clever merge resolve options by @bvanjoi in #4974
- chore: remove #4325 in webpack-test by @ahabhgk in #5035
- refactor: make sure add all runtime globals when process_runtime_requirements by @ahabhgk in #5032
- chore(runtime-diff): jsonp chunk loading runtime module by @LingyuCoder in #4915
- chore(rspack_core): oxc_resolver v0.6.2 by @Boshen in #5047
- refactor: diagnosable modules by @h-a-n-a in #4924
New Contributors
- @burhanuday made their first contribution in #4976
- @puppet-666 made their first contribution in #4949
- @bostondv made their first contribution in #5034
Full Changelog: v0.4.3...v0.4.4
v0.4.3
Highlights
Support optimization.splitChunks.hidePathInfo
Prevents exposing path info when creating names for parts splitted by maxSize.
Support splitChunks.automaticNameDelimiter
By default rspack will generate names using origin and name of the chunk (e.g. vendors~main.js
). This option lets you specify the delimiter to use for the generated names. doc
Support splitChunks.cacheGroups.{cacheGroup}.filename
Sets the hint for chunk id. It will be added to chunk's filename. doc
What's Changed
Performance Improvements β‘
Exciting New Features π
- feat: mf fallback module by @ahabhgk in #4895
- feat(rspack/minified): support info.minimized from copy plugin (#4908) by @Kunduin in #4909
- feat: eval binary expression by @bvanjoi in #4918
- feat: support splitChunks.cacheGroup.filename&delimiter by @LingyuCoder in #4930
- feat: runtime optimization by @IWANABETHATGUY in #4917
- feat: support eval
typeof require
by @bvanjoi in #4929 - feat(runtime): optimize get chunk filename runtime module with dynamic+static by @LingyuCoder in #4943
- feat: add create_module_assets by @JSerFeng in #4941
- feat: add more chunk methods by @ahabhgk in #4951
- feat: support optimization.splitChunks.hidePathInfo option by @SyMind in #4964
Bug Fixes π
- fix: module decorator when harmony mixed by @LingyuCoder in #4900
- fix: webpack-test/cases/parsing/issue-7519 with tree shaking enable by @IWANABETHATGUY in #4904
- fix: eco-ci trigger after nightly release by @ahabhgk in #4853
- fix(rspack_core): oxc_resolver v0.6.0 - resolve styled-components correctly by @Boshen in #4928
- fix: inner graph function visit by @IWANABETHATGUY in #4927
- fix: should return number.to_string instead of char::from by @IWANABETHATGUY in #4947
- fix: rm dep type for resolve by @bvanjoi in #4946
- fix: π align with webpack number_hash by @IWANABETHATGUY in #4955
- fix: module.context is undefined by @SyMind in #4961
- fix: remove static new_treeshaking switch by @JSerFeng in #4962
- fix: compare blocks and its group_options by @bvanjoi in #4967
- fix: get js chunk filename by @ahabhgk in #4971
Other Changes
- chore(runtime-diff): align module decorator runtime modules with webpack by @LingyuCoder in #4891
- chore(runtime-diff): alignment of hot module replacement runtime module by @LingyuCoder in #4856
- chore: remove all skipLibCheck by @xiaoxiangmoe in #4910
- chore: add build:cli:release:{platform} scripts by @aweary in #4859
- test: prevent .DS_store been add to test cases on macos by @LingyuCoder in #4920
- refactor: de-hardcoded module factory and move mf out of core by @ahabhgk in #4925
- chore: deprecate @rspack/plugin-node-polyfill by @hardfist in #4937
- chore: add debug info under panic with debug build by @h-a-n-a in #4940
- chore(runtime-diff): alignment of get chunk filename by @LingyuCoder in #4500
- refactor: error and diagnostics by @h-a-n-a in #4866
- refactor:
miette::Error
asDiagnostic
andrspack_error::Error
by @h-a-n-a in #4892 - chore: optimize diff test case by @LingyuCoder in #4950
- refactor: should not always rely on
Result
by @h-a-n-a in #4880 - chore(webpack-test): enable resolving/browser-field tests by @Boshen in #4952
- test(runtime): add test case of using [id] in get chunk filename runtime module by @LingyuCoder in #4972
- chore(runtime-diff): alignment of startup chunk dependencies runtime module by @LingyuCoder in #4508
New Contributors
Full Changelog: v0.4.2...v0.4.3
v0.4.2
Highlights
experiments.rspackFuture.newTreeshaking
the new tree shaking implementation specifically addressing compatibility issues with webpack architecture and optimizing for reduced output size.
(see below for a detailed explanation)
optimization.mangleExports
allow rspack to control export mangling.
(see below for a detailed explanation)
What's Changed
Exciting New Features π
- feat: JsAsset remove version field by @jerrykingxyz in #4836
- feat: support ecosystem-ci suiteRef trigger by @ahabhgk in #4847
- feat: do not convert panics to results by @h-a-n-a in #4848
- feat: implement
ChunkGraph.getChunkModulesIterable
andChunkGraph.getChunkEntryModulesIterable
by @xc2 in #4855 - feat(runtime-diff): alignment of wasm async loading runtime module by @LingyuCoder in #4863
- feat: align webpack - allow
false
foroptimization.splitChunks
on options validation by @xc2 in #4883 - feat: mangle exports by @IWANABETHATGUY in #4805
- feat: support scriptType by @faga295 in #4814
- feat: extract data from mf generated code by @ahabhgk in #4799
Bug Fixes π
- fix: include tpl string into bail out module ident by @bvanjoi in #4810
- fix(plugin-react-refresh): fix peer warning and reduce dependencies by @chenjiahan in #4807
- fix: bump styled_components and add tests by @nieyuyao in #4813
- fix: updated swc to solve the asciionly bug by @bvanjoi in #4824
- fix: repeat report view link in stats report by @LingyuCoder in #4829
- fix: nested new url by @ahabhgk in #4831
- fix(resolver): resolve query and fragments with unicode filenames by @Boshen in #4830
- fix: remove @ts-expect-error in rspack-plugin-html by @HerringtonDarkholme in #4852
- fix(css): dedup for css module keys by @bvanjoi in #4867
- fix: js files are not minified well when outputModule is true (#4819) by @xc2 in #4857
- fix: enable "context-weak" by @bvanjoi in #4870
- fix: production environment refreshPlugin error by @dribble-njr in #4875
- fix(e2e): remove dev-client based e2e testing cases to fix e2e testing by @xc2 in #4884
- fix: chunk modules test on windows by @ahabhgk in #4894
New Contributors
- @xc2 made their first contribution in #4855
- @dribble-njr made their first contribution in #4875
Full Changelog: v0.4.1...v0.4.2
experiments.rspackFuture.newTreeshaking
This quarter, substantial efforts were dedicated to enhancing tree shaking. While the older tree shaking method remains applicable in most scenarios, it lacks full compatibility with webpack architecture, resulting in divergent behaviors compared to webpack. Additionally, it may produce larger output in certain scenarios when contrasted with webpack. For example, efforts were made to address these issues and optimize tree shaking for improved performance and compatibility.
One of the noteworthy enhancements is the reduction in generated output size. The revamped tree shaking is designed to produce leaner output, particularly when compared to certain scenarios with the previous tree shaking implementation. Here is an example:
source
// index.js
import { a } from './lib.js'
a
// lib.js
export * from './a.js'
// a.js
export const a = 3;
export const b = 3;
package.json
{
"sideEffects": false
}
rspack.config.js
const rspack = require("@rspack/core");
/** @type {import('@rspack/core').Configuration} */
const config = {
entry: "./src/index.js",
plugins: [
],
experiments: {
rspackFuture: {
newTreeshaking: false // `newTreeshaking` disable by default
}
},
optimization: {
moduleIds:"named", // use nanmed moduleIds and disable `minize` for better demonstration
minimize: false
},
};
module.exports = config;
Since the whole module is side effects free, we could directly import a
from a.js
. This could eliminate lib.js
in output.
with old tree shaking
// skip runtime code ...
var __webpack_modules__ = {
"./src/a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
a: function() { return a; }
});
const a = 3;
const b = 3;
}),
"./src/index.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib */"./src/lib.js");
_lib__WEBPACK_IMPORTED_MODULE_0__.a;
}),
"./src/lib.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */"./src/a.js");
__webpack_require__.es(_a__WEBPACK_IMPORTED_MODULE_0__, __webpack_exports__);
}),
}
with new tree shaking
enable experiments.rspackFuture.newTreeshaking
const rspack = require("@rspack/core");
/** @type {import('@rspack/core').Configuration} */
const config = {
// ...
experiments: {
rspackFuture: {
- newTreeshaking: false
+ newTreeshaking: true
}
},
// ...
};
module.exports = config;
output
var __webpack_modules__ = {
"./src/a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
a: function() { return a; }
});
const a = 3;
const b = 3;
}),
"./src/index.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib */"./src/a.js");
_lib__WEBPACK_IMPORTED_MODULE_0__.a;
}),
}
The new treeshaking implementation is still undergoing stability testing; hence, it remains disabled by default. If you wish to experiment with it, you can enable it by using the following:
const rspack = require("@rspack/core");
/** @type {import('@rspack/core').Configuration} */
const config = {
// ...
experiments: {
rspackFuture: {
newTreeshaking: true
}
},
// ...
};
module.exports = config;
more details you could refer:
https://www.rspack.dev/config/experiments.html#experimentsrspackfuturenewtreeshaking
and related options:
optimization.mangleExports
optimization.mangleExports
allows to control export mangling.
Reuse the previous example, making slight modifications for a better explanation.
// index.js
- import { aaa } from './lib.js'
+ import { aaa } from './lib.js'
- a
+ aaa
// lib.js
export * from './a.js'
// a.js
- export const aaa = 3;
+ export const aaa = 3;
export const b = 3;
Enable experiments.rspackFuture.newTreeshaking
and optimization.mangleExports
Output
The export of module src/a.js was condensed into a single letter, leading to a decrease in the overall output size.
var __webpack_modules__ = {
"./src/a.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
P: function() { return aaa; }
});
const aaa = 3;
const b = 3;
}),
"./src/index.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib */"./src/a.js");
_lib__WEBPACK_IMPORTED_MODULE_0__.P;
}),
}
Note this feature is not stable yet, and requires experiments.rspackFuture.newTreeshaking
to be enabled.
v0.4.1
Highlights
- Support
compiler.hooks.shouldEmit
hook: Return a boolean telling whether to emit. - Support
compilation.hooks.childCompiler
hook: Executed after created a childCompiler. - Support function type
splitChunks.cacheGroups.{cacheGroup}.test
What's Changed
Performance Improvements β‘
- perf: reduce aggregateTimeout to speed up HMR by @chenjiahan in #4724
- perf: compilation.hooks.optimizeChunkModules auto disable by @jerrykingxyz in #4756
Exciting New Features π
- feat: support function type for
splitChunks.{cacheGroup}.{test, name}
by @bvanjoi in #4722 - feat: support Chunk.groupsIterable and ChunkGroup.getParents by @bvanjoi in #4641
- feat(plugin-driver): add execute module by @JSerFeng in #4737
- feat: support
Compiler.shouldEmit
by @bvanjoi in #4742 - feat: Module Federation, part 1, ContainerPlugin by @ahabhgk in #4642
- feat: support
compilation.hooks.childCompiler
by @bvanjoi in #4773 - feat: Module Federation, part 2, ContainerReferencePlugin by @ahabhgk in #4735
- feat: bump swc to support
format.inline_script
by @bvanjoi in #4786 - feat: Module Federation, part 3, ProvideSharedPlugin by @ahabhgk in #4778
- feat: Module Federation, part 4, ConsumeSharedPlugin by @ahabhgk in #4783
- feat: support String.raw for context module by @faga295 in #4764
Bug Fixes π
- fix: πassignDeterministicIds alignment by @IWANABETHATGUY in #4693
- fix: π should invoke
visit_prop
anyway in inner_graph by @IWANABETHATGUY in #4683 - fix(harmony-deps-scanner): should only be
dep.call=true
in call_expr or tagged template's tag by @JSerFeng in #4701 - fix: sort by chunk name before merge duplicate chunk by @bvanjoi in #4725
- fix: compare chunks by modules by @ahabhgk in #4732
- fix(harmony-import-specifier-dep-scanner): add new expr into consideration by @JSerFeng in #4729
- fix: remove @types/webpack-dev-server by @jerrykingxyz in #4744
- fix: use fixed version for rspack in template by @zoolsher in #4746
- fix: typos by @yiliang114 in #4761
- fix: zod-validation-error type error by @xiaoxiangmoe in #4763
- fix: only register
SplitChunkPlugin
once by @bvanjoi in #4766 - fix: flag side effects plugin update dep by @IWANABETHATGUY in #4747
- fix uniqueName Acquisition method by @ityuany in #4670
- fix: regex flags by @nomyfan in #4781
- fix: keep the query passed to loader by @bvanjoi in #4782
- fix: dir path ends with * by @ahabhgk in #4790
- fix: mf test on windows by @ahabhgk in #4793
- fix: use correct DefinePlugin in plugin-react-refresh by @ahabhgk in #4794
- fix: throw error when there had conflict between
chunkName
andentryPointChunk
by @bvanjoi in #4795 - fix: windows test by @ahabhgk in #4796
Other Changes
- chore: remove angular example by @LingyuCoder in #4710
- refactor: block-based code-splitting by @ahabhgk in #4680
- chore: skip show sccache stats by @jerrykingxyz in #4706
- chore: remove angular pnpm lock by @LingyuCoder in #4711
- chore(webpack-test): remove the flaky test which requires on timings by @Boshen in #4715
- chore: fix typos by @Priestch in #4700
- chore(chunk_graph): improve chunk_graph perf by @JSerFeng in #4716
- ci: improve webpack-test stability by @Boshen in #4726
- chore: use eprintln to report error for runtime_requirements by @JSerFeng in #4717
- chore: self hosted macos skip remove sdk by @jerrykingxyz in #4733
- chore: compat get default export by @LingyuCoder in #4731
- chore: commonjs exports dependency by @LingyuCoder in #4720
- refactor: move impl_runtime_module macro to core by @ahabhgk in #4738
- release: 0.4.0 by @h-a-n-a in #4041
- chore: ci set pnpm store-dir in project by @jerrykingxyz in #4743
- chore: fix debugger launcher on window by @h-a-n-a in #4750
- chore: upgrade template to 0.4.0 by @hardfist in #4752
- chore: rspack test tools diff by @LingyuCoder in #4668
- chore: diff trigger by @LingyuCoder in #4755
- chore: diff trigger test by @LingyuCoder in #4760
- ci: remove diff test from release workflow by @LingyuCoder in #4768
- chore(webpack-test): make tests more future proof by @Boshen in #4758
- chore: canary release add windows and enable windows ci on main branch by @jerrykingxyz in #4772
- chore: bump nodejs_resolver by @bvanjoi in #4791
New Contributors
- @Priestch made their first contribution in #4700
- @yiliang114 made their first contribution in #4761
- @ityuany made their first contribution in #4670
- @nomyfan made their first contribution in #4781
Full Changelog: v0.4.0...v0.4.1
v0.4.0
Rspack 0.4.0 is out!
Read the announcement blog post: Announcing Rspack 0.4.
Overview
- Rsbuild v0.1: an enhanced Rspack CLI
- Drop NodeJS 14 Support
- @rspack/core is now a peer dependency
- OXC Resolver by default!
- Deprecating builtins.react.refresh
- Deprecating builtin:sass-loader
- Refactored export API in @rspack/core
- and more...
Migrating from v0.3
Check out our migration guide for in-depth migration details.
What's Changed
Performance Improvements β‘
Exciting New Features π
- feat: support
ContextDependency
by @bvanjoi in #4682 - feat: support optimization.nodeEnv by @SyMind in #4698
- feat:
experiments.incrementalRebuild
add deprecation warning by @jerrykingxyz in #4727
Bug Fixes π
- fix(webpack-test): fix the slow 5 seconds test by @Boshen in #4694
- fix(webpack-test): fix the 1 second slow test by @Boshen in #4695
- fix: @swc/jest type error by @ahabhgk in #4705
- fix: export StatsCompilation by @ahabhgk in #4709
- fix: remove default export by @ahabhgk in #4728
- fix(resolver): make sure package.json path is inside the resolved path by @Boshen in #4730
Other Changes
- chore: bump dev webpack from 5.76.0 to 5.89.0 by @LingyuCoder in #4688
- chore: run webpack tests in parallel by @Boshen in #4691
- chore: skip show sccache stats by @jerrykingxyz in #4707
- chore: pnpm set cache dir by version by @jerrykingxyz in #4719
Full Changelog: v0.3.14...v0.4.0
v0.3.14
What's Changed
Bug Fixes π
- fix(typing): fix ExternalObject type argument not found by @HerringtonDarkholme in #4651
- fix:
require.context
should parse literals by @h-a-n-a in #4665 - fix: arco pro tree shaking issues by @IWANABETHATGUY in #4655
- fix: fix filenames with multiple bytes in match-resource by @h-a-n-a in #4674
- fix: π export default expr codegen should keep expr leading comments by @IWANABETHATGUY in #4676
- fix(runtime): revert alignment of commonjs exports dependency by @JSerFeng in #4679
- fix(typing): fix packages/rspack-cli ts-expect-error by @HerringtonDarkholme in #4673
Other Changes
- test: add test cases for #4643 by @LingyuCoder in #4659
- chore: add engine check to ensure pnpm version by @hardfist in #4654
- chore: remove useless pnpm:devPreinstall and doctor.js from
package.json
by @Boshen in #4675 - chore(test): replace babel-jest with @swc/jest (#4587) by @msdlisper in #4623
Full Changelog: v0.3.13...v0.3.14
v0.3.13
Highlight
This version contains a hotfix of #4643
What's Changed
Exciting New Features π
Bug Fixes π
- fix: π recursive visitor state by @IWANABETHATGUY in #4637
- fix(runtime): get export default when new class by @LingyuCoder in #4639
- fix: π detecting export named decl side effects by @IWANABETHATGUY in #4629
- fix: compiler.webpack.ModuleFilenameHelpers type error by @jerrykingxyz in #4650
Other Changes
- fix(3180): panicking when importing empty dependency by @Hamzakh777 in #4320
- fix: type error by @xiaoxiangmoe in #3863
- chore: support passing refs to ecosystem-ci by @h-a-n-a in #4657
- revert: get export default by @LingyuCoder in #4653
- ci: disable more optimization.minimize in examples/ by @Boshen in #4658
New Contributors
- @nyqykk made their first contribution in #4628
- @xiaoxiangmoe made their first contribution in #3863
Full Changelog: v0.3.12...v0.3.13
v0.3.12
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 β‘
- perf(plugin-react-refresh): remove schema-utils by @chenjiahan in #4591
- perf(@rspack/core): remove schema-utils by @chenjiahan in #4593
Exciting New Features π
- feat: should have null as placeholder in stats chunks before chunkIds by @JSerFeng in #4549
- feat: support more minify options by @h-a-n-a in #4554
- feat: support entryDescription.library by @ahabhgk in #4547
- feat: support webpackContextName for import context by @bvanjoi in #4570
- feat(example): vue2-tsx by @Y80 in #4573
- feat(runtime): alignment of commonjs exports dependency by @LingyuCoder in #4572
- feat: deprecate splitChunks options by @h-a-n-a in #4580
- feat: add module and context fields in loader context by @JSerFeng in #4586
- feat(runtime): alignment of module runtime requirements by @LingyuCoder in #4581
- feat(resolver): print detailed error messages for oxc_resolver (#4564) by @msdlisper in #4614
- feat: add auxiliary_files in js chunk by @JSerFeng in #4636
Bug Fixes π
- fix: deep insert runtime to splitted chunk by @bvanjoi in #4548
- fix: succeedModule hook panic when can't convert to jsModule by @IWANABETHATGUY in #4555
- fix: make builtin plugins class name consistent with webpack by @chenjiahan in #4563
- fix: require.context should not fail when using
endWith
algo (#4557) by @hverlin in #4577 - fix: fix unsoundness of napi type detection by @h-a-n-a in #4575
- fix: add the
./package.json
in the package.json's exports by @xfsnowind in #4543 - fix: tree shaking dfs_order test case. by @IWANABETHATGUY in #4574
- fix: avoid generate banner when there are not extract comment by @bvanjoi in #4592
- fix: fix url rewriting in css variables by @h-a-n-a in #4606
- fix: fix infinite while loop when entry name contains '/' like 'routes/index' by @hardfist in #4610
- fix: warning for direct access import.meta by @OceanPresentChao in #4621
- fix(chunk_graph): chunkGraph insert if not present by @JSerFeng in #4615
- fix: use original value when
import.style
is object by @bvanjoi in #4616
Other Changes
- chore: adjust to 14 days for need reproduction label by @hardfist in #4561
- feat: support stats runtime modules by @faga295 in #4126
- chore: upload artifact use RUNNER_LABELS by @jerrykingxyz in #4567
- refactor: remove cumbersome type conversions by @h-a-n-a in #4569
- chore: fix
launch.json
by @h-a-n-a in #4598 - chore: auto assign author as assignee by @hardfist in #4599
- chore: fix auto-assign workflow by @hardfist in #4600
- chore(runtime-diff): alignment of compat get default export runtime module by @LingyuCoder in #4607
- chore: move @rspack/dev-server from deps to devDeps by @9aoy in #4496
- chore: export more stats type for users use by @9aoy in #4604
- chore: add react-refresh to rspack-cli reference by @hardfist in #4608
- ci: disable minification for example/arco-pro to speed up CI by @Boshen in #4620
- chore: better debugging by @h-a-n-a in #4611
- chore: remove goverance by @hardfist in #4627
- refactor(process_runtime_requirements): align api with webpack by @JSerFeng in #4617
- chore: bump swc-emotion by @JSerFeng in #4631
- refactor: AsyncDependenciesBlock by @ahabhgk in #4595
- ci: disable most of the optimization.minimize in examples to speed up CI by @Boshen in #4624
New Contributors
- @hverlin made their first contribution in #4577
- @Y80 made their first contribution in #4573
- @xfsnowind made their first contribution in #4543
- @msdlisper made their first contribution in #4614
Full Changelog: v0.3.11...v0.3.12
v0.3.11
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 β‘
- perf: pass
SyntaxContext
by copy by @Austaras in #4519 - perf(@rspack/core): remove util dependency by @chenjiahan in #4539
Exciting New Features π
- feat: support banner in extractComments of minify by @bvanjoi in #4534
- feat: support optional chaining by @h-a-n-a in #4502
- feat: support timestamps by @h-a-n-a in #4545
- feat: support WarnCaseSensitiveModulesPlugin by @OceanPresentChao in #4379
Bug Fixes π
- fix: the scheduled GitHub action should not run on forked repositories by @SyMind in #4514
- fix: class extends by @IWANABETHATGUY in #4481
Other Changes
- chore(runtime-diff): alignment of load script runtime module by @LingyuCoder in #4507
- chore(runtime-diff): alignment of startup entrypoint runtime module by @LingyuCoder in #4523
- chore: bump swc by @bvanjoi in #4533
- chore(CODEOWNERS): update some owners by @Boshen in #4535
- chore: replace querystring with fast-querystring in @rspack/core deps by @m1911star in #4530
- feat: support asset info source filename by @faga295 in #4013
New Contributors
- @m1911star made their first contribution in #4530
Full Changelog: v0.3.10...v0.3.11
v0.3.10
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 π
- fix: export default as edge case in
HarmonyExportImportedSpecifierDependency
by @IWANABETHATGUY in #4402 - fix: do not stopped when decode base64 failed by @bvanjoi in #4403
- fix: cjs bare exports expression detect by @ahabhgk in #4375
- fix: π pure expression dependency apply replace resouce,and get side effects state impl by @IWANABETHATGUY in #4407
- fix: use indirect call for TaggedTpl by @bvanjoi in #4412
- fix: fake namespace mode should fallthrough by @ahabhgk in #4413
- fix: loader definition not being exported by @h-a-n-a in #4423
- fix: insert the path of html template to fileDependencies by @bvanjoi in #4425
- fix: import/export with string literal by @ahabhgk in #4430
- fix: π export multiple export by @IWANABETHATGUY in #4444
- fix: use string as key for resolve.by_dependency by @bvanjoi in #4436
- fix: empty __resourceQuery replace by @ahabhgk in #4451
- fix: nested member chain by @IWANABETHATGUY in #4448
- fix: mark regexp as None when it has g or y flag for context module by @bvanjoi in #4457
- fix: not replace require when it not resolved by @bvanjoi in #4468
- fix: side effects analyze in exported decl or expr by @IWANABETHATGUY in #4463
- fix: the scheduled GitHub action should not run on forked repositories by @SyMind in #4469
- fix: not print the warning when use child compiler by @bvanjoi in #4477
- fix: duplicate entrypoint files by @ahabhgk in #4480
- fix: should have null as placeholder in stats chunks before chunkIds by @JSerFeng in #4310
- fix: windows stats snapshot by @ahabhgk in #4487
- fix: multiStats version by @ahabhgk in #4491
- fix: remove unnecessary normalize for
output.chunk_loading_global
by @bvanjoi in #4484
Other Changes
- chore: remove useless rustup target install by @jerrykingxyz in #4405
- chore: windows and macos add target before build by @jerrykingxyz in #4417
- chore: component style remains consistent by @btea in #4286
- chore: upgrade napi by @h-a-n-a in #4428
- chore: follow up fix for rust test by @ahabhgk in #4435
- chore: enable more webpack-test by @ahabhgk in #4447
- chore: add ./x webpack for run tests against webpack-test suites by @hardfist in #4460
- chore: optimize CI running speed by @jerrykingxyz in #4452
- chore: update rustc version by @bvanjoi in #4475
- chore: Adding the test toolkit which is used to diff the bundle results of rspack and webpack by @LingyuCoder in #4474
- chore: remove --no-frozen-lockfile when pnpm install by @jerrykingxyz in #4482
- chore(runtime-diff): alignment of auto public path runtime module by @LingyuCoder in #4488
- chore(runtime diff): cases for runtime modules not need to change by @LingyuCoder in #4490
- revert: should have null as placeholder in stats chunks before chunkIds by @JSerFeng in #4492
- chore: update pnpm lock file by @jerrykingxyz in #4493
- chore: alignment of async runtime module by @LingyuCoder in #4494
- chore(runtime-diff): alignment of create fake namespace object runtime module by @LingyuCoder in #4498
- chore(runtime-diff): alignment of get main filename by @LingyuCoder in #4501
- chore: check pnpm lockfile on ci by @jerrykingxyz in #4495
- chore(runtime-diff): alignment of global runtime module by @LingyuCoder in #4506
- chore(runtime-diff): alignment of get trusted type policy runtime module by @LingyuCoder in #4503
- refactor(plugin-react-refresh): using tsc to build by @chenjiahan in #4486
- chore: release do not use local cache by @jerrykingxyz in #4516
New Contributors
- @btea made their first contribution in #4286
- @SyMind made their first contribution in #4384
- @Austaras made their first contribution in #4497
Full Changelog: v0.3.8...v0.3.10