@lynx-js/react-rsbuild-plugin 0.14.0 → 0.15.0

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,25 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](https://github.com/lynx-family/lynx-stack/pull/2423))
8
+
9
+ `removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments.
10
+
11
+ ### Patch Changes
12
+
13
+ - Support `@lynx-js/react` 0.118.0. ([#2432](https://github.com/lynx-family/lynx-stack/pull/2432))
14
+
15
+ - Updated dependencies [[`1f4f117`](https://github.com/lynx-family/lynx-stack/commit/1f4f1171a35a00d2c9f2ae9ecff50be2626ca5bb)]:
16
+ - @lynx-js/react-webpack-plugin@0.9.0
17
+ - @lynx-js/react-alias-rsbuild-plugin@0.15.0
18
+ - @lynx-js/use-sync-external-store@1.5.0
19
+ - @lynx-js/react-refresh-webpack-plugin@0.3.5
20
+ - @lynx-js/css-extract-webpack-plugin@0.7.0
21
+ - @lynx-js/template-webpack-plugin@0.10.8
22
+
3
23
  ## 0.14.0
4
24
 
5
25
  ### Minor Changes
package/dist/208.js CHANGED
@@ -656,10 +656,11 @@ const validateConfig = (()=>{
656
656
  if (void 0 === value) return true;
657
657
  return false;
658
658
  }));
659
- const _io4 = (input, _exceptionable = true)=>(void 0 === input.pkgName || Array.isArray(input.pkgName) && input.pkgName.every((elem, _index5)=>"string" == typeof elem)) && (void 0 === input.retainProp || Array.isArray(input.retainProp) && input.retainProp.every((elem, _index6)=>"string" == typeof elem)) && (void 0 === input.removeCallParams || Array.isArray(input.removeCallParams) && input.removeCallParams.every((elem, _index7)=>"string" == typeof elem)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
659
+ const _io4 = (input, _exceptionable = true)=>(void 0 === input.pkgName || Array.isArray(input.pkgName) && input.pkgName.every((elem, _index5)=>"string" == typeof elem)) && (void 0 === input.retainProp || Array.isArray(input.retainProp) && input.retainProp.every((elem, _index6)=>"string" == typeof elem)) && (void 0 === input.removeCall || Array.isArray(input.removeCall) && input.removeCall.every((elem, _index7)=>"string" == typeof elem)) && (void 0 === input.removeCallParams || Array.isArray(input.removeCallParams) && input.removeCallParams.every((elem, _index8)=>"string" == typeof elem)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
660
660
  if ([
661
661
  "pkgName",
662
662
  "retainProp",
663
+ "removeCall",
663
664
  "removeCallParams"
664
665
  ].some((prop)=>key === prop)) return true;
665
666
  const value = input[key];
@@ -711,9 +712,9 @@ const validateConfig = (()=>{
711
712
  path: _path + ".customCSSInheritanceList",
712
713
  expected: "(Array<string> | undefined)",
713
714
  value: input.customCSSInheritanceList
714
- }, _errorFactory)) && input.customCSSInheritanceList.every((elem, _index8)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
715
+ }, _errorFactory)) && input.customCSSInheritanceList.every((elem, _index9)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
715
716
  method: "typia.createAssertEquals",
716
- path: _path + ".customCSSInheritanceList[" + _index8 + "]",
717
+ path: _path + ".customCSSInheritanceList[" + _index9 + "]",
717
718
  expected: "string",
718
719
  value: elem
719
720
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -884,9 +885,9 @@ const validateConfig = (()=>{
884
885
  path: _path + ".componentsPkg",
885
886
  expected: "(Array<string> | undefined)",
886
887
  value: input.componentsPkg
887
- }, _errorFactory)) && input.componentsPkg.every((elem, _index9)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
888
+ }, _errorFactory)) && input.componentsPkg.every((elem, _index10)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
888
889
  method: "typia.createAssertEquals",
889
- path: _path + ".componentsPkg[" + _index9 + "]",
890
+ path: _path + ".componentsPkg[" + _index10 + "]",
890
891
  expected: "string",
891
892
  value: elem
892
893
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -899,9 +900,9 @@ const validateConfig = (()=>{
899
900
  path: _path + ".oldRuntimePkg",
900
901
  expected: "(Array<string> | undefined)",
901
902
  value: input.oldRuntimePkg
902
- }, _errorFactory)) && input.oldRuntimePkg.every((elem, _index10)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
903
+ }, _errorFactory)) && input.oldRuntimePkg.every((elem, _index11)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
903
904
  method: "typia.createAssertEquals",
904
- path: _path + ".oldRuntimePkg[" + _index10 + "]",
905
+ path: _path + ".oldRuntimePkg[" + _index11 + "]",
905
906
  expected: "string",
906
907
  value: elem
907
908
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -919,9 +920,9 @@ const validateConfig = (()=>{
919
920
  path: _path + ".additionalComponentAttributes",
920
921
  expected: "(Array<string> | undefined)",
921
922
  value: input.additionalComponentAttributes
922
- }, _errorFactory)) && input.additionalComponentAttributes.every((elem, _index11)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
923
+ }, _errorFactory)) && input.additionalComponentAttributes.every((elem, _index12)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
923
924
  method: "typia.createAssertEquals",
924
- path: _path + ".additionalComponentAttributes[" + _index11 + "]",
925
+ path: _path + ".additionalComponentAttributes[" + _index12 + "]",
925
926
  expected: "string",
926
927
  value: elem
927
928
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -1042,9 +1043,9 @@ const validateConfig = (()=>{
1042
1043
  path: _path + ".pkgName",
1043
1044
  expected: "(Array<string> | undefined)",
1044
1045
  value: input.pkgName
1045
- }, _errorFactory)) && input.pkgName.every((elem, _index12)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1046
+ }, _errorFactory)) && input.pkgName.every((elem, _index13)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1046
1047
  method: "typia.createAssertEquals",
1047
- path: _path + ".pkgName[" + _index12 + "]",
1048
+ path: _path + ".pkgName[" + _index13 + "]",
1048
1049
  expected: "string",
1049
1050
  value: elem
1050
1051
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -1057,9 +1058,9 @@ const validateConfig = (()=>{
1057
1058
  path: _path + ".retainProp",
1058
1059
  expected: "(Array<string> | undefined)",
1059
1060
  value: input.retainProp
1060
- }, _errorFactory)) && input.retainProp.every((elem, _index13)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1061
+ }, _errorFactory)) && input.retainProp.every((elem, _index14)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1061
1062
  method: "typia.createAssertEquals",
1062
- path: _path + ".retainProp[" + _index13 + "]",
1063
+ path: _path + ".retainProp[" + _index14 + "]",
1063
1064
  expected: "string",
1064
1065
  value: elem
1065
1066
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -1067,14 +1068,29 @@ const validateConfig = (()=>{
1067
1068
  path: _path + ".retainProp",
1068
1069
  expected: "(Array<string> | undefined)",
1069
1070
  value: input.retainProp
1071
+ }, _errorFactory)) && (void 0 === input.removeCall || (Array.isArray(input.removeCall) || _assertGuard._assertGuard(_exceptionable, {
1072
+ method: "typia.createAssertEquals",
1073
+ path: _path + ".removeCall",
1074
+ expected: "(Array<string> | undefined)",
1075
+ value: input.removeCall
1076
+ }, _errorFactory)) && input.removeCall.every((elem, _index15)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1077
+ method: "typia.createAssertEquals",
1078
+ path: _path + ".removeCall[" + _index15 + "]",
1079
+ expected: "string",
1080
+ value: elem
1081
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
1082
+ method: "typia.createAssertEquals",
1083
+ path: _path + ".removeCall",
1084
+ expected: "(Array<string> | undefined)",
1085
+ value: input.removeCall
1070
1086
  }, _errorFactory)) && (void 0 === input.removeCallParams || (Array.isArray(input.removeCallParams) || _assertGuard._assertGuard(_exceptionable, {
1071
1087
  method: "typia.createAssertEquals",
1072
1088
  path: _path + ".removeCallParams",
1073
1089
  expected: "(Array<string> | undefined)",
1074
1090
  value: input.removeCallParams
1075
- }, _errorFactory)) && input.removeCallParams.every((elem, _index14)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1091
+ }, _errorFactory)) && input.removeCallParams.every((elem, _index16)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
1076
1092
  method: "typia.createAssertEquals",
1077
- path: _path + ".removeCallParams[" + _index14 + "]",
1093
+ path: _path + ".removeCallParams[" + _index16 + "]",
1078
1094
  expected: "string",
1079
1095
  value: elem
1080
1096
  }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
@@ -1086,6 +1102,7 @@ const validateConfig = (()=>{
1086
1102
  if ([
1087
1103
  "pkgName",
1088
1104
  "retainProp",
1105
+ "removeCall",
1089
1106
  "removeCallParams"
1090
1107
  ].some((prop)=>key === prop)) return true;
1091
1108
  const value = input[key];
package/dist/index.d.ts CHANGED
@@ -446,6 +446,8 @@ export declare interface PluginReactLynxOptions {
446
446
  * @remarks
447
447
  *
448
448
  * These options should only be used for migrating from ReactLynx2.0.
449
+ *
450
+ * @defaultValue `undefined`
449
451
  */
450
452
  compat?: Partial<CompatVisitorConfig> & {
451
453
  /**
@@ -484,6 +486,8 @@ export declare interface PluginReactLynxOptions {
484
486
  * ],
485
487
  * }
486
488
  * ```
489
+ *
490
+ * @defaultValue `undefined`
487
491
  */
488
492
  customCSSInheritanceList?: string[] | undefined;
489
493
  /**
@@ -492,19 +496,23 @@ export declare interface PluginReactLynxOptions {
492
496
  * @remarks
493
497
  * This is recommended to be set to true to reduce template size.
494
498
  *
499
+ * @defaultValue `true`
500
+ *
495
501
  * @public
496
502
  */
497
503
  debugInfoOutside?: boolean;
498
504
  /**
499
505
  * defaultDisplayLinear controls whether the default value of `display` in CSS is `linear`.
500
506
  *
501
- * @remarks
502
- *
503
507
  * If `defaultDisplayLinear === false`, the default `display` would be `flex` instead of `linear`.
508
+ *
509
+ * @defaultValue `true`
504
510
  */
505
511
  defaultDisplayLinear?: boolean;
506
512
  /**
507
513
  * enableAccessibilityElement set the default value of `accessibility-element` for all `<view />` elements.
514
+ *
515
+ * @defaultValue `false`
508
516
  */
509
517
  enableAccessibilityElement?: boolean;
510
518
  /**
@@ -539,6 +547,8 @@ export declare interface PluginReactLynxOptions {
539
547
  * - `text-shadow`
540
548
  *
541
549
  * It is recommended to use with {@link PluginReactLynxOptions.customCSSInheritanceList} to avoid performance issues.
550
+ *
551
+ * @defaultValue `false`
542
552
  */
543
553
  enableCSSInheritance?: boolean;
544
554
  /**
@@ -554,11 +564,15 @@ export declare interface PluginReactLynxOptions {
554
564
  *
555
565
  * We find that collecting invalidation nodes and updating them is a relatively time-consuming process.
556
566
  * If there is no such usage and better style matching performance is needed, this feature can be selectively disabled.
567
+ *
568
+ * @defaultValue `true`
557
569
  */
558
570
  enableCSSInvalidation?: boolean;
559
571
  /**
560
572
  * enableCSSSelector controls whether enabling the new CSS implementation.
561
573
  *
574
+ * @defaultValue `true`
575
+ *
562
576
  * @public
563
577
  */
564
578
  enableCSSSelector?: boolean;
@@ -607,25 +621,35 @@ export declare interface PluginReactLynxOptions {
607
621
  enableSSR?: boolean;
608
622
  /**
609
623
  * removeDescendantSelectorScope is used to remove the scope of descendant selectors.
624
+ *
625
+ * @defaultValue `true`
610
626
  */
611
627
  removeDescendantSelectorScope?: boolean;
612
628
  /**
613
629
  * How main-thread code will be shaken.
630
+ *
631
+ * @defaultValue `undefined`
614
632
  */
615
633
  shake?: Partial<ShakeVisitorConfig> | undefined;
616
634
  /**
617
635
  * Like `define` in various bundlers, but this one happens at transform time, and a DCE pass will be performed.
636
+ *
637
+ * @defaultValue `undefined`
618
638
  */
619
639
  defineDCE?: Partial<DefineDceVisitorConfig> | undefined;
620
640
  /**
621
641
  * `engineVersion` specifies the minimum Lynx Engine version required for an App bundle to function properly.
622
642
  *
643
+ * @defaultValue `'3.2'`
644
+ *
623
645
  * @public
624
646
  */
625
647
  engineVersion?: string;
626
648
  /**
627
649
  * targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on.
628
650
  *
651
+ * @defaultValue `'3.2'`
652
+ *
629
653
  * @public
630
654
  * @deprecated `targetSdkVersion` is now an alias of {@link PluginReactLynxOptions.engineVersion}. Use {@link PluginReactLynxOptions.engineVersion} instead.
631
655
  */
@@ -653,6 +677,8 @@ export declare interface PluginReactLynxOptions {
653
677
  /**
654
678
  * Generate standalone lazy bundle.
655
679
  *
680
+ * @defaultValue `false`
681
+ *
656
682
  * @alpha
657
683
  */
658
684
  experimental_isLazyBundle?: boolean;
@@ -727,6 +753,32 @@ export declare interface ShakeVisitorConfig {
727
753
  * @public
728
754
  */
729
755
  retainProp: Array<string>
756
+ /**
757
+ * Function names whose calls should be replaced with `undefined` during transformation
758
+ *
759
+ * @example
760
+ * ```js
761
+ * import { defineConfig } from '@lynx-js/rspeedy'
762
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
763
+ *
764
+ * export default defineConfig({
765
+ * plugins: [
766
+ * pluginReactLynx({
767
+ * shake: {
768
+ * removeCall: ['useMyCustomEffect']
769
+ * }
770
+ * })
771
+ * ]
772
+ * })
773
+ * ```
774
+ *
775
+ * @remarks
776
+ * Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
777
+ * The provided values will be merged with the default values instead of replacing them.
778
+ *
779
+ * @public
780
+ */
781
+ removeCall: Array<string>
730
782
  /**
731
783
  * Function names whose parameters should be removed during transformation
732
784
  *
@@ -747,7 +799,7 @@ export declare interface ShakeVisitorConfig {
747
799
  * ```
748
800
  *
749
801
  * @remarks
750
- * Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
802
+ * Default value: `[]`
751
803
  * The provided values will be merged with the default values instead of replacing them.
752
804
  *
753
805
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,18 +33,18 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@lynx-js/css-extract-webpack-plugin": "0.7.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.14.0",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.15.0",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.5",
38
- "@lynx-js/react-webpack-plugin": "0.8.0",
38
+ "@lynx-js/react-webpack-plugin": "0.9.0",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.3",
40
- "@lynx-js/template-webpack-plugin": "0.10.7",
40
+ "@lynx-js/template-webpack-plugin": "0.10.8",
41
41
  "@lynx-js/use-sync-external-store": "1.5.0",
42
42
  "background-only": "^0.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "7.57.6",
45
+ "@microsoft/api-extractor": "7.58.2",
46
46
  "@rollup/plugin-typescript": "^12.3.0",
47
- "@rsbuild/core": "1.7.4",
47
+ "@rsbuild/core": "1.7.5",
48
48
  "@rsbuild/plugin-sass": "1.5.0",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.2.2",
50
50
  "rsbuild-plugin-arethetypeswrong": "0.2.0",
@@ -54,14 +54,14 @@
54
54
  "type-fest": "^5.4.4",
55
55
  "typia": "10.1.0",
56
56
  "typia-rspack-plugin": "2.2.2",
57
- "@lynx-js/config-rsbuild-plugin": "0.0.1",
58
- "@lynx-js/react": "0.117.1",
57
+ "@lynx-js/config-rsbuild-plugin": "0.0.2",
58
+ "@lynx-js/react": "0.118.0",
59
59
  "@lynx-js/react-transform": "0.2.0",
60
- "@lynx-js/rspeedy": "0.14.0",
60
+ "@lynx-js/rspeedy": "0.14.1",
61
61
  "@lynx-js/vitest-setup": "0.0.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0 || ^0.117.0"
64
+ "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0 || ^0.117.0 || ^0.118.0"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@lynx-js/react": {