@lynx-js/react-rsbuild-plugin-canary 0.16.1 → 0.16.2-canary-20260429-eb46fea3

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 +55 -48
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.16.2-canary-20260429080413-eb46fea3504525123ec18ac08ec7afe47566bf33
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`e4ace87`](https://github.com/lynx-family/lynx-stack/commit/e4ace875119eeeeaccbea0635b7f916a06d0d6d0)]:
8
+ - @lynx-js/react@0.120.1-canary-20260429080413-eb46fea3504525123ec18ac08ec7afe47566bf33
9
+ - @lynx-js/react-alias-rsbuild-plugin@0.16.2-canary-20260429080413-eb46fea3504525123ec18ac08ec7afe47566bf33
10
+ - @lynx-js/use-sync-external-store@1.5.0
11
+ - @lynx-js/react-refresh-webpack-plugin@0.3.5
12
+ - @lynx-js/react-webpack-plugin@0.9.2
13
+ - @lynx-js/template-webpack-plugin@0.11.1-canary-20260429080413-eb46fea3504525123ec18ac08ec7afe47566bf33
14
+ - @lynx-js/css-extract-webpack-plugin@0.7.1
15
+
3
16
  ## 0.16.1
4
17
 
5
18
  ### Patch Changes
@@ -65,7 +78,6 @@
65
78
  ### Minor Changes
66
79
 
67
80
  - feat: support `optimizeBundleSize` option to remove unused code for main-thread and background. ([#2336](https://github.com/lynx-family/lynx-stack/pull/2336))
68
-
69
81
  - If `optimizeBundleSize` is `true` or `optimizeBundleSize.background` is `true`, `lynx.registerDataProcessors` calls will be marked as pure for the background thread output.
70
82
  - 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.
71
83
 
@@ -92,7 +104,6 @@
92
104
  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).
93
105
 
94
106
  - feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
95
-
96
107
  - When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
97
108
  - Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
98
109
 
@@ -261,8 +272,8 @@
261
272
  With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
262
273
 
263
274
  ```js
264
- import { defineConfig } from '@lynx-js/rspeedy'
265
- import { pluginBabel } from '@rsbuild/plugin-babel'
275
+ import { defineConfig } from "@lynx-js/rspeedy";
276
+ import { pluginBabel } from "@rsbuild/plugin-babel";
266
277
 
267
278
  export default defineConfig({
268
279
  plugins: [
@@ -270,17 +281,17 @@
270
281
  include: /\.(?:jsx|tsx)$/,
271
282
  babelLoaderOptions(opts) {
272
283
  opts.plugins?.unshift([
273
- 'babel-plugin-react-compiler',
284
+ "babel-plugin-react-compiler",
274
285
  // See https://react.dev/reference/react-compiler/configuration for config
275
286
  {
276
287
  // ReactLynx only supports target to version 17
277
- target: '17',
288
+ target: "17",
278
289
  },
279
- ])
290
+ ]);
280
291
  },
281
292
  }),
282
293
  ],
283
- })
294
+ });
284
295
  ```
285
296
 
286
297
  - Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
@@ -483,28 +494,28 @@
483
494
 
484
495
  ```ts
485
496
  type InlineChunkTestFunction = (params: {
486
- size: number
487
- name: string
488
- }) => boolean
497
+ size: number;
498
+ name: string;
499
+ }) => boolean;
489
500
 
490
- type InlineChunkTest = RegExp | InlineChunkTestFunction
501
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
491
502
 
492
503
  type InlineChunkConfig =
493
504
  | boolean
494
505
  | InlineChunkTest
495
- | { enable?: boolean | 'auto', test: InlineChunkTest }
506
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
496
507
  ```
497
508
 
498
509
  ```ts
499
- import { defineConfig } from '@lynx-js/rspeedy'
510
+ import { defineConfig } from "@lynx-js/rspeedy";
500
511
 
501
512
  export default defineConfig({
502
513
  output: {
503
514
  inlineScripts: ({ name, size }) => {
504
- return name.includes('foo') && size < 1000
515
+ return name.includes("foo") && size < 1000;
505
516
  },
506
517
  },
507
- })
518
+ });
508
519
  ```
509
520
 
510
521
  - 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)]:
