Releases: web-infra-dev/rspack
0.2.4
What's Changed
Exciting New Features π
- feat: false for chunkLoading and asyncChunks by @ahabhgk in #3590
- feat: baseUri and publicPath for per entry by @ahabhgk in #3614
- feat: add entryOption hook by @annanShao in #3499
Bug Fixes π
- fix: react flow side effect analyze by @IWANABETHATGUY in #3592
- fix: WebpackDevServer typing import by @linbudu599 in #3559
- fix: adjust rspack/core dependencies by @jerrykingxyz in #3601
- fix: import export check invalidation on make stage by @jerrykingxyz in #3604
- fix: split chunk type filter & pass test for css url by @suxin2017 in #3600
- fix: side effects rule match by @IWANABETHATGUY in #3627
Other Changes
- refactor(cli): support for
.cts
γ.mts
and followstype: module
by @molvqingtai in #3222 - chore: add basic-ts example by @hyf0 in #3618
- chore: env plugin by @IWANABETHATGUY in #3596
- chore: π€ pass terser options by @IWANABETHATGUY in #3628
- chore(ci): should not add stale tag for awaiting more feedback issues by @hyf0 in #3624
- chore: exit if cargo returns any non-zero code by @h-a-n-a in #3623
- chore: add tsx in .vue in vue3-tsx example by @hardfist in #3622
New Contributors
- @linbudu599 made their first contribution in #3559
- @molvqingtai made their first contribution in #3222
Full Changelog: 0.2.3...0.2.4
v0.2.3
What's Changed
Performance Improvements β‘
- perf: compilation.*Dependencies cache results and merge call by @jerrykingxyz in #3536
- perf: π€ optimize tree shaking by @IWANABETHATGUY in #3547
Exciting New Features π
- feat(css): emit debug info in development mode by @hyf0 in #3531
- feat(core): support async-node target by @hardfist in #3468
- feat: support builtin swc-loader by @suxin2017 in #3382
- feat: add buildModule hook by @dmitry-stepanenko in #3466
- feat: custom runtime tree shaking by @IWANABETHATGUY in #3419
- feat(splitChunks): support
splitChunks.{cacheGroup}.type
by @hyf0 in #3569 - feat: easier way for converting
JsRegExp
toRspackRegex
by @hyf0 in #3574 - feat: chunkLoading for per entry by @ahabhgk in #3584
Bug Fixes π
- fix(css): should skip when
last_module == selected_module
and align more with Webpack by @hyf0 in #3535 - fix: example angular bundle size is a lot bigger than webpack by @IWANABETHATGUY in #3514
- fix: π ignore github ID for typos check by @IWANABETHATGUY in #3540
- fix: migrate more webpack library test by @underfin in #3376
- fix: windows ci by @underfin in #3560
- fix: do not expose non-webpack node interfaces by @h-a-n-a in #3542
- fix: code generation cache not working by @jerrykingxyz in #3577
- fix: Wasm sideEffect analysis failed by @IWANABETHATGUY in #3563
- fix: create rspack project template by @caohuilin in #3585
- fix: rspack serve will automatically rebuild once by @jerrykingxyz in #3586
Other Changes
- refactor(css): Remove unnecessary and structure code, add comments by @hyf0 in #3529
- chore: toolchain channel vision by @suxin2017 in #3538
- chore: add project governance by @Boshen in #3537
- test: π support test.filter.js return string by @IWANABETHATGUY in #3541
- ci: use debug build for tests by @Boshen in #3374
- chore: correct comments by @hyf0 in #3549
- refactor(crates/rspack_plugin_javascript):
builtins.define
should not rely onGlobalPassOptions
by @Hamzakh777 in #3516 - refactor: EntryOptions and EntryPlugin by @ahabhgk in #3545
- test(webpack): enable some tests related to splitChunks by @hyf0 in #3566
- test(webpack): enable loader cases by @h-a-n-a in #3568
- chore: Update PULL_REQUEST_TEMPLATE.md by @Boshen in #3570
- refactor(rspack_regex): readability and functionality by @hyf0 in #3573
- chore: add vue3-tsx example by @h-a-n-a in #3578
- test: π€ banner plugin by @IWANABETHATGUY in #3579
New Contributors
- @Hamzakh777 made their first contribution in #3516
Full Changelog: 0.2.2...0.2.3
v0.2.2
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 deprecatebuliltins.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
tosplitChunks.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 π
- fix: partially fix polyfill by @h-a-n-a in #3469
- fix(splitChunk): custom cacheGroup default priority consistent with webpack by @9aoy in #3482
- fix: dynamic import may generate invalid module ids by @chenjiahan in #3475
- fix(provide): fix object-expr by @suxin2017 in #3486
- fix: Base64Error caused by unclean base64 by @ahabhgk in #3494
- fix(deps): use
[email protected]
to supportnode@^14.17
by @hyf0 in #3510
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
- @cheerioInf made their first contribution in #3487
Full Changelog: 0.2.1...0.2.2
v0.2.1
What's Changed
Exciting New Features π
- feat: nested module rules by @ahabhgk in #3380
- feat: support compiler.hooks.assetEmitted by @jerrykingxyz in #3387
- feat: make options having a single source of truth by @hyf0 in #3378
- feat: resource within scheme by @ahabhgk in #3367
- feat: support file uri by @ahabhgk in #3397
- feat: add finishMake hook by @dmitry-stepanenko in #3390
- feat: create-rspack add template-vue by @faga295 in #2153
- feat: Add 'succeedModule' and 'stillValidModule' hooks by @annanShao in #3318
- feat(config): friendly config error message by @hyf0 in #3413
- feat(config): zod schema for optimization by @hyf0 in #3416
- feat(splitChunks): support passing
false
tosplitChunks.{cacheGroup}.xxx
by @hyf0 in #3420 - feat: electron support by @ahabhgk in #3414
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
- chore: π€ disable for now by @IWANABETHATGUY in #3384
- chore: π€ tweak word case by @IWANABETHATGUY in #3389
- chore: update vue example by @h-a-n-a in #3386
- chore: delete npm folder by @hardfist in #3394
- chore: add back vue build by @h-a-n-a in #3393
- chore: remove commit step when publishing by @hardfist in #3395
- chore: add back npm packages for local publishing by @h-a-n-a in #3396
- chore: add vue2-ts example by @hardfist in #3398
- chore: support short build commands by @h-a-n-a in #3400
- chore(packages): upload less files to npm by @Boshen in #3362
- chore: fix release mr by @hardfist in #3427
- chore: add release nigthly after full release by @hardfist in #3429
- chore(webpack-test): --forceExit for open handles by @Boshen in #3432
- chore: fix binding by @hardfist in #3443
- test: webpack cache deps test to file deps test by @jerrykingxyz in #3445
New Contributors
- @dmitry-stepanenko made their first contribution in #3390
- @annanShao made their first contribution in #3318
Full Changelog: 0.2.0...0.2.1
v0.2.0
Rspack 0.2.0 is out!
Read the announcement blog post: Announcing Rspack 0.2.
Overview
Official vue-loader support π
And also
- realContentHash support
- DataURI support
- ESM output support
- Configurable SplitChunksPlugin support
- Webpack Compatibility Updates: style-loader, css-loader, node-loader, svelte-loader and ForkTsCheckerWebpackPlugin and more
- Framework Ecosystem Updates: NestJS, Storybook React (5 - 10 times faster)
- More hooks and Loader APIs
- and more...
What's Changed
Breaking Changes π
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 matchingimport.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 π
- feat: port
ImportMetaPlugin
of Webpack by @underfin in #2684 - feat(cli): enable strictCommand & strictOption check by @hardfist in #2723
- feat: passthrough panics for parallel-running futures by @h-a-n-a in #2737
- feat(html):
builtins.html
should inject<script src="xxxx.js" />
in<head />
by @suxin2017 in #2770 - feat: πΈ export info support by @IWANABETHATGUY in #2776
- feat: add chunkFormat & chunkLoading & enabledChunkLoadingTypes config by @underfin in #2792
- feat: impl new
loader-runner
for preparing to supportvue-loader
andpitching loader
by @h-a-n-a in #2789 - feat: support complex magical comment
import(/* webpackChunkName: "/dist/d/js_d" */ "./d")
by @suxin2017 in #2812 - feat: support
experiments.outputModule
by @underfin in #2803 - chore: π€ optimize code completion of config.target by @IWANABETHATGUY in #2826
- feat: support
npx rspack preview
by @faga295 in #2434 - feat: implement built-in
BannerPlugin
by @9aoy in #2819 - feat(hook): add
optimizeModules
hook by @nieyuyao in #2758 - feat: add ImportScriptsChunkLoadingPlugin by @underfin in #2839
- feat: support loader-runner and pitching by @h-a-n-a in #2808
- feat: support
Rule.enforce
by @h-a-n-a in #2862 - feat: chunk asset hook by @IWANABETHATGUY in #2603
- feat: support passing function to
externals
by @underfin in #2866 - feat: add moduleAssets for stats by @ahabhgk in #2864
- feat: support inline loader by @h-a-n-a in #2867
- feat: πΈ compiler. getCache by @IWANABETHATGUY in #2892
- feat: require.resolve and require.resolveWeak for string literal by @ahabhgk in #2888
- feat: external module render with node-commonjs & module by @underfin in #2906
- feat(@rspack/core): add typings about
LoaderDefinition
by @Asuka109 in #2908 - feat: enable compression and cache with
noEmitAssets: true
by @hyf0 in #2907 - feat: support experiments.css by @hardfist in #2930
- feat(cli): add --entry flags by @faga295 in #2902
- feat: add compatible compilation.modules by @IWANABETHATGUY in #2932
- feat: add comments in module code generation by @faga295 in #2893
- feat: asset resource side effects by @IWANABETHATGUY in #2849
- feat(new_split_chunks): support
splitChunks.minSize
by @hyf0 in #2954 - feat: support minifyoptions extract comments by @faga295 in #2882
- feat(create-rspack): add template react-ts by @wood3n in #2963
- feat(terser): expose terser options by @dgmachado in #2983
- feat(x.mjs): add
x clean
command by @Boshen in #2980 - feat(new_split_chunks): support
reuseExistingChunk
by @hyf0 in #3000 - feat(rspack): add ignoreWarnings option by @nagy-nabil in #2987
- feat(new_split_chunks): support
splitChunks.{cacheGroup}.minSize
by @hyf0 in #3015 - feat: support inline match resource by @h-a-n-a in #3017
- feat(new_split_chunks): support
splitChunks.name
by @hyf0 in #2955 - feat: simple normal module hook by @IWANABETHATGUY in #2446
- feat: allow to pass
false
tosplitChunks.name
andsplitChunks.{cacheGroup}.name
by @hyf0 in #3029 - feat(module factory): add before_resolve hook by @suxin2017 in #2940
- feat(rust): add output.sourceMapFilename core by @lippzhang in #3005
- feat: optimization.realContentHash by @ahabhgk in #2984
- feat(angular): adding initial support by @zackarychapple in #3009
- feat: optional-dependency by @suxin2017 in #3050
- 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
- feat(core): support webpack-manifest-plugin by @hardfist in #3163
- feat(library): support system.js by @suxin2017 in https://github.com/web-infra-...
v0.1.12
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 β‘
- perf: skip call chunkAsset hook when not in use by @jerrykingxyz in #3228
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
andRule.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 π
- fix(license-plugin): add support for license-plugin in case of perChunkOutput as false by @dgmachado in #3172
- fix: π don't crash when export * of external module by @IWANABETHATGUY in #3167
- fix(magic_comment): support '()' by @suxin2017 in #3179
- fix: add experiments.css schema by @9aoy in #3183
- fix(plugin-node-polyfill): remove console polyfill by @KyrieLii in #3191
- fix: wasm loading runtime on node-18 by @ahabhgk in #3197
- fix: render exports for esm output at hmr by @underfin in #3194
- fix: export-all-from-side-effects-free-commonjs by @IWANABETHATGUY in #3181
- fix: fix provide can't be override by user by @zhangliu in #3201
- fix: provided dependency generated code not stable by @ahabhgk in #3204
- fix: ci clippy by @IWANABETHATGUY in #3208
- fix: context module elimated by @IWANABETHATGUY in #3151
- fix: π amd external-array by @IWANABETHATGUY in #3226
- fix(dev-client): remove some unused dependencies by @chenjiahan in #3244
- fix:
source
could be unavailable if asset was deleted by @h-a-n-a in #3250 - fix(core): upgrade regress to 0.6.0 to fix regress compile regex error by @hardfist in #3251
Other Changes
- chore: π€ fix cargo test crash by @IWANABETHATGUY in #3178
- refactor: compilation getPath by @ahabhgk in #3143
- chore: console error info when ./x failed by @hardfist in #3175
- chore: fix arco-pro example crashing in debug mode by @Boshen in #3192
- chore: fix arco-pro crash again by @hardfist in #3195
- chore: fix fix-issue-3873 crash by @hardfist in #3196
- chore: fix node16 tests by @hardfist in #3200
- ci: add test Node.js v18 by @Boshen in #3168
- chore: fix jest crash on node by @hardfist in #3206
- ci: create issue in rspack-website when a pr is merged with "need documentation" label by @Boshen in #3211
- chore: add repro link to the bug issue template by @Boshen in #3225
- chore: add
x ready
command for running everything by @Boshen in #3230 - ci: remove unnecessary
test
option from reusable-build by @Boshen in #3245 - ci: automatically create Tuesday's release PR by @Boshen in #3248
- chore: add debug shell by @hardfist in #3261
- chore: fix debug shell by @hardfist in #3264
- ci: remove nightly step from full release by @Boshen in #3265
- chore: progressively migrate webpack test case by @IWANABETHATGUY in #3256
New Contributors
- @zhangliu made their first contribution in #3201
- @edusperoni made their first contribution in #3235
Full Changelog: v0.1.11...v0.1.12
v0.1.11
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.
Support optimization.removeEmptyChunks
Tells Rspack to detect and remove chunks which are empty. Setting optimization.removeEmptyChunks to false will disable this optimization.
Support splitChunks.{cacheGroup}.enforce
What's Changed
Performance Improvements β‘
- perf: π€ optimize regex by @IWANABETHATGUY in #3113
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 π
- fix(rspack_plugin_javascript): remove empty whitespace from runtime by @Boshen in #3083
- fix: add correct chunk group runtime for multiply entry single runtime by @underfin in #3094
- fix: rebuild loses error messages by @jerrykingxyz in #3101
- fix(emotion): should use source code for computing hash by @hyf0 in #3100
- fix: replace wrong with unicode by @ahabhgk in #3102
- fix: fix esbuild iife for minify plugin by @hardfist in #3107
- fix(context module): should escape context module regex by @suxin2017 in #3037
- fix: π tree shaking nuxt error by @IWANABETHATGUY in #3125
- fix(create-rspack): fix compatible problem with node@14 by @hardfist in #3159
- fix: call devServer.invalidate() panic by @jerrykingxyz in #3105
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
forBox<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
to5.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
- @sladyn98 made their first contribution in #2831
- @GarrisonD made their first contribution in #3156
Full Changelog: v0.1.10...v0.1.11
v0.1.10
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 π
- feat: support experiments.css by @hardfist in #2930
- feat(cli): add --entry flags by @faga295 in #2902
- feat: add compatible compilation.modules by @IWANABETHATGUY in #2932
- feat: add comments in module code generation by @faga295 in #2893
- feat: asset resource side effects by @IWANABETHATGUY in #2849
- feat(new_split_chunks): support
splitChunks.minSize
by @hyf0 in #2954 - feat: support minifyoptions extract comments by @faga295 in #2882
- feat(create-rspack): add template react-ts by @wood3n in #2963
- feat(terser): expose terser options by @dgmachado in #2983
- feat(x.mjs): add
x clean
command by @Boshen in #2980 - feat(new_split_chunks): support
reuseExistingChunk
by @hyf0 in #3000 - feat(rspack): add ignoreWarnings option by @nagy-nabil in #2987
- feat(new_split_chunks): support
splitChunks.{cacheGroup}.minSize
by @hyf0 in #3015 - feat: support inline match resource by @h-a-n-a in #3017
- feat(new_split_chunks): support
splitChunks.name
by @hyf0 in #2955 - feat: simple normal module hook by @IWANABETHATGUY in #2446
- feat: allow to pass
false
tosplitChunks.name
andsplitChunks.{cacheGroup}.name
by @hyf0 in #3029 - feat(module factory): add before_resolve hook by @suxin2017 in #2940
- feat(rust): add output.sourceMapFilename core by @lippzhang in #3005
- feat: optimization.realContentHash by @ahabhgk in #2984
- feat(angular): adding initial support by @zackarychapple in #3009
- feat: optional-dependency by @suxin2017 in #3050
Bug Fixes π
- fix: benchmark CI failed. by @IWANABETHATGUY in #2928
- fix: add missing
newSplitChunks
in schema.js by @hyf0 in #2934 - fix: require.resolve(Weak) should eval to true in if stmt test expr by @ahabhgk in #2935
- fix: should not reset
is_founded
inReactRefreshUsage
by @underfin in #2939 - fix: cannot reading
noEmitAssets
by @faga295 in #2942 - fix: hash chunkLoadingGlobal by @underfin in #2946
- fix: π use unknown module type in SWC by @JSerFeng in #2406
- fix(resolve): relative path resolve bug by @jerrykingxyz in #2952
- fix: π unexpected export warning by @IWANABETHATGUY in #2959
- fix: Fix type checking in config examples by @danielkoller in #2965
- fix(react-hmr): inject the runtime global function by @hyf0 in #2977
- fix: add entry startup to fix async script chunk loading by @underfin in #2966
- fix: entry startup for target node by @underfin in #3006
- fix: circular dependencies rebuild panic by @jerrykingxyz in #3001
- fix(core): fix require(
./xxx/xx.js
) failed by @hardfist in #3014 - fix(core): compatible with stats.version by @hardfist in #3016
- fix(new_split_chunks): should not care about
reuseExistingChunk
if name is specified forCacheGroup
by @hyf0 in #3045 - fix: π cross compile by @IWANABETHATGUY in #3059
- fix: css url generate with auto public path by @ahabhgk in #3061
- fix: already split module should connect chunk group at multiply entry by @underfin in #3057
- fix(resolve): bump nodejs-resolver to fix baseUrl bug in tsconfig by @bvanjoi in #3072
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...
v0.1.9
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 matchingimport.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 π
- feat: add chunkFormat & chunkLoading & enabledChunkLoadingTypes config by @underfin in #2792
- feat: impl new
loader-runner
for preparing to supportvue-loader
andpitching loader
by @h-a-n-a in #2789 - feat: support complex magical comment
import(/* webpackChunkName: "/dist/d/js_d" */ "./d")
by @suxin2017 in #2812 - feat: support
experiments.outputModule
by @underfin in #2803 - chore: π€ optimize code completion of config.target by @IWANABETHATGUY in #2826
- feat: support
npx rspack preview
by @faga295 in #2434 - feat: implement built-in
BannerPlugin
by @9aoy in #2819 - feat(hook): add
optimizeModules
hook by @nieyuyao in #2758 - feat: add ImportScriptsChunkLoadingPlugin by @underfin in #2839
- feat: support loader-runner and pitching by @h-a-n-a in #2808
- feat: support
Rule.enforce
by @h-a-n-a in #2862 - feat: chunk asset hook by @IWANABETHATGUY in #2603
- feat: support passing function to
externals
by @underfin in #2866 - feat: add moduleAssets for stats by @ahabhgk in #2864
- feat: support inline loader by @h-a-n-a in #2867
- feat: πΈ compiler. getCache by @IWANABETHATGUY in #2892
- feat: require.resolve and require.resolveWeak for string literal by @ahabhgk in #2888
- feat: external module render with node-commonjs & module by @underfin in #2906
- feat(@rspack/core): add typings about
LoaderDefinition
by @Asuka109 in #2908 - feat: enable compression and cache with
noEmitAssets: true
by @hyf0 in #2907
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 defaultresolve.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
- ci: set fail-fast: false for matrix builds by @Boshen in #2796
- chore: π€ revert examples basic by @IWANABETHATGUY in #2799
- ci: only cache Rust builds on the main branch by @Boshen in #2798
- refactor: SplitChunksPlugin by @hyf0 in #2782
- chore: fix lock by @h-a-n-a in #2805
- test: webpack compatibility metric by @IWANABETHATGUY in #2745
- ci: fix fail-fast by @Boshen in #2809
- chore: π€ check node binding lock file by @IWANABETHATGUY in #2814
- ci: share rust target directory in check-rs by @Boshen in #2818
- chore: remove ./x and Makefile and replace them with npm scripts by @hyf0 in #2825
- chore: bump sugar_path to 0.0.12 by @Boshen in #2830
- ci: πCI ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL by @IWANABETHATGUY in #2833
- chore: scripts should be ESM by default by @hyf0 in #2827
- ci: install pnpm in benchmark CI by @hyf0 in #2836
- test: webpack examples by @IWANABETHATGUY in #2793
- chore: π€ add common-check.yaml and fix ci by @IWANABETHATGUY in #2847
- chore: use
zx
to replace xtask by @hyf0 in #2840 - chore: π€ update benchmark link by @IWANABETHATGUY in #2848
- refactor:
crates/rspack_plugin_javascript/src/visitors/dependency/util.rs
by @hyf0 in #2865 - refactor(runtime): unwrap the function in ir by @bvanjoi in #2860
- refactor: align
starts_with
with the same semantics by @hyf0 in #2872 - refactor: Make
check_changeset.cjs
ESM and use ZX by @hyf0 in #2878 - chore: should exit if the exitCode is not zero at
check_changeset.js
by @hyf0 in #2880 - chore: fix peerDep of rspack-plugin-html by @hardfist in #2876
- chore: fix
make-threejs10x.js
script by @hyf0 in #2887 - chore: prettier example code by @hardfist in #2889
- chore: π€ bump napi retry by @IWANABETHATGUY in #2784
- chore: add more examples by @hardfist in #2896
New Contributors
- @GiveMe-A-Name made their first contribution in #2835
- @lippzhang made their first contribution in #2861
- @Asuka109 made their first contribution in #2908
Full Changelog: v0.1.8...v0.1.9
v0.1.8
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 π
- feat: port
ImportMetaPlugin
of Webpack by @underfin in #2684 - feat(cli): enable strictCommand & strictOption check by @hardfist in #2723
- feat: passthrough panics for parallel-running futures by @h-a-n-a in #2737
- feat(html):
builtins.html
should inject<script src="xxxx.js" />
in<head />
by @suxin2017 in #2770 - feat: πΈ export info support by @IWANABETHATGUY in #2776
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
- chore: split test by @hardfist in #2703
- chore: remove the prefix of title in GitHub issue template by @hyf0 in #2698
- test: long test.js by @IWANABETHATGUY in #2708
- chore: fix GitHub issue template by @hyf0 in #2718
- chore: check bump in ci by @hardfist in #2716
- chore: add datetime to nightly version by @hardfist in #2720
- chore: add graph of contributors by @hyf0 in #2726
- test: finish all webpack test migration by @IWANABETHATGUY in #2709
- chore: use copilot in PR template by default by @hyf0 in #2729
- chore: Improve PR template by @hyf0 in #2730
- chore: add codeowner for crate error by @h-a-n-a in #2736
- ci(release): Refactor release script with reusable workflow by @Boshen in #2597
- chore: remove continue-on-error from reusable-build by @Boshen in #2743
- ci: remove invalid "description" field from release-canary by @Boshen in #2746
- chore: bump swc 0.74.6 by @underfin in #2657
- chore: introduce zx, corepack and setup script by @hyf0 in #2754
- chore: fix typo by @hyf0 in #2755
- chore: remove
zx
in setup script by @hyf0 in #2756 - style: fix clippy warning by @siyou in #2764
- chore: Add release.yml by @hyf0 in #2765
- ci: labeling PR with release: xxx automatically by @hyf0 in #2767
- chore: ignore the PRs created by github-actions in release notes by @hyf0 in #2766
- chore: improve structrue of PULL_REQUEST_TEMPLATE.md by @hyf0 in #2769
- chore: π€ bump napi by @IWANABETHATGUY in #2717
- chore: Revert "chore: π€ bump napi (#2717)" by @IWANABETHATGUY in #2783
- chore: update and lock pnpm to 7.32.0 by @zakuru in #2780
- chore: fine grained lint stage by @IWANABETHATGUY in #2794
New Contributors
Full Changelog: v0.1.7...v0.1.8