@lynx-js/react-rsbuild-plugin-canary 0.18.1 → 0.18.2-canary-20260727-080da860

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 +67 -54
  2. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.18.2-canary-20260727074348-080da8606b9792b2eb5aa59cbcbd7807ad598ce2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2b84546`](https://github.com/lynx-family/lynx-stack/commit/2b845466f0de75277cef130c20ccb8ea7c1d6e66)]:
8
+ - @lynx-js/react@0.123.2-canary-20260727074348-080da8606b9792b2eb5aa59cbcbd7807ad598ce2
9
+ - @lynx-js/template-webpack-plugin@0.14.1-canary-20260727074348-080da8606b9792b2eb5aa59cbcbd7807ad598ce2
10
+ - @lynx-js/react-alias-rsbuild-plugin@0.18.2-canary-20260727074348-080da8606b9792b2eb5aa59cbcbd7807ad598ce2
11
+ - @lynx-js/use-sync-external-store@1.5.0
12
+ - @lynx-js/react-refresh-webpack-plugin@0.4.1
13
+ - @lynx-js/react-webpack-plugin@0.10.1
14
+ - @lynx-js/css-extract-webpack-plugin@0.10.0
15
+
3
16
  ## 0.18.1
4
17
 
5
18
  ### Patch Changes
@@ -28,7 +41,7 @@
28
41
  loader.
29
42
 
30
43
  ```js
31
- import('./Foo.jsx', { with: { mode: 'sync' | 'async' } })
44
+ import("./Foo.jsx", { with: { mode: "sync" | "async" } });
32
45
  ```
33
46
 
34
47
  Force a loader regardless of `engineVersion` with the `REACT_LAZY_BUNDLE_FETCHER`
@@ -40,14 +53,14 @@
40
53
 
41
54
  ```js
42
55
  pluginReactLynx({
43
- firstScreenSyncTiming: 'manual',
44
- })
56
+ firstScreenSyncTiming: "manual",
57
+ });
45
58
  ```
46
59
 
47
60
  ```js
48
- import { markFirstScreenSyncReady } from '@lynx-js/react'
61
+ import { markFirstScreenSyncReady } from "@lynx-js/react";
49
62
 
50
- markFirstScreenSyncReady()
63
+ markFirstScreenSyncReady();
51
64
  ```
52
65
 
53
66
  ### Patch Changes
@@ -55,8 +68,8 @@
55
68
  - 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))
56
69
 
57
70
  ```js
58
- import { defineConfig } from '@lynx-js/rspeedy'
59
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
71
+ import { defineConfig } from "@lynx-js/rspeedy";
72
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
60
73
 
61
74
  export default defineConfig({
62
75
  plugins: [
@@ -66,7 +79,7 @@
66
79
  },
67
80
  }),
68
81
  ],
69
- })
82
+ });
70
83
  ```
71
84
 
72
85
  The default (SlotV2) codegen is unchanged, and the runtime keeps supporting both forms.
@@ -126,11 +139,11 @@
126
139
  `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.
127
140
 
128
141
  ```js
129
- import { execSync } from 'node:child_process'
142
+ import { execSync } from "node:child_process";
130
143
 
131
- import { defineConfig } from '@lynx-js/rspeedy'
144
+ import { defineConfig } from "@lynx-js/rspeedy";
132
145
 
133
- const gitHash = execSync('git rev-parse --short HEAD').toString().trim()
146
+ const gitHash = execSync("git rev-parse --short HEAD").toString().trim();
134
147
 
135
148
  export default defineConfig({
136
149
  output: {
@@ -141,7 +154,7 @@
141
154
  : `[name].${platform}.bundle`,
142
155
  },
143
156
  },
144
- })
157
+ });
145
158
  ```
146
159
 
147
160
  - 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))
@@ -450,8 +463,8 @@
450
463
  With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
451
464
 
