@lynx-js/react-rsbuild-plugin-canary 0.18.0 → 0.18.1-canary-20260716-e75b5619

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +64 -60
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.18.1-canary-20260716090211-e75b5619c567d9fd28897990281f6332bf6d88c4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @lynx-js/template-webpack-plugin@0.13.1-canary-20260716090211-e75b5619c567d9fd28897990281f6332bf6d88c4
9
+ - @lynx-js/css-extract-webpack-plugin@0.9.0
10
+ - @lynx-js/react-webpack-plugin@0.10.0
11
+ - @lynx-js/react-alias-rsbuild-plugin@0.18.1-canary-20260716090211-e75b5619c567d9fd28897990281f6332bf6d88c4
12
+
3
13
  ## 0.18.0
4
14
 
5
15
  ### Minor Changes
@@ -15,7 +25,7 @@
15
25
  loader.
16
26
 
17
27
  ```js
18
- import('./Foo.jsx', { with: { mode: 'sync' | 'async' } })
28
+ import("./Foo.jsx", { with: { mode: "sync" | "async" } });
19
29
  ```
20
30
 
21
31
  Force a loader regardless of `engineVersion` with the `REACT_LAZY_BUNDLE_FETCHER`
@@ -27,14 +37,14 @@
27
37
 
28
38
  ```js
29
39
  pluginReactLynx({
30
- firstScreenSyncTiming: 'manual',
31
- })
40
+ firstScreenSyncTiming: "manual",
41
+ });
32
42
  ```
33
43
 
34
44
  ```js
35
- import { markFirstScreenSyncReady } from '@lynx-js/react'
45
+ import { markFirstScreenSyncReady } from "@lynx-js/react";
36
46
 
37
- markFirstScreenSyncReady()
47
+ markFirstScreenSyncReady();
38
48
  ```
39
49
 
40
50
  ### Patch Changes
@@ -42,8 +52,8 @@
42
52
  - Add `compat.legacySlot` to `pluginReactLynx`. When enabled, dynamic children are compiled to the pre-SlotV2 form (JSX `children` + `wrapper` elements + `__DynamicPartChildren`/`__DynamicPartSlot` symbols instead of `$0`/`$1` slot props + `SlotV2`), so the compiled output stays compatible with legacy runtimes without `SlotV2` support (`< 0.120.0`, which shipped the SlotV2 refactor in #1764) — e.g. a standalone lazy bundle consumed by a host App that ships an older runtime. ([#2947](https://github.com/lynx-family/lynx-stack/pull/2947))
43
53
 
44
54
  ```js
45
- import { defineConfig } from '@lynx-js/rspeedy'
46
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
55
+ import { defineConfig } from "@lynx-js/rspeedy";
56
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
47
57
 
48
58
  export default defineConfig({
49
59
  plugins: [
@@ -53,7 +63,7 @@
53
63
  },
54
64
  }),
55
65
  ],
56
- })
66
+ });
57
67
  ```
58
68
 
59
69
  The default (SlotV2) codegen is unchanged, and the runtime keeps supporting both forms.
@@ -113,11 +123,11 @@
113
123
  `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.
114
124
 
115
125
  ```js
116
- import { execSync } from 'node:child_process'
126
+ import { execSync } from "node:child_process";
117
127
 
118
- import { defineConfig } from '@lynx-js/rspeedy'
128
+ import { defineConfig } from "@lynx-js/rspeedy";
119
129
 
120
- const gitHash = execSync('git rev-parse --short HEAD').toString().trim()
130
+ const gitHash = execSync("git rev-parse --short HEAD").toString().trim();
121
131
 
122
132
  export default defineConfig({
123
133
  output: {
@@ -128,7 +138,7 @@
128
138
  : `[name].${platform}.bundle`,
129
139
  },
130
140
  },
131
- })
141
+ });
132
142
  ```
133
143
 
134
144
  - 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))
@@ -241,7 +251,6 @@
241
251
  ### Minor Changes
242
252
 
243
253
  - feat: support `optimizeBundleSize` option to remove unused code for main-thread and background. ([#2336](https://github.com/lynx-family/lynx-stack/pull/2336))
244
-
245
254
  - If `optimizeBundleSize` is `true` or `optimizeBundleSize.background` is `true`, `lynx.registerDataProcessors` calls will be marked as pure for the background thread output.
246
255
  - If `optimizeBundleSize` is `true` or `optimizeBundleSize.mainThread` is `true`, `NativeModules.call` and `lynx.getJSModule` calls will be marked as pure for the main-thread output.
247
256
 
@@ -268,7 +277,6 @@
268
277
  Upgrade preact from [f7693b72](https://github.com/preactjs/preact/commit/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0) to [55254ef7](https://github.com/preactjs/preact/commit/55254ef7021e563cc1a86fb816058964a1b6a29a), see diffs at [f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).
269
278
 
270
279
  - feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
271
-
272
280
  - When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
273
281
  - Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
274
282
 
@@ -437,8 +445,8 @@
437
445
  With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
438
446
 
439
447
  ```js
440
- import { defineConfig } from '@lynx-js/rspeedy'
441
- import { pluginBabel } from '@rsbuild/plugin-babel'
448
+ import { defineConfig } from "@lynx-js/rspeedy";
449
+ import { pluginBabel } from "@rsbuild/plugin-babel";
442
450
 
443
451
  export default defineConfig({
444
452
  plugins: [
@@ -446,17 +454,17 @@
446
454
  include: /\.(?:jsx|tsx)$/,
447
455
  babelLoaderOptions(opts) {
448
456
  opts.plugins?.unshift([
449
- 'babel-plugin-react-compiler',
457
+ "babel-plugin-react-compiler",
450
458
  // See https://react.dev/reference/react-compiler/configuration for config
451
459
  {
452
460
  // ReactLynx only supports target to version 17
453
- target: '17',
461
+ target: "17",
454
462
  },
455
- ])
463
+ ]);
456
464
  },
457
465
  }),
458
466
  ],
459
- })
467
+ });
460
468
  ```
461
469
 
462
470
  - Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
@@ -659,28 +667,28 @@
659
667
 
660
668
  ```ts
661
669
  type InlineChunkTestFunction = (params: {
662
- size: number
663
- name: string
664
- }) => boolean
670
+ size: number;
671
+ name: string;
672
+ }) => boolean;
665
673
 
666
- type InlineChunkTest = RegExp | InlineChunkTestFunction
674
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
667
675
 
668
676
  type InlineChunkConfig =
669
677
  | boolean
670
678
  | InlineChunkTest
671
- | { enable?: boolean | 'auto', test: InlineChunkTest }
679
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
672
680
  ```
673
681
 
674
682
  ```ts
675
- import { defineConfig } from '@lynx-js/rspeedy'
683
+ import { defineConfig } from "@lynx-js/rspeedy";
676
684
 
677
685
  export default defineConfig({
678
686
  output: {
679
687
  inlineScripts: ({ name, size }) => {
680
- return name.includes('foo') && size < 1000
688
+ return name.includes("foo") && size < 1000;
681
689
  },
682
690
  },
683
- })
691
+ });
684
692
  ```
685
693
 
686
694
  - Updated dependencies [[`51cb73d`](https://github.com/lynx-family/lynx-stack/commit/51cb73dd0b77d35540644cdd2e6c37db856f0e8a), [`69fb042`](https://github.com/lynx-family/lynx-stack/commit/69fb0420e297abf768c889769c95a207c480b3c7), [`a7e8b5b`](https://github.com/lynx-family/lynx-stack/commit/a7e8b5bbbab0490e7cf6f47581130e7b32739abb)]:
@@ -760,13 +768,13 @@
760
768
  example:
761
769
 
762
770
  ```js
763
- import { defineConfig } from '@lynx-js/rspeedy'
771
+ import { defineConfig } from "@lynx-js/rspeedy";
764
772
 
765
773
  export default defineConfig({
766
774
  output: {
767
775
  inlineScripts: false,
768
776
  },
769
- })
777
+ });
770
778
  ```
771
779
 
772
780
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -824,7 +832,6 @@
824
832
  - Refactor: Replace built-in `background-only` implementation with npm package ([#602](https://github.com/lynx-family/lynx-stack/pull/602))
825
833
 
826
834
  Previously we maintained custom files:
827
-
828
835
  - `empty.ts` for background thread
829
836
  - `error.ts` for main thread validation
830
837
 
@@ -853,7 +860,7 @@
853
860
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
854
861
 
855
862
  ```js
856
- import { defineConfig } from '@lynx-js/rspeedy'
863
+ import { defineConfig } from "@lynx-js/rspeedy";
857
864
 
858
865
  export default defineConfig({
859
866
  tools: {
@@ -865,7 +872,7 @@
865
872
  },
866
873
  },
867
874
  },
868
- })
875
+ });
869
876
  ```
870
877
 
871
878
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -1041,7 +1048,7 @@
1041
1048
  You may turn it off using `output.minify.css: false`:
1042
1049
 
1043
1050
  ```js
1044
- import { defineConfig } from '@lynx-js/rspeedy'
1051
+ import { defineConfig } from "@lynx-js/rspeedy";
1045
1052
 
1046
1053
  export default defineConfig({
1047
1054
  output: {
@@ -1049,18 +1056,18 @@
1049
1056
  css: false,
1050
1057
  },
1051
1058
  },
1052
- })
1059
+ });
1053
1060
  ```
1054
1061
 
1055
1062
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
1056
1063
 
1057
1064
  ```js
1058
- import { defineConfig } from '@lynx-js/rspeedy'
1059
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
1065
+ import { defineConfig } from "@lynx-js/rspeedy";
1066
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
1060
1067
 
1061
1068
  export default defineConfig({
1062
1069
  plugins: [pluginCssMinimizer()],
1063
- })
1070
+ });
1064
1071
  ```
1065
1072
 
1066
1073
  ### Patch Changes
@@ -1114,7 +1121,6 @@
1114
1121
 
1115
1122
  - 7b84edf: feat(web): introduce new output chunk format
1116
1123
  - 39efd7c: Change `enableRemoveCSSScope` defaults from `undefined` to `true`, now `enableRemoveCSSScope` can be:
1117
-
1118
1124
  - `true` (by default): All CSS files are treated as global CSS.
1119
1125
  - `false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.
1120
1126
  - `undefined`: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues.
@@ -1140,18 +1146,18 @@
1140
1146
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
1141
1147
 
1142
1148
  ```js
1143
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
1144
- import { defineConfig } from '@lynx-js/rspeedy'
1149
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
1150
+ import { defineConfig } from "@lynx-js/rspeedy";
1145
1151
 
1146
1152
  export default defineConfig({
1147
1153
  plugins: [
1148
1154
  pluginReactLynx({
1149
1155
  defineDCE: {
1150
- __SOME_FALSE_DEFINE__: 'false',
1156
+ __SOME_FALSE_DEFINE__: "false",
1151
1157
  },
1152
1158
  }),
1153
1159
  ],
1154
- })
1160
+ });
1155
1161
  ```
1156
1162
 
1157
1163
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -1159,20 +1165,20 @@
1159
1165
  For example, `import` initialized by dead code will be removed:
1160
1166
 
1161
1167
  ```js
1162
- import { foo } from 'bar'
1168
+ import { foo } from "bar";
1163
1169
 
1164
1170
  if (__SOME_FALSE_DEFINE__) {
1165
- foo()
1166
- console.log('dead code')
1171
+ foo();
1172
+ console.log("dead code");
1167
1173
  } else {
1168
- console.log('reachable code')
1174
+ console.log("reachable code");
1169
1175
  }
1170
1176
  ```
1171
1177
 
1172
1178
  will be transformed to:
1173
1179
 
1174
1180
  ```js
1175
- console.log('reachable code')
1181
+ console.log("reachable code");
1176
1182
  ```
1177
1183
 
