@lynx-js/react-rsbuild-plugin 0.16.3 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Lower `let`/`const` to `var` in the build output for faster QuickJS parsing. The SWC `transform-block-scoping` pass is added to both the background and main-thread layers (on top of the existing target baseline), and rspack `output.environment.const` is set to `false` so bundler-generated runtime code also uses `var`. ([#2755](https://github.com/lynx-family/lynx-stack/pull/2755))
8
+
9
+ - Support a function form for `output.filename.bundle`. ([#2701](https://github.com/lynx-family/lynx-stack/pull/2701))
10
+
11
+ `output.filename.bundle` now accepts a function `(context: { lazyBundle: boolean; entryName?: string; platform: string }) => string` in addition to a string. The function is called once for the main bundle (`lazyBundle: false`) and once for the lazy bundles (`lazyBundle: true`), so a single config can control both the main bundle filename and the lazy bundle filename — without a dedicated `lazyBundle` field or a custom plugin.
12
+
13
+ ```js
14
+ import { execSync } from 'node:child_process'
15
+
16
+ import { defineConfig } from '@lynx-js/rspeedy'
17
+
18
+ const gitHash = execSync('git rev-parse --short HEAD').toString().trim()
19
+
20
+ export default defineConfig({
21
+ output: {
22
+ filename: {
23
+ bundle: ({ lazyBundle, platform }) =>
24
+ lazyBundle
25
+ ? `my-lazy-bundles/[name].[fullhash]-${gitHash}.bundle`
26
+ : `[name].${platform}.bundle`,
27
+ },
28
+ },
29
+ })
30
+ ```
31
+
32
+ - Support [Rsbuild v2](https://rsbuild.rs/guide/upgrade/v1-to-v2) and [Rspack v2](https://rspack.rs/guide/migration/rspack_1.x) in the React Rsbuild plugin, including the new CSS and JavaScript rule structure, Rspack-only refresh and CSS extraction plugins, top-level `splitChunks` handling, and Rspeedy profile configuration. ([#2603](https://github.com/lynx-family/lynx-stack/pull/2603))
33
+
34
+ - Express the SWC compilation baseline through `env` (a high `targets` plus an explicit `include` transform list) instead of `jsc.target`. The emitted build output is unchanged for existing projects. ([#2748](https://github.com/lynx-family/lynx-stack/pull/2748))
35
+
36
+ Because `env` and `jsc.target` are mutually exclusive in SWC, `tools.swc.jsc.target` is no longer accepted and now throws a clear error. To downlevel specific syntax, add the corresponding transforms to `tools.swc.env.include` instead — they extend the base/background baseline (the main thread keeps its fixed es2019 baseline, matching the previous `jsc.target` behavior).
37
+
38
+ ### Patch Changes
39
+
40
+ - Enrich the "Unknown property" validation error of `pluginReactLynx` to point users at `pluginLynxConfig` when they are trying to set a Lynx config. ([#2796](https://github.com/lynx-family/lynx-stack/pull/2796))
41
+
42
+ - Updated dependencies [[`e0aa6a3`](https://github.com/lynx-family/lynx-stack/commit/e0aa6a3f4fc8ba848a3a41789b3775a46fea24dc), [`409594b`](https://github.com/lynx-family/lynx-stack/commit/409594b9c51bb0c13f01c7d3f16949b27ebfdced), [`e0aa6a3`](https://github.com/lynx-family/lynx-stack/commit/e0aa6a3f4fc8ba848a3a41789b3775a46fea24dc), [`409594b`](https://github.com/lynx-family/lynx-stack/commit/409594b9c51bb0c13f01c7d3f16949b27ebfdced), [`9fffedb`](https://github.com/lynx-family/lynx-stack/commit/9fffedb68422bec3794cd714ced8057845b88eaf), [`d8be1ee`](https://github.com/lynx-family/lynx-stack/commit/d8be1ee6819c6bd43e4251e33ebb91d54aad35fd), [`409594b`](https://github.com/lynx-family/lynx-stack/commit/409594b9c51bb0c13f01c7d3f16949b27ebfdced), [`b839f19`](https://github.com/lynx-family/lynx-stack/commit/b839f1982d5a830ac8f3708435cce0f4b47cb15f), [`ac7d0eb`](https://github.com/lynx-family/lynx-stack/commit/ac7d0eb7b01f7302d5f69c783b0428938679255d), [`409594b`](https://github.com/lynx-family/lynx-stack/commit/409594b9c51bb0c13f01c7d3f16949b27ebfdced)]:
43
+ - @lynx-js/css-extract-webpack-plugin@0.8.0
44
+ - @lynx-js/template-webpack-plugin@0.12.0
45
+ - @lynx-js/react-refresh-webpack-plugin@0.4.0
46
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.2.0
47
+ - @lynx-js/react-webpack-plugin@0.9.4
48
+ - @lynx-js/react-alias-rsbuild-plugin@0.17.0
49
+ - @lynx-js/use-sync-external-store@1.5.0
50
+
3
51
  ## 0.16.3
4
52
 
5
53
  ### Patch Changes