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

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 +55 -0
  2. package/dist/index.js +14 -2
  3. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.10.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Be compat with `@lynx-js/react` v0.111.0 ([#204](https://github.com/lynx-family/lynx-stack/pull/204))
8
+
9
+ - Updated dependencies [[`99a3557`](https://github.com/lynx-family/lynx-stack/commit/99a355719ad3106d20118dc1ea3abf34ddbdb9ad)]:
10
+ - @lynx-js/react-webpack-plugin@0.6.18
11
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.6
12
+ - @lynx-js/use-sync-external-store@1.5.0
13
+ - @lynx-js/react-refresh-webpack-plugin@0.3.3
14
+
15
+ ## 0.10.5
16
+
17
+ ### Patch Changes
18
+
19
+ - Avoid IIFE in `main-thread.js` to resolve memory leak when using `<list />`. ([#1176](https://github.com/lynx-family/lynx-stack/pull/1176))
20
+
21
+ - Enable fine-grained control for `output.inlineScripts` ([#883](https://github.com/lynx-family/lynx-stack/pull/883))
22
+
23
+ ```ts
24
+ type InlineChunkTestFunction = (params: {
25
+ size: number
26
+ name: string
27
+ }) => boolean
28
+
29
+ type InlineChunkTest = RegExp | InlineChunkTestFunction
30
+
31
+ type InlineChunkConfig =
32
+ | boolean
33
+ | InlineChunkTest
34
+ | { enable?: boolean | 'auto', test: InlineChunkTest }
35
+ ```
36
+
37
+ ```ts
38
+ import { defineConfig } from '@lynx-js/rspeedy'
39
+
40
+ export default defineConfig({
41
+ output: {
42
+ inlineScripts: ({ name, size }) => {
43
+ return name.includes('foo') && size < 1000
44
+ },
45
+ },
46
+ })
47
+ ```
48
+
49
+ - Updated dependencies [[`51cb73d`](https://github.com/lynx-family/lynx-stack/commit/51cb73dd0b77d35540644cdd2e6c37db856f0e8a), [`69fb042`](https://github.com/lynx-family/lynx-stack/commit/69fb0420e297abf768c889769c95a207c480b3c7), [`a7e8b5b`](https://github.com/lynx-family/lynx-stack/commit/a7e8b5bbbab0490e7cf6f47581130e7b32739abb)]:
50
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.1.2
51
+ - @lynx-js/template-webpack-plugin@0.8.1
52
+ - @lynx-js/react-webpack-plugin@0.6.17
53
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.5
54
+ - @lynx-js/use-sync-external-store@1.5.0
55
+ - @lynx-js/react-refresh-webpack-plugin@0.3.3
56
+ - @lynx-js/css-extract-webpack-plugin@0.6.0
57
+
3
58
  ## 0.10.4
4
59
 
5
60
  ### Patch Changes
package/dist/index.js CHANGED
@@ -359,8 +359,11 @@ function applyEntry(api, options) {
359
359
  }
360
360
  ]).end();
361
361
  });
362
+ let finalFirstScreenSyncTiming = firstScreenSyncTiming;
362
363
  if (isLynx) {
363
- const inlineScripts = 'boolean' == typeof environment.config.output?.inlineScripts ? environment.config.output.inlineScripts : true;
364
+ let inlineScripts;
365
+ inlineScripts = experimental_isLazyBundle ? true : environment.config.output?.inlineScripts ?? true;
366
+ if (true !== inlineScripts) finalFirstScreenSyncTiming = 'jsReady';
364
367
  chain.plugin(PLUGIN_NAME_RUNTIME_WRAPPER).use(RuntimeWrapperWebpackPlugin, [
365
368
  {
366
369
  injectVars (vars) {
@@ -390,7 +393,7 @@ function applyEntry(api, options) {
390
393
  chain.plugin(PLUGIN_NAME_REACT).after(PLUGIN_NAME_TEMPLATE).use(ReactWebpackPlugin, [
391
394
  {
392
395
  disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
393
- firstScreenSyncTiming,
396
+ firstScreenSyncTiming: finalFirstScreenSyncTiming,
394
397
  enableSSR,
395
398
  mainThreadChunks,
396
399
  extractStr,
@@ -1228,6 +1231,15 @@ function pluginReactLynx(userOptions) {
1228
1231
  inlineScripts: true
1229
1232
  }
1230
1233
  });
1234
+ config = mergeRsbuildConfig({
1235
+ tools: {
1236
+ rspack: {
1237
+ output: {
1238
+ iife: false
1239
+ }
1240
+ }
1241
+ }
1242
+ }, config);
1231
1243
  return config;
1232
1244
  });
1233
1245
  if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,18 +33,18 @@
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.4",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.10.6",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.3",
38
- "@lynx-js/react-webpack-plugin": "0.6.16",
39
- "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.1",
40
- "@lynx-js/template-webpack-plugin": "0.8.0",
38
+ "@lynx-js/react-webpack-plugin": "0.6.18",
39
+ "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.2",
40
+ "@lynx-js/template-webpack-plugin": "0.8.1",
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
- "@rollup/plugin-typescript": "^12.1.3",
47
- "@rsbuild/core": "1.3.21",
46
+ "@rollup/plugin-typescript": "^12.1.4",
47
+ "@rsbuild/core": "1.4.3",
48
48
  "@rsbuild/plugin-sass": "1.3.2",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
50
50
  "@rsbuild/plugin-webpack-swc": "1.1.1",
@@ -54,13 +54,13 @@
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.110.0",
57
+ "@lynx-js/react": "0.111.0",
58
58
  "@lynx-js/react-transform": "0.2.0",
59
- "@lynx-js/rspeedy": "0.9.10",
59
+ "@lynx-js/rspeedy": "0.10.0",
60
60
  "@lynx-js/vitest-setup": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@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"
63
+ "@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"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@lynx-js/react": {