1178
1184
  - Updated dependencies [8dd6cca]
@@ -1191,7 +1197,6 @@
1191
1197
  - 958efda: feat(web): bundle background.js into main-thread.js for web
1192
1198
 
1193
1199
  To enable this feature:
1194
-
1195
1200
  1. set the performance.chunkSplit.strategy to `all-in-one`
1196
1201
  2. use the `mode:'production'` to build
1197
1202
 
@@ -1215,18 +1220,18 @@
1215
1220
  - a30c83d: Add `compat.removeComponentAttrRegex`.
1216
1221
 
1217
1222
  ```js
1218
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
1219
- import { defineConfig } from '@lynx-js/rspeedy'
1223
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
1224
+ import { defineConfig } from "@lynx-js/rspeedy";
1220
1225
 
1221
1226
  export default defineConfig({
1222
1227
  plugins: [
1223
1228
  pluginReactLynx({
1224
1229
  compat: {
1225
- removeComponentAttrRegex: 'YOUR REGEX',
1230
+ removeComponentAttrRegex: "YOUR REGEX",
1226
1231
  },
1227
1232
  }),
1228
1233
  ],
1229
- })
1234
+ });
1230
1235
  ```
1231
1236
 
1232
1237
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -1238,18 +1243,17 @@
1238
1243
 
1239
1244
  - 36f8e4c: Add `enableAccessibilityElement`.
1240
1245
  - b37e3d9: Enforced build-time errors for importing `background-only` modules in the `main-thread`.
1241
-
1242
1246
  - use `import 'background-only'` to mark a module as restricted to the background environment. Any attempt to import such a module in the main thread will result in a build-time error.
1243
1247
 
1244
1248
  For example:
1245
1249
 
1246
1250
  ```javascript
1247
1251
  // bar.ts
1248
- import 'background-only'
1252
+ import "background-only";
1249
1253
 
1250
1254
  export const bar = () => {
1251
- return 'bar'
1252
- }
1255
+ return "bar";
1256
+ };
1253
1257
  ```
1254
1258
 
1255
1259
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -1258,15 +1262,15 @@
1258
1262
 
1259
1263
  ```tsx
1260
1264
  // App.tsx
1261
- import { bar } from './bar.js'
1265
+ import { bar } from "./bar.js";
1262
1266
 
1263
1267
  function App() {
1264
- bar()
1268
+ bar();
1265
1269
  return (
1266
1270
  <view>
1267
1271
  <text>Hello, Lynx x rspeedy</text>
1268
1272
  </view>
1269
- )
1273
+ );
1270
1274
  }
1271
1275
  ```
1272
1276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.18.0",
3
+ "version": "0.18.1-canary-20260716-e75b5619",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.9.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.18.0",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.18.1-canary-20260716-e75b5619",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.4.1",
38
38
  "@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.10.0",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.2.2",
40
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.13.0",
40
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.13.1-canary-20260716-e75b5619",
41
41
  "@lynx-js/use-sync-external-store": "npm:@lynx-js/use-sync-external-store-canary@1.5.0",
42
42
  "background-only": "npm:background-only-canary@0.0.1",
43
43
  "tiny-invariant": "^1.3.3"
@@ -56,11 +56,11 @@
56
56
  "typia": "12.1.1",
57
57
  "typia-rspack-plugin": "3.0.1",
58
58
  "@lynx-js/config-rsbuild-plugin": "npm:@lynx-js/config-rsbuild-plugin-canary@0.1.1",
59
- "@lynx-js/react-transform": "0.2.0",
60
59
  "@lynx-js/react": "npm:@lynx-js/react-canary@0.123.0",
61
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.16.0",
62
60
  "@lynx-js/debug-metadata": "npm:@lynx-js/debug-metadata-canary@0.1.0",
63
- "@lynx-js/test-tools": "0.0.0"
61
+ "@lynx-js/test-tools": "0.0.0",
62
+ "@lynx-js/react-transform": "0.2.0",
63
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.16.1-canary-20260716-e75b5619"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@lynx-js/react": "*"