@lynx-js/react-rsbuild-plugin 0.9.8 → 0.9.10

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.js +27 -18
  3. package/package.json +17 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.9.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`e599635`](https://github.com/lynx-family/lynx-stack/commit/e599635a667c2d98271e0d54b7f6d49dadbfbdba), [`c38c737`](https://github.com/lynx-family/lynx-stack/commit/c38c737096697781a154219d6b1e3b4ffbf6512f), [`d16522e`](https://github.com/lynx-family/lynx-stack/commit/d16522eee0db3cd1a6ec20fb5832fd79f89a2264)]:
8
+ - @lynx-js/template-webpack-plugin@0.6.11
9
+ - @lynx-js/web-webpack-plugin@0.6.7
10
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.1.0
11
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.10
12
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
13
+ - @lynx-js/react-webpack-plugin@0.6.13
14
+ - @lynx-js/css-extract-webpack-plugin@0.5.3
15
+
16
+ ## 0.9.9
17
+
18
+ ### Patch Changes
19
+
20
+ - Fix runtime error: "SyntaxError: Identifier 'i' has already been declared". ([#651](https://github.com/lynx-family/lynx-stack/pull/651))
21
+
22
+ - Enable runtime profiling when `performance.profile` is set to true. ([#722](https://github.com/lynx-family/lynx-stack/pull/722))
23
+
24
+ - fix: resolve page crash on development mode when enabling `experimental_isLazyBundle: true` ([#653](https://github.com/lynx-family/lynx-stack/pull/653))
25
+
26
+ - Support `@lynx-js/react` v0.108.0. ([#649](https://github.com/lynx-family/lynx-stack/pull/649))
27
+
28
+ - Updated dependencies [[`ea4da1a`](https://github.com/lynx-family/lynx-stack/commit/ea4da1af0ff14e2480e49f7004a3a2616594968d), [`ca15dda`](https://github.com/lynx-family/lynx-stack/commit/ca15dda4122c5eedc1fd82cefb0cd9af7fdaa47e), [`f8d369d`](https://github.com/lynx-family/lynx-stack/commit/f8d369ded802f8d7b9b859b1f150015d65773b0f), [`ea4da1a`](https://github.com/lynx-family/lynx-stack/commit/ea4da1af0ff14e2480e49f7004a3a2616594968d)]:
29
+ - @lynx-js/react-webpack-plugin@0.6.13
30
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.0.10
31
+ - @lynx-js/react-alias-rsbuild-plugin@0.9.9
32
+ - @lynx-js/react-refresh-webpack-plugin@0.3.2
33
+
3
34
  ## 0.9.8
4
35
 
5
36
  ### Patch Changes
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@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
11
+ "../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/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,9 +53,9 @@ var __webpack_modules__ = {
53
53
  "with"
54
54
  ]);
55
55
  },
56
- "../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
56
+ "../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/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@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs");
58
+ const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs");
59
59
  const _assertGuard = (exceptionable, props, factory)=>{
60
60
  if (true === exceptionable) if (factory) throw factory(props);
61
61
  else throw new TypeGuardError_1.TypeGuardError(props);
@@ -63,7 +63,7 @@ var __webpack_modules__ = {
63
63
  };
64
64
  exports._assertGuard = _assertGuard;
65
65
  },
66
- "../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
+ "../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
67
67
  __webpack_require__.r(__webpack_exports__);
68
68
  __webpack_require__.d(__webpack_exports__, {
69
69
  TypeGuardError: ()=>TypeGuardError
@@ -246,7 +246,7 @@ function applyEntry(api, options) {
246
246
  const templateFilename = ('object' == typeof config.output?.filename ? config.output.filename.bundle ?? config.output.filename.template : config.output?.filename) ?? '[name].[platform].bundle';
247
247
  const mainThreadEntry = `${entryName}__main-thread`;
248
248
  const mainThreadName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', `${entryName}/main-thread.js`);
249
- const backgroundName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', getBackgroundFilename(entryName, environment.config, isProd));
249
+ const backgroundName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].posix.join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', getBackgroundFilename(entryName, environment.config, isProd, experimental_isLazyBundle));
250
250
  const backgroundEntry = entryName;
251
251
  mainThreadChunks.push(mainThreadName);
252
252
  chain.entry(mainThreadEntry).add({
@@ -255,7 +255,7 @@ function applyEntry(api, options) {
255
255
  filename: mainThreadName
256
256
  }).when(isDev && !isWeb, (entry)=>{
257
257
  const require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
258
- entry.add({
258
+ entry.prepend({
259
259
  layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD,
260
260
  import: require.resolve('@lynx-js/css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs')
261
261
  });
@@ -264,13 +264,13 @@ function applyEntry(api, options) {
264
264
  import: imports,
265
265
  filename: backgroundName
266
266
  }).when(isDev && !isWeb, (entry)=>{
267
- entry.add({
267
+ entry.prepend({
268
268
  layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
269
269
  import: '@rspack/core/hot/dev-server'
270
- }).add({
270
+ }).prepend({
271
271
  layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
272
272
  import: '@lynx-js/webpack-dev-transport/client'
273
- }).add({
273
+ }).prepend({
274
274
  layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
275
275
  import: '@lynx-js/react/refresh'
276
276
  });
@@ -308,18 +308,26 @@ function applyEntry(api, options) {
308
308
  if (isLynx) chain.plugin(PLUGIN_NAME_RUNTIME_WRAPPER).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27793081__.RuntimeWrapperWebpackPlugin, [
309
309
  {
310
310
  injectVars (vars) {
311
+ const UNUSED_VARS = new Set([
312
+ 'Card',
313
+ 'Component',
314
+ 'ReactLynx',
315
+ 'Behavior'
316
+ ]);
311
317
  return vars.map((name)=>{
312
- if ('Component' === name) return '__Component';
318
+ if (UNUSED_VARS.has(name)) return `__${name}`;
313
319
  return name;
314
320
  });
315
321
  },
316
322
  targetSdkVersion,
317
- test: /^(?!.*main-thread(?:\.[A-Fa-f0-9]*)?\.js$).*\.js$/
323
+ test: /^(?!.*main-thread(?:\.[A-Fa-f0-9]*)?\.js$).*\.js$/,
324
+ experimental_isLazyBundle
318
325
  }
319
326
  ]).end().plugin(`${__WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.LynxEncodePlugin.name}`).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.LynxEncodePlugin, [
320
327
  {}
321
328
  ]).end();
322
329
  if (isWeb) chain.plugin(PLUGIN_NAME_WEB).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_web_webpack_plugin_6ba19e5a__.WebWebpackPlugin, []).end();
330
+ const rsbuildConfig = api.getRsbuildConfig();
323
331
  chain.plugin(PLUGIN_NAME_REACT).after(PLUGIN_NAME_TEMPLATE).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.ReactWebpackPlugin, [
324
332
  {
325
333
  disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
@@ -327,7 +335,8 @@ function applyEntry(api, options) {
327
335
  enableSSR,
328
336
  mainThreadChunks,
329
337
  extractStr,
330
- experimental_isLazyBundle
338
+ experimental_isLazyBundle,
339
+ profile: rsbuildConfig.performance?.profile
331
340
  }
332
341
  ]);
333
342
  });
@@ -357,15 +366,15 @@ function getChunks(entryName, entryValue) {
357
366
  imports
358
367
  };
359
368
  }
360
- function getBackgroundFilename(entryName, config, isProd) {
369
+ function getBackgroundFilename(entryName, config, isProd, experimental_isLazyBundle) {
361
370
  const { filename } = config.output;
362
371
  if ('string' == typeof filename.js) return filename.js.replaceAll('[name]', entryName).replaceAll('.js', '/background.js');
363
- return `${entryName}/background${getHash(config, isProd)}.js`;
372
+ return `${entryName}/background${getHash(config, isProd, experimental_isLazyBundle)}.js`;
364
373
  }
365
- function getHash(config, isProd) {
374
+ function getHash(config, isProd, experimental_isLazyBundle) {
366
375
  if ('string' == typeof config.output?.filenameHash) return config.output.filenameHash ? `.[${config.output.filenameHash}]` : EMPTY_HASH;
367
376
  if (config.output?.filenameHash === false) return EMPTY_HASH;
368
- if (isProd) return DEFAULT_FILENAME_HASH;
377
+ if (isProd || experimental_isLazyBundle) return DEFAULT_FILENAME_HASH;
369
378
  return EMPTY_HASH;
370
379
  }
371
380
  function applyGenerator(api) {
@@ -509,8 +518,8 @@ function applySWC(api) {
509
518
  }
510
519
  }, config));
511
520
  }
512
- var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
513
- var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_assertGuard.js");
521
+ var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
522
+ var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.3.0_@samchon+openapi@4.3.0_typescript@5.8.3/node_modules/typia/lib/internal/_assertGuard.js");
514
523
  const validateConfig = (()=>{
515
524
  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)=>{
516
525
  if ([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.9.8",
3
+ "version": "0.9.10",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,34 +32,34 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "background-only": "^0.0.1",
36
35
  "@lynx-js/css-extract-webpack-plugin": "0.5.3",
37
- "@lynx-js/react-alias-rsbuild-plugin": "0.9.8",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.9.10",
38
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.2",
39
- "@lynx-js/react-webpack-plugin": "0.6.12",
40
- "@lynx-js/runtime-wrapper-webpack-plugin": "0.0.9",
41
- "@lynx-js/template-webpack-plugin": "0.6.10",
42
- "@lynx-js/web-webpack-plugin": "0.6.6"
38
+ "@lynx-js/react-webpack-plugin": "0.6.13",
39
+ "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.0",
40
+ "@lynx-js/template-webpack-plugin": "0.6.11",
41
+ "@lynx-js/web-webpack-plugin": "0.6.7",
42
+ "background-only": "^0.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "7.52.5",
45
+ "@microsoft/api-extractor": "7.52.8",
46
46
  "@rollup/plugin-typescript": "^12.1.2",
47
- "@rsbuild/core": "1.3.11",
47
+ "@rsbuild/core": "1.3.20",
48
48
  "@rsbuild/plugin-sass": "1.3.1",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
50
- "@rsbuild/plugin-webpack-swc": "1.1.0",
51
- "@rsbuild/webpack": "1.3.0",
52
- "@samchon/openapi": "4.1.0",
50
+ "@rsbuild/plugin-webpack-swc": "1.1.1",
51
+ "@rsbuild/webpack": "1.3.1",
52
+ "@samchon/openapi": "4.3.0",
53
53
  "tailwindcss": "^3.4.17",
54
- "type-fest": "^4.40.0",
55
- "typia": "9.1.1",
54
+ "type-fest": "^4.41.0",
55
+ "typia": "9.3.0",
56
56
  "typia-rspack-plugin": "2.0.1",
57
- "@lynx-js/react": "0.107.0",
58
- "@lynx-js/rspeedy": "0.9.3",
57
+ "@lynx-js/react": "0.108.1",
58
+ "@lynx-js/rspeedy": "0.9.5",
59
59
  "@lynx-js/vitest-setup": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0"
62
+ "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "@lynx-js/react": {