@@ -584,13 +595,13 @@
584
595
  example:
585
596
 
586
597
  ```js
587
- import { defineConfig } from '@lynx-js/rspeedy'
598
+ import { defineConfig } from "@lynx-js/rspeedy";
588
599
 
589
600
  export default defineConfig({
590
601
  output: {
591
602
  inlineScripts: false,
592
603
  },
593
- })
604
+ });
594
605
  ```
595
606
 
596
607
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -648,7 +659,6 @@
648
659
  - Refactor: Replace built-in `background-only` implementation with npm package ([#602](https://github.com/lynx-family/lynx-stack/pull/602))
649
660
 
650
661
  Previously we maintained custom files:
651
-
652
662
  - `empty.ts` for background thread
653
663
  - `error.ts` for main thread validation
654
664
 
@@ -677,7 +687,7 @@
677
687
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
678
688
 
679
689
  ```js
680
- import { defineConfig } from '@lynx-js/rspeedy'
690
+ import { defineConfig } from "@lynx-js/rspeedy";
681
691
 
682
692
  export default defineConfig({
683
693
  tools: {
@@ -689,7 +699,7 @@
689
699
  },
690
700
  },
691
701
  },
692
- })
702
+ });
693
703
  ```
694
704
 
695
705
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -865,7 +875,7 @@
865
875
  You may turn it off using `output.minify.css: false`:
866
876
 
867
877
  ```js
868
- import { defineConfig } from '@lynx-js/rspeedy'
878
+ import { defineConfig } from "@lynx-js/rspeedy";
869
879
 
870
880
  export default defineConfig({
871
881
  output: {
@@ -873,18 +883,18 @@
873
883
  css: false,
874
884
  },
875
885
  },
876
- })
886
+ });
877
887
  ```
878
888
 
879
889
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
880
890
 
881
891
  ```js
882
- import { defineConfig } from '@lynx-js/rspeedy'
883
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
892
+ import { defineConfig } from "@lynx-js/rspeedy";
893
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
884
894
 
885
895
  export default defineConfig({
886
896
  plugins: [pluginCssMinimizer()],
887
- })
897
+ });
888
898
  ```
889
899
 
890
900
  ### Patch Changes
@@ -938,7 +948,6 @@
938
948
 
939
949
  - 7b84edf: feat(web): introduce new output chunk format
940
950
  - 39efd7c: Change `enableRemoveCSSScope` defaults from `undefined` to `true`, now `enableRemoveCSSScope` can be:
941
-
942
951
  - `true` (by default): All CSS files are treated as global CSS.
943
952
  - `false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.
944
953
  - `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.
@@ -964,18 +973,18 @@
964
973
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
965
974
 
966
975
  ```js
967
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
968
- import { defineConfig } from '@lynx-js/rspeedy'
976
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
977
+ import { defineConfig } from "@lynx-js/rspeedy";
969
978
 
970
979
  export default defineConfig({
971
980
  plugins: [
972
981
  pluginReactLynx({
973
982
  defineDCE: {
974
- __SOME_FALSE_DEFINE__: 'false',
983
+ __SOME_FALSE_DEFINE__: "false",
975
984
  },
976
985
  }),
977
986
  ],
978
- })
987
+ });
979
988
  ```
980
989
 
981
990
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -983,20 +992,20 @@
983
992
  For example, `import` initialized by dead code will be removed:
984
993
 
985
994
  ```js
986
- import { foo } from 'bar'
995
+ import { foo } from "bar";
987
996
 
988
997
  if (__SOME_FALSE_DEFINE__) {
989
- foo()
990
- console.log('dead code')
998
+ foo();
999
+ console.log("dead code");
991
1000
  } else {
992
- console.log('reachable code')
1001
+ console.log("reachable code");
993
1002
  }
994
1003
  ```
995
1004
 
996
1005
  will be transformed to:
997
1006
 
998
1007
  ```js
999
- console.log('reachable code')
1008
+ console.log("reachable code");
1000
1009
  ```
1001
1010
 
1002
1011
  - Updated dependencies [8dd6cca]
@@ -1015,7 +1024,6 @@
1015
1024
  - 958efda: feat(web): bundle background.js into main-thread.js for web
1016
1025
 
1017
1026
  To enable this feature:
1018
-
1019
1027
  1. set the performance.chunkSplit.strategy to `all-in-one`
1020
1028
  2. use the `mode:'production'` to build
1021
1029
 
@@ -1039,18 +1047,18 @@
1039
1047
  - a30c83d: Add `compat.removeComponentAttrRegex`.
1040
1048
 
1041
1049
  ```js
1042
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
1043
- import { defineConfig } from '@lynx-js/rspeedy'
1050
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
1051
+ import { defineConfig } from "@lynx-js/rspeedy";
1044
1052
 
1045
1053
  export default defineConfig({
1046
1054
  plugins: [
1047
1055
  pluginReactLynx({
1048
1056
  compat: {
1049
- removeComponentAttrRegex: 'YOUR REGEX',
1057
+ removeComponentAttrRegex: "YOUR REGEX",
1050
1058
  },
1051
1059
  }),
1052
1060
  ],
1053
- })
1061
+ });
1054
1062
  ```
1055
1063
 
1056
1064
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -1062,18 +1070,17 @@
1062
1070
 
1063
1071
  - 36f8e4c: Add `enableAccessibilityElement`.
1064
1072
  - b37e3d9: Enforced build-time errors for importing `background-only` modules in the `main-thread`.
1065
-
1066
1073
  - 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.
1067
1074
 
1068
1075
  For example:
1069
1076
 
1070
1077
  ```javascript
1071
1078
  // bar.ts
1072
- import 'background-only'
1079
+ import "background-only";
1073
1080
 
1074
1081
  export const bar = () => {
1075
- return 'bar'
1076
- }
1082
+ return "bar";
1083
+ };
1077
1084
  ```
1078
1085
 
1079
1086
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -1082,15 +1089,15 @@
1082
1089
 
1083
1090
  ```tsx
1084
1091
  // App.tsx
1085
- import { bar } from './bar.js'
1092
+ import { bar } from "./bar.js";
1086
1093
 
1087
1094
  function App() {
1088
- bar()
1095
+ bar();
1089
1096
  return (
1090
1097
  <view>
1091
1098
  <text>Hello, Lynx x rspeedy</text>
1092
1099
  </view>
1093
- )
1100
+ );
1094
1101
  }
1095
1102
  ```
1096
1103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.16.1",
3
+ "version": "0.16.2-canary-20260429-eb46fea3",
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.7.1",
36
- "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.16.1",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.16.2-canary-20260429-eb46fea3",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.5",
38
38
  "@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.9.2",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
40
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.11.0",
40
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.11.1-canary-20260429-eb46fea3",
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,9 +56,9 @@
56
56
  "typia": "10.1.0",
57
57
  "typia-rspack-plugin": "2.2.2",
58
58
  "@lynx-js/config-rsbuild-plugin": "npm:@lynx-js/config-rsbuild-plugin-canary@0.0.2",
59
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.120.0",
59
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.120.1-canary-20260429-eb46fea3",
60
60
  "@lynx-js/react-transform": "0.2.0",
61
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.14.3",
61
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.14.4-canary-20260429-eb46fea3",
62
62
  "@lynx-js/vitest-setup": "0.0.0"
63
63
  },
64
64
  "peerDependencies": {