@lynx-js/react-rsbuild-plugin 0.10.6 → 0.10.8

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,35 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.10.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix "TypeError: cannot read property 'call' of undefined" error during HMR updates. ([#1304](https://github.com/lynx-family/lynx-stack/pull/1304))
8
+
9
+ - Supports extractStr for large JSON ([#1230](https://github.com/lynx-family/lynx-stack/pull/1230))
10
+
11
+ - Change `extractStr` to `false` when `performance.chunkSplit.strategy` is not `all-in-one`. ([#1251](https://github.com/lynx-family/lynx-stack/pull/1251))
12
+
13
+ - Updated dependencies [[`cb7feb6`](https://github.com/lynx-family/lynx-stack/commit/cb7feb6e8cc9f4b83ac3147bd3e5a82059caa06a), [`ec7228f`](https://github.com/lynx-family/lynx-stack/commit/ec7228fadfb917a1f6149aca4775386badae73fa)]:
14
+ - @lynx-js/template-webpack-plugin@0.8.2
15
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.8
16
+ - @lynx-js/use-sync-external-store@1.5.0
17
+ - @lynx-js/react-refresh-webpack-plugin@0.3.4
18
+ - @lynx-js/react-webpack-plugin@0.6.18
19
+ - @lynx-js/css-extract-webpack-plugin@0.6.0
20
+
21
+ ## 0.10.7
22
+
23
+ ### Patch Changes
24
+
25
+ - Support [`experiments.typeReexportsPresence`](https://rspack.rs/config/experiments#experimentstypereexportspresence). ([#1246](https://github.com/lynx-family/lynx-stack/pull/1246))
26
+
27
+ - Updated dependencies [[`d513dd9`](https://github.com/lynx-family/lynx-stack/commit/d513dd9fb7ee950f36aaaee0d62ede8072f7b031)]:
28
+ - @lynx-js/react-refresh-webpack-plugin@0.3.4
29
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.7
30
+ - @lynx-js/use-sync-external-store@1.5.0
31
+ - @lynx-js/react-webpack-plugin@0.6.18
32
+
3
33
  ## 0.10.6
4
34
 
5
35
  ### Patch Changes
package/dist/index.js CHANGED
@@ -287,8 +287,8 @@ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
287
287
  const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
288
288
  const EMPTY_HASH = '';
289
289
  function applyEntry(api, options) {
290
- const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, extractStr, experimental_isLazyBundle } = options;
291
- const { config } = api.useExposed(Symbol.for('rspeedy.api'));
290
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
291
+ const { config, logger } = api.useExposed(Symbol.for('rspeedy.api'));
292
292
  api.modifyBundlerChain((chain, { environment, isDev, isProd })=>{
293
293
  const entries = chain.entryPoints.entries() ?? {};
294
294
  const isLynx = 'lynx' === environment.name;
@@ -390,6 +390,11 @@ function applyEntry(api, options) {
390
390
  }
391
391
  if (isWeb) chain.plugin(PLUGIN_NAME_WEB).use(WebEncodePlugin, []).end();
392
392
  const rsbuildConfig = api.getRsbuildConfig();
393
+ let extractStr = originalExtractStr;
394
+ if (rsbuildConfig.performance?.chunkSplit?.strategy !== 'all-in-one' && originalExtractStr) {
395
+ logger.warn('`extractStr` is changed to `false` because it is only supported in `all-in-one` chunkSplit strategy, please set `performance.chunkSplit.strategy` to `all-in-one` to use `extractStr.`');
396
+ extractStr = false;
397
+ }
393
398
  chain.plugin(PLUGIN_NAME_REACT).after(PLUGIN_NAME_TEMPLATE).use(ReactWebpackPlugin, [
394
399
  {
395
400
  disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
@@ -439,13 +444,14 @@ function getHash(config, isProd, experimental_isLazyBundle) {
439
444
  if (isProd || experimental_isLazyBundle) return DEFAULT_FILENAME_HASH;
440
445
  return EMPTY_HASH;
441
446
  }
442
- function applyGenerator(api) {
447
+ function applyGenerator(api, options) {
443
448
  api.modifyBundlerChain({
444
449
  order: 'pre',
445
450
  handler: (chain)=>{
446
- chain.module.rule(`json-parse:${LAYERS.MAIN_THREAD}`).issuerLayer(LAYERS.MAIN_THREAD).test(/\.json$/).type('json').generator({
451
+ const rule = chain.module.rule("react:json-parse").test(/\.json$/).type('json').generator({
447
452
  JSONParse: false
448
453
  });
454
+ if (!options.extractStr) rule.issuerLayer(LAYERS.MAIN_THREAD);
449
455
  }
450
456
  });
451
457
  }
@@ -1211,7 +1217,7 @@ function pluginReactLynx(userOptions) {
1211
1217
  applyCSS(api, resolvedOptions);
1212
1218
  applyEntry(api, resolvedOptions);
1213
1219
  applyBackgroundOnly(api);
1214
- applyGenerator(api);
1220
+ applyGenerator(api, resolvedOptions);
1215
1221
  applyLoaders(api, resolvedOptions);
1216
1222
  applyRefresh(api);
1217
1223
  applySplitChunksRule(api);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,19 +33,19 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@lynx-js/css-extract-webpack-plugin": "0.6.0",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.10.6",
37
- "@lynx-js/react-refresh-webpack-plugin": "0.3.3",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.10.8",
37
+ "@lynx-js/react-refresh-webpack-plugin": "0.3.4",
38
38
  "@lynx-js/react-webpack-plugin": "0.6.18",
39
39
  "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.2",
40
- "@lynx-js/template-webpack-plugin": "0.8.1",
40
+ "@lynx-js/template-webpack-plugin": "0.8.2",
41
41
  "@lynx-js/use-sync-external-store": "1.5.0",
42
42
  "background-only": "^0.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@microsoft/api-extractor": "7.52.8",
46
46
  "@rollup/plugin-typescript": "^12.1.4",
47
- "@rsbuild/core": "1.4.3",
48
- "@rsbuild/plugin-sass": "1.3.2",
47
+ "@rsbuild/core": "1.4.7",
48
+ "@rsbuild/plugin-sass": "1.3.3",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
50
50
  "@rsbuild/plugin-webpack-swc": "1.1.1",
51
51
  "@rsbuild/webpack": "1.3.2",
@@ -54,9 +54,9 @@
54
54
  "type-fest": "^4.41.0",
55
55
  "typia": "9.3.1",
56
56
  "typia-rspack-plugin": "2.1.0",
57
- "@lynx-js/react": "0.111.0",
57
+ "@lynx-js/react": "0.111.2",
58
58
  "@lynx-js/react-transform": "0.2.0",
59
- "@lynx-js/rspeedy": "0.10.0",
59
+ "@lynx-js/rspeedy": "0.10.2",
60
60
  "@lynx-js/vitest-setup": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {