@lynx-js/react-rsbuild-plugin-canary 0.12.2 → 0.12.3-canary-20251223-71b9083d

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,14 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.12.3-canary-20251223075424-71b9083d7c117666ae815e62ced38709c3d207e6
4
+
5
+ ### Patch Changes
6
+
7
+ - expose LAYERS via `api.expose` for other rsbuild plugins. ([#2006](https://github.com/lynx-family/lynx-stack/pull/2006))
8
+
9
+ - Updated dependencies []:
10
+ - @lynx-js/react-alias-rsbuild-plugin@0.12.3-canary-20251223075424-71b9083d7c117666ae815e62ced38709c3d207e6
11
+
3
12
  ## 0.12.2
4
13
 
5
14
  ### Patch Changes
@@ -52,8 +61,8 @@
52
61
  With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
53
62
 
54
63
  ```js
55
- import { defineConfig } from '@lynx-js/rspeedy'
56
- import { pluginBabel } from '@rsbuild/plugin-babel'
64
+ import { defineConfig } from "@lynx-js/rspeedy";
65
+ import { pluginBabel } from "@rsbuild/plugin-babel";
57
66
 
58
67
  export default defineConfig({
59
68
  plugins: [
@@ -61,17 +70,17 @@
61
70
  include: /\.(?:jsx|tsx)$/,
62
71
  babelLoaderOptions(opts) {
63
72
  opts.plugins?.unshift([
64
- 'babel-plugin-react-compiler',
73
+ "babel-plugin-react-compiler",
65
74
  // See https://react.dev/reference/react-compiler/configuration for config
66
75
  {
67
76
  // ReactLynx only supports target to version 17
68
- target: '17',
77
+ target: "17",
69
78
  },
70
- ])
79
+ ]);
71
80
  },
72
81
  }),
73
82
  ],
74
- })
83
+ });
75
84
  ```
76
85
 
77
86
  - Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
@@ -274,28 +283,28 @@
274
283
 
275
284
  ```ts
276
285
  type InlineChunkTestFunction = (params: {
277
- size: number
278
- name: string
279
- }) => boolean
286
+ size: number;
287
+ name: string;
288
+ }) => boolean;
280
289
 
281
- type InlineChunkTest = RegExp | InlineChunkTestFunction
290
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
282
291
 
283
292
  type InlineChunkConfig =
284
293
  | boolean
285
294
  | InlineChunkTest
286
- | { enable?: boolean | 'auto', test: InlineChunkTest }
295
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
287
296
  ```
288
297
 
289
298
  ```ts
290
- import { defineConfig } from '@lynx-js/rspeedy'
299
+ import { defineConfig } from "@lynx-js/rspeedy";
291
300
 
292
301
  export default defineConfig({
293
302
  output: {
294
303
  inlineScripts: ({ name, size }) => {
295
- return name.includes('foo') && size < 1000
304
+ return name.includes("foo") && size < 1000;
296
305
  },
297
306
  },
298
- })
307
+ });
299
308
  ```
300
309
 
301
310
  - 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)]:
@@ -375,13 +384,13 @@
375
384
  example:
376
385
 
377
386
  ```js
378
- import { defineConfig } from '@lynx-js/rspeedy'
387
+ import { defineConfig } from "@lynx-js/rspeedy";
379
388
 
380
389
  export default defineConfig({
381
390
  output: {
382
391
  inlineScripts: false,
383
392
  },
384
- })
393
+ });
385
394
  ```
386
395
 
387
396
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -468,7 +477,7 @@
468
477
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
469
478
 
470
479
  ```js
471
- import { defineConfig } from '@lynx-js/rspeedy'
480
+ import { defineConfig } from "@lynx-js/rspeedy";
472
481
 
473
482
  export default defineConfig({
474
483
  tools: {
@@ -480,7 +489,7 @@
480
489
  },
481
490
  },
482
491
  },
483
- })
492
+ });
484
493
  ```
485
494
 
486
495
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -656,7 +665,7 @@
656
665
  You may turn it off using `output.minify.css: false`:
657
666
 
658
667
  ```js
659
- import { defineConfig } from '@lynx-js/rspeedy'
668
+ import { defineConfig } from "@lynx-js/rspeedy";
660
669
 
661
670
  export default defineConfig({
662
671
  output: {
@@ -664,18 +673,18 @@
664
673
  css: false,
665
674
  },
666
675
  },
667
- })
676
+ });
668
677
  ```
669
678
 
670
679
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
671
680
 
672
681
  ```js
673
- import { defineConfig } from '@lynx-js/rspeedy'
674
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
682
+ import { defineConfig } from "@lynx-js/rspeedy";
683
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
675
684
 
676
685
  export default defineConfig({
677
686
  plugins: [pluginCssMinimizer()],
678
- })
687
+ });
679
688
  ```
680
689
 
681
690
  ### Patch Changes
@@ -755,18 +764,18 @@
755
764
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
756
765
 
757
766
  ```js
758
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
759
- import { defineConfig } from '@lynx-js/rspeedy'
767
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
768
+ import { defineConfig } from "@lynx-js/rspeedy";
760
769
 
761
770
  export default defineConfig({
762
771
  plugins: [
763
772
  pluginReactLynx({
764
773
  defineDCE: {
765
- __SOME_FALSE_DEFINE__: 'false',
774
+ __SOME_FALSE_DEFINE__: "false",
766
775
  },
767
776
  }),
768
777
  ],
769
- })
778
+ });
770
779
  ```
771
780
 
772
781
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -774,20 +783,20 @@
774
783
  For example, `import` initialized by dead code will be removed:
775
784
 
776
785
  ```js
777
- import { foo } from 'bar'
786
+ import { foo } from "bar";
778
787
 
779
788
  if (__SOME_FALSE_DEFINE__) {
780
- foo()
781
- console.log('dead code')
789
+ foo();
790
+ console.log("dead code");
782
791
  } else {
783
- console.log('reachable code')
792
+ console.log("reachable code");
784
793
  }
785
794
  ```
786
795
 
787
796
  will be transformed to:
788
797
 
789
798
  ```js
790
- console.log('reachable code')
799
+ console.log("reachable code");
791
800
  ```
792
801
 
793
802
  - Updated dependencies [8dd6cca]
@@ -830,18 +839,18 @@
830
839
  - a30c83d: Add `compat.removeComponentAttrRegex`.
831
840
 
832
841
  ```js
833
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
834
- import { defineConfig } from '@lynx-js/rspeedy'
842
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
843
+ import { defineConfig } from "@lynx-js/rspeedy";
835
844
 
836
845
  export default defineConfig({
837
846
  plugins: [
838
847
  pluginReactLynx({
839
848
  compat: {
840
- removeComponentAttrRegex: 'YOUR REGEX',
849
+ removeComponentAttrRegex: "YOUR REGEX",
841
850
  },
842
851
  }),
843
852
  ],
844
- })
853
+ });
845
854
  ```
846
855
 
847
856
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -860,11 +869,11 @@
860
869
 
861
870
  ```javascript
862
871
  // bar.ts
863
- import 'background-only'
872
+ import "background-only";
864
873
 
865
874
  export const bar = () => {
866
- return 'bar'
867
- }
875
+ return "bar";
876
+ };
868
877
  ```
869
878
 
870
879
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -873,15 +882,15 @@
873
882
 
874
883
  ```tsx
875
884
  // App.tsx
876
- import { bar } from './bar.js'
885
+ import { bar } from "./bar.js";
877
886
 
878
887
  function App() {
879
- bar()
888
+ bar();
880
889
  return (
881
890
  <view>
882
891
  <text>Hello, Lynx x rspeedy</text>
883
892
  </view>
884
- )
893
+ );
885
894
  }
886
895
  ```
887
896
 
package/dist/index.js CHANGED
@@ -1251,6 +1251,7 @@ function pluginReactLynx(userOptions) {
1251
1251
  return config;
1252
1252
  });
1253
1253
  if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
1254
+ api.expose(Symbol.for('LAYERS'), LAYERS);
1254
1255
  const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
1255
1256
  const require = createRequire(import.meta.url);
1256
1257
  const { version } = require('../package.json');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.12.2",
3
+ "version": "0.12.3-canary-20251223-71b9083d",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.2",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.3-canary-20251223-71b9083d",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
38
38
  "@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.3",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
@@ -56,8 +56,8 @@
56
56
  "typia-rspack-plugin": "2.2.2",
57
57
  "@lynx-js/react-transform": "0.2.0",
58
58
  "@lynx-js/react": "npm:@lynx-js/react-canary@0.115.1",
59
- "@lynx-js/vitest-setup": "0.0.0",
60
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.3"
59
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.3",
60
+ "@lynx-js/vitest-setup": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@lynx-js/react": "*"