@lynx-js/react-rsbuild-plugin 0.10.3 → 0.10.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/index.js +14 -2
  3. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.10.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Avoid IIFE in `main-thread.js` to resolve memory leak when using `<list />`. ([#1176](https://github.com/lynx-family/lynx-stack/pull/1176))
8
+
9
+ - Enable fine-grained control for `output.inlineScripts` ([#883](https://github.com/lynx-family/lynx-stack/pull/883))
10
+
11
+ ```ts
12
+ type InlineChunkTestFunction = (params: {
13
+ size: number
14
+ name: string
15
+ }) => boolean
16
+
17
+ type InlineChunkTest = RegExp | InlineChunkTestFunction
18
+
19
+ type InlineChunkConfig =
20
+ | boolean
21
+ | InlineChunkTest
22
+ | { enable?: boolean | 'auto', test: InlineChunkTest }
23
+ ```
24
+
25
+ ```ts
26
+ import { defineConfig } from '@lynx-js/rspeedy'
27
+
28
+ export default defineConfig({
29
+ output: {
30
+ inlineScripts: ({ name, size }) => {
31
+ return name.includes('foo') && size < 1000
32
+ },
33
+ },
34
+ })
35
+ ```
36
+
37
+ - 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)]:
38
+ - @lynx-js/runtime-wrapper-webpack-plugin@0.1.2
39
+ - @lynx-js/template-webpack-plugin@0.8.1
40
+ - @lynx-js/react-webpack-plugin@0.6.17
41
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.5
42
+ - @lynx-js/use-sync-external-store@1.5.0
43
+ - @lynx-js/react-refresh-webpack-plugin@0.3.3
44
+ - @lynx-js/css-extract-webpack-plugin@0.6.0
45
+
46
+ ## 0.10.4
47
+
48
+ ### Patch Changes
49
+
50
+ - Support `@lynx-js/react` v0.110.0. ([#770](https://github.com/lynx-family/lynx-stack/pull/770))
51
+
52
+ - Updated dependencies [[`f84a1cc`](https://github.com/lynx-family/lynx-stack/commit/f84a1cce524af653f19bfc18657851ed24a9ba79), [`0d151db`](https://github.com/lynx-family/lynx-stack/commit/0d151db39fe9c7eeb75010798948e1964a962515), [`0d151db`](https://github.com/lynx-family/lynx-stack/commit/0d151db39fe9c7eeb75010798948e1964a962515), [`51676ed`](https://github.com/lynx-family/lynx-stack/commit/51676edf4076dd2bbccaf8048c8e0abe4f3c142d), [`0d151db`](https://github.com/lynx-family/lynx-stack/commit/0d151db39fe9c7eeb75010798948e1964a962515), [`a43ae05`](https://github.com/lynx-family/lynx-stack/commit/a43ae054bbe60250b0faf7a15d23b0445bb3c594), [`0a0ef40`](https://github.com/lynx-family/lynx-stack/commit/0a0ef4094a9c81f8849605c17a4c8f08dc128171), [`9b61210`](https://github.com/lynx-family/lynx-stack/commit/9b6121090ce349156c09238cb3bb167066b35a21)]:
53
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.4
54
+ - @lynx-js/react-webpack-plugin@0.6.16
55
+ - @lynx-js/css-extract-webpack-plugin@0.6.0
56
+ - @lynx-js/template-webpack-plugin@0.8.0
57
+ - @lynx-js/react-refresh-webpack-plugin@0.3.3
58
+ - @lynx-js/use-sync-external-store@1.5.0
59
+
3
60
  ## 0.10.3
4
61
 
5
62
  ### 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.3",
3
+ "version": "0.10.5",
4
4
  "description": "A rsbuild plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -32,18 +32,18 @@
32
32
  "README.md"
33
33
  ],
34
34
  "dependencies": {
35
- "@lynx-js/css-extract-webpack-plugin": "0.5.4",
36
- "@lynx-js/react-alias-rsbuild-plugin": "0.10.3",
35
+ "@lynx-js/css-extract-webpack-plugin": "0.6.0",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "0.10.5",
37
37
  "@lynx-js/react-refresh-webpack-plugin": "0.3.3",
38
- "@lynx-js/react-webpack-plugin": "0.6.15",
39
- "@lynx-js/runtime-wrapper-webpack-plugin": "0.1.1",
40
- "@lynx-js/template-webpack-plugin": "0.7.2",
38
+ "@lynx-js/react-webpack-plugin": "0.6.17",
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.2",
46
+ "@rollup/plugin-typescript": "^12.1.3",
47
47
  "@rsbuild/core": "1.3.21",
48
48
  "@rsbuild/plugin-sass": "1.3.2",
49
49
  "@rsbuild/plugin-typed-css-modules": "1.0.2",
@@ -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.109.2",
57
+ "@lynx-js/react": "0.110.1",
58
58
  "@lynx-js/react-transform": "0.2.0",
59
- "@lynx-js/rspeedy": "0.9.9",
59
+ "@lynx-js/rspeedy": "0.9.11",
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"
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"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@lynx-js/react": {