@lynx-js/react-webpack-plugin-canary 0.10.0 → 0.10.1-canary-20260717-08dd06ae
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 -23
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.10.1-canary-20260717031202-08dd06ae3a812155fa82d8d0356e5b7ae5395155
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Accept `@lynx-js/template-webpack-plugin` `^0.14.0` as a peer dependency. ([#2993](https://github.com/lynx-family/lynx-stack/pull/2993))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`08dd06a`](https://github.com/lynx-family/lynx-stack/commit/08dd06ae3a812155fa82d8d0356e5b7ae5395155)]:
|
|
10
|
+
- @lynx-js/template-webpack-plugin@0.14.0-canary-20260717031202-08dd06ae3a812155fa82d8d0356e5b7ae5395155
|
|
11
|
+
|
|
3
12
|
## 0.10.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -19,12 +28,12 @@
|
|
|
19
28
|
|
|
20
29
|
```js
|
|
21
30
|
pluginReactLynx({
|
|
22
|
-
firstScreenSyncTiming:
|
|
31
|
+
firstScreenSyncTiming: "manual",
|
|
23
32
|
});
|
|
24
33
|
```
|
|
25
34
|
|
|
26
35
|
```js
|
|
27
|
-
import { markFirstScreenSyncReady } from
|
|
36
|
+
import { markFirstScreenSyncReady } from "@lynx-js/react";
|
|
28
37
|
|
|
29
38
|
markFirstScreenSyncReady();
|
|
30
39
|
```
|
|
@@ -34,8 +43,8 @@
|
|
|
34
43
|
- Add `compat.legacySlot` to `pluginReactLynx`. When enabled, dynamic children are compiled to the pre-SlotV2 form (JSX `children` + `wrapper` elements + `__DynamicPartChildren`/`__DynamicPartSlot` symbols instead of `$0`/`$1` slot props + `SlotV2`), so the compiled output stays compatible with legacy runtimes without `SlotV2` support (`< 0.120.0`, which shipped the SlotV2 refactor in #1764) — e.g. a standalone lazy bundle consumed by a host App that ships an older runtime. ([#2947](https://github.com/lynx-family/lynx-stack/pull/2947))
|
|
35
44
|
|
|
36
45
|
```js
|
|
37
|
-
import { defineConfig } from
|
|
38
|
-
import { pluginReactLynx } from
|
|
46
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
47
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
39
48
|
|
|
40
49
|
export default defineConfig({
|
|
41
50
|
plugins: [
|
|
@@ -62,7 +71,6 @@
|
|
|
62
71
|
- Support enabling preact devtools in production via the `REACT_DEVTOOL` environment variable. ([#2880](https://github.com/lynx-family/lynx-stack/pull/2880))
|
|
63
72
|
|
|
64
73
|
By default `@lynx-js/preact-devtools` is aliased away in production builds. Setting the `REACT_DEVTOOL` environment variable now:
|
|
65
|
-
|
|
66
74
|
1. keeps a user-imported `@lynx-js/preact-devtools` from being stripped;
|
|
67
75
|
2. defines `__REACT_DEVTOOL__`, which gates the dev-only runtime hooks devtools depends on (such as `injectLepusMethods`) so they also run in production;
|
|
68
76
|
3. keeps function/class names during minification (`keep_fnames`/`keep_classnames`), which devtools needs to resolve component names (`type.name`) and to reconstruct the hook tree (it matches minified stack frames by function name).
|
|
@@ -119,7 +127,6 @@
|
|
|
119
127
|
### Minor Changes
|
|
120
128
|
|
|
121
129
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
122
|
-
|
|
123
130
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
124
131
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
125
132
|
|
|
@@ -128,7 +135,6 @@
|
|
|
128
135
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
129
136
|
|
|
130
137
|
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`.
|
|
131
|
-
|
|
132
138
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
133
139
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
134
140
|
|
|
@@ -208,16 +214,16 @@
|
|
|
208
214
|
type InlineChunkConfig =
|
|
209
215
|
| boolean
|
|
210
216
|
| InlineChunkTest
|
|
211
|
-
| { enable?: boolean |
|
|
217
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
212
218
|
```
|
|
213
219
|
|
|
214
220
|
```ts
|
|
215
|
-
import { defineConfig } from
|
|
221
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
216
222
|
|
|
217
223
|
export default defineConfig({
|
|
218
224
|
output: {
|
|
219
225
|
inlineScripts: ({ name, size }) => {
|
|
220
|
-
return name.includes(
|
|
226
|
+
return name.includes("foo") && size < 1000;
|
|
221
227
|
},
|
|
222
228
|
},
|
|
223
229
|
});
|
|
@@ -272,7 +278,6 @@
|
|
|
272
278
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
273
279
|
|
|
274
280
|
Now use support the following usage
|
|
275
|
-
|
|
276
281
|
- mainthread event
|
|
277
282
|
- mainthread ref
|
|
278
283
|
- runOnMainThread/runOnBackground
|
|
@@ -301,7 +306,7 @@
|
|
|
301
306
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
302
307
|
|
|
303
308
|
```js
|
|
304
|
-
import { forwardRef, useImperativeHandle } from
|
|
309
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
305
310
|
|
|
306
311
|
export default forwardRef(function App(_, ref) {
|
|
307
312
|
useImperativeHandle(ref, () => {
|
|
@@ -309,7 +314,7 @@
|
|
|
309
314
|
return {
|
|
310
315
|
name() {
|
|
311
316
|
// This should be considered as background only
|
|
312
|
-
console.info(
|
|
317
|
+
console.info("This should not exist in main-thread");
|
|
313
318
|
},
|
|
314
319
|
};
|
|
315
320
|
});
|
|
@@ -369,14 +374,14 @@
|
|
|
369
374
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
370
375
|
|
|
371
376
|
```js
|
|
372
|
-
import { pluginReactLynx } from
|
|
373
|
-
import { defineConfig } from
|
|
377
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
378
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
374
379
|
|
|
375
380
|
export default defineConfig({
|
|
376
381
|
plugins: [
|
|
377
382
|
pluginReactLynx({
|
|
378
383
|
defineDCE: {
|
|
379
|
-
__SOME_FALSE_DEFINE__:
|
|
384
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
380
385
|
},
|
|
381
386
|
}),
|
|
382
387
|
],
|
|
@@ -388,20 +393,20 @@
|
|
|
388
393
|
For example, `import` initialized by dead code will be removed:
|
|
389
394
|
|
|
390
395
|
```js
|
|
391
|
-
import { foo } from
|
|
396
|
+
import { foo } from "bar";
|
|
392
397
|
|
|
393
398
|
if (__SOME_FALSE_DEFINE__) {
|
|
394
399
|
foo();
|
|
395
|
-
console.log(
|
|
400
|
+
console.log("dead code");
|
|
396
401
|
} else {
|
|
397
|
-
console.log(
|
|
402
|
+
console.log("reachable code");
|
|
398
403
|
}
|
|
399
404
|
```
|
|
400
405
|
|
|
401
406
|
will be transformed to:
|
|
402
407
|
|
|
403
408
|
```js
|
|
404
|
-
console.log(
|
|
409
|
+
console.log("reachable code");
|
|
405
410
|
```
|
|
406
411
|
|
|
407
412
|
## 0.6.0
|
|
@@ -411,14 +416,14 @@
|
|
|
411
416
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
412
417
|
|
|
413
418
|
```js
|
|
414
|
-
import { pluginReactLynx } from
|
|
415
|
-
import { defineConfig } from
|
|
419
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
420
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
416
421
|
|
|
417
422
|
export default defineConfig({
|
|
418
423
|
plugins: [
|
|
419
424
|
pluginReactLynx({
|
|
420
425
|
compat: {
|
|
421
|
-
removeComponentAttrRegex:
|
|
426
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
422
427
|
},
|
|
423
428
|
}),
|
|
424
429
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1-canary-20260717-08dd06ae",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@rstest/core": "0.11.0",
|
|
45
45
|
"css-loader": "^7.1.4",
|
|
46
46
|
"swc-loader": "^0.2.7",
|
|
47
|
-
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.
|
|
47
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.10.0-canary-20260717-08dd06ae",
|
|
48
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.14.0-canary-20260717-08dd06ae",
|
|
48
49
|
"@lynx-js/react": "npm:@lynx-js/react-canary@0.123.0",
|
|
49
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.13.0",
|
|
50
50
|
"@lynx-js/test-tools": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|