@lynx-js/react-webpack-plugin-canary 0.8.0 → 0.9.0-canary-20260407-156d64da
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 +28 -18
- package/lib/loaders/options.js +3 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.9.0-canary-20260407140348-156d64da67e83dfc92e63568cee602c21db873cf
|
|
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
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies []:
|
|
14
|
+
- @lynx-js/template-webpack-plugin@0.10.8-canary-20260407140348-156d64da67e83dfc92e63568cee602c21db873cf
|
|
15
|
+
|
|
3
16
|
## 0.8.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
6
19
|
|
|
7
20
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
8
|
-
|
|
9
21
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
10
22
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
11
23
|
|
|
@@ -14,7 +26,6 @@
|
|
|
14
26
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
15
27
|
|
|
16
28
|
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
29
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
19
30
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
20
31
|
|
|
@@ -94,16 +105,16 @@
|
|
|
94
105
|
type InlineChunkConfig =
|
|
95
106
|
| boolean
|
|
96
107
|
| InlineChunkTest
|
|
97
|
-
| { enable?: boolean |
|
|
108
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
98
109
|
```
|
|
99
110
|
|
|
100
111
|
```ts
|
|
101
|
-
import { defineConfig } from
|
|
112
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
102
113
|
|
|
103
114
|
export default defineConfig({
|
|
104
115
|
output: {
|
|
105
116
|
inlineScripts: ({ name, size }) => {
|
|
106
|
-
return name.includes(
|
|
117
|
+
return name.includes("foo") && size < 1000;
|
|
107
118
|
},
|
|
108
119
|
},
|
|
109
120
|
});
|
|
@@ -158,7 +169,6 @@
|
|
|
158
169
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
159
170
|
|
|
160
171
|
Now use support the following usage
|
|
161
|
-
|
|
162
172
|
- mainthread event
|
|
163
173
|
- mainthread ref
|
|
164
174
|
- runOnMainThread/runOnBackground
|
|
@@ -187,7 +197,7 @@
|
|
|
187
197
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
188
198
|
|
|
189
199
|
```js
|
|
190
|
-
import { forwardRef, useImperativeHandle } from
|
|
200
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
191
201
|
|
|
192
202
|
export default forwardRef(function App(_, ref) {
|
|
193
203
|
useImperativeHandle(ref, () => {
|
|
@@ -195,7 +205,7 @@
|
|
|
195
205
|
return {
|
|
196
206
|
name() {
|
|
197
207
|
// This should be considered as background only
|
|
198
|
-
console.info(
|
|
208
|
+
console.info("This should not exist in main-thread");
|
|
199
209
|
},
|
|
200
210
|
};
|
|
201
211
|
});
|
|
@@ -255,14 +265,14 @@
|
|
|
255
265
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
256
266
|
|
|
257
267
|
```js
|
|
258
|
-
import { pluginReactLynx } from
|
|
259
|
-
import { defineConfig } from
|
|
268
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
269
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
260
270
|
|
|
261
271
|
export default defineConfig({
|
|
262
272
|
plugins: [
|
|
263
273
|
pluginReactLynx({
|
|
264
274
|
defineDCE: {
|
|
265
|
-
__SOME_FALSE_DEFINE__:
|
|
275
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
266
276
|
},
|
|
267
277
|
}),
|
|
268
278
|
],
|
|
@@ -274,20 +284,20 @@
|
|
|
274
284
|
For example, `import` initialized by dead code will be removed:
|
|
275
285
|
|
|
276
286
|
```js
|
|
277
|
-
import { foo } from
|
|
287
|
+
import { foo } from "bar";
|
|
278
288
|
|
|
279
289
|
if (__SOME_FALSE_DEFINE__) {
|
|
280
290
|
foo();
|
|
281
|
-
console.log(
|
|
291
|
+
console.log("dead code");
|
|
282
292
|
} else {
|
|
283
|
-
console.log(
|
|
293
|
+
console.log("reachable code");
|
|
284
294
|
}
|
|
285
295
|
```
|
|
286
296
|
|
|
287
297
|
will be transformed to:
|
|
288
298
|
|
|
289
299
|
```js
|
|
290
|
-
console.log(
|
|
300
|
+
console.log("reachable code");
|
|
291
301
|
```
|
|
292
302
|
|
|
293
303
|
## 0.6.0
|
|
@@ -297,14 +307,14 @@
|
|
|
297
307
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
298
308
|
|
|
299
309
|
```js
|
|
300
|
-
import { pluginReactLynx } from
|
|
301
|
-
import { defineConfig } from
|
|
310
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
311
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
302
312
|
|
|
303
313
|
export default defineConfig({
|
|
304
314
|
plugins: [
|
|
305
315
|
pluginReactLynx({
|
|
306
316
|
compat: {
|
|
307
|
-
removeComponentAttrRegex:
|
|
317
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
308
318
|
},
|
|
309
319
|
}),
|
|
310
320
|
],
|
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-156d64da",
|
|
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/react": "npm:@lynx-js/react-canary@0.
|
|
46
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.118.0-canary-20260407-156d64da",
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.8-canary-20260407-156d64da",
|
|
47
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
48
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.6",
|
|
49
49
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|