@lynx-js/react-webpack-plugin-canary 0.10.3 → 0.10.4-canary-20260812-21528f12
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 -19
- package/lib/loaders/options.js +1 -0
- package/lib/loaders/testing.js +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.10.4-canary-20260812160206-21528f12c347564c40bc0c15de3df7db5ce85afe
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add `compat.transformLegacyEventAttributeNames` to disable legacy event attribute-name conversion independently from other compatibility transforms. ([#3475](https://github.com/lynx-family/lynx-stack/pull/3475))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`6cc9624`](https://github.com/lynx-family/lynx-stack/commit/6cc9624fb54dc7f73b6e68e49e2322b8136d3418)]:
|
|
10
|
+
- @lynx-js/template-webpack-plugin@0.15.1-canary-20260812160206-21528f12c347564c40bc0c15de3df7db5ce85afe
|
|
11
|
+
|
|
3
12
|
## 0.10.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -39,12 +48,12 @@
|
|
|
39
48
|
|
|
40
49
|
```js
|
|
41
50
|
pluginReactLynx({
|
|
42
|
-
firstScreenSyncTiming:
|
|
51
|
+
firstScreenSyncTiming: "manual",
|
|
43
52
|
});
|
|
44
53
|
```
|
|
45
54
|
|
|
46
55
|
```js
|
|
47
|
-
import { markFirstScreenSyncReady } from
|
|
56
|
+
import { markFirstScreenSyncReady } from "@lynx-js/react";
|
|
48
57
|
|
|
49
58
|
markFirstScreenSyncReady();
|
|
50
59
|
```
|
|
@@ -54,8 +63,8 @@
|
|
|
54
63
|
- 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))
|
|
55
64
|
|
|
56
65
|
```js
|
|
57
|
-
import { defineConfig } from
|
|
58
|
-
import { pluginReactLynx } from
|
|
66
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
67
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
59
68
|
|
|
60
69
|
export default defineConfig({
|
|
61
70
|
plugins: [
|
|
@@ -228,16 +237,16 @@
|
|
|
228
237
|
type InlineChunkConfig =
|
|
229
238
|
| boolean
|
|
230
239
|
| InlineChunkTest
|
|
231
|
-
| { enable?: boolean |
|
|
240
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
232
241
|
```
|
|
233
242
|
|
|
234
243
|
```ts
|
|
235
|
-
import { defineConfig } from
|
|
244
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
236
245
|
|
|
237
246
|
export default defineConfig({
|
|
238
247
|
output: {
|
|
239
248
|
inlineScripts: ({ name, size }) => {
|
|
240
|
-
return name.includes(
|
|
249
|
+
return name.includes("foo") && size < 1000;
|
|
241
250
|
},
|
|
242
251
|
},
|
|
243
252
|
});
|
|
@@ -321,7 +330,7 @@
|
|
|
321
330
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
322
331
|
|
|
323
332
|
```js
|
|
324
|
-
import { forwardRef, useImperativeHandle } from
|
|
333
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
325
334
|
|
|
326
335
|
export default forwardRef(function App(_, ref) {
|
|
327
336
|
useImperativeHandle(ref, () => {
|
|
@@ -329,7 +338,7 @@
|
|
|
329
338
|
return {
|
|
330
339
|
name() {
|
|
331
340
|
// This should be considered as background only
|
|
332
|
-
console.info(
|
|
341
|
+
console.info("This should not exist in main-thread");
|
|
333
342
|
},
|
|
334
343
|
};
|
|
335
344
|
});
|
|
@@ -389,14 +398,14 @@
|
|
|
389
398
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
390
399
|
|
|
391
400
|
```js
|
|
392
|
-
import { pluginReactLynx } from
|
|
393
|
-
import { defineConfig } from
|
|
401
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
402
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
394
403
|
|
|
395
404
|
export default defineConfig({
|
|
396
405
|
plugins: [
|
|
397
406
|
pluginReactLynx({
|
|
398
407
|
defineDCE: {
|
|
399
|
-
__SOME_FALSE_DEFINE__:
|
|
408
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
400
409
|
},
|
|
401
410
|
}),
|
|
402
411
|
],
|
|
@@ -408,20 +417,20 @@
|
|
|
408
417
|
For example, `import` initialized by dead code will be removed:
|
|
409
418
|
|
|
410
419
|
```js
|
|
411
|
-
import { foo } from
|
|
420
|
+
import { foo } from "bar";
|
|
412
421
|
|
|
413
422
|
if (__SOME_FALSE_DEFINE__) {
|
|
414
423
|
foo();
|
|
415
|
-
console.log(
|
|
424
|
+
console.log("dead code");
|
|
416
425
|
} else {
|
|
417
|
-
console.log(
|
|
426
|
+
console.log("reachable code");
|
|
418
427
|
}
|
|
419
428
|
```
|
|
420
429
|
|
|
421
430
|
will be transformed to:
|
|
422
431
|
|
|
423
432
|
```js
|
|
424
|
-
console.log(
|
|
433
|
+
console.log("reachable code");
|
|
425
434
|
```
|
|
426
435
|
|
|
427
436
|
## 0.6.0
|
|
@@ -431,14 +440,14 @@
|
|
|
431
440
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
432
441
|
|
|
433
442
|
```js
|
|
434
|
-
import { pluginReactLynx } from
|
|
435
|
-
import { defineConfig } from
|
|
443
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
444
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
436
445
|
|
|
437
446
|
export default defineConfig({
|
|
438
447
|
plugins: [
|
|
439
448
|
pluginReactLynx({
|
|
440
449
|
compat: {
|
|
441
|
-
removeComponentAttrRegex:
|
|
450
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
442
451
|
},
|
|
443
452
|
}),
|
|
444
453
|
],
|
package/lib/loaders/options.js
CHANGED
|
@@ -39,6 +39,7 @@ function getCommonOptions(inputSourceMap) {
|
|
|
39
39
|
newRuntimePkg: compat?.newRuntimePkg ?? PUBLIC_RUNTIME_PKG,
|
|
40
40
|
oldRuntimePkg: compat?.oldRuntimePkg ?? [OLD_RUNTIME_PKG],
|
|
41
41
|
simplifyCtorLikeReactLynx2: compat?.simplifyCtorLikeReactLynx2 ?? false,
|
|
42
|
+
transformLegacyEventAttributeNames: compat?.transformLegacyEventAttributeNames ?? true,
|
|
42
43
|
// NOTE: never pass '' (empty string) as default value
|
|
43
44
|
...(typeof compat?.removeComponentAttrRegex === 'string' && {
|
|
44
45
|
removeComponentAttrRegex: compat?.removeComponentAttrRegex,
|
package/lib/loaders/testing.js
CHANGED
|
@@ -22,6 +22,7 @@ function testingLoader(content) {
|
|
|
22
22
|
newRuntimePkg: compat.newRuntimePkg ?? '@lynx-js/react',
|
|
23
23
|
oldRuntimePkg: compat.oldRuntimePkg ?? ['@lynx-js/react-runtime'],
|
|
24
24
|
simplifyCtorLikeReactLynx2: compat.simplifyCtorLikeReactLynx2 ?? false,
|
|
25
|
+
transformLegacyEventAttributeNames: compat.transformLegacyEventAttributeNames ?? true,
|
|
25
26
|
...(typeof compat.removeComponentAttrRegex === 'string' && {
|
|
26
27
|
removeComponentAttrRegex: compat.removeComponentAttrRegex,
|
|
27
28
|
}),
|
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.4-canary-20260812-21528f12",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-extractor": "7.58.12",
|
|
42
42
|
"@rspack/core": "2.1.7",
|
|
43
|
-
"@rspack/lite-tapable": "1.1.
|
|
44
|
-
"@rstest/core": "0.11.
|
|
43
|
+
"@rspack/lite-tapable": "1.1.5",
|
|
44
|
+
"@rstest/core": "0.11.6",
|
|
45
45
|
"css-loader": "^7.1.4",
|
|
46
46
|
"swc-loader": "^0.2.7",
|
|
47
47
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.10.1",
|
|
48
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.123.
|
|
49
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.15.
|
|
48
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.123.4-canary-20260812-21528f12",
|
|
49
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.15.1-canary-20260812-21528f12",
|
|
50
50
|
"@lynx-js/test-tools": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|