452
465
  ```js
453
- import { defineConfig } from '@lynx-js/rspeedy'
454
- import { pluginBabel } from '@rsbuild/plugin-babel'
466
+ import { defineConfig } from "@lynx-js/rspeedy";
467
+ import { pluginBabel } from "@rsbuild/plugin-babel";
455
468
 
456
469
  export default defineConfig({
457
470
  plugins: [
@@ -459,17 +472,17 @@
459
472
  include: /\.(?:jsx|tsx)$/,
460
473
  babelLoaderOptions(opts) {
461
474
  opts.plugins?.unshift([
462
- 'babel-plugin-react-compiler',
475
+ "babel-plugin-react-compiler",
463
476
  // See https://react.dev/reference/react-compiler/configuration for config
464
477
  {
465
478
  // ReactLynx only supports target to version 17
466
- target: '17',
479
+ target: "17",
467
480
  },
468
- ])
481
+ ]);
469
482
  },
470
483
  }),
471
484
  ],
472
- })
485
+ });
473
486
  ```
474
487
 
475
488
  - Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
@@ -672,28 +685,28 @@
672
685
 
673
686
  ```ts
674
687
  type InlineChunkTestFunction = (params: {
675
- size: number
676
- name: string
677
- }) => boolean
688
+ size: number;
689
+ name: string;
690
+ }) => boolean;
678
691
 
679
- type InlineChunkTest = RegExp | InlineChunkTestFunction
692
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
680
693
 
681
694
  type InlineChunkConfig =
682
695
  | boolean
683
696
  | InlineChunkTest
684
- | { enable?: boolean | 'auto', test: InlineChunkTest }
697
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
685
698
  ```
686
699
 
687
700
  ```ts
688
- import { defineConfig } from '@lynx-js/rspeedy'
701
+ import { defineConfig } from "@lynx-js/rspeedy";
689
702
 
690
703
  export default defineConfig({
691
704
  output: {
692
705
  inlineScripts: ({ name, size }) => {
693
- return name.includes('foo') && size < 1000
706
+ return name.includes("foo") && size < 1000;
694
707
  },
695
708
  },
696
- })
709
+ });
697
710
  ```
698
711
 
699
712
  - 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)]:
@@ -773,13 +786,13 @@
773
786
  example:
774
787
 
775
788
  ```js
776
- import { defineConfig } from '@lynx-js/rspeedy'
789
+ import { defineConfig } from "@lynx-js/rspeedy";
777
790
 
778
791
  export default defineConfig({
779
792
  output: {
780
793
  inlineScripts: false,
781
794
  },
782
- })
795
+ });
783
796
  ```
784
797
 
785
798
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -866,7 +879,7 @@
866
879
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
867
880
 
868
881
  ```js
869
- import { defineConfig } from '@lynx-js/rspeedy'
882
+ import { defineConfig } from "@lynx-js/rspeedy";
870
883
 
871
884
  export default defineConfig({
872
885
  tools: {
@@ -878,7 +891,7 @@
878
891
  },
879
892
  },
880
893
  },
881
- })
894
+ });
882
895
  ```
883
896
 
884
897
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -1054,7 +1067,7 @@
1054
1067
  You may turn it off using `output.minify.css: false`:
1055
1068
 
1056
1069
  ```js
1057
- import { defineConfig } from '@lynx-js/rspeedy'
1070
+ import { defineConfig } from "@lynx-js/rspeedy";
1058
1071
 
1059
1072
  export default defineConfig({
1060
1073
  output: {
@@ -1062,18 +1075,18 @@
1062
1075
  css: false,
1063
1076
  },
1064
1077
  },
1065
- })
1078
+ });
1066
1079
  ```
1067
1080
 
1068
1081
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
1069
1082
 
1070
1083
  ```js
1071
- import { defineConfig } from '@lynx-js/rspeedy'
1072
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
1084
+ import { defineConfig } from "@lynx-js/rspeedy";
1085
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
1073
1086
 
1074
1087
  export default defineConfig({
1075
1088
  plugins: [pluginCssMinimizer()],
1076
- })
1089
+ });
1077
1090
  ```
1078
1091
 
1079
1092
  ### Patch Changes
@@ -1153,18 +1166,18 @@
1153
1166
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
1154
1167
 
