@lynx-js/react-rsbuild-plugin 0.9.3 → 0.9.5

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,37 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: add enableCSSInvalidation for encodeCSS of css HMR, this will fix pseudo-class (such as `:active`) not working in HMR. ([#435](https://github.com/lynx-family/lynx-stack/pull/435))
8
+
9
+ - Disable `module.generator.json.JSONParse` option as it increases the bundle size of `main-thread.js`. For more detail, please see this [issue](https://github.com/webpack/webpack/issues/19319). ([#402](https://github.com/lynx-family/lynx-stack/pull/402))
10
+
11
+ - Updated dependencies [[`3e7988f`](https://github.com/lynx-family/lynx-stack/commit/3e7988f3af4b4f460eaf5add29cca19537dc1a6b), [`7243242`](https://github.com/lynx-family/lynx-stack/commit/7243242801e3a8ca0213c0ef642f69a22c39960e)]:
12
+ - @lynx-js/css-extract-webpack-plugin@0.5.3
13
+ - @lynx-js/template-webpack-plugin@0.6.8
14
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.5
15
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
16
+ - @lynx-js/react-webpack-plugin@0.6.10
17
+ - @lynx-js/web-webpack-plugin@0.6.3
18
+
19
+ ## 0.9.4
20
+
21
+ ### Patch Changes
22
+
23
+ - feat: add extractStr option to pluginReactLynx ([#391](https://github.com/lynx-family/lynx-stack/pull/391))
24
+
25
+ - Convert background-only files from js to ts ([#346](https://github.com/lynx-family/lynx-stack/pull/346))
26
+
27
+ - Updated dependencies [[`f849117`](https://github.com/lynx-family/lynx-stack/commit/f84911731faa4d0f6373d1202b9b2cabb0bafc48), [`d730101`](https://github.com/lynx-family/lynx-stack/commit/d7301017a383b8825cdc813a649ef26ce1c37641), [`42217c2`](https://github.com/lynx-family/lynx-stack/commit/42217c2c77a33e729977fc7108b218a1cb868e6a), [`f03bd4a`](https://github.com/lynx-family/lynx-stack/commit/f03bd4a62f81902ba55caf10df56447c89743e62)]:
28
+ - @lynx-js/react-webpack-plugin@0.6.10
29
+ - @lynx-js/template-webpack-plugin@0.6.7
30
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.4
31
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
32
+ - @lynx-js/css-extract-webpack-plugin@0.5.2
33
+ - @lynx-js/web-webpack-plugin@0.6.3
34
+
3
35
  ## 0.9.3
4
36
 
5
37
  ### Patch Changes
@@ -311,7 +343,7 @@
311
343
  })
312
344
  ```
313
345
 
314
- NOTE: This feature is deprecated and will be removed in the future. Use codemod instead.
346
+ NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
315
347
 
316
348
  - 5f8d492: **BREAKING CHANGE**: Require `@lynx-js/react` v0.103.0.
317
349
  - 5f8d492: Deprecate `compat.simplifyCtorLikeReactLynx2`
@@ -413,9 +445,9 @@
413
445
 
414
446
  ### Minor Changes
415
447
 
416
- - 91c267b: feat: enable auto publicpath for environment.web
448
+ - 91c267b: feat: enable auto `publicPath` for environment.web
417
449
 
418
- In many case, users cannot set a correct assertprefix configuration. Typically those chunks will be uploaded after chunk dumped. Developers may be not able to know the url before those chunks are uploaded.
450
+ In many case, users cannot set a correct `output.assertPrefix` configuration. Typically those chunks will be uploaded after chunk dumped. Developers may be not able to know the url before those chunks are uploaded.
419
451
 
420
452
  In this commit, we allow webpack to infer the correct public path by the import.meta.url.
421
453
 
package/README.md CHANGED
@@ -40,7 +40,7 @@ Visit [Lynx Website](https://lynxjs.org/api/rspeedy/react-rsbuild-plugin.pluginr
40
40
 
41
41
  ## Contributing
42
42
 
43
- Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/contributing.md) to make sure you have a smooth experience contributing to this project.
43
+ Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.
44
44
 
45
45
  ## License
46
46
 
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RsbuildPluginAPI } from '@rsbuild/core';
2
+ export declare function applyGenerator(api: RsbuildPluginAPI): void;
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_web_webpack_plugin_6ba19e5a__ from "@lynx-js/web-webpack-plugin";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_refresh_webpack_plugin_a01c5e97__ from "@lynx-js/react-refresh-webpack-plugin";
10
10
  var __webpack_modules__ = {
11
- "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
11
+ "../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
12
12
  exports._accessExpressionAsString = void 0;
13
13
  const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
14
14
  exports._accessExpressionAsString = _accessExpressionAsString;
@@ -53,19 +53,17 @@ var __webpack_modules__ = {
53
53
  "with"
54
54
  ]);
55
55
  },
56
- "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
56
+ "../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
57
57
  exports._assertGuard = void 0;
58
- const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/TypeGuardError.mjs");
58
+ const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs");
59
59
  const _assertGuard = (exceptionable, props, factory)=>{
60
- if (true === exceptionable) {
61
- if (factory) throw factory(props);
62
- throw new TypeGuardError_1.TypeGuardError(props);
63
- }
60
+ if (true === exceptionable) if (factory) throw factory(props);
61
+ else throw new TypeGuardError_1.TypeGuardError(props);
64
62
  return false;
65
63
  };
66
64
  exports._assertGuard = _assertGuard;
67
65
  },
68
- "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
+ "../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
69
67
  __webpack_require__.r(__webpack_exports__);
70
68
  __webpack_require__.d(__webpack_exports__, {
71
69
  TypeGuardError: ()=>TypeGuardError
@@ -141,7 +139,7 @@ function applyBackgroundOnly(api) {
141
139
  });
142
140
  }
143
141
  function applyCSS(api, options) {
144
- const { enableRemoveCSSScope, enableCSSSelector, targetSdkVersion } = options;
142
+ const { enableRemoveCSSScope, enableCSSSelector, enableCSSInvalidation, targetSdkVersion } = options;
145
143
  api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(config, {
146
144
  output: {
147
145
  injectStyles: false
@@ -159,18 +157,32 @@ function applyCSS(api, options) {
159
157
  ];
160
158
  cssRules.filter((rule)=>chain.module.rules.has(rule)).forEach((ruleName)=>{
161
159
  const rule = chain.module.rule(ruleName);
162
- if (rule.uses.has(CHAIN_ID.USE.LIGHTNINGCSS) && 'lynx' === environment.name) rule.uses.delete(CHAIN_ID.USE.LIGHTNINGCSS);
160
+ removeLightningCSS(rule);
163
161
  rule.issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(CssExtractPlugin.loader).end();
164
162
  const uses = rule.uses.entries();
165
163
  const ruleEntries = rule.entries();
166
164
  const cssLoaderRule = uses[CHAIN_ID.USE.CSS].entries();
167
165
  chain.module.rule(`${ruleName}:${__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD}`).merge(ruleEntries).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).use(CHAIN_ID.USE.IGNORE_CSS).loader(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, './loaders/ignore-css-loader')).end().uses.merge(uses).delete(CHAIN_ID.USE.MINI_CSS_EXTRACT).delete(CHAIN_ID.USE.LIGHTNINGCSS).delete(CHAIN_ID.USE.CSS).end().use(CHAIN_ID.USE.CSS).after(CHAIN_ID.USE.IGNORE_CSS).merge(cssLoaderRule).options(normalizeCssLoaderOptions(cssLoaderRule.options, true)).end();
168
166
  });
167
+ const inlineCSSRules = [
168
+ CHAIN_ID.RULE.CSS_INLINE,
169
+ CHAIN_ID.RULE.SASS_INLINE,
170
+ CHAIN_ID.RULE.LESS_INLINE,
171
+ CHAIN_ID.RULE.STYLUS_INLINE
172
+ ];
173
+ inlineCSSRules.filter((rule)=>rule && chain.module.rules.has(rule)).forEach((ruleName)=>{
174
+ const rule = chain.module.rule(ruleName);
175
+ removeLightningCSS(rule);
176
+ });
177
+ function removeLightningCSS(rule) {
178
+ if (rule.uses.has(CHAIN_ID.USE.LIGHTNINGCSS) && 'lynx' === environment.name) rule.uses.delete(CHAIN_ID.USE.LIGHTNINGCSS);
179
+ }
169
180
  chain.plugin(CHAIN_ID.PLUGIN.MINI_CSS_EXTRACT).tap(([options])=>[
170
181
  {
171
182
  ...options,
172
183
  enableRemoveCSSScope: enableRemoveCSSScope ?? true,
173
184
  enableCSSSelector,
185
+ enableCSSInvalidation,
174
186
  targetSdkVersion,
175
187
  cssPlugins: [
176
188
  __WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.CSSPlugins.parserPlugins.removeFunctionWhiteSpace()
@@ -211,7 +223,7 @@ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
211
223
  const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
212
224
  const EMPTY_HASH = '';
213
225
  function applyEntry(api, options) {
214
- const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, experimental_isLazyBundle } = options;
226
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, extractStr, experimental_isLazyBundle } = options;
215
227
  const { config } = api.useExposed(Symbol.for('rspeedy.api'));
216
228
  api.modifyBundlerChain((chain, { environment, isDev, isProd })=>{
217
229
  const entries = chain.entryPoints.entries() ?? {};
@@ -304,6 +316,7 @@ function applyEntry(api, options) {
304
316
  firstScreenSyncTiming,
305
317
  enableSSR,
306
318
  mainThreadChunks,
319
+ extractStr,
307
320
  experimental_isLazyBundle
308
321
  }
309
322
  ]);
@@ -326,10 +339,8 @@ function getChunks(entryName, entryValue) {
326
339
  const { dependOn } = item;
327
340
  if (Array.isArray(item.import)) imports.push(...item.import);
328
341
  else imports.push(item.import);
329
- if (!!dependOn) {
330
- if ('string' == typeof dependOn) chunks.unshift(dependOn);
331
- else chunks.unshift(...dependOn);
332
- }
342
+ if (dependOn) if ('string' == typeof dependOn) chunks.unshift(dependOn);
343
+ else chunks.unshift(...dependOn);
333
344
  }
334
345
  return {
335
346
  chunks,
@@ -347,6 +358,16 @@ function getHash(config, isProd) {
347
358
  if (isProd) return DEFAULT_FILENAME_HASH;
348
359
  return EMPTY_HASH;
349
360
  }
361
+ function applyGenerator(api) {
362
+ api.modifyBundlerChain({
363
+ order: 'pre',
364
+ handler: (chain)=>{
365
+ chain.module.rule(`json-parse:${__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD}`).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).test(/\.json$/).type('json').generator({
366
+ JSONParse: false
367
+ });
368
+ }
369
+ });
370
+ }
350
371
  function applyLazy(api) {
351
372
  api.modifyBundlerChain((chain)=>{
352
373
  chain.output.library({
@@ -478,10 +499,10 @@ function applySWC(api) {
478
499
  }
479
500
  }));
480
501
  }
481
- var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
482
- var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_assertGuard.js");
502
+ var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/internal/_accessExpressionAsString.js");
503
+ var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@8.1.1_@samchon+openapi@3.2.3_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js");
483
504
  const validateConfig = (()=>{
484
- 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.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (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.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io4(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io5(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io6(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
505
+ 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.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (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.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io4(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io5(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io6(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) && _io8(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
485
506
  if ([
486
507
  "compat",
487
508
  "customCSSInheritanceList",
@@ -504,6 +525,7 @@ const validateConfig = (()=>{
504
525
  "defineDCE",
505
526
  "engineVersion",
506
527
  "targetSdkVersion",
528
+ "extractStr",
507
529
  "experimental_isLazyBundle"
508
530
  ].some((prop)=>key === prop)) return true;
509
531
  const value = input[key];
@@ -577,6 +599,14 @@ const validateConfig = (()=>{
577
599
  if (void 0 === value) return true;
578
600
  return "string" == typeof value;
579
601
  });
602
+ const _io8 = (input, _exceptionable = true)=>(void 0 === input.strLength || "number" == typeof input.strLength) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
603
+ if ([
604
+ "strLength"
605
+ ].some((prop)=>key === prop)) return true;
606
+ const value = input[key];
607
+ if (void 0 === value) return true;
608
+ return false;
609
+ }));
580
610
  const _ao0 = (input, _path, _exceptionable = true)=>(void 0 === input.compat || ("object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) || _assertGuard._assertGuard(_exceptionable, {
581
611
  method: "typia.createAssertEquals",
582
612
  path: _path + ".compat",
@@ -712,6 +742,21 @@ const validateConfig = (()=>{
712
742
  path: _path + ".targetSdkVersion",
713
743
  expected: "(string | undefined)",
714
744
  value: input.targetSdkVersion
745
+ }, _errorFactory)) && (null !== input.extractStr || _assertGuard._assertGuard(_exceptionable, {
746
+ method: "typia.createAssertEquals",
747
+ path: _path + ".extractStr",
748
+ expected: "(Partial<ExtractStrConfig> | boolean | undefined)",
749
+ value: input.extractStr
750
+ }, _errorFactory)) && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || ("object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) || _assertGuard._assertGuard(_exceptionable, {
751
+ method: "typia.createAssertEquals",
752
+ path: _path + ".extractStr",
753
+ expected: "(Partial<ExtractStrConfig> | boolean | undefined)",
754
+ value: input.extractStr
755
+ }, _errorFactory)) && _ao8(input.extractStr, _path + ".extractStr", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
756
+ method: "typia.createAssertEquals",
757
+ path: _path + ".extractStr",
758
+ expected: "(Partial<ExtractStrConfig> | boolean | undefined)",
759
+ value: input.extractStr
715
760
  }, _errorFactory)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle || _assertGuard._assertGuard(_exceptionable, {
716
761
  method: "typia.createAssertEquals",
717
762
  path: _path + ".experimental_isLazyBundle",
@@ -740,6 +785,7 @@ const validateConfig = (()=>{
740
785
  "defineDCE",
741
786
  "engineVersion",
742
787
  "targetSdkVersion",
788
+ "extractStr",
743
789
  "experimental_isLazyBundle"
744
790
  ].some((prop)=>key === prop)) return true;
745
791
  const value = input[key];
@@ -1038,6 +1084,24 @@ const validateConfig = (()=>{
1038
1084
  value: value
1039
1085
  }, _errorFactory);
1040
1086
  });
1087
+ const _ao8 = (input, _path, _exceptionable = true)=>(void 0 === input.strLength || "number" == typeof input.strLength || _assertGuard._assertGuard(_exceptionable, {
1088
+ method: "typia.createAssertEquals",
1089
+ path: _path + ".strLength",
1090
+ expected: "(number | undefined)",
1091
+ value: input.strLength
1092
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
1093
+ if ([
1094
+ "strLength"
1095
+ ].some((prop)=>key === prop)) return true;
1096
+ const value = input[key];
1097
+ if (void 0 === value) return true;
1098
+ return _assertGuard._assertGuard(_exceptionable, {
1099
+ method: "typia.createAssertEquals",
1100
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
1101
+ expected: "undefined",
1102
+ value: value
1103
+ }, _errorFactory);
1104
+ }));
1041
1105
  const __is = (input, _exceptionable = true)=>void 0 === input || "object" == typeof input && null !== input && false === Array.isArray(input) && _io0(input, true);
1042
1106
  let _errorFactory;
1043
1107
  return (input, errorFactory = ({ path, expected, value })=>{
@@ -1097,6 +1161,7 @@ function pluginReactLynx(userOptions) {
1097
1161
  defineDCE: void 0,
1098
1162
  targetSdkVersion: '',
1099
1163
  engineVersion: '',
1164
+ extractStr: false,
1100
1165
  experimental_isLazyBundle: false
1101
1166
  };
1102
1167
  const resolvedOptions = Object.assign(defaultOptions, userOptions, {
@@ -1113,6 +1178,7 @@ function pluginReactLynx(userOptions) {
1113
1178
  applyCSS(api, resolvedOptions);
1114
1179
  applyEntry(api, resolvedOptions);
1115
1180
  applyBackgroundOnly(api);
1181
+ applyGenerator(api);
1116
1182
  applyLoaders(api, resolvedOptions);
1117
1183
  applyRefresh(api);
1118
1184
  applySplitChunksRule(api);
@@ -0,0 +1,4 @@
1
+ import type { Rspack } from '@rsbuild/core';
2
+ export default function invalidImportErrorLoader(this: Rspack.LoaderContext<{
3
+ message: string;
4
+ }>): void;
@@ -1,4 +1,5 @@
1
- export default function invalidImportErrorLoader() {
1
+ function invalidImportErrorLoader() {
2
2
  const { message } = this.getOptions();
3
3
  throw new Error(message);
4
4
  }
5
+ export { invalidImportErrorLoader as default };
@@ -1,5 +1,6 @@
1
1
  import type { RsbuildPlugin } from '@rsbuild/core';
2
2
  import type { CompatVisitorConfig, DefineDceVisitorConfig, JsxTransformerConfig, ShakeVisitorConfig } from '@lynx-js/react/transform';
3
+ import type { ExtractStrConfig } from '@lynx-js/react-webpack-plugin';
3
4
  /**
4
5
  * Options of {@link pluginReactLynx}
5
6
  *
@@ -240,6 +241,13 @@ export interface PluginReactLynxOptions {
240
241
  * @deprecated `targetSdkVersion` is now an alias of {@link PluginReactLynxOptions.engineVersion}. Use {@link PluginReactLynxOptions.engineVersion} instead.
241
242
  */
242
243
  targetSdkVersion?: string;
244
+ /**
245
+ * Merge same string literals in JS and Lepus to reduce output bundle size.
246
+ * Set to `false` to disable.
247
+ *
248
+ * @defaultValue false
249
+ */
250
+ extractStr?: Partial<ExtractStrConfig> | boolean;
243
251
  /**
244
252
  * Generate standalone lazy bundle.
245
253
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,28 +32,29 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@lynx-js/css-extract-webpack-plugin": "0.5.2",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.9.3",
37
- "@lynx-js/react-webpack-plugin": "0.6.9",
35
+ "@lynx-js/css-extract-webpack-plugin": "0.5.3",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.9.5",
38
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.2",
38
+ "@lynx-js/react-webpack-plugin": "0.6.10",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.0.9",
40
- "@lynx-js/template-webpack-plugin": "0.6.6",
40
+ "@lynx-js/template-webpack-plugin": "0.6.8",
41
41
  "@lynx-js/web-webpack-plugin": "0.6.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@microsoft/api-extractor": "7.51.1",
44
+ "@microsoft/api-extractor": "7.52.2",
45
45
  "@rollup/plugin-typescript": "^12.1.2",
46
- "@rsbuild/core": "1.2.19",
47
- "@rsbuild/plugin-sass": "1.2.2",
46
+ "@rsbuild/core": "1.3.2",
47
+ "@rsbuild/plugin-sass": "1.3.1",
48
48
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
49
- "@rsbuild/plugin-webpack-swc": "1.0.12",
50
- "@rsbuild/webpack": "1.2.3",
49
+ "@rsbuild/plugin-webpack-swc": "1.1.0",
50
+ "@rsbuild/webpack": "1.3.0",
51
+ "@samchon/openapi": "3.2.3",
51
52
  "tailwindcss": "^3.4.17",
52
- "type-fest": "^4.37.0",
53
- "typia": "7.6.4",
54
- "typia-rspack-plugin": "^1.0.2",
55
- "@lynx-js/react": "0.106.0",
56
- "@lynx-js/rspeedy": "0.8.5",
53
+ "type-fest": "^4.39.0",
54
+ "typia": "8.1.1",
55
+ "typia-rspack-plugin": "2.0.0",
56
+ "@lynx-js/react": "0.106.3",
57
+ "@lynx-js/rspeedy": "0.9.0",
57
58
  "@lynx-js/vitest-setup": "0.0.0"
58
59
  },
59
60
  "peerDependencies": {
File without changes
@@ -1 +0,0 @@
1
- throw new Error("This module cannot be imported from a Main Thread module. It should only be used from a Background Thread.");