@lynx-js/react-webpack-plugin-canary 0.10.0-canary-20260715-2b5d83a4 → 0.10.0
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 +26 -23
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.0
|
|
3
|
+
## 0.10.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
```js
|
|
21
21
|
pluginReactLynx({
|
|
22
|
-
firstScreenSyncTiming:
|
|
22
|
+
firstScreenSyncTiming: 'manual',
|
|
23
23
|
});
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
|
-
import { markFirstScreenSyncReady } from
|
|
27
|
+
import { markFirstScreenSyncReady } from '@lynx-js/react';
|
|
28
28
|
|
|
29
29
|
markFirstScreenSyncReady();
|
|
30
30
|
```
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
- 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
35
|
|
|
36
36
|
```js
|
|
37
|
-
import { defineConfig } from
|
|
38
|
-
import { pluginReactLynx } from
|
|
37
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
38
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
39
39
|
|
|
40
40
|
export default defineConfig({
|
|
41
41
|
plugins: [
|
|
@@ -52,9 +52,8 @@
|
|
|
52
52
|
|
|
53
53
|
- Fix `globDynamicComponentEntry is not defined` when an external bundle's main-thread section is evaluated. An external bundle is not a dynamic component, so `globDynamicComponentEntry` (only in scope for the main card and dynamic components) is undeclared there. The snapshot / element-template transform now bakes the `__Card__` entry name into an external bundle's snapshots instead of referencing the bare identifier, via a new internal `isExternalBundle` loader option. ([#2934](https://github.com/lynx-family/lynx-stack/pull/2934))
|
|
54
54
|
|
|
55
|
-
- Updated dependencies [[`
|
|
56
|
-
- @lynx-js/
|
|
57
|
-
- @lynx-js/webpack-runtime-globals@0.0.7-canary-20260715145040-2b5d83a4b8e3c1f5329de9d9fe7539d38e33e420
|
|
55
|
+
- Updated dependencies [[`fec4237`](https://github.com/lynx-family/lynx-stack/commit/fec4237b2257455a40a68f33864fb713c147f7d4)]:
|
|
56
|
+
- @lynx-js/webpack-runtime-globals@0.0.7
|
|
58
57
|
|
|
59
58
|
## 0.9.5
|
|
60
59
|
|
|
@@ -63,6 +62,7 @@
|
|
|
63
62
|
- Support enabling preact devtools in production via the `REACT_DEVTOOL` environment variable. ([#2880](https://github.com/lynx-family/lynx-stack/pull/2880))
|
|
64
63
|
|
|
65
64
|
By default `@lynx-js/preact-devtools` is aliased away in production builds. Setting the `REACT_DEVTOOL` environment variable now:
|
|
65
|
+
|
|
66
66
|
1. keeps a user-imported `@lynx-js/preact-devtools` from being stripped;
|
|
67
67
|
2. defines `__REACT_DEVTOOL__`, which gates the dev-only runtime hooks devtools depends on (such as `injectLepusMethods`) so they also run in production;
|
|
68
68
|
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,6 +119,7 @@
|
|
|
119
119
|
### Minor Changes
|
|
120
120
|
|
|
121
121
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
122
|
+
|
|
122
123
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
123
124
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
124
125
|
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
128
129
|
|
|
129
130
|
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
|
+
|
|
130
132
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
131
133
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
132
134
|
|
|
@@ -206,16 +208,16 @@
|
|
|
206
208
|
type InlineChunkConfig =
|
|
207
209
|
| boolean
|
|
208
210
|
| InlineChunkTest
|
|
209
|
-
| { enable?: boolean |
|
|
211
|
+
| { enable?: boolean | 'auto'; test: InlineChunkTest };
|
|
210
212
|
```
|
|
211
213
|
|
|
212
214
|
```ts
|
|
213
|
-
import { defineConfig } from
|
|
215
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
214
216
|
|
|
215
217
|
export default defineConfig({
|
|
216
218
|
output: {
|
|
217
219
|
inlineScripts: ({ name, size }) => {
|
|
218
|
-
return name.includes(
|
|
220
|
+
return name.includes('foo') && size < 1000;
|
|
219
221
|
},
|
|
220
222
|
},
|
|
221
223
|
});
|
|
@@ -270,6 +272,7 @@
|
|
|
270
272
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
271
273
|
|
|
272
274
|
Now use support the following usage
|
|
275
|
+
|
|
273
276
|
- mainthread event
|
|
274
277
|
- mainthread ref
|
|
275
278
|
- runOnMainThread/runOnBackground
|
|
@@ -298,7 +301,7 @@
|
|
|
298
301
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
299
302
|
|
|
300
303
|
```js
|
|
301
|
-
import { forwardRef, useImperativeHandle } from
|
|
304
|
+
import { forwardRef, useImperativeHandle } from '@lynx-js/react';
|
|
302
305
|
|
|
303
306
|
export default forwardRef(function App(_, ref) {
|
|
304
307
|
useImperativeHandle(ref, () => {
|
|
@@ -306,7 +309,7 @@
|
|
|
306
309
|
return {
|
|
307
310
|
name() {
|
|
308
311
|
// This should be considered as background only
|
|
309
|
-
console.info(
|
|
312
|
+
console.info('This should not exist in main-thread');
|
|
310
313
|
},
|
|
311
314
|
};
|
|
312
315
|
});
|
|
@@ -366,14 +369,14 @@
|
|
|
366
369
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
367
370
|
|
|
368
371
|
```js
|
|
369
|
-
import { pluginReactLynx } from
|
|
370
|
-
import { defineConfig } from
|
|
372
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
373
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
371
374
|
|
|
372
375
|
export default defineConfig({
|
|
373
376
|
plugins: [
|
|
374
377
|
pluginReactLynx({
|
|
375
378
|
defineDCE: {
|
|
376
|
-
__SOME_FALSE_DEFINE__:
|
|
379
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
377
380
|
},
|
|
378
381
|
}),
|
|
379
382
|
],
|
|
@@ -385,20 +388,20 @@
|
|
|
385
388
|
For example, `import` initialized by dead code will be removed:
|
|
386
389
|
|
|
387
390
|
```js
|
|
388
|
-
import { foo } from
|
|
391
|
+
import { foo } from 'bar';
|
|
389
392
|
|
|
390
393
|
if (__SOME_FALSE_DEFINE__) {
|
|
391
394
|
foo();
|
|
392
|
-
console.log(
|
|
395
|
+
console.log('dead code');
|
|
393
396
|
} else {
|
|
394
|
-
console.log(
|
|
397
|
+
console.log('reachable code');
|
|
395
398
|
}
|
|
396
399
|
```
|
|
397
400
|
|
|
398
401
|
will be transformed to:
|
|
399
402
|
|
|
400
403
|
```js
|
|
401
|
-
console.log(
|
|
404
|
+
console.log('reachable code');
|
|
402
405
|
```
|
|
403
406
|
|
|
404
407
|
## 0.6.0
|
|
@@ -408,14 +411,14 @@
|
|
|
408
411
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
409
412
|
|
|
410
413
|
```js
|
|
411
|
-
import { pluginReactLynx } from
|
|
412
|
-
import { defineConfig } from
|
|
414
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
415
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
413
416
|
|
|
414
417
|
export default defineConfig({
|
|
415
418
|
plugins: [
|
|
416
419
|
pluginReactLynx({
|
|
417
420
|
compat: {
|
|
418
|
-
removeComponentAttrRegex:
|
|
421
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
419
422
|
},
|
|
420
423
|
}),
|
|
421
424
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.10.0
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@lynx-js/debug-metadata": "npm:@lynx-js/debug-metadata-canary@0.1.0",
|
|
37
|
-
"@lynx-js/webpack-runtime-globals": "npm:@lynx-js/webpack-runtime-globals-canary@0.0.7
|
|
37
|
+
"@lynx-js/webpack-runtime-globals": "npm:@lynx-js/webpack-runtime-globals-canary@0.0.7",
|
|
38
38
|
"tiny-invariant": "^1.3.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -44,10 +44,10 @@
|
|
|
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.9.0
|
|
48
|
-
"@lynx-js/
|
|
49
|
-
"@lynx-js/
|
|
50
|
-
"@lynx-js/
|
|
47
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.9.0",
|
|
48
|
+
"@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
|
+
"@lynx-js/test-tools": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@lynx-js/template-webpack-plugin": "*"
|