@lynx-js/react-webpack-plugin-canary 0.6.9 → 0.6.10-canary-20250327-42217c2c

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,15 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.6.10-canary-20250327165511-42217c2c77a33e729977fc7108b218a1cb868e6a
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix issue where loading a lazy bundle fails if it does not return a webpack chunk. ([#365](https://github.com/lynx-family/lynx-stack/pull/365))
8
+
9
+ - Updated dependencies [[`f03bd4a`](https://github.com/lynx-family/lynx-stack/commit/f03bd4a62f81902ba55caf10df56447c89743e62), [`808ee60`](https://github.com/lynx-family/lynx-stack/commit/808ee6084c1b48496292c7af68d5baeeeb860051)]:
10
+ - @lynx-js/template-webpack-plugin@0.6.7-canary-20250327165511-42217c2c77a33e729977fc7108b218a1cb868e6a
11
+ - @lynx-js/react@0.106.2-canary-20250327165511-42217c2c77a33e729977fc7108b218a1cb868e6a
12
+
3
13
  ## 0.6.9
4
14
 
5
15
  ### Patch Changes
@@ -13,7 +23,7 @@
13
23
  - Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
14
24
 
15
25
  ```js
16
- import { forwardRef, useImperativeHandle } from '@lynx-js/react';
26
+ import { forwardRef, useImperativeHandle } from "@lynx-js/react";
17
27
 
18
28
  export default forwardRef(function App(_, ref) {
19
29
  useImperativeHandle(ref, () => {
@@ -21,7 +31,7 @@
21
31
  return {
22
32
  name() {
23
33
  // This should be considered as background only
24
- console.info('This should not exist in main-thread');
34
+ console.info("This should not exist in main-thread");
25
35
  },
26
36
  };
27
37
  });
@@ -81,14 +91,14 @@
81
91
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
82
92
 
83
93
  ```js
84
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
85
- import { defineConfig } from '@lynx-js/rspeedy';
94
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
95
+ import { defineConfig } from "@lynx-js/rspeedy";
86
96
 
87
97
  export default defineConfig({
88
98
  plugins: [
89
99
  pluginReactLynx({
90
100
  defineDCE: {
91
- __SOME_FALSE_DEFINE__: 'false',
101
+ __SOME_FALSE_DEFINE__: "false",
92
102
  },
93
103
  }),
94
104
  ],
@@ -100,20 +110,20 @@
100
110
  For example, `import` initialized by dead code will be removed:
101
111
 
102
112
  ```js
103
- import { foo } from 'bar';
113
+ import { foo } from "bar";
104
114
 
105
115
  if (__SOME_FALSE_DEFINE__) {
106
116
  foo();
107
- console.log('dead code');
117
+ console.log("dead code");
108
118
  } else {
109
- console.log('reachable code');
119
+ console.log("reachable code");
110
120
  }
111
121
  ```
112
122
 
113
123
  will be transformed to:
114
124
 
115
125
  ```js
116
- console.log('reachable code');
126
+ console.log("reachable code");
117
127
  ```
118
128
 
119
129
  ## 0.6.0
@@ -123,14 +133,14 @@
123
133
  - a30c83d: Add `compat.removeComponentAttrRegex`.
124
134
 
125
135
  ```js
126
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
127
- import { defineConfig } from '@lynx-js/rspeedy';
136
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
137
+ import { defineConfig } from "@lynx-js/rspeedy";
128
138
 
129
139
  export default defineConfig({
130
140
  plugins: [
131
141
  pluginReactLynx({
132
142
  compat: {
133
- removeComponentAttrRegex: 'YOUR REGEX',
143
+ removeComponentAttrRegex: "YOUR REGEX",
134
144
  },
135
145
  }),
136
146
  ],
@@ -12,8 +12,8 @@ export function createLynxProcessEvalResultRuntimeModule(webpack) {
12
12
  }
13
13
  return `
14
14
  ${LynxRuntimeGlobals.lynxProcessEvalResult} = function (result, schema) {
15
- var chunk = result(schema);
16
- if (chunk.ids && chunk.modules) {
15
+ var chunk = result && result(schema);
16
+ if (chunk && chunk.ids && chunk.modules) {
17
17
  // We only deal with webpack chunk
18
18
  ${webpack.RuntimeGlobals.externalInstallChunk}(chunk);
19
19
  // TODO: sort with preOrderIndex. See: https://github.com/web-infra-dev/rspack/pull/8588
@@ -22,6 +22,7 @@ ${LynxRuntimeGlobals.lynxProcessEvalResult} = function (result, schema) {
22
22
  }
23
23
  return chunk;
24
24
  }
25
+ return chunk
25
26
  }
26
27
  `;
27
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.6.9",
3
+ "version": "0.6.10-canary-20250327-42217c2c",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -38,15 +38,15 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@microsoft/api-extractor": "7.51.1",
41
- "@rspack/core": "1.3.0-beta.0",
41
+ "@rspack/core": "1.3.0-beta.1",
42
42
  "css-loader": "^7.1.2",
43
43
  "swc-loader": "^0.2.6",
44
44
  "webpack": "^5.98.0",
45
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.106.0",
46
45
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.2",
47
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.6.6",
46
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.106.2-canary-20250327-42217c2c",
48
47
  "@lynx-js/test-tools": "0.0.0",
49
- "@lynx-js/vitest-setup": "0.0.0"
48
+ "@lynx-js/vitest-setup": "0.0.0",
49
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.6.7-canary-20250327-42217c2c"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@lynx-js/react": "*",