@lynx-js/react-rsbuild-plugin-canary 0.12.3 → 0.12.4-canary-20251229-917ae6ab

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,18 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.12.4-canary-20251229100543-917ae6ab8c5e11293377e3e22da3fc775f9b1de5
4
+
5
+ ### Patch Changes
6
+
7
+ - ([#2051](https://github.com/lynx-family/lynx-stack/pull/2051))
8
+
9
+ - Updated dependencies [[`821154b`](https://github.com/lynx-family/lynx-stack/commit/821154b3c80b3116598c47a78cd4477cc9859311)]:
10
+ - @lynx-js/react@0.115.3-canary-20251229100543-917ae6ab8c5e11293377e3e22da3fc775f9b1de5
11
+ - @lynx-js/react-alias-rsbuild-plugin@0.12.4-canary-20251229100543-917ae6ab8c5e11293377e3e22da3fc775f9b1de5
12
+ - @lynx-js/use-sync-external-store@1.5.0
13
+ - @lynx-js/react-refresh-webpack-plugin@0.3.4
14
+ - @lynx-js/react-webpack-plugin@0.7.3
15
+
3
16
  ## 0.12.3
4
17
 
5
18
  ### Patch Changes
@@ -66,8 +79,8 @@
66
79
  With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
67
80
 
68
81
  ```js
69
- import { defineConfig } from '@lynx-js/rspeedy'
70
- import { pluginBabel } from '@rsbuild/plugin-babel'
82
+ import { defineConfig } from "@lynx-js/rspeedy";
83
+ import { pluginBabel } from "@rsbuild/plugin-babel";
71
84
 
72
85
  export default defineConfig({
73
86
  plugins: [
@@ -75,17 +88,17 @@
75
88
  include: /\.(?:jsx|tsx)$/,
76
89
  babelLoaderOptions(opts) {
77
90
  opts.plugins?.unshift([
78
- 'babel-plugin-react-compiler',
91
+ "babel-plugin-react-compiler",
79
92
  // See https://react.dev/reference/react-compiler/configuration for config
80
93
  {
81
94
  // ReactLynx only supports target to version 17
82
- target: '17',
95
+ target: "17",
83
96
  },
84
- ])
97
+ ]);
85
98
  },
86
99
  }),
87
100
  ],
88
- })
101
+ });
89
102
  ```
90
103
 
91
104
  - Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
@@ -288,28 +301,28 @@
288
301
 
289
302
  ```ts
290
303
  type InlineChunkTestFunction = (params: {
291
- size: number
292
- name: string
293
- }) => boolean
304
+ size: number;
305
+ name: string;
306
+ }) => boolean;
294
307
 
295
- type InlineChunkTest = RegExp | InlineChunkTestFunction
308
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
296
309
 
297
310
  type InlineChunkConfig =
298
311
  | boolean
299
312
  | InlineChunkTest
300
- | { enable?: boolean | 'auto', test: InlineChunkTest }
313
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
301
314
  ```
302
315
 
303
316
  ```ts
304
- import { defineConfig } from '@lynx-js/rspeedy'
317
+ import { defineConfig } from "@lynx-js/rspeedy";
305
318
 
306
319
  export default defineConfig({
307
320
  output: {
308
321
  inlineScripts: ({ name, size }) => {
309
- return name.includes('foo') && size < 1000
322
+ return name.includes("foo") && size < 1000;
310
323
  },
311
324
  },
312
- })
325
+ });
313
326
  ```
314
327
 
315
328
  - 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)]:
@@ -389,13 +402,13 @@
389
402
  example:
390
403
 
391
404
  ```js
392
- import { defineConfig } from '@lynx-js/rspeedy'
405
+ import { defineConfig } from "@lynx-js/rspeedy";
393
406
 
394
407
  export default defineConfig({
395
408
  output: {
396
409
  inlineScripts: false,
397
410
  },
398
- })
411
+ });
399
412
  ```
400
413
 
401
414
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -482,7 +495,7 @@
482
495
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
483
496
 
484
497
  ```js
485
- import { defineConfig } from '@lynx-js/rspeedy'
498
+ import { defineConfig } from "@lynx-js/rspeedy";
486
499
 
487
500
  export default defineConfig({
488
501
  tools: {
@@ -494,7 +507,7 @@
494
507
  },
495
508
  },
496
509
  },
497
- })
510
+ });
498
511
  ```
499
512
 
500
513
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -670,7 +683,7 @@
670
683
  You may turn it off using `output.minify.css: false`:
671
684
 
672
685
  ```js
673
- import { defineConfig } from '@lynx-js/rspeedy'
686
+ import { defineConfig } from "@lynx-js/rspeedy";
674
687
 
675
688
  export default defineConfig({
676
689
  output: {
@@ -678,18 +691,18 @@
678
691
  css: false,
679
692
  },
680
693
  },
681
- })
694
+ });
682
695
  ```
683
696
 
684
697
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
685
698
 
686
699
  ```js
687
- import { defineConfig } from '@lynx-js/rspeedy'
688
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
700
+ import { defineConfig } from "@lynx-js/rspeedy";
701
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
689
702
 
690
703
  export default defineConfig({
691
704
  plugins: [pluginCssMinimizer()],
692
- })
705
+ });
693
706
  ```
694
707
 
695
708
  ### Patch Changes
@@ -769,18 +782,18 @@
769
782
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
770
783
 
771
784
  ```js
772
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
773
- import { defineConfig } from '@lynx-js/rspeedy'
785
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
786
+ import { defineConfig } from "@lynx-js/rspeedy";
774
787
 
775
788
  export default defineConfig({
776
789
  plugins: [
777
790
  pluginReactLynx({
778
791
  defineDCE: {
779
- __SOME_FALSE_DEFINE__: 'false',
792
+ __SOME_FALSE_DEFINE__: "false",
780
793
  },
781
794
  }),
782
795
  ],
783
- })
796
+ });
784
797
  ```
785
798
 
786
799
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -788,20 +801,20 @@
788
801
  For example, `import` initialized by dead code will be removed:
789
802
 
790
803
  ```js
791
- import { foo } from 'bar'
804
+ import { foo } from "bar";
792
805
 
793
806
  if (__SOME_FALSE_DEFINE__) {
794
- foo()
795
- console.log('dead code')
807
+ foo();
808
+ console.log("dead code");
796
809
  } else {
797
- console.log('reachable code')
810
+ console.log("reachable code");
798
811
  }
799
812
  ```
800
813
 
801
814
  will be transformed to:
802
815
 
803
816
  ```js
804
- console.log('reachable code')
817
+ console.log("reachable code");
805
818
  ```
806
819
 
807
820
  - Updated dependencies [8dd6cca]
@@ -844,18 +857,18 @@
844
857
  - a30c83d: Add `compat.removeComponentAttrRegex`.
845
858
 
846
859
  ```js
847
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
848
- import { defineConfig } from '@lynx-js/rspeedy'
860
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
861
+ import { defineConfig } from "@lynx-js/rspeedy";
849
862
 
850
863
  export default defineConfig({
851
864
  plugins: [
852
865
  pluginReactLynx({
853
866
  compat: {
854
- removeComponentAttrRegex: 'YOUR REGEX',
867
+ removeComponentAttrRegex: "YOUR REGEX",
855
868
  },
856
869
  }),
857
870
  ],
858
- })
871
+ });
859
872
  ```
860
873
 
861
874
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -874,11 +887,11 @@
874
887
 
875
888
  ```javascript
876
889
  // bar.ts
877
- import 'background-only'
890
+ import "background-only";
878
891
 
879
892
  export const bar = () => {
880
- return 'bar'
881
- }
893
+ return "bar";
894
+ };
882
895
  ```
883
896
 
884
897
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -887,15 +900,15 @@
887
900
 
888
901
  ```tsx
889
902
  // App.tsx
890
- import { bar } from './bar.js'
903
+ import { bar } from "./bar.js";
891
904
 
892
905
  function App() {
893
- bar()
906
+ bar();
894
907
  return (
895
908
  <view>
896
909
  <text>Hello, Lynx x rspeedy</text>
897
910
  </view>
898
- )
911
+ );
899
912
  }
900
913
  ```
901
914
 
package/dist/300.js CHANGED
@@ -3,7 +3,7 @@ export const __rspack_esm_ids = [
3
3
  "300"
4
4
  ];
5
5
  export const __webpack_modules__ = {
6
- "./src/resolve.ts" (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6
+ "./src/resolve.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
7
7
  __webpack_require__.d(__webpack_exports__, {
8
8
  getImportResolver: ()=>getImportResolver,
9
9
  getMainThreadResolver: ()=>getMainThreadResolver
package/dist/index.d.ts CHANGED
@@ -5,7 +5,9 @@
5
5
  */
6
6
 
7
7
  import { LAYERS } from '@lynx-js/react-webpack-plugin';
8
+ import type { LynxTemplatePlugin as LynxTemplatePlugin_2 } from '@lynx-js/template-webpack-plugin';
8
9
  import type { RsbuildPlugin } from '@rsbuild/core';
10
+ import type { TemplateHooks } from '@lynx-js/template-webpack-plugin';
9
11
 
10
12
  /**
11
13
  * {@inheritdoc CompatVisitorConfig.addComponentElement}
@@ -412,6 +414,10 @@ export declare interface ExtractStrConfig {
412
414
 
413
415
  export { LAYERS }
414
416
 
417
+ export declare interface LynxTemplatePlugin {
418
+ getLynxTemplatePluginHooks: typeof LynxTemplatePlugin_2.getLynxTemplatePluginHooks;
419
+ }
420
+
415
421
  /**
416
422
  * Create a rsbuild plugin for ReactLynx.
417
423
  *
@@ -723,4 +729,6 @@ export declare interface ShakeVisitorConfig {
723
729
  removeCallParams: Array<string>
724
730
  }
725
731
 
732
+ export { TemplateHooks }
733
+
726
734
  export { }
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import * as __rspack_external_node_path_c5b9b54f from "node:path";
3
3
  import * as __rspack_external_node_url_e96de089 from "node:url";
4
4
  import { createRequire } from "node:module";
5
5
  import { LAYERS, ReactWebpackPlugin } from "@lynx-js/react-webpack-plugin";
6
- import { RuntimeWrapperWebpackPlugin } from "@lynx-js/runtime-wrapper-webpack-plugin";
7
6
  import { LynxEncodePlugin, LynxTemplatePlugin, WebEncodePlugin } from "@lynx-js/template-webpack-plugin";
7
+ import { RuntimeWrapperWebpackPlugin } from "@lynx-js/runtime-wrapper-webpack-plugin";
8
8
  import { ReactRefreshRspackPlugin, ReactRefreshWebpackPlugin } from "@lynx-js/react-refresh-webpack-plugin";
9
9
  var __webpack_modules__ = {
10
- "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.js" (__unused_webpack_module, exports) {
10
+ "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.js" (__unused_rspack_module, exports) {
11
11
  exports._accessExpressionAsString = void 0;
12
12
  const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
13
13
  exports._accessExpressionAsString = _accessExpressionAsString;
@@ -52,7 +52,7 @@ var __webpack_modules__ = {
52
52
  "with"
53
53
  ]);
54
54
  },
55
- "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_assertGuard.js" (__unused_webpack_module, exports, __webpack_require__) {
55
+ "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_assertGuard.js" (__unused_rspack_module, exports, __webpack_require__) {
56
56
  exports._assertGuard = void 0;
57
57
  const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/TypeGuardError.mjs");
58
58
  const _assertGuard = (exceptionable, props, factory)=>{
@@ -71,7 +71,7 @@ var __webpack_modules__ = {
71
71
  "node:url" (module) {
72
72
  module.exports = __rspack_external_node_url_e96de089;
73
73
  },
74
- "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/TypeGuardError.mjs" (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
74
+ "../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/TypeGuardError.mjs" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
75
75
  __webpack_require__.r(__webpack_exports__);
76
76
  __webpack_require__.d(__webpack_exports__, {
77
77
  TypeGuardError: ()=>TypeGuardError
@@ -135,7 +135,7 @@ __webpack_require__.m = __webpack_modules__;
135
135
  })();
136
136
  (()=>{
137
137
  __webpack_require__.r = (exports)=>{
138
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
138
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
139
139
  value: 'Module'
140
140
  });
141
141
  Object.defineProperty(exports, '__esModule', {
@@ -1252,6 +1252,11 @@ function pluginReactLynx(userOptions) {
1252
1252
  });
1253
1253
  if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
1254
1254
  api.expose(Symbol.for('LAYERS'), LAYERS);
1255
+ api.expose(Symbol.for('LynxTemplatePlugin'), {
1256
+ LynxTemplatePlugin: {
1257
+ getLynxTemplatePluginHooks: LynxTemplatePlugin.getLynxTemplatePluginHooks.bind(LynxTemplatePlugin)
1258
+ }
1259
+ });
1255
1260
  const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
1256
1261
  const require = createRequire(import.meta.url);
1257
1262
  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.3",
3
+ "version": "0.12.4-canary-20251229-917ae6ab",
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.3",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.4-canary-20251229-917ae6ab",
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",
@@ -54,10 +54,10 @@
54
54
  "type-fest": "^5.0.1",
55
55
  "typia": "10.1.0",
56
56
  "typia-rspack-plugin": "2.2.2",
57
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.115.2",
57
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.115.3-canary-20251229-917ae6ab",
58
58
  "@lynx-js/react-transform": "0.2.0",
59
- "@lynx-js/vitest-setup": "0.0.0",
60
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.4"
59
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.4",
60
+ "@lynx-js/vitest-setup": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@lynx-js/react": "*"