1155
1168
  ```js
1156
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
1157
- import { defineConfig } from '@lynx-js/rspeedy'
1169
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
1170
+ import { defineConfig } from "@lynx-js/rspeedy";
1158
1171
 
1159
1172
  export default defineConfig({
1160
1173
  plugins: [
1161
1174
  pluginReactLynx({
1162
1175
  defineDCE: {
1163
- __SOME_FALSE_DEFINE__: 'false',
1176
+ __SOME_FALSE_DEFINE__: "false",
1164
1177
  },
1165
1178
  }),
1166
1179
  ],
1167
- })
1180
+ });
1168
1181
  ```
1169
1182
 
1170
1183
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -1172,20 +1185,20 @@
1172
1185
  For example, `import` initialized by dead code will be removed:
1173
1186
 
1174
1187
  ```js
1175
- import { foo } from 'bar'
1188
+ import { foo } from "bar";
1176
1189
 
1177
1190
  if (__SOME_FALSE_DEFINE__) {
1178
- foo()
1179
- console.log('dead code')
1191
+ foo();
1192
+ console.log("dead code");
1180
1193
  } else {
1181
- console.log('reachable code')
1194
+ console.log("reachable code");
1182
1195
  }
1183
1196
  ```
1184
1197
 
1185
1198
  will be transformed to:
1186
1199
 
1187
1200
  ```js
1188
- console.log('reachable code')
1201
+ console.log("reachable code");
1189
1202
  ```
1190
1203
 
1191
1204
  - Updated dependencies [8dd6cca]
@@ -1228,18 +1241,18 @@
1228
1241
  - a30c83d: Add `compat.removeComponentAttrRegex`.
1229
1242
 
1230
1243
  ```js
1231
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
1232
- import { defineConfig } from '@lynx-js/rspeedy'
1244
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
1245
+ import { defineConfig } from "@lynx-js/rspeedy";
1233
1246
 
1234
1247
  export default defineConfig({
1235
1248
  plugins: [
1236
1249
  pluginReactLynx({
1237
1250
  compat: {
1238
- removeComponentAttrRegex: 'YOUR REGEX',
1251
+ removeComponentAttrRegex: "YOUR REGEX",
1239
1252
  },
1240
1253
  }),
1241
1254
  ],
1242
- })
1255
+ });
1243
1256
  ```
1244
1257
 
1245
1258
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -1258,11 +1271,11 @@
1258
1271
 
1259
1272
  ```javascript
1260
1273
  // bar.ts
1261
- import 'background-only'
1274
+ import "background-only";
1262
1275
 
1263
1276
  export const bar = () => {
1264
- return 'bar'
1265
- }
1277
+ return "bar";
1278
+ };
1266
1279
  ```
1267
1280
 
1268
1281
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -1271,15 +1284,15 @@
1271
1284
 
1272
1285
  ```tsx
1273
1286
  // App.tsx
1274
- import { bar } from './bar.js'
1287
+ import { bar } from "./bar.js";
1275
1288
 
1276
1289
  function App() {
1277
- bar()
1290
+ bar();
1278
1291
  return (
1279
1292
  <view>
1280
1293
  <text>Hello, Lynx x rspeedy</text>
1281
1294
  </view>
1282
- )
1295
+ );
1283
1296
  }
1284
1297
  ```
1285
1298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.18.1",
3
+ "version": "0.18.2-canary-20260727-080da860",
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.10.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.18.1",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.18.2-canary-20260727-080da860",
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.1",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.2.3",
40
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.14.0",
40
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.14.1-canary-20260727-080da860",
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.2.0",
59
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.123.2-canary-20260727-080da860",
59
60
  "@lynx-js/debug-metadata": "npm:@lynx-js/debug-metadata-canary@0.1.0",
60
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.123.1",
61
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.16.1",
62
- "@lynx-js/test-tools": "0.0.0",
63
- "@lynx-js/react-transform": "0.2.0"
61
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.16.2-canary-20260727-080da860",
62
+ "@lynx-js/react-transform": "0.2.0",
63
+ "@lynx-js/test-tools": "0.0.0"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@lynx-js/react": "*"