@lynx-js/react-rsbuild-plugin 0.18.2 → 0.19.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,34 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Register the snapshot and worklet definitions collected from the background build on the main thread, so a definition the main-thread bundle dropped no longer fails with `Snapshot not found`. ([#3393](https://github.com/lynx-family/lynx-stack/pull/3393))
8
+
9
+ ### Patch Changes
10
+
11
+ - Add `compat.transformLegacyEventAttributeNames` to disable legacy event attribute-name conversion independently from other compatibility transforms. ([#3475](https://github.com/lynx-family/lynx-stack/pull/3475))
12
+ - Updated dependencies [[`21528f1`](https://github.com/lynx-family/lynx-stack/commit/21528f12c347564c40bc0c15de3df7db5ce85afe), [`f391460`](https://github.com/lynx-family/lynx-stack/commit/f391460d176eb84cb30faa0ca1644be388ce216a), [`c58b6f9`](https://github.com/lynx-family/lynx-stack/commit/c58b6f91cf7084d2585f42e00db3dd699c27ed61), [`6cc9624`](https://github.com/lynx-family/lynx-stack/commit/6cc9624fb54dc7f73b6e68e49e2322b8136d3418), [`328f712`](https://github.com/lynx-family/lynx-stack/commit/328f7125d1881cf438e58aa749f1e554a756b652), [`c58b6f9`](https://github.com/lynx-family/lynx-stack/commit/c58b6f91cf7084d2585f42e00db3dd699c27ed61)]:
13
+ - @lynx-js/react-webpack-plugin@0.11.0
14
+ - @lynx-js/react-alias-rsbuild-plugin@0.19.0
15
+ - @lynx-js/template-webpack-plugin@0.15.1
16
+ - @lynx-js/react-refresh-webpack-plugin@0.4.2
17
+ - @lynx-js/use-sync-external-store@1.5.0
18
+ - @lynx-js/css-extract-webpack-plugin@0.10.1
19
+
20
+ ## 0.18.3
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`3b36a4e`](https://github.com/lynx-family/lynx-stack/commit/3b36a4eb378b98f335c7212cb5258c6722efeed6), [`43f74b0`](https://github.com/lynx-family/lynx-stack/commit/43f74b01e1d6af7798e79ddd03c0a972d49c3aea), [`3b36a4e`](https://github.com/lynx-family/lynx-stack/commit/3b36a4eb378b98f335c7212cb5258c6722efeed6)]:
25
+ - @lynx-js/css-extract-webpack-plugin@0.10.1
26
+ - @lynx-js/react-webpack-plugin@0.10.3
27
+ - @lynx-js/template-webpack-plugin@0.15.0
28
+ - @lynx-js/react-alias-rsbuild-plugin@0.18.3
29
+ - @lynx-js/react-refresh-webpack-plugin@0.4.1
30
+ - @lynx-js/use-sync-external-store@1.5.0
31
+
3
32
  ## 0.18.2
4
33
 
5
34
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -51,8 +51,7 @@ export declare interface CompatVisitorConfig {
51
51
  * @public
52
52
  * Specifies the list of component package names that need compatibility processing
53
53
  *
54
- * @remarks
55
- * Default value: `['@lynx-js/react-components']`
54
+ * @defaultValue `['@lynx-js/react-components']`
56
55
  *
57
56
  * @example
58
57
  *
@@ -76,8 +75,7 @@ export declare interface CompatVisitorConfig {
76
75
  * @public
77
76
  * Specifies the list of old runtime package names that need compatibility processing
78
77
  *
79
- * @remarks
80
- * Default value: `['@lynx-js/react-runtime']`
78
+ * @defaultValue `['@lynx-js/react-runtime']`
81
79
  *
82
80
  * @example
83
81
  *
@@ -101,8 +99,7 @@ export declare interface CompatVisitorConfig {
101
99
  * @public
102
100
  * Specifies the new runtime package name
103
101
  *
104
- * @remarks
105
- * Default value: `'@lynx-js/react'`
102
+ * @defaultValue `'@lynx-js/react'`
106
103
  *
107
104
  * @example
108
105
  *
@@ -126,11 +123,11 @@ export declare interface CompatVisitorConfig {
126
123
  * @public
127
124
  * Specifies additional component attributes list, these attributes will be passed to the wrapped `<view>` instead of the component.
128
125
  *
126
+ * @defaultValue `[]`
127
+ *
129
128
  * @remarks
130
129
  * This only takes effect when {@link CompatVisitorConfig.addComponentElement} is enabled.
131
130
  *
132
- * Default value: `[]`
133
- *
134
131
  * @example
135
132
  *
136
133
  * ```js
@@ -153,8 +150,7 @@ export declare interface CompatVisitorConfig {
153
150
  * @public
154
151
  * Controls whether to add wrapper elements for components
155
152
  *
156
- * @remarks
157
- * Default value: `false`
153
+ * @defaultValue `false`
158
154
  *
159
155
  * @example
160
156
  *
@@ -211,8 +207,7 @@ export declare interface CompatVisitorConfig {
211
207
  *
212
208
  * Instead, use `background-only` on class methods for explicit and maintainable behavior
213
209
  *
214
- * @remarks
215
- * Default value: `false`
210
+ * @defaultValue `false`
216
211
  *
217
212
  * @example
218
213
  *
@@ -232,6 +227,17 @@ export declare interface CompatVisitorConfig {
232
227
  * ```
233
228
  */
234
229
  simplifyCtorLikeReactLynx2: boolean
230
+ /**
231
+ * @public
232
+ * Whether to transform legacy event attribute names on Lynx elements.
233
+ *
234
+ * When enabled, legacy event attributes such as `onClick` and
235
+ * `onClickCatch` are transformed to `bindtap` and `catchtap`.
236
+ * Disable this when another transform owns event attribute-name conversion.
237
+ *
238
+ * @defaultValue `true`
239
+ */
240
+ transformLegacyEventAttributeNames?: boolean
235
241
  /**
236
242
  * @public
237
243
  * Regular expression used to remove component attributes
@@ -240,8 +246,7 @@ export declare interface CompatVisitorConfig {
240
246
  *
241
247
  * If your code depends on this switch, when distributing it to other projects through npm packages or other means, you'll also need to enable this switch. This will lead to the proliferation of switches, which is not conducive to code reuse between different projects.
242
248
  *
243
- * @remarks
244
- * Default value: `None`
249
+ * @defaultValue `undefined`
245
250
  *
246
251
  * @example
247
252
  *
@@ -265,8 +270,7 @@ export declare interface CompatVisitorConfig {
265
270
  * @public
266
271
  * Whether to disable deprecated warnings
267
272
  *
268
- * @remarks
269
- * Default value: `false`
273
+ * @defaultValue `false`
270
274
  *
271
275
  * @example
272
276
  *
@@ -293,8 +297,7 @@ export declare interface CompatVisitorConfig {
293
297
  * @deprecated
294
298
  * Dark mode configuration
295
299
  *
296
- * @remarks
297
- * Default value: `None`
300
+ * @defaultValue `undefined`
298
301
  *
299
302
  * @example
300
303
  *
@@ -421,8 +424,7 @@ export declare interface ExtractStrConfig {
421
424
  * @public
422
425
  * The minimum length of string literals to be extracted.
423
426
  *
424
- * @remarks
425
- * Default value: `20`.
427
+ * @defaultValue `20`
426
428
  *
427
429
  * @example
428
430
  *
@@ -793,9 +795,11 @@ export declare interface ShakeVisitorConfig {
793
795
  * })
794
796
  * ```
795
797
  *
798
+ * @defaultValue `['@lynx-js/react-runtime']`
799
+ *
796
800
  * @remarks
797
- * Default value: `['@lynx-js/react-runtime']`
798
801
  * The provided values will be merged with the default values instead of replacing them.
802
+ *
799
803
  * @public
800
804
  */
801
805
  pkgName: Array<string>
@@ -818,8 +822,9 @@ export declare interface ShakeVisitorConfig {
818
822
  * })
819
823
  * ```
820
824
  *
825
+ * @defaultValue `['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`
826
+ *
821
827
  * @remarks
822
- * Default value: `['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`
823
828
  * The provided values will be merged with the default values instead of replacing them.
824
829
  *
825
830
  * @public
@@ -844,8 +849,9 @@ export declare interface ShakeVisitorConfig {
844
849
  * })
845
850
  * ```
846
851
  *
852
+ * @defaultValue `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
853
+ *
847
854
  * @remarks
848
- * Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
849
855
  * The provided values will be merged with the default values instead of replacing them.
850
856
  *
851
857
  * @public
@@ -870,8 +876,9 @@ export declare interface ShakeVisitorConfig {
870
876
  * })
871
877
  * ```
872
878
  *
879
+ * @defaultValue `[]`
880
+ *
873
881
  * @remarks
874
- * Default value: `[]`
875
882
  * The provided values will be merged with the default values instead of replacing them.
876
883
  *
877
884
  * @public
package/dist/index.js CHANGED
@@ -138,6 +138,7 @@ function applyEntry(api, options) {
138
138
  const lazyBundleFetcher = resolveLazyBundleFetcher(targetSdkVersion);
139
139
  api.modifyBundlerChain(async (chain, { environment, isDev, isProd })=>{
140
140
  const mainThreadChunks = [];
141
+ const entryPairs = [];
141
142
  const rsbuildConfig = api.getRsbuildConfig();
142
143
  const userConfig = api.getRsbuildConfig('original');
143
144
  const chunkSplitStrategy = userConfig.performance?.chunkSplit?.strategy;
@@ -174,6 +175,10 @@ function applyEntry(api, options) {
174
175
  const backgroundName = node_path.posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', getBackgroundFilename(entryName, environment.config, isProd, experimental_isLazyBundle));
175
176
  const backgroundEntry = entryName;
176
177
  mainThreadChunks.push(mainThreadName);
178
+ entryPairs.push({
179
+ mainThread: mainThreadEntry,
180
+ background: backgroundEntry
181
+ });
177
182
  chain.entry(mainThreadEntry).add({
178
183
  layer: LAYERS.MAIN_THREAD,
179
184
  import: imports,
@@ -273,6 +278,7 @@ function applyEntry(api, options) {
273
278
  globalPropsMode,
274
279
  enableSSR,
275
280
  mainThreadChunks,
281
+ entryPairs,
276
282
  extractStr,
277
283
  experimental_isLazyBundle,
278
284
  experimental_useElementTemplate: options.experimental_useElementTemplate,
@@ -676,7 +682,7 @@ const validateConfig = (()=>{
676
682
  if (void 0 === value) return true;
677
683
  return false;
678
684
  }));
679
- const _io1 = (input, _exceptionable = true)=>(void 0 === input.componentsPkg || Array.isArray(input.componentsPkg) && input.componentsPkg.every((elem, _index2)=>"string" == typeof elem)) && (void 0 === input.oldRuntimePkg || Array.isArray(input.oldRuntimePkg) && input.oldRuntimePkg.every((elem, _index3)=>"string" == typeof elem)) && (void 0 === input.newRuntimePkg || "string" == typeof input.newRuntimePkg) && (void 0 === input.additionalComponentAttributes || Array.isArray(input.additionalComponentAttributes) && input.additionalComponentAttributes.every((elem, _index4)=>"string" == typeof elem)) && null !== input.addComponentElement && (void 0 === input.addComponentElement || "boolean" == typeof input.addComponentElement || "object" == typeof input.addComponentElement && null !== input.addComponentElement && _io2(input.addComponentElement, _exceptionable)) && (void 0 === input.simplifyCtorLikeReactLynx2 || "boolean" == typeof input.simplifyCtorLikeReactLynx2) && (void 0 === input.removeComponentAttrRegex || "string" == typeof input.removeComponentAttrRegex) && (void 0 === input.disableDeprecatedWarning || "boolean" == typeof input.disableDeprecatedWarning) && null !== input.darkMode && (void 0 === input.darkMode || "boolean" == typeof input.darkMode || "object" == typeof input.darkMode && null !== input.darkMode && _io3(input.darkMode, _exceptionable)) && (void 0 === input.legacySlot || "boolean" == typeof input.legacySlot) && (void 0 === input.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
685
+ const _io1 = (input, _exceptionable = true)=>(void 0 === input.componentsPkg || Array.isArray(input.componentsPkg) && input.componentsPkg.every((elem, _index2)=>"string" == typeof elem)) && (void 0 === input.oldRuntimePkg || Array.isArray(input.oldRuntimePkg) && input.oldRuntimePkg.every((elem, _index3)=>"string" == typeof elem)) && (void 0 === input.newRuntimePkg || "string" == typeof input.newRuntimePkg) && (void 0 === input.additionalComponentAttributes || Array.isArray(input.additionalComponentAttributes) && input.additionalComponentAttributes.every((elem, _index4)=>"string" == typeof elem)) && null !== input.addComponentElement && (void 0 === input.addComponentElement || "boolean" == typeof input.addComponentElement || "object" == typeof input.addComponentElement && null !== input.addComponentElement && _io2(input.addComponentElement, _exceptionable)) && (void 0 === input.simplifyCtorLikeReactLynx2 || "boolean" == typeof input.simplifyCtorLikeReactLynx2) && (void 0 === input.transformLegacyEventAttributeNames || "boolean" == typeof input.transformLegacyEventAttributeNames) && (void 0 === input.removeComponentAttrRegex || "string" == typeof input.removeComponentAttrRegex) && (void 0 === input.disableDeprecatedWarning || "boolean" == typeof input.disableDeprecatedWarning) && null !== input.darkMode && (void 0 === input.darkMode || "boolean" == typeof input.darkMode || "object" == typeof input.darkMode && null !== input.darkMode && _io3(input.darkMode, _exceptionable)) && (void 0 === input.legacySlot || "boolean" == typeof input.legacySlot) && (void 0 === input.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
680
686
  if ([
681
687
  "componentsPkg",
682
688
  "oldRuntimePkg",
@@ -684,6 +690,7 @@ const validateConfig = (()=>{
684
690
  "additionalComponentAttributes",
685
691
  "addComponentElement",
686
692
  "simplifyCtorLikeReactLynx2",
693
+ "transformLegacyEventAttributeNames",
687
694
  "removeComponentAttrRegex",
688
695
  "disableDeprecatedWarning",
689
696
  "darkMode",
@@ -1047,6 +1054,11 @@ const validateConfig = (()=>{
1047
1054
  path: _path + ".simplifyCtorLikeReactLynx2",
1048
1055
  expected: "(boolean | undefined)",
1049
1056
  value: input.simplifyCtorLikeReactLynx2
1057
+ }, _errorFactory)) && (void 0 === input.transformLegacyEventAttributeNames || "boolean" == typeof input.transformLegacyEventAttributeNames || _assertGuard(_exceptionable, {
1058
+ method: "typia.createAssertEquals",
1059
+ path: _path + ".transformLegacyEventAttributeNames",
1060
+ expected: "(boolean | undefined)",
1061
+ value: input.transformLegacyEventAttributeNames
1050
1062
  }, _errorFactory)) && (void 0 === input.removeComponentAttrRegex || "string" == typeof input.removeComponentAttrRegex || _assertGuard(_exceptionable, {
1051
1063
  method: "typia.createAssertEquals",
1052
1064
  path: _path + ".removeComponentAttrRegex",
@@ -1090,6 +1102,7 @@ const validateConfig = (()=>{
1090
1102
  "additionalComponentAttributes",
1091
1103
  "addComponentElement",
1092
1104
  "simplifyCtorLikeReactLynx2",
1105
+ "transformLegacyEventAttributeNames",
1093
1106
  "removeComponentAttrRegex",
1094
1107
  "disableDeprecatedWarning",
1095
1108
  "darkMode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.18.2",
3
+ "version": "0.19.0",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,37 +33,37 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "tiny-invariant": "^1.3.3",
36
- "@lynx-js/css-extract-webpack-plugin": "0.10.0",
37
- "@lynx-js/react-alias-rsbuild-plugin": "0.18.2",
38
- "@lynx-js/react-refresh-webpack-plugin": "0.4.1",
39
- "@lynx-js/react-webpack-plugin": "0.10.2",
36
+ "@lynx-js/css-extract-webpack-plugin": "0.10.1",
37
+ "@lynx-js/react-alias-rsbuild-plugin": "0.19.0",
38
+ "@lynx-js/react-refresh-webpack-plugin": "0.4.2",
39
+ "@lynx-js/react-webpack-plugin": "0.11.0",
40
40
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.2.3",
41
- "@lynx-js/template-webpack-plugin": "0.14.1",
41
+ "@lynx-js/template-webpack-plugin": "0.15.1",
42
42
  "@lynx-js/use-sync-external-store": "1.5.0",
43
43
  "background-only": "^0.0.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "7.58.12",
47
- "@rsbuild/core": "2.1.7",
47
+ "@rsbuild/core": "2.1.10",
48
48
  "@rsbuild/plugin-sass": "2.0.1",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.2.4",
50
- "@rstest/core": "0.11.3",
50
+ "@rstest/core": "0.11.6",
51
51
  "rsbuild-plugin-arethetypeswrong": "0.3.1",
52
52
  "rsbuild-plugin-publint": "1.0.0",
53
- "source-map": "^0.7.6",
53
+ "source-map": "^0.8.0",
54
54
  "tailwindcss": "^3.4.19",
55
55
  "type-fest": "^5.8.0",
56
56
  "typia": "12.1.1",
57
57
  "typia-rspack-plugin": "3.0.1",
58
- "@lynx-js/config-rsbuild-plugin": "0.2.1",
58
+ "@lynx-js/config-rsbuild-plugin": "0.2.2",
59
59
  "@lynx-js/debug-metadata": "0.1.0",
60
- "@lynx-js/react": "0.123.2",
60
+ "@lynx-js/react": "0.124.0",
61
61
  "@lynx-js/react-transform": "0.2.0",
62
- "@lynx-js/rspeedy": "0.16.2",
62
+ "@lynx-js/rspeedy": "0.16.4",
63
63
  "@lynx-js/test-tools": "0.0.0"
64
64
  },
65
65
  "peerDependencies": {
66
- "@lynx-js/react": "^0.123.0"
66
+ "@lynx-js/react": "^0.124.0"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@lynx-js/react": {