Highlights
rspackFuture.disableTransformByDefault
Default transformation was a default strategy for transform introduced v0.1.x. This introduced ton of problems during our daily development. For example, excluding node_modules for certain libraries are not supported, thus, which results in some mis-transformations.
From now on, you can opt-in experiments.rspackFuture.disableTransformByDefault = true
to disable the internal transformations. This greatly aligns Rspack with Webpack architecture. By enabling this option, these few options are not able to use anymore:
- builtins.react
- builtins.pluginImport
- builtins.emotion
- builtins.relay
- bulitins.presetEnv
- builtins.decorator
- target: target is now only supported to transform runtime code generated by Rspack, please refer to
builtin:swc-loader
for user code transformation for Rspack.
Builtin types(Rule.type) are removed in favor of webpack's web-standard bundling:
- jsx, jsx/auto, jsx/esm, jsx/dynamic
- ts, tsx
We will come up a new strategy to add back these DX friendly features in the future.
Instead, builtin:swc-loader is added for fine-grained transformation.
Please refer to this guide for the migration and details.
react-refresh migration
In this version, we'd like to introduce a better way to enable react fast refresh with @rspack/plugin-react-refresh, which is more powerful and flexible than builtins.react.refresh = true, now you can use it with builtin:swc-loader, swc-loader, or babel-loader.
Checkout docs for more details
Deprecating builtin:sass-loader
builtin:sass-loader is deprecated in favor of sass-loader. You can still use it in this and the next minor version. It will be officially removed in v0.5.0. See this for our deprecation stages.
Optimize the progress bar style
- Thinner and shorter lines
- Removed progress text
- Green color
Preview:
Screen.Recording.2023-09-15.at.17.44.51.mov
What's Changed
Something
Performance Improvements ⚡
Exciting New Features 🎉
- feat(rspack_core): oxc_resolver v0.2.0 by @Boshen in #4192
- feat: support disabling default transformation by @h-a-n-a in #4054
- feat(progress): optimize the progress bar style by @chenjiahan in #4197
- feat: disableReactRefreshByDefault future flag by @ahabhgk in #4196
- feat: export HMR plugin by @ahabhgk in #4199
- feat: deprecate
builtin:sass-loader
by @h-a-n-a in #4226 - feat: support
output.hotUpdateGlobal
by @ahabhgk in #4227 - feat: add side effects detect by @IWANABETHATGUY in #4215
- feat: builtin:react-refresh-loader by @ahabhgk in #4230
- feat: support
include
andexclude
of react-refresh-rspack-plugin by @h-a-n-a in #4233 - feat: support object external item value by @ahabhgk in #4234
Bug Fixes 🐞
- fix: shouldn't always apply react refresh plugin by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4194
- fix: fix module source-map by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4200
- fix: remove
react
fromrspackExperiments
ofbuiltin:swc-loader
by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4221 - fix: merge disableReactRefreshByDefault to disableTransformByDefault by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4220
- fix: missing rspack-only plugins on compiler.webpack by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4223
- fix: filter export imported specifier used name . by @IWANABETHATGUY in https://github.com/web-infra-dev/rspack/pull/4229
- fix: fix react-refresh
self
is not defined by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4232 - fix: react refresh test windows failed by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4242
- fix: avoid double react refresh transform in rspack-dev-server by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4243
- fix: passing option as
&str
caused memory leak inbuiltin:swc-loader
by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4235 - fix(chore): fix node path compatible problem & add express example by @hardfist in https://github.com/web-infra-dev/rspack/pull/4248
- fix: $RefreshReg$ is not defined error in node_modules by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4251
Other Changes
- chore: 🤖 generat webpack based tree shaking test snapshot. by @IWANABETHATGUY in #4186
- refactor: public path runtime module by @underfin in #4193
- style(rspack_plugin_progress): Change the formatting style to match WebpackBar by @Hamzakh777 in #4201
- test: pass more tree shaking test case by @IWANABETHATGUY in #4191
- chore: more tree shaking test2 by @IWANABETHATGUY in #4208
- refactor: change method on
ExportsInfoId
align to webpack by @IWANABETHATGUY in #4209 - chore: fix example dep by @h-a-n-a in #4218
- chore: fix example-emotion by @h-a-n-a in #4222
- chore: worklet example & express example by @hardfist in #4237
- chore: add builtins.react/... only works for transformByDefault tip by @9aoy in #4249
- chore: fix lockfile by @h-a-n-a in #4252
Full Changelog: v0.3.4...v0.3.5