@lynx-js/react-webpack-plugin-canary 0.6.18 → 0.6.19-canary-20250721-7cd5ea2c
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 +21 -15
- package/lib/ReactWebpackPlugin.js +4 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.6.19-canary-20250721065429-7cd5ea2cebf12aa982ddc048dec4c5c7ed6bc1d6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix `REACT_PROFILE` not taking effect. ([#1306](https://github.com/lynx-family/lynx-stack/pull/1306))
|
|
8
|
+
|
|
3
9
|
## 0.6.18
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -23,16 +29,16 @@
|
|
|
23
29
|
type InlineChunkConfig =
|
|
24
30
|
| boolean
|
|
25
31
|
| InlineChunkTest
|
|
26
|
-
| { enable?: boolean |
|
|
32
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
```ts
|
|
30
|
-
import { defineConfig } from
|
|
36
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
31
37
|
|
|
32
38
|
export default defineConfig({
|
|
33
39
|
output: {
|
|
34
40
|
inlineScripts: ({ name, size }) => {
|
|
35
|
-
return name.includes(
|
|
41
|
+
return name.includes("foo") && size < 1000;
|
|
36
42
|
},
|
|
37
43
|
},
|
|
38
44
|
});
|
|
@@ -116,7 +122,7 @@
|
|
|
116
122
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
117
123
|
|
|
118
124
|
```js
|
|
119
|
-
import { forwardRef, useImperativeHandle } from
|
|
125
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
120
126
|
|
|
121
127
|
export default forwardRef(function App(_, ref) {
|
|
122
128
|
useImperativeHandle(ref, () => {
|
|
@@ -124,7 +130,7 @@
|
|
|
124
130
|
return {
|
|
125
131
|
name() {
|
|
126
132
|
// This should be considered as background only
|
|
127
|
-
console.info(
|
|
133
|
+
console.info("This should not exist in main-thread");
|
|
128
134
|
},
|
|
129
135
|
};
|
|
130
136
|
});
|
|
@@ -184,14 +190,14 @@
|
|
|
184
190
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
185
191
|
|
|
186
192
|
```js
|
|
187
|
-
import { pluginReactLynx } from
|
|
188
|
-
import { defineConfig } from
|
|
193
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
194
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
189
195
|
|
|
190
196
|
export default defineConfig({
|
|
191
197
|
plugins: [
|
|
192
198
|
pluginReactLynx({
|
|
193
199
|
defineDCE: {
|
|
194
|
-
__SOME_FALSE_DEFINE__:
|
|
200
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
195
201
|
},
|
|
196
202
|
}),
|
|
197
203
|
],
|
|
@@ -203,20 +209,20 @@
|
|
|
203
209
|
For example, `import` initialized by dead code will be removed:
|
|
204
210
|
|
|
205
211
|
```js
|
|
206
|
-
import { foo } from
|
|
212
|
+
import { foo } from "bar";
|
|
207
213
|
|
|
208
214
|
if (__SOME_FALSE_DEFINE__) {
|
|
209
215
|
foo();
|
|
210
|
-
console.log(
|
|
216
|
+
console.log("dead code");
|
|
211
217
|
} else {
|
|
212
|
-
console.log(
|
|
218
|
+
console.log("reachable code");
|
|
213
219
|
}
|
|
214
220
|
```
|
|
215
221
|
|
|
216
222
|
will be transformed to:
|
|
217
223
|
|
|
218
224
|
```js
|
|
219
|
-
console.log(
|
|
225
|
+
console.log("reachable code");
|
|
220
226
|
```
|
|
221
227
|
|
|
222
228
|
## 0.6.0
|
|
@@ -226,14 +232,14 @@
|
|
|
226
232
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
227
233
|
|
|
228
234
|
```js
|
|
229
|
-
import { pluginReactLynx } from
|
|
230
|
-
import { defineConfig } from
|
|
235
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
236
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
231
237
|
|
|
232
238
|
export default defineConfig({
|
|
233
239
|
plugins: [
|
|
234
240
|
pluginReactLynx({
|
|
235
241
|
compat: {
|
|
236
|
-
removeComponentAttrRegex:
|
|
242
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
237
243
|
},
|
|
238
244
|
}),
|
|
239
245
|
],
|
|
@@ -103,9 +103,11 @@ class ReactWebpackPlugin {
|
|
|
103
103
|
__DEV__: JSON.stringify(compiler.options.mode === 'development'),
|
|
104
104
|
// We enable profile by default in development.
|
|
105
105
|
// It can also be disabled by environment variable `REACT_PROFILE=false`
|
|
106
|
-
__PROFILE__: JSON.stringify(
|
|
107
|
-
??
|
|
106
|
+
__PROFILE__: JSON.stringify(process.env['REACT_PROFILE']
|
|
107
|
+
?? options.profile
|
|
108
108
|
?? compiler.options.mode === 'development'),
|
|
109
|
+
// User can enable ALog by environment variable `REACT_ALOG=true`
|
|
110
|
+
__ALOG__: JSON.stringify(Boolean(process.env['REACT_ALOG'])),
|
|
109
111
|
__EXTRACT_STR__: JSON.stringify(Boolean(options.extractStr)),
|
|
110
112
|
__FIRST_SCREEN_SYNC_TIMING__: JSON.stringify(options.firstScreenSyncTiming),
|
|
111
113
|
__ENABLE_SSR__: JSON.stringify(options.enableSSR),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19-canary-20250721-7cd5ea2c",
|
|
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.52.8",
|
|
41
|
-
"@rspack/core": "1.4.
|
|
41
|
+
"@rspack/core": "1.4.8",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
43
|
"swc-loader": "^0.2.6",
|
|
44
44
|
"webpack": "^5.99.9",
|
|
45
45
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.0",
|
|
46
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.111.2",
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.2",
|
|
46
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
47
|
-
"@lynx-js/
|
|
48
|
-
"@lynx-js/vitest-setup": "0.0.0",
|
|
49
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.1"
|
|
49
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@lynx-js/react": "*",
|