@lynx-js/react-rsbuild-plugin 0.17.1 → 0.18.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 +86 -0
- package/dist/index.d.ts +42 -4
- package/dist/index.js +39 -7
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Stop injecting `webpackChunkName` into dynamic imports so lazy bundle intermediate files stay inside the output directory. ([#2961](https://github.com/lynx-family/lynx-stack/pull/2961))
|
|
8
|
+
|
|
9
|
+
The ReactLynx transform injected `webpackChunkName: "<request>-react__<layer>"`, so a dynamic import resolving above the compiler context (e.g. `import('../../Foo.js')`) leaked `../` into `[name]`/`[id]` and the intermediate js/css/hmr files escaped the output directory. Async chunks now keep rspack's own ids, `__webpack_require__.lynx_aci` maps them by chunk id, and each lazy bundle's intermediate JS and CSS are emitted under `.rspeedy/async/<bundle-name>/<layer>.js` and `<layer>.css` next to its other intermediate outputs (`tasm.json`, `debug-metadata.json`, CSS hot-update files). Explicit `webpackChunkName` comments written by users are still honored and keep the user-controlled `[name]` placement. Main-thread chunks no longer emit CSS hot-update files — CSS only exists on the background thread, and the main-thread HMR runtime receives updates from it.
|
|
10
|
+
|
|
11
|
+
These packages release together and must be upgraded together: `@lynx-js/react-webpack-plugin` and `@lynx-js/css-extract-webpack-plugin` require `@lynx-js/template-webpack-plugin` `^0.13.0`, and `@lynx-js/react-rsbuild-plugin` requires `@lynx-js/react` `^0.123.0`.
|
|
12
|
+
|
|
13
|
+
- Choose the lazy bundle loader from `engineVersion`: use the new `fetchBundle` ([#2584](https://github.com/lynx-family/lynx-stack/pull/2584))
|
|
14
|
+
loader when `engineVersion >= 3.9`, otherwise keep the legacy `QueryComponent`
|
|
15
|
+
loader.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import('./Foo.jsx', { with: { mode: 'sync' | 'async' } })
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Force a loader regardless of `engineVersion` with the `REACT_LAZY_BUNDLE_FETCHER`
|
|
22
|
+
env var (`FetchBundle` / `QueryComponent`).
|
|
23
|
+
|
|
24
|
+
- Add `firstScreenSyncTiming: 'manual'` and a new `markFirstScreenSyncReady()` API exported by `@lynx-js/react`. ([#2826](https://github.com/lynx-family/lynx-stack/pull/2826))
|
|
25
|
+
|
|
26
|
+
In `'manual'` mode, the main thread holds the UI control after the first screen until the business calls `markFirstScreenSyncReady()`, so the handover timing to the background thread (for hydration) is fully controlled by the user. The API can be called from both threads (a background-thread call is forwarded to the main thread) and takes effect once the first-screen tree has finished rendering.
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
pluginReactLynx({
|
|
30
|
+
firstScreenSyncTiming: 'manual',
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { markFirstScreenSyncReady } from '@lynx-js/react'
|
|
36
|
+
|
|
37
|
+
markFirstScreenSyncReady()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Add `compat.legacySlot` to `pluginReactLynx`. When enabled, dynamic children are compiled to the pre-SlotV2 form (JSX `children` + `wrapper` elements + `__DynamicPartChildren`/`__DynamicPartSlot` symbols instead of `$0`/`$1` slot props + `SlotV2`), so the compiled output stays compatible with legacy runtimes without `SlotV2` support (`< 0.120.0`, which shipped the SlotV2 refactor in #1764) — e.g. a standalone lazy bundle consumed by a host App that ships an older runtime. ([#2947](https://github.com/lynx-family/lynx-stack/pull/2947))
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
46
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
47
|
+
|
|
48
|
+
export default defineConfig({
|
|
49
|
+
plugins: [
|
|
50
|
+
pluginReactLynx({
|
|
51
|
+
compat: {
|
|
52
|
+
legacySlot: true,
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The default (SlotV2) codegen is unchanged, and the runtime keeps supporting both forms.
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [[`0a5f3f2`](https://github.com/lynx-family/lynx-stack/commit/0a5f3f2347000124eb266ba24459c615a5bc5520), [`983e33d`](https://github.com/lynx-family/lynx-stack/commit/983e33d73d20f6a9558c5662c7b7983ff3a2fa7a), [`1064984`](https://github.com/lynx-family/lynx-stack/commit/1064984d887eb76f880b8ccfeea096c9d787beca), [`a10dbd8`](https://github.com/lynx-family/lynx-stack/commit/a10dbd8939842ca091981e2ec9fabc95b8920f45), [`34318ea`](https://github.com/lynx-family/lynx-stack/commit/34318ea3432b6484a383707458ed9c4ee19e2097), [`fec4237`](https://github.com/lynx-family/lynx-stack/commit/fec4237b2257455a40a68f33864fb713c147f7d4), [`2b5d83a`](https://github.com/lynx-family/lynx-stack/commit/2b5d83a4b8e3c1f5329de9d9fe7539d38e33e420), [`2b5d83a`](https://github.com/lynx-family/lynx-stack/commit/2b5d83a4b8e3c1f5329de9d9fe7539d38e33e420), [`fec4237`](https://github.com/lynx-family/lynx-stack/commit/fec4237b2257455a40a68f33864fb713c147f7d4), [`fec4237`](https://github.com/lynx-family/lynx-stack/commit/fec4237b2257455a40a68f33864fb713c147f7d4), [`fec4237`](https://github.com/lynx-family/lynx-stack/commit/fec4237b2257455a40a68f33864fb713c147f7d4), [`983e33d`](https://github.com/lynx-family/lynx-stack/commit/983e33d73d20f6a9558c5662c7b7983ff3a2fa7a)]:
|
|
62
|
+
- @lynx-js/react-webpack-plugin@0.10.0
|
|
63
|
+
- @lynx-js/react-refresh-webpack-plugin@0.4.1
|
|
64
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.18.0
|
|
65
|
+
- @lynx-js/css-extract-webpack-plugin@0.9.0
|
|
66
|
+
- @lynx-js/template-webpack-plugin@0.13.0
|
|
67
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
68
|
+
- @lynx-js/runtime-wrapper-webpack-plugin@0.2.2
|
|
69
|
+
|
|
70
|
+
## 0.17.2
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Fix the `web` environment crashing in development because its main thread was bundled with the Rsbuild web HMR runtime. ([#2910](https://github.com/lynx-family/lynx-stack/pull/2910))
|
|
75
|
+
|
|
76
|
+
Previously the `web` environment was compiled with `target: 'web'`, which makes Rsbuild inject its own HMR client (`@rsbuild/core/dist/client/hmr.js`). That client drives `__webpack_require__.hmrM`, which is implemented with `lynx.requireModuleAsync` — an API the web main thread does not provide — so hot updates crashed.
|
|
77
|
+
|
|
78
|
+
The `web` environment now uses the same target and HMR entry as the `lynx` environment, going through Lynx's own HMR runtime instead of the Rsbuild web one.
|
|
79
|
+
|
|
80
|
+
- Updated dependencies [[`7a6577a`](https://github.com/lynx-family/lynx-stack/commit/7a6577a5b29db4020cbba22a911f712bafde7e66), [`d18c3e7`](https://github.com/lynx-family/lynx-stack/commit/d18c3e7a3976569ec9ba2a1b4a1e0e6c3ffa1f1d)]:
|
|
81
|
+
- @lynx-js/runtime-wrapper-webpack-plugin@0.2.1
|
|
82
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.17.2
|
|
83
|
+
- @lynx-js/react-webpack-plugin@0.9.5
|
|
84
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
85
|
+
- @lynx-js/react-refresh-webpack-plugin@0.4.0
|
|
86
|
+
- @lynx-js/template-webpack-plugin@0.12.2
|
|
87
|
+
- @lynx-js/css-extract-webpack-plugin@0.8.0
|
|
88
|
+
|
|
3
89
|
## 0.17.1
|
|
4
90
|
|
|
5
91
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -314,6 +314,40 @@ export declare interface CompatVisitorConfig {
|
|
|
314
314
|
* ```
|
|
315
315
|
*/
|
|
316
316
|
darkMode?: boolean | DarkModeConfig
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Compile dynamic children as children + wrapper (the pre-SlotV2 slot
|
|
320
|
+
* codegen: `Slot`/`Children` dynamic parts rendered through wrapper
|
|
321
|
+
* elements) instead of the default SlotV2 codegen (`$N` slot props).
|
|
322
|
+
*
|
|
323
|
+
* @remarks
|
|
324
|
+
*
|
|
325
|
+
* Enable this when the compiled output needs to run on legacy
|
|
326
|
+
* `@lynx-js/react` runtimes without `SlotV2` support (`< 0.120.0`),
|
|
327
|
+
* e.g. a standalone lazy bundle consumed by a host App that ships an
|
|
328
|
+
* older runtime. It only changes the compile output; the runtime
|
|
329
|
+
* supports both forms.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
*
|
|
333
|
+
* ```js
|
|
334
|
+
* import { defineConfig } from '@lynx-js/rspeedy'
|
|
335
|
+
* import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
336
|
+
*
|
|
337
|
+
* export default defineConfig({
|
|
338
|
+
* plugins: [
|
|
339
|
+
* pluginReactLynx({
|
|
340
|
+
* compat: {
|
|
341
|
+
* legacySlot: true,
|
|
342
|
+
* },
|
|
343
|
+
* })
|
|
344
|
+
* ],
|
|
345
|
+
* })
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @defaultValue `false`
|
|
349
|
+
*/
|
|
350
|
+
legacySlot?: boolean
|
|
317
351
|
}
|
|
318
352
|
|
|
319
353
|
declare interface DarkModeConfig {
|
|
@@ -447,11 +481,12 @@ export declare interface PluginReactLynxOptions {
|
|
|
447
481
|
*/
|
|
448
482
|
enableUiSourceMap?: boolean;
|
|
449
483
|
/**
|
|
450
|
-
* The `compat` option controls compatibilities with
|
|
484
|
+
* The `compat` option controls compatibilities with legacy ReactLynx.
|
|
451
485
|
*
|
|
452
486
|
* @remarks
|
|
453
487
|
*
|
|
454
|
-
* These options should only be used for migrating from ReactLynx2.0
|
|
488
|
+
* These options should only be used for migrating from ReactLynx2.0 or
|
|
489
|
+
* targeting legacy ReactLynx3 runtimes.
|
|
455
490
|
*
|
|
456
491
|
* @defaultValue `undefined`
|
|
457
492
|
*/
|
|
@@ -605,18 +640,21 @@ export declare interface PluginReactLynxOptions {
|
|
|
605
640
|
/**
|
|
606
641
|
* This flag controls when MainThread (Lepus) transfers control to Background after the first screen
|
|
607
642
|
*
|
|
608
|
-
* This flag has
|
|
643
|
+
* This flag has three options:
|
|
609
644
|
*
|
|
610
645
|
* `"immediately"`: Transfer immediately
|
|
611
646
|
*
|
|
612
647
|
* `"jsReady"`: Transfer when background (JS Runtime) is ready
|
|
613
648
|
*
|
|
649
|
+
* `"manual"`: Transfer when the business calls the `markFirstScreenSyncReady()` API exported
|
|
650
|
+
* by `@lynx-js/react`, so the handover timing is fully controlled by the user
|
|
651
|
+
*
|
|
614
652
|
* After handing over control, MainThread (Lepus) runtime can no longer respond to data updates,
|
|
615
653
|
* and data updates will be forwarded to background (JS Runtime) and processed __asynchronously__
|
|
616
654
|
*
|
|
617
655
|
* @defaultValue "immediately"
|
|
618
656
|
*/
|
|
619
|
-
firstScreenSyncTiming?: 'immediately' | 'jsReady';
|
|
657
|
+
firstScreenSyncTiming?: 'immediately' | 'jsReady' | 'manual';
|
|
620
658
|
/**
|
|
621
659
|
* `enableSSR` enable Lynx SSR feature for this build.
|
|
622
660
|
*
|
package/dist/index.js
CHANGED
|
@@ -104,6 +104,28 @@ const normalizeCssLoaderOptions = (options, exportOnlyLocals)=>{
|
|
|
104
104
|
}
|
|
105
105
|
return options;
|
|
106
106
|
};
|
|
107
|
+
const FETCH_BUNDLE_MIN_ENGINE_VERSION = '3.9';
|
|
108
|
+
function resolveLazyBundleFetcher(engineVersion) {
|
|
109
|
+
const meets = meetsMinEngineVersion(engineVersion, FETCH_BUNDLE_MIN_ENGINE_VERSION);
|
|
110
|
+
const envOverride = process.env['REACT_LAZY_BUNDLE_FETCHER'];
|
|
111
|
+
if ('FetchBundle' === envOverride && !meets) throw new Error(`[pluginReactLynx] REACT_LAZY_BUNDLE_FETCHER=FetchBundle requires engineVersion >= ${FETCH_BUNDLE_MIN_ENGINE_VERSION}, but got ${engineVersion ? `'${engineVersion}'` : '<unset>'}. Older hosts do not expose 'lynx.fetchBundle' / 'lynx.loadScript'. Either bump 'engineVersion' to '${FETCH_BUNDLE_MIN_ENGINE_VERSION}' or higher, or unset REACT_LAZY_BUNDLE_FETCHER (the default falls back to 'QueryComponent' on older hosts).`);
|
|
112
|
+
if ('FetchBundle' === envOverride || 'QueryComponent' === envOverride) return envOverride;
|
|
113
|
+
return meets ? 'FetchBundle' : 'QueryComponent';
|
|
114
|
+
}
|
|
115
|
+
function meetsMinEngineVersion(actual, min) {
|
|
116
|
+
if (!actual) return false;
|
|
117
|
+
const actualParts = actual.split('.').map(Number);
|
|
118
|
+
const minParts = min.split('.').map(Number);
|
|
119
|
+
const len = Math.max(actualParts.length, minParts.length);
|
|
120
|
+
for(let i = 0; i < len; i++){
|
|
121
|
+
const a = actualParts[i] ?? 0;
|
|
122
|
+
const m = minParts[i] ?? 0;
|
|
123
|
+
if (Number.isNaN(a) || Number.isNaN(m)) return false;
|
|
124
|
+
if (a > m) break;
|
|
125
|
+
if (a < m) return false;
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
107
129
|
const PLUGIN_NAME_REACT = 'lynx:react';
|
|
108
130
|
const PLUGIN_NAME_TEMPLATE = 'lynx:template';
|
|
109
131
|
const PLUGIN_NAME_RUNTIME_WRAPPER = 'lynx:runtime-wrapper';
|
|
@@ -113,6 +135,7 @@ const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
|
|
|
113
135
|
const EMPTY_HASH = '';
|
|
114
136
|
function applyEntry(api, options) {
|
|
115
137
|
const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, firstScreenSyncTiming, globalPropsMode, enableSSR, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
|
|
138
|
+
const lazyBundleFetcher = resolveLazyBundleFetcher(targetSdkVersion);
|
|
116
139
|
api.modifyBundlerChain(async (chain, { environment, isDev, isProd })=>{
|
|
117
140
|
const mainThreadChunks = [];
|
|
118
141
|
const rsbuildConfig = api.getRsbuildConfig();
|
|
@@ -126,8 +149,8 @@ function applyEntry(api, options) {
|
|
|
126
149
|
const isLynx = 'lynx' === environment.name || environment.name.startsWith('lynx-');
|
|
127
150
|
const isWeb = 'web' === environment.name || environment.name.startsWith('web-');
|
|
128
151
|
const { hmr, liveReload } = environment.config.dev ?? {};
|
|
129
|
-
const enabledHMR = isDev &&
|
|
130
|
-
const enabledLiveReload = isDev &&
|
|
152
|
+
const enabledHMR = isDev && false !== hmr;
|
|
153
|
+
const enabledLiveReload = isDev && false !== liveReload;
|
|
131
154
|
chain.entryPoints.clear();
|
|
132
155
|
Object.entries(entries).forEach(([entryName, entryPoint])=>{
|
|
133
156
|
const { imports } = getChunks(entryName, entryPoint.values());
|
|
@@ -203,6 +226,7 @@ function applyEntry(api, options) {
|
|
|
203
226
|
removeDescendantSelectorScope,
|
|
204
227
|
targetSdkVersion,
|
|
205
228
|
experimental_isLazyBundle,
|
|
229
|
+
lazyBundleFetcher,
|
|
206
230
|
cssPlugins: []
|
|
207
231
|
}
|
|
208
232
|
]).end();
|
|
@@ -253,7 +277,8 @@ function applyEntry(api, options) {
|
|
|
253
277
|
experimental_isLazyBundle,
|
|
254
278
|
experimental_useElementTemplate: options.experimental_useElementTemplate,
|
|
255
279
|
profile: getDefaultProfile(),
|
|
256
|
-
workletRuntimePath: await resolve(`@lynx-js/react/${isDev ? 'worklet-dev-runtime' : 'worklet-runtime'}`)
|
|
280
|
+
workletRuntimePath: await resolve(`@lynx-js/react/${isDev ? 'worklet-dev-runtime' : 'worklet-runtime'}`),
|
|
281
|
+
lazyBundleFetcher
|
|
257
282
|
}
|
|
258
283
|
]);
|
|
259
284
|
function getDefaultProfile() {
|
|
@@ -618,7 +643,7 @@ const _assertGuard = (exceptionable, props, factory)=>{
|
|
|
618
643
|
return false;
|
|
619
644
|
};
|
|
620
645
|
const validateConfig = (()=>{
|
|
621
|
-
const _io0 = (input, _exceptionable = true)=>(void 0 === input.enableUiSourceMap || "boolean" == typeof input.enableUiSourceMap) && (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) && (void 0 === input.experimental_useElementTemplate || "boolean" == typeof input.experimental_useElementTemplate) && null !== input.optimizeBundleSize && (void 0 === input.optimizeBundleSize || "boolean" == typeof input.optimizeBundleSize || "object" == typeof input.optimizeBundleSize && null !== input.optimizeBundleSize && false === Array.isArray(input.optimizeBundleSize) && _io8(input.optimizeBundleSize, _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
|
|
646
|
+
const _io0 = (input, _exceptionable = true)=>(void 0 === input.enableUiSourceMap || "boolean" == typeof input.enableUiSourceMap) && (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 || "manual" === 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) && (void 0 === input.experimental_useElementTemplate || "boolean" == typeof input.experimental_useElementTemplate) && null !== input.optimizeBundleSize && (void 0 === input.optimizeBundleSize || "boolean" == typeof input.optimizeBundleSize || "object" == typeof input.optimizeBundleSize && null !== input.optimizeBundleSize && false === Array.isArray(input.optimizeBundleSize) && _io8(input.optimizeBundleSize, _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
|
|
622
647
|
if ([
|
|
623
648
|
"enableUiSourceMap",
|
|
624
649
|
"compat",
|
|
@@ -648,7 +673,7 @@ const validateConfig = (()=>{
|
|
|
648
673
|
if (void 0 === value) return true;
|
|
649
674
|
return false;
|
|
650
675
|
}));
|
|
651
|
-
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.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
|
|
676
|
+
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)=>{
|
|
652
677
|
if ([
|
|
653
678
|
"componentsPkg",
|
|
654
679
|
"oldRuntimePkg",
|
|
@@ -659,6 +684,7 @@ const validateConfig = (()=>{
|
|
|
659
684
|
"removeComponentAttrRegex",
|
|
660
685
|
"disableDeprecatedWarning",
|
|
661
686
|
"darkMode",
|
|
687
|
+
"legacySlot",
|
|
662
688
|
"disableCreateSelectorQueryIncompatibleWarning"
|
|
663
689
|
].some((prop)=>key === prop)) return true;
|
|
664
690
|
const value = input[key];
|
|
@@ -792,10 +818,10 @@ const validateConfig = (()=>{
|
|
|
792
818
|
path: _path + ".enableRemoveCSSScope",
|
|
793
819
|
expected: "(boolean | undefined)",
|
|
794
820
|
value: input.enableRemoveCSSScope
|
|
795
|
-
}, _errorFactory)) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming || _assertGuard(_exceptionable, {
|
|
821
|
+
}, _errorFactory)) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming || "manual" === input.firstScreenSyncTiming || _assertGuard(_exceptionable, {
|
|
796
822
|
method: "typia.createAssertEquals",
|
|
797
823
|
path: _path + ".firstScreenSyncTiming",
|
|
798
|
-
expected: "(\"immediately\" | \"jsReady\" | undefined)",
|
|
824
|
+
expected: "(\"immediately\" | \"jsReady\" | \"manual\" | undefined)",
|
|
799
825
|
value: input.firstScreenSyncTiming
|
|
800
826
|
}, _errorFactory)) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR || _assertGuard(_exceptionable, {
|
|
801
827
|
method: "typia.createAssertEquals",
|
|
@@ -1012,6 +1038,11 @@ const validateConfig = (()=>{
|
|
|
1012
1038
|
path: _path + ".darkMode",
|
|
1013
1039
|
expected: "(DarkModeConfig | boolean | undefined)",
|
|
1014
1040
|
value: input.darkMode
|
|
1041
|
+
}, _errorFactory)) && (void 0 === input.legacySlot || "boolean" == typeof input.legacySlot || _assertGuard(_exceptionable, {
|
|
1042
|
+
method: "typia.createAssertEquals",
|
|
1043
|
+
path: _path + ".legacySlot",
|
|
1044
|
+
expected: "(boolean | undefined)",
|
|
1045
|
+
value: input.legacySlot
|
|
1015
1046
|
}, _errorFactory)) && (void 0 === input.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning || _assertGuard(_exceptionable, {
|
|
1016
1047
|
method: "typia.createAssertEquals",
|
|
1017
1048
|
path: _path + ".disableCreateSelectorQueryIncompatibleWarning",
|
|
@@ -1028,6 +1059,7 @@ const validateConfig = (()=>{
|
|
|
1028
1059
|
"removeComponentAttrRegex",
|
|
1029
1060
|
"disableDeprecatedWarning",
|
|
1030
1061
|
"darkMode",
|
|
1062
|
+
"legacySlot",
|
|
1031
1063
|
"disableCreateSelectorQueryIncompatibleWarning"
|
|
1032
1064
|
].some((prop)=>key === prop)) return true;
|
|
1033
1065
|
const value = input[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"tiny-invariant": "^1.3.3",
|
|
36
|
-
"@lynx-js/css-extract-webpack-plugin": "0.
|
|
37
|
-
"@lynx-js/react-alias-rsbuild-plugin": "0.
|
|
38
|
-
"@lynx-js/react-refresh-webpack-plugin": "0.4.
|
|
39
|
-
"@lynx-js/react-webpack-plugin": "0.
|
|
40
|
-
"@lynx-js/runtime-wrapper-webpack-plugin": "0.2.
|
|
41
|
-
"@lynx-js/template-webpack-plugin": "0.
|
|
36
|
+
"@lynx-js/css-extract-webpack-plugin": "0.9.0",
|
|
37
|
+
"@lynx-js/react-alias-rsbuild-plugin": "0.18.0",
|
|
38
|
+
"@lynx-js/react-refresh-webpack-plugin": "0.4.1",
|
|
39
|
+
"@lynx-js/react-webpack-plugin": "0.10.0",
|
|
40
|
+
"@lynx-js/runtime-wrapper-webpack-plugin": "0.2.2",
|
|
41
|
+
"@lynx-js/template-webpack-plugin": "0.13.0",
|
|
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.2",
|
|
47
|
-
"@rsbuild/core": "2.
|
|
47
|
+
"@rsbuild/core": "2.1.4",
|
|
48
48
|
"@rsbuild/plugin-sass": "1.5.2",
|
|
49
49
|
"@rsbuild/plugin-typed-css-modules": "1.2.2",
|
|
50
|
-
"@rstest/core": "0.
|
|
50
|
+
"@rstest/core": "0.11.0",
|
|
51
51
|
"rsbuild-plugin-arethetypeswrong": "0.3.1",
|
|
52
52
|
"rsbuild-plugin-publint": "0.3.4",
|
|
53
53
|
"source-map": "^0.7.6",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"type-fest": "^5.4.4",
|
|
56
56
|
"typia": "12.1.1",
|
|
57
57
|
"typia-rspack-plugin": "3.0.1",
|
|
58
|
-
"@lynx-js/config-rsbuild-plugin": "0.1.0",
|
|
59
58
|
"@lynx-js/debug-metadata": "0.1.0",
|
|
60
|
-
"@lynx-js/react": "0.
|
|
59
|
+
"@lynx-js/react": "0.123.0",
|
|
60
|
+
"@lynx-js/config-rsbuild-plugin": "0.1.1",
|
|
61
61
|
"@lynx-js/react-transform": "0.2.0",
|
|
62
|
-
"@lynx-js/rspeedy": "0.
|
|
62
|
+
"@lynx-js/rspeedy": "0.16.0",
|
|
63
63
|
"@lynx-js/test-tools": "0.0.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@lynx-js/react": "^0.
|
|
66
|
+
"@lynx-js/react": "^0.123.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@lynx-js/react": {
|