@lynx-js/react-rsbuild-plugin-canary 0.10.5 → 0.10.6-canary-20250702-12185038
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 +49 -36
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.10.6-canary-20250702075331-12185038975812a24696b23083e2097baeae3866
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Be compat with `@lynx-js/react` v0.111.0 ([#204](https://github.com/lynx-family/lynx-stack/pull/204))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`99a3557`](https://github.com/lynx-family/lynx-stack/commit/99a355719ad3106d20118dc1ea3abf34ddbdb9ad), [`99a3557`](https://github.com/lynx-family/lynx-stack/commit/99a355719ad3106d20118dc1ea3abf34ddbdb9ad)]:
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.6.18-canary-20250702075331-12185038975812a24696b23083e2097baeae3866
|
|
11
|
+
- @lynx-js/react@0.111.0-canary-20250702075331-12185038975812a24696b23083e2097baeae3866
|
|
12
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.6-canary-20250702075331-12185038975812a24696b23083e2097baeae3866
|
|
13
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
14
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
15
|
+
|
|
3
16
|
## 0.10.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -10,28 +23,28 @@
|
|
|
10
23
|
|
|
11
24
|
```ts
|
|
12
25
|
type InlineChunkTestFunction = (params: {
|
|
13
|
-
size: number
|
|
14
|
-
name: string
|
|
15
|
-
}) => boolean
|
|
26
|
+
size: number;
|
|
27
|
+
name: string;
|
|
28
|
+
}) => boolean;
|
|
16
29
|
|
|
17
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
30
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction;
|
|
18
31
|
|
|
19
32
|
type InlineChunkConfig =
|
|
20
33
|
| boolean
|
|
21
34
|
| InlineChunkTest
|
|
22
|
-
| { enable?: boolean |
|
|
35
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
23
36
|
```
|
|
24
37
|
|
|
25
38
|
```ts
|
|
26
|
-
import { defineConfig } from
|
|
39
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
27
40
|
|
|
28
41
|
export default defineConfig({
|
|
29
42
|
output: {
|
|
30
43
|
inlineScripts: ({ name, size }) => {
|
|
31
|
-
return name.includes(
|
|
44
|
+
return name.includes("foo") && size < 1000;
|
|
32
45
|
},
|
|
33
46
|
},
|
|
34
|
-
})
|
|
47
|
+
});
|
|
35
48
|
```
|
|
36
49
|
|
|
37
50
|
- Updated dependencies [[`51cb73d`](https://github.com/lynx-family/lynx-stack/commit/51cb73dd0b77d35540644cdd2e6c37db856f0e8a), [`69fb042`](https://github.com/lynx-family/lynx-stack/commit/69fb0420e297abf768c889769c95a207c480b3c7), [`a7e8b5b`](https://github.com/lynx-family/lynx-stack/commit/a7e8b5bbbab0490e7cf6f47581130e7b32739abb)]:
|
|
@@ -111,13 +124,13 @@
|
|
|
111
124
|
example:
|
|
112
125
|
|
|
113
126
|
```js
|
|
114
|
-
import { defineConfig } from
|
|
127
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
115
128
|
|
|
116
129
|
export default defineConfig({
|
|
117
130
|
output: {
|
|
118
131
|
inlineScripts: false,
|
|
119
132
|
},
|
|
120
|
-
})
|
|
133
|
+
});
|
|
121
134
|
```
|
|
122
135
|
|
|
123
136
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -204,7 +217,7 @@
|
|
|
204
217
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
205
218
|
|
|
206
219
|
```js
|
|
207
|
-
import { defineConfig } from
|
|
220
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
208
221
|
|
|
209
222
|
export default defineConfig({
|
|
210
223
|
tools: {
|
|
@@ -216,7 +229,7 @@
|
|
|
216
229
|
},
|
|
217
230
|
},
|
|
218
231
|
},
|
|
219
|
-
})
|
|
232
|
+
});
|
|
220
233
|
```
|
|
221
234
|
|
|
222
235
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -392,7 +405,7 @@
|
|
|
392
405
|
You may turn it off using `output.minify.css: false`:
|
|
393
406
|
|
|
394
407
|
```js
|
|
395
|
-
import { defineConfig } from
|
|
408
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
396
409
|
|
|
397
410
|
export default defineConfig({
|
|
398
411
|
output: {
|
|
@@ -400,18 +413,18 @@
|
|
|
400
413
|
css: false,
|
|
401
414
|
},
|
|
402
415
|
},
|
|
403
|
-
})
|
|
416
|
+
});
|
|
404
417
|
```
|
|
405
418
|
|
|
406
419
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
407
420
|
|
|
408
421
|
```js
|
|
409
|
-
import { defineConfig } from
|
|
410
|
-
import { pluginCssMinimizer } from
|
|
422
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
423
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
411
424
|
|
|
412
425
|
export default defineConfig({
|
|
413
426
|
plugins: [pluginCssMinimizer()],
|
|
414
|
-
})
|
|
427
|
+
});
|
|
415
428
|
```
|
|
416
429
|
|
|
417
430
|
### Patch Changes
|
|
@@ -491,18 +504,18 @@
|
|
|
491
504
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
492
505
|
|
|
493
506
|
```js
|
|
494
|
-
import { pluginReactLynx } from
|
|
495
|
-
import { defineConfig } from
|
|
507
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
508
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
496
509
|
|
|
497
510
|
export default defineConfig({
|
|
498
511
|
plugins: [
|
|
499
512
|
pluginReactLynx({
|
|
500
513
|
defineDCE: {
|
|
501
|
-
__SOME_FALSE_DEFINE__:
|
|
514
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
502
515
|
},
|
|
503
516
|
}),
|
|
504
517
|
],
|
|
505
|
-
})
|
|
518
|
+
});
|
|
506
519
|
```
|
|
507
520
|
|
|
508
521
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -510,20 +523,20 @@
|
|
|
510
523
|
For example, `import` initialized by dead code will be removed:
|
|
511
524
|
|
|
512
525
|
```js
|
|
513
|
-
import { foo } from
|
|
526
|
+
import { foo } from "bar";
|
|
514
527
|
|
|
515
528
|
if (__SOME_FALSE_DEFINE__) {
|
|
516
|
-
foo()
|
|
517
|
-
console.log(
|
|
529
|
+
foo();
|
|
530
|
+
console.log("dead code");
|
|
518
531
|
} else {
|
|
519
|
-
console.log(
|
|
532
|
+
console.log("reachable code");
|
|
520
533
|
}
|
|
521
534
|
```
|
|
522
535
|
|
|
523
536
|
will be transformed to:
|
|
524
537
|
|
|
525
538
|
```js
|
|
526
|
-
console.log(
|
|
539
|
+
console.log("reachable code");
|
|
527
540
|
```
|
|
528
541
|
|
|
529
542
|
- Updated dependencies [8dd6cca]
|
|
@@ -566,18 +579,18 @@
|
|
|
566
579
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
567
580
|
|
|
568
581
|
```js
|
|
569
|
-
import { pluginReactLynx } from
|
|
570
|
-
import { defineConfig } from
|
|
582
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
583
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
571
584
|
|
|
572
585
|
export default defineConfig({
|
|
573
586
|
plugins: [
|
|
574
587
|
pluginReactLynx({
|
|
575
588
|
compat: {
|
|
576
|
-
removeComponentAttrRegex:
|
|
589
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
577
590
|
},
|
|
578
591
|
}),
|
|
579
592
|
],
|
|
580
|
-
})
|
|
593
|
+
});
|
|
581
594
|
```
|
|
582
595
|
|
|
583
596
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -596,11 +609,11 @@
|
|
|
596
609
|
|
|
597
610
|
```javascript
|
|
598
611
|
// bar.ts
|
|
599
|
-
import
|
|
612
|
+
import "background-only";
|
|
600
613
|
|
|
601
614
|
export const bar = () => {
|
|
602
|
-
return
|
|
603
|
-
}
|
|
615
|
+
return "bar";
|
|
616
|
+
};
|
|
604
617
|
```
|
|
605
618
|
|
|
606
619
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -609,15 +622,15 @@
|
|
|
609
622
|
|
|
610
623
|
```tsx
|
|
611
624
|
// App.tsx
|
|
612
|
-
import { bar } from
|
|
625
|
+
import { bar } from "./bar.js";
|
|
613
626
|
|
|
614
627
|
function App() {
|
|
615
|
-
bar()
|
|
628
|
+
bar();
|
|
616
629
|
return (
|
|
617
630
|
<view>
|
|
618
631
|
<text>Hello, Lynx x rspeedy</text>
|
|
619
632
|
</view>
|
|
620
|
-
)
|
|
633
|
+
);
|
|
621
634
|
}
|
|
622
635
|
```
|
|
623
636
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6-canary-20250702-12185038",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.0",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.6-canary-20250702-12185038",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.3",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.18-canary-20250702-12185038",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.2",
|
|
40
40
|
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.1",
|
|
41
41
|
"@lynx-js/use-sync-external-store": "npm:@lynx-js/use-sync-external-store-canary@1.5.0",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"type-fest": "^4.41.0",
|
|
55
55
|
"typia": "9.3.1",
|
|
56
56
|
"typia-rspack-plugin": "2.1.0",
|
|
57
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.111.0-canary-20250702-12185038",
|
|
58
58
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/
|
|
59
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.11",
|
|
60
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|