@lynx-js/react-rsbuild-plugin-canary 0.12.5 → 0.12.6-canary-20260116-67bcf4c5
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 +55 -42
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.12.6-canary-20260116110102-67bcf4c5bf62a1c8296fe2ca209ea82355fc8c6b
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`a7a2ad7`](https://github.com/lynx-family/lynx-stack/commit/a7a2ad79c02c7051f7ae46b2e3cc63484decc101), [`4cd7182`](https://github.com/lynx-family/lynx-stack/commit/4cd71828a073e27ac3a2f5accded53e42e663215)]:
|
|
8
|
+
- @lynx-js/react@0.116.0-canary-20260116110102-67bcf4c5bf62a1c8296fe2ca209ea82355fc8c6b
|
|
9
|
+
- @lynx-js/template-webpack-plugin@0.10.2-canary-20260116110102-67bcf4c5bf62a1c8296fe2ca209ea82355fc8c6b
|
|
10
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.12.6-canary-20260116110102-67bcf4c5bf62a1c8296fe2ca209ea82355fc8c6b
|
|
11
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
12
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
13
|
+
- @lynx-js/react-webpack-plugin@0.7.3
|
|
14
|
+
- @lynx-js/css-extract-webpack-plugin@0.7.0
|
|
15
|
+
|
|
3
16
|
## 0.12.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -90,8 +103,8 @@
|
|
|
90
103
|
With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
|
|
91
104
|
|
|
92
105
|
```js
|
|
93
|
-
import { defineConfig } from
|
|
94
|
-
import { pluginBabel } from
|
|
106
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
107
|
+
import { pluginBabel } from "@rsbuild/plugin-babel";
|
|
95
108
|
|
|
96
109
|
export default defineConfig({
|
|
97
110
|
plugins: [
|
|
@@ -99,17 +112,17 @@
|
|
|
99
112
|
include: /\.(?:jsx|tsx)$/,
|
|
100
113
|
babelLoaderOptions(opts) {
|
|
101
114
|
opts.plugins?.unshift([
|
|
102
|
-
|
|
115
|
+
"babel-plugin-react-compiler",
|
|
103
116
|
// See https://react.dev/reference/react-compiler/configuration for config
|
|
104
117
|
{
|
|
105
118
|
// ReactLynx only supports target to version 17
|
|
106
|
-
target:
|
|
119
|
+
target: "17",
|
|
107
120
|
},
|
|
108
|
-
])
|
|
121
|
+
]);
|
|
109
122
|
},
|
|
110
123
|
}),
|
|
111
124
|
],
|
|
112
|
-
})
|
|
125
|
+
});
|
|
113
126
|
```
|
|
114
127
|
|
|
115
128
|
- Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
@@ -312,28 +325,28 @@
|
|
|
312
325
|
|
|
313
326
|
```ts
|
|
314
327
|
type InlineChunkTestFunction = (params: {
|
|
315
|
-
size: number
|
|
316
|
-
name: string
|
|
317
|
-
}) => boolean
|
|
328
|
+
size: number;
|
|
329
|
+
name: string;
|
|
330
|
+
}) => boolean;
|
|
318
331
|
|
|
319
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
332
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction;
|
|
320
333
|
|
|
321
334
|
type InlineChunkConfig =
|
|
322
335
|
| boolean
|
|
323
336
|
| InlineChunkTest
|
|
324
|
-
| { enable?: boolean |
|
|
337
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
325
338
|
```
|
|
326
339
|
|
|
327
340
|
```ts
|
|
328
|
-
import { defineConfig } from
|
|
341
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
329
342
|
|
|
330
343
|
export default defineConfig({
|
|
331
344
|
output: {
|
|
332
345
|
inlineScripts: ({ name, size }) => {
|
|
333
|
-
return name.includes(
|
|
346
|
+
return name.includes("foo") && size < 1000;
|
|
334
347
|
},
|
|
335
348
|
},
|
|
336
|
-
})
|
|
349
|
+
});
|
|
337
350
|
```
|
|
338
351
|
|
|
339
352
|
- 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)]:
|
|
@@ -413,13 +426,13 @@
|
|
|
413
426
|
example:
|
|
414
427
|
|
|
415
428
|
```js
|
|
416
|
-
import { defineConfig } from
|
|
429
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
417
430
|
|
|
418
431
|
export default defineConfig({
|
|
419
432
|
output: {
|
|
420
433
|
inlineScripts: false,
|
|
421
434
|
},
|
|
422
|
-
})
|
|
435
|
+
});
|
|
423
436
|
```
|
|
424
437
|
|
|
425
438
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -506,7 +519,7 @@
|
|
|
506
519
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
507
520
|
|
|
508
521
|
```js
|
|
509
|
-
import { defineConfig } from
|
|
522
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
510
523
|
|
|
511
524
|
export default defineConfig({
|
|
512
525
|
tools: {
|
|
@@ -518,7 +531,7 @@
|
|
|
518
531
|
},
|
|
519
532
|
},
|
|
520
533
|
},
|
|
521
|
-
})
|
|
534
|
+
});
|
|
522
535
|
```
|
|
523
536
|
|
|
524
537
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -694,7 +707,7 @@
|
|
|
694
707
|
You may turn it off using `output.minify.css: false`:
|
|
695
708
|
|
|
696
709
|
```js
|
|
697
|
-
import { defineConfig } from
|
|
710
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
698
711
|
|
|
699
712
|
export default defineConfig({
|
|
700
713
|
output: {
|
|
@@ -702,18 +715,18 @@
|
|
|
702
715
|
css: false,
|
|
703
716
|
},
|
|
704
717
|
},
|
|
705
|
-
})
|
|
718
|
+
});
|
|
706
719
|
```
|
|
707
720
|
|
|
708
721
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
709
722
|
|
|
710
723
|
```js
|
|
711
|
-
import { defineConfig } from
|
|
712
|
-
import { pluginCssMinimizer } from
|
|
724
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
725
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
713
726
|
|
|
714
727
|
export default defineConfig({
|
|
715
728
|
plugins: [pluginCssMinimizer()],
|
|
716
|
-
})
|
|
729
|
+
});
|
|
717
730
|
```
|
|
718
731
|
|
|
719
732
|
### Patch Changes
|
|
@@ -793,18 +806,18 @@
|
|
|
793
806
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
794
807
|
|
|
795
808
|
```js
|
|
796
|
-
import { pluginReactLynx } from
|
|
797
|
-
import { defineConfig } from
|
|
809
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
810
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
798
811
|
|
|
799
812
|
export default defineConfig({
|
|
800
813
|
plugins: [
|
|
801
814
|
pluginReactLynx({
|
|
802
815
|
defineDCE: {
|
|
803
|
-
__SOME_FALSE_DEFINE__:
|
|
816
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
804
817
|
},
|
|
805
818
|
}),
|
|
806
819
|
],
|
|
807
|
-
})
|
|
820
|
+
});
|
|
808
821
|
```
|
|
809
822
|
|
|
810
823
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -812,20 +825,20 @@
|
|
|
812
825
|
For example, `import` initialized by dead code will be removed:
|
|
813
826
|
|
|
814
827
|
```js
|
|
815
|
-
import { foo } from
|
|
828
|
+
import { foo } from "bar";
|
|
816
829
|
|
|
817
830
|
if (__SOME_FALSE_DEFINE__) {
|
|
818
|
-
foo()
|
|
819
|
-
console.log(
|
|
831
|
+
foo();
|
|
832
|
+
console.log("dead code");
|
|
820
833
|
} else {
|
|
821
|
-
console.log(
|
|
834
|
+
console.log("reachable code");
|
|
822
835
|
}
|
|
823
836
|
```
|
|
824
837
|
|
|
825
838
|
will be transformed to:
|
|
826
839
|
|
|
827
840
|
```js
|
|
828
|
-
console.log(
|
|
841
|
+
console.log("reachable code");
|
|
829
842
|
```
|
|
830
843
|
|
|
831
844
|
- Updated dependencies [8dd6cca]
|
|
@@ -868,18 +881,18 @@
|
|
|
868
881
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
869
882
|
|
|
870
883
|
```js
|
|
871
|
-
import { pluginReactLynx } from
|
|
872
|
-
import { defineConfig } from
|
|
884
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
885
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
873
886
|
|
|
874
887
|
export default defineConfig({
|
|
875
888
|
plugins: [
|
|
876
889
|
pluginReactLynx({
|
|
877
890
|
compat: {
|
|
878
|
-
removeComponentAttrRegex:
|
|
891
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
879
892
|
},
|
|
880
893
|
}),
|
|
881
894
|
],
|
|
882
|
-
})
|
|
895
|
+
});
|
|
883
896
|
```
|
|
884
897
|
|
|
885
898
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -898,11 +911,11 @@
|
|
|
898
911
|
|
|
899
912
|
```javascript
|
|
900
913
|
// bar.ts
|
|
901
|
-
import
|
|
914
|
+
import "background-only";
|
|
902
915
|
|
|
903
916
|
export const bar = () => {
|
|
904
|
-
return
|
|
905
|
-
}
|
|
917
|
+
return "bar";
|
|
918
|
+
};
|
|
906
919
|
```
|
|
907
920
|
|
|
908
921
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -911,15 +924,15 @@
|
|
|
911
924
|
|
|
912
925
|
```tsx
|
|
913
926
|
// App.tsx
|
|
914
|
-
import { bar } from
|
|
927
|
+
import { bar } from "./bar.js";
|
|
915
928
|
|
|
916
929
|
function App() {
|
|
917
|
-
bar()
|
|
930
|
+
bar();
|
|
918
931
|
return (
|
|
919
932
|
<view>
|
|
920
933
|
<text>Hello, Lynx x rspeedy</text>
|
|
921
934
|
</view>
|
|
922
|
-
)
|
|
935
|
+
);
|
|
923
936
|
}
|
|
924
937
|
```
|
|
925
938
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6-canary-20260116-67bcf4c5",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.6-canary-20260116-67bcf4c5",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
|
|
38
38
|
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.3",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.2-canary-20260116-67bcf4c5",
|
|
41
41
|
"@lynx-js/use-sync-external-store": "npm:@lynx-js/use-sync-external-store-canary@1.5.0",
|
|
42
42
|
"background-only": "npm:background-only-canary@0.0.1"
|
|
43
43
|
},
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"type-fest": "^5.0.1",
|
|
55
55
|
"typia": "10.1.0",
|
|
56
56
|
"typia-rspack-plugin": "2.2.2",
|
|
57
|
-
"@lynx-js/
|
|
58
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.115.4",
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.116.0-canary-20260116-67bcf4c5",
|
|
59
58
|
"@lynx-js/react-transform": "0.2.0",
|
|
60
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.13.
|
|
59
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.13.1-canary-20260116-67bcf4c5",
|
|
60
|
+
"@lynx-js/config-rsbuild-plugin": "npm:@lynx-js/config-rsbuild-plugin-canary@0.0.1",
|
|
61
61
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|