@lynx-js/react-rsbuild-plugin 0.12.10 → 0.13.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,30 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **BREAKING CHANGE**: ([#2319](https://github.com/lynx-family/lynx-stack/pull/2319))
8
+
9
+ Change preact package from `@hongzhiyuan/preact` to `@lynx-js/internal-preact`.
10
+
11
+ Upgrade preact from [f7693b72](https://github.com/preactjs/preact/commit/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0) to [55254ef7](https://github.com/preactjs/preact/commit/55254ef7021e563cc1a86fb816058964a1b6a29a), see diffs at [f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).
12
+
13
+ - feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
14
+
15
+ - When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
16
+ - Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [[`f1129ea`](https://github.com/lynx-family/lynx-stack/commit/f1129ea0a84096354a86bc3436c7b0efc109d768), [`27f1cff`](https://github.com/lynx-family/lynx-stack/commit/27f1cffbea99585b547aff669b8e230533987036), [`ed566f0`](https://github.com/lynx-family/lynx-stack/commit/ed566f0fe6a14ffae59d21bd2c5e5dd2755f28a4), [`402ec2b`](https://github.com/lynx-family/lynx-stack/commit/402ec2b34bce286181493e171f95e6a4257a1907)]:
21
+ - @lynx-js/react-webpack-plugin@0.8.0
22
+ - @lynx-js/react-refresh-webpack-plugin@0.3.5
23
+ - @lynx-js/react-alias-rsbuild-plugin@0.13.0
24
+ - @lynx-js/use-sync-external-store@1.5.0
25
+ - @lynx-js/template-webpack-plugin@0.10.6
26
+ - @lynx-js/css-extract-webpack-plugin@0.7.0
27
+
3
28
  ## 0.12.10
4
29
 
5
30
  ### Patch Changes
package/dist/208.js CHANGED
@@ -199,7 +199,7 @@ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
199
199
  const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
200
200
  const EMPTY_HASH = '';
201
201
  function applyEntry(api, options) {
202
- const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
202
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, firstScreenSyncTiming, globalPropsMode, enableSSR, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
203
203
  api.modifyBundlerChain(async (chain, { environment, isDev, isProd })=>{
204
204
  const mainThreadChunks = [];
205
205
  const rsbuildConfig = api.getRsbuildConfig();
@@ -315,6 +315,7 @@ function applyEntry(api, options) {
315
315
  {
316
316
  disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
317
317
  firstScreenSyncTiming,
318
+ globalPropsMode,
318
319
  enableSSR,
319
320
  mainThreadChunks,
320
321
  extractStr,
@@ -489,7 +490,7 @@ const applySplitChunksRule = (api)=>{
489
490
  const extraGroups = {};
490
491
  extraGroups['preact'] = {
491
492
  name: 'lib-preact',
492
- test: /node_modules[\\/](.*?[\\/])?(?:preact|preact[\\/]compat|preact[\\/]hooks|preact[\\/]jsx-runtime)[\\/]/,
493
+ test: /node_modules[\\/](.*?[\\/])?(?:(?:internal-)?preact|(?:internal-)?preact[\\/]compat|(?:internal-)?preact[\\/]hooks|(?:internal-)?preact[\\/]jsx-runtime)[\\/]/,
493
494
  priority: 0
494
495
  };
495
496
  chain.optimization.splitChunks({
@@ -562,7 +563,7 @@ function applyUseSyncExternalStore(api) {
562
563
  const _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_assertGuard.js");
563
564
  const _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@10.1.0_typescript@5.9.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
564
565
  const validateConfig = (()=>{
565
- 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)=>{
566
+ 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) && (void 0 === input.globalPropsMode || "reactive" === input.globalPropsMode || "event" === input.globalPropsMode) && 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)=>{
566
567
  if ([
567
568
  "compat",
568
569
  "customCSSInheritanceList",
@@ -581,6 +582,7 @@ const validateConfig = (()=>{
581
582
  "defineDCE",
582
583
  "engineVersion",
583
584
  "targetSdkVersion",
585
+ "globalPropsMode",
584
586
  "extractStr",
585
587
  "experimental_isLazyBundle"
586
588
  ].some((prop)=>key === prop)) return true;
@@ -762,6 +764,11 @@ const validateConfig = (()=>{
762
764
  path: _path + ".targetSdkVersion",
763
765
  expected: "(string | undefined)",
764
766
  value: input.targetSdkVersion
767
+ }, _errorFactory)) && (void 0 === input.globalPropsMode || "reactive" === input.globalPropsMode || "event" === input.globalPropsMode || _assertGuard._assertGuard(_exceptionable, {
768
+ method: "typia.createAssertEquals",
769
+ path: _path + ".globalPropsMode",
770
+ expected: "(\"event\" | \"reactive\" | undefined)",
771
+ value: input.globalPropsMode
765
772
  }, _errorFactory)) && (null !== input.extractStr || _assertGuard._assertGuard(_exceptionable, {
766
773
  method: "typia.createAssertEquals",
767
774
  path: _path + ".extractStr",
@@ -801,6 +808,7 @@ const validateConfig = (()=>{
801
808
  "defineDCE",
802
809
  "engineVersion",
803
810
  "targetSdkVersion",
811
+ "globalPropsMode",
804
812
  "extractStr",
805
813
  "experimental_isLazyBundle"
806
814
  ].some((prop)=>key === prop)) return true;
@@ -1138,6 +1146,7 @@ function pluginReactLynx(userOptions) {
1138
1146
  targetSdkVersion: '',
1139
1147
  engineVersion: '',
1140
1148
  extractStr: false,
1149
+ globalPropsMode: 'reactive',
1141
1150
  experimental_isLazyBundle: false
1142
1151
  };
1143
1152
  const resolvedOptions = Object.assign(defaultOptions, userOptions, {
package/dist/index.d.ts CHANGED
@@ -630,6 +630,18 @@ export declare interface PluginReactLynxOptions {
630
630
  * @deprecated `targetSdkVersion` is now an alias of {@link PluginReactLynxOptions.engineVersion}. Use {@link PluginReactLynxOptions.engineVersion} instead.
631
631
  */
632
632
  targetSdkVersion?: string;
633
+ /**
634
+ * Configure the update mode of `lynx.__globalProps`.
635
+ *
636
+ * This flag has two options:
637
+ *
638
+ * `'reactive'`: `UpdateGlobalProps` will trigger update automatically.
639
+ *
640
+ * `'event'`: `UpdateGlobalProps` will trigger global event and users need to trigger update in the event handler.
641
+ *
642
+ * @defaultValue `'reactive'`
643
+ */
644
+ globalPropsMode?: 'reactive' | 'event';
633
645
  /**
634
646
  * Merge same string literals in JS and Lepus to reduce output bundle size.
635
647
  * Set to `false` to disable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.12.10",
3
+ "version": "0.13.0",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@lynx-js/css-extract-webpack-plugin": "0.7.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.12.10",
37
- "@lynx-js/react-refresh-webpack-plugin": "0.3.4",
38
- "@lynx-js/react-webpack-plugin": "0.7.4",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.13.0",
37
+ "@lynx-js/react-refresh-webpack-plugin": "0.3.5",
38
+ "@lynx-js/react-webpack-plugin": "0.8.0",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.3",
40
- "@lynx-js/template-webpack-plugin": "0.10.5",
40
+ "@lynx-js/template-webpack-plugin": "0.10.6",
41
41
  "@lynx-js/use-sync-external-store": "1.5.0",
42
42
  "background-only": "^0.0.1"
43
43
  },
@@ -55,13 +55,13 @@
55
55
  "typia": "10.1.0",
56
56
  "typia-rspack-plugin": "2.2.2",
57
57
  "@lynx-js/config-rsbuild-plugin": "0.0.1",
58
- "@lynx-js/react": "0.116.5",
58
+ "@lynx-js/react": "0.117.0",
59
59
  "@lynx-js/react-transform": "0.2.0",
60
- "@lynx-js/rspeedy": "0.13.5",
60
+ "@lynx-js/rspeedy": "0.13.6",
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"
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"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@lynx-js/react": {