@lynx-js/react-webpack-plugin-canary 0.8.0 → 0.9.0-canary-20260407-1f4f1171
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 +23 -18
- package/lib/loaders/options.js +3 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.9.0-canary-20260407131324-1f4f1171a35a00d2c9f2ae9ecff50be2626ca5bb
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](https://github.com/lynx-family/lynx-stack/pull/2423))
|
|
8
|
+
|
|
9
|
+
`removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments.
|
|
10
|
+
|
|
3
11
|
## 0.8.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
6
14
|
|
|
7
15
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
8
|
-
|
|
9
16
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
10
17
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
11
18
|
|
|
@@ -14,7 +21,6 @@
|
|
|
14
21
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
15
22
|
|
|
16
23
|
The lazy bundle IIFE wrapper is now injected in `processAssets` at `PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1` by walking chunk groups instead of patching assets in `beforeEncode`.
|
|
17
|
-
|
|
18
24
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
19
25
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
20
26
|
|
|
@@ -94,16 +100,16 @@
|
|
|
94
100
|
type InlineChunkConfig =
|
|
95
101
|
| boolean
|
|
96
102
|
| InlineChunkTest
|
|
97
|
-
| { enable?: boolean |
|
|
103
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
98
104
|
```
|
|
99
105
|
|
|
100
106
|
```ts
|
|
101
|
-
import { defineConfig } from
|
|
107
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
102
108
|
|
|
103
109
|
export default defineConfig({
|
|
104
110
|
output: {
|
|
105
111
|
inlineScripts: ({ name, size }) => {
|
|
106
|
-
return name.includes(
|
|
112
|
+
return name.includes("foo") && size < 1000;
|
|
107
113
|
},
|
|
108
114
|
},
|
|
109
115
|
});
|
|
@@ -158,7 +164,6 @@
|
|
|
158
164
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
159
165
|
|
|
160
166
|
Now use support the following usage
|
|
161
|
-
|
|
162
167
|
- mainthread event
|
|
163
168
|
- mainthread ref
|
|
164
169
|
- runOnMainThread/runOnBackground
|
|
@@ -187,7 +192,7 @@
|
|
|
187
192
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
188
193
|
|
|
189
194
|
```js
|
|
190
|
-
import { forwardRef, useImperativeHandle } from
|
|
195
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
191
196
|
|
|
192
197
|
export default forwardRef(function App(_, ref) {
|
|
193
198
|
useImperativeHandle(ref, () => {
|
|
@@ -195,7 +200,7 @@
|
|
|
195
200
|
return {
|
|
196
201
|
name() {
|
|
197
202
|
// This should be considered as background only
|
|
198
|
-
console.info(
|
|
203
|
+
console.info("This should not exist in main-thread");
|
|
199
204
|
},
|
|
200
205
|
};
|
|
201
206
|
});
|
|
@@ -255,14 +260,14 @@
|
|
|
255
260
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
256
261
|
|
|
257
262
|
```js
|
|
258
|
-
import { pluginReactLynx } from
|
|
259
|
-
import { defineConfig } from
|
|
263
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
264
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
260
265
|
|
|
261
266
|
export default defineConfig({
|
|
262
267
|
plugins: [
|
|
263
268
|
pluginReactLynx({
|
|
264
269
|
defineDCE: {
|
|
265
|
-
__SOME_FALSE_DEFINE__:
|
|
270
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
266
271
|
},
|
|
267
272
|
}),
|
|
268
273
|
],
|
|
@@ -274,20 +279,20 @@
|
|
|
274
279
|
For example, `import` initialized by dead code will be removed:
|
|
275
280
|
|
|
276
281
|
```js
|
|
277
|
-
import { foo } from
|
|
282
|
+
import { foo } from "bar";
|
|
278
283
|
|
|
279
284
|
if (__SOME_FALSE_DEFINE__) {
|
|
280
285
|
foo();
|
|
281
|
-
console.log(
|
|
286
|
+
console.log("dead code");
|
|
282
287
|
} else {
|
|
283
|
-
console.log(
|
|
288
|
+
console.log("reachable code");
|
|
284
289
|
}
|
|
285
290
|
```
|
|
286
291
|
|
|
287
292
|
will be transformed to:
|
|
288
293
|
|
|
289
294
|
```js
|
|
290
|
-
console.log(
|
|
295
|
+
console.log("reachable code");
|
|
291
296
|
```
|
|
292
297
|
|
|
293
298
|
## 0.6.0
|
|
@@ -297,14 +302,14 @@
|
|
|
297
302
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
298
303
|
|
|
299
304
|
```js
|
|
300
|
-
import { pluginReactLynx } from
|
|
301
|
-
import { defineConfig } from
|
|
305
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
306
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
302
307
|
|
|
303
308
|
export default defineConfig({
|
|
304
309
|
plugins: [
|
|
305
310
|
pluginReactLynx({
|
|
306
311
|
compat: {
|
|
307
|
-
removeComponentAttrRegex:
|
|
312
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
308
313
|
},
|
|
309
314
|
}),
|
|
310
315
|
],
|
package/lib/loaders/options.js
CHANGED
|
@@ -154,14 +154,15 @@ export function getMainThreadTransformOptions(inputSourceMap) {
|
|
|
154
154
|
'defaultProps',
|
|
155
155
|
...(shake?.retainProp ?? []),
|
|
156
156
|
],
|
|
157
|
-
|
|
157
|
+
removeCall: [
|
|
158
158
|
'useEffect',
|
|
159
159
|
'useLayoutEffect',
|
|
160
160
|
'__runInJS',
|
|
161
161
|
'useLynxGlobalEventListener',
|
|
162
162
|
'useImperativeHandle',
|
|
163
|
-
...(shake?.
|
|
163
|
+
...(shake?.removeCall ?? []),
|
|
164
164
|
],
|
|
165
|
+
removeCallParams: shake?.removeCallParams ?? [],
|
|
165
166
|
},
|
|
166
167
|
worklet: {
|
|
167
168
|
...commonOptions.worklet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-canary-20260407-1f4f1171",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@microsoft/api-extractor": "7.57.6",
|
|
41
|
-
"@rspack/core": "1.7.
|
|
41
|
+
"@rspack/core": "1.7.9",
|
|
42
42
|
"css-loader": "^7.1.4",
|
|
43
43
|
"swc-loader": "^0.2.7",
|
|
44
44
|
"webpack": "^5.105.2",
|
|
45
45
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
|
|
46
|
-
"@lynx-js/
|
|
46
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.7",
|
|
47
47
|
"@lynx-js/test-tools": "0.0.0",
|
|
48
|
-
"@lynx-js/
|
|
48
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.118.0-canary-20260407-1f4f1171",
|
|
49
49
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|