@lynx-js/react-rsbuild-plugin-canary 0.11.0 → 1.0.0-canary-20250918-b69a986a

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,6 +1,6 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
- ## 0.11.0
3
+ ## 1.0.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -8,19 +8,16 @@
8
8
 
9
9
  Since the thread element resolution is still in experimental stage and may have stability risks, it will be disabled by default after this change.
10
10
 
11
- - **BREAKING CHANGE**: Remove the `enableICU` option. ([#1800](https://github.com/lynx-family/lynx-stack/pull/1800))
12
-
13
11
  ### Patch Changes
14
12
 
15
- - Be compat with `@lynx-js/react` v0.114.0 ([#1781](https://github.com/lynx-family/lynx-stack/pull/1781))
16
-
17
- - Updated dependencies [[`24100ab`](https://github.com/lynx-family/lynx-stack/commit/24100ab63302f8f2bc10578c70ac5cceeffe312a), [`24100ab`](https://github.com/lynx-family/lynx-stack/commit/24100ab63302f8f2bc10578c70ac5cceeffe312a), [`d0ef559`](https://github.com/lynx-family/lynx-stack/commit/d0ef559fac383634437880681855923968b4fa65)]:
18
- - @lynx-js/template-webpack-plugin@0.9.0
19
- - @lynx-js/react-webpack-plugin@0.7.1
20
- - @lynx-js/css-extract-webpack-plugin@0.6.3
21
- - @lynx-js/react-alias-rsbuild-plugin@0.11.0
22
- - @lynx-js/use-sync-external-store@1.5.0
13
+ - Updated dependencies [[`24100ab`](https://github.com/lynx-family/lynx-stack/commit/24100ab63302f8f2bc10578c70ac5cceeffe312a), [`24100ab`](https://github.com/lynx-family/lynx-stack/commit/24100ab63302f8f2bc10578c70ac5cceeffe312a), [`8b741a0`](https://github.com/lynx-family/lynx-stack/commit/8b741a09dac5218ad921dbbe2b33d1aaebff6141), [`f09e0aa`](https://github.com/lynx-family/lynx-stack/commit/f09e0aac48d5dd890d8e94c41536d6b721a968d6), [`7f46fdc`](https://github.com/lynx-family/lynx-stack/commit/7f46fdcb53b66adcd0bd74c05fda8eef00fd10e4)]:
14
+ - @lynx-js/template-webpack-plugin@0.9.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
15
+ - @lynx-js/react-webpack-plugin@0.7.1-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
16
+ - @lynx-js/css-extract-webpack-plugin@0.6.3-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
17
+ - @lynx-js/react@0.114.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
18
+ - @lynx-js/react-alias-rsbuild-plugin@1.0.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
23
19
  - @lynx-js/react-refresh-webpack-plugin@0.3.4
20
+ - @lynx-js/use-sync-external-store@1.5.0
24
21
 
25
22
  ## 0.10.14
26
23
 
@@ -161,28 +158,28 @@
161
158
 
162
159
  ```ts
163
160
  type InlineChunkTestFunction = (params: {
164
- size: number
165
- name: string
166
- }) => boolean
161
+ size: number;
162
+ name: string;
163
+ }) => boolean;
167
164
 
168
- type InlineChunkTest = RegExp | InlineChunkTestFunction
165
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
169
166
 
170
167
  type InlineChunkConfig =
171
168
  | boolean
172
169
  | InlineChunkTest
173
- | { enable?: boolean | 'auto', test: InlineChunkTest }
170
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
174
171
  ```
175
172
 
176
173
  ```ts
177
- import { defineConfig } from '@lynx-js/rspeedy'
174
+ import { defineConfig } from "@lynx-js/rspeedy";
178
175
 
179
176
  export default defineConfig({
180
177
  output: {
181
178
  inlineScripts: ({ name, size }) => {
182
- return name.includes('foo') && size < 1000
179
+ return name.includes("foo") && size < 1000;
183
180
  },
184
181
  },
185
- })
182
+ });
186
183
  ```
187
184
 
188
185
  - 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)]:
@@ -262,13 +259,13 @@
262
259
  example:
263
260
 
264
261
  ```js
265
- import { defineConfig } from '@lynx-js/rspeedy'
262
+ import { defineConfig } from "@lynx-js/rspeedy";
266
263
 
267
264
  export default defineConfig({
268
265
  output: {
269
266
  inlineScripts: false,
270
267
  },
271
- })
268
+ });
272
269
  ```
273
270
 
274
271
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -355,7 +352,7 @@
355
352
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
356
353
 
357
354
  ```js
358
- import { defineConfig } from '@lynx-js/rspeedy'
355
+ import { defineConfig } from "@lynx-js/rspeedy";
359
356
 
360
357
  export default defineConfig({
361
358
  tools: {
@@ -367,7 +364,7 @@
367
364
  },
368
365
  },
369
366
  },
370
- })
367
+ });
371
368
  ```
372
369
 
373
370
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -543,7 +540,7 @@
543
540
  You may turn it off using `output.minify.css: false`:
544
541
 
545
542
  ```js
546
- import { defineConfig } from '@lynx-js/rspeedy'
543
+ import { defineConfig } from "@lynx-js/rspeedy";
547
544
 
548
545
  export default defineConfig({
549
546
  output: {
@@ -551,18 +548,18 @@
551
548
  css: false,
552
549
  },
553
550
  },
554
- })
551
+ });
555
552
  ```
556
553
 
557
554
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
558
555
 
559
556
  ```js
560
- import { defineConfig } from '@lynx-js/rspeedy'
561
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
557
+ import { defineConfig } from "@lynx-js/rspeedy";
558
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
562
559
 
563
560
  export default defineConfig({
564
561
  plugins: [pluginCssMinimizer()],
565
- })
562
+ });
566
563
  ```
567
564
 
568
565
  ### Patch Changes
@@ -642,18 +639,18 @@
642
639
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
643
640
 
644
641
  ```js
645
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
646
- import { defineConfig } from '@lynx-js/rspeedy'
642
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
643
+ import { defineConfig } from "@lynx-js/rspeedy";
647
644
 
648
645
  export default defineConfig({
649
646
  plugins: [
650
647
  pluginReactLynx({
651
648
  defineDCE: {
652
- __SOME_FALSE_DEFINE__: 'false',
649
+ __SOME_FALSE_DEFINE__: "false",
653
650
  },
654
651
  }),
655
652
  ],
656
- })
653
+ });
657
654
  ```
658
655
 
659
656
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -661,20 +658,20 @@
661
658
  For example, `import` initialized by dead code will be removed:
662
659
 
663
660
  ```js
664
- import { foo } from 'bar'
661
+ import { foo } from "bar";
665
662
 
666
663
  if (__SOME_FALSE_DEFINE__) {
667
- foo()
668
- console.log('dead code')
664
+ foo();
665
+ console.log("dead code");
669
666
  } else {
670
- console.log('reachable code')
667
+ console.log("reachable code");
671
668
  }
672
669
  ```
673
670
 
674
671
  will be transformed to:
675
672
 
676
673
  ```js
677
- console.log('reachable code')
674
+ console.log("reachable code");
678
675
  ```
679
676
 
680
677
  - Updated dependencies [8dd6cca]
@@ -717,18 +714,18 @@
717
714
  - a30c83d: Add `compat.removeComponentAttrRegex`.
718
715
 
719
716
  ```js
720
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
721
- import { defineConfig } from '@lynx-js/rspeedy'
717
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
718
+ import { defineConfig } from "@lynx-js/rspeedy";
722
719
 
723
720
  export default defineConfig({
724
721
  plugins: [
725
722
  pluginReactLynx({
726
723
  compat: {
727
- removeComponentAttrRegex: 'YOUR REGEX',
724
+ removeComponentAttrRegex: "YOUR REGEX",
728
725
  },
729
726
  }),
730
727
  ],
731
- })
728
+ });
732
729
  ```
733
730
 
734
731
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -747,11 +744,11 @@
747
744
 
748
745
  ```javascript
749
746
  // bar.ts
750
- import 'background-only'
747
+ import "background-only";
751
748
 
752
749
  export const bar = () => {
753
- return 'bar'
754
- }
750
+ return "bar";
751
+ };
755
752
  ```
756
753
 
757
754
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -760,15 +757,15 @@
760
757
 
761
758
  ```tsx
762
759
  // App.tsx
763
- import { bar } from './bar.js'
760
+ import { bar } from "./bar.js";
764
761
 
765
762
  function App() {
766
- bar()
763
+ bar();
767
764
  return (
768
765
  <view>
769
766
  <text>Hello, Lynx x rspeedy</text>
770
767
  </view>
771
- )
768
+ );
772
769
  }
773
770
  ```
774
771
 
package/dist/index.d.ts CHANGED
@@ -501,6 +501,14 @@ export declare interface PluginReactLynxOptions {
501
501
  * enableAccessibilityElement set the default value of `accessibility-element` for all `<view />` elements.
502
502
  */
503
503
  enableAccessibilityElement?: boolean;
504
+ /**
505
+ * enableICU enables the Intl API to be enabled globally.
506
+ *
507
+ * If enabled, please double check the compatibility with Lynx Share Context feature to avoid using shared Intl API from other destroyed card.
508
+ *
509
+ * @defaultValue `false`
510
+ */
511
+ enableICU?: boolean;
504
512
  /**
505
513
  * enableCSSInheritance enables the default inheritance properties.
506
514
  *
package/dist/index.js CHANGED
@@ -284,7 +284,7 @@ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
284
284
  const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
285
285
  const EMPTY_HASH = '';
286
286
  function applyEntry(api, options) {
287
- const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
287
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
288
288
  const { config, logger } = api.useExposed(Symbol.for('rspeedy.api'));
289
289
  api.modifyBundlerChain(async (chain, { environment, isDev, isProd })=>{
290
290
  const entries = chain.entryPoints.entries() ?? {};
@@ -339,6 +339,7 @@ function applyEntry(api, options) {
339
339
  defaultDisplayLinear,
340
340
  enableA11y: true,
341
341
  enableAccessibilityElement,
342
+ enableICU,
342
343
  enableCSSInheritance,
343
344
  enableCSSInvalidation,
344
345
  enableCSSSelector,
@@ -606,13 +607,14 @@ function applyUseSyncExternalStore(api) {
606
607
  var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_accessExpressionAsString.js");
607
608
  var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_assertGuard.js");
608
609
  const validateConfig = (()=>{
609
- const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io4(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io5(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && null !== input.extractStr && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || "object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) && _io7(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
610
+ const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io4(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io5(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && null !== input.extractStr && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || "object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) && _io7(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
610
611
  if ([
611
612
  "compat",
612
613
  "customCSSInheritanceList",
613
614
  "debugInfoOutside",
614
615
  "defaultDisplayLinear",
615
616
  "enableAccessibilityElement",
617
+ "enableICU",
616
618
  "enableCSSInheritance",
617
619
  "enableCSSInvalidation",
618
620
  "enableCSSSelector",
@@ -736,6 +738,11 @@ const validateConfig = (()=>{
736
738
  path: _path + ".enableAccessibilityElement",
737
739
  expected: "(boolean | undefined)",
738
740
  value: input.enableAccessibilityElement
741
+ }, _errorFactory)) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU || _assertGuard._assertGuard(_exceptionable, {
742
+ method: "typia.createAssertEquals",
743
+ path: _path + ".enableICU",
744
+ expected: "(boolean | undefined)",
745
+ value: input.enableICU
739
746
  }, _errorFactory)) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance || _assertGuard._assertGuard(_exceptionable, {
740
747
  method: "typia.createAssertEquals",
741
748
  path: _path + ".enableCSSInheritance",
@@ -833,6 +840,7 @@ const validateConfig = (()=>{
833
840
  "debugInfoOutside",
834
841
  "defaultDisplayLinear",
835
842
  "enableAccessibilityElement",
843
+ "enableICU",
836
844
  "enableCSSInheritance",
837
845
  "enableCSSInvalidation",
838
846
  "enableCSSSelector",
@@ -1169,6 +1177,7 @@ function pluginReactLynx(userOptions) {
1169
1177
  debugInfoOutside: true,
1170
1178
  defaultDisplayLinear: true,
1171
1179
  enableAccessibilityElement: false,
1180
+ enableICU: false,
1172
1181
  enableCSSInheritance: false,
1173
1182
  enableCSSInvalidation: true,
1174
1183
  enableCSSSelector: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.11.0",
3
+ "version": "1.0.0-canary-20250918-b69a986a",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,17 +32,17 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.3",
36
- "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.0",
35
+ "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.3-canary-20250918-b69a986a",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@1.0.0-canary-20250918-b69a986a",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
38
- "@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.1",
38
+ "@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.1-canary-20250918-b69a986a",
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.9.0",
40
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.9.0-canary-20250918-b69a986a",
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
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "7.52.13",
45
+ "@microsoft/api-extractor": "7.52.11",
46
46
  "@rollup/plugin-typescript": "^12.1.4",
47
47
  "@rsbuild/core": "1.5.4",
48
48
  "@rsbuild/plugin-sass": "1.4.0",
@@ -53,9 +53,9 @@
53
53
  "type-fest": "^4.41.0",
54
54
  "typia": "9.7.2",
55
55
  "typia-rspack-plugin": "2.2.2",
56
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.114.0",
56
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.114.0-canary-20250918-b69a986a",
57
57
  "@lynx-js/react-transform": "0.2.0",
58
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.3",
58
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.3-canary-20250918-b69a986a",
59
59
  "@lynx-js/vitest-setup": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {