@lynx-js/react-rsbuild-plugin-canary 0.11.2 → 0.11.3-canary-20251029-96545dd9
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 +46 -36
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.11.3-canary-20251029071231-96545dd9f966c07aa64437aefc781a9f3e260861
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`96545dd`](https://github.com/lynx-family/lynx-stack/commit/96545dd9f966c07aa64437aefc781a9f3e260861)]:
|
|
8
|
+
- @lynx-js/template-webpack-plugin@0.9.1-canary-20251029071231-96545dd9f966c07aa64437aefc781a9f3e260861
|
|
9
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.4
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.7.1
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.3-canary-20251029071231-96545dd9f966c07aa64437aefc781a9f3e260861
|
|
12
|
+
|
|
3
13
|
## 0.11.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -184,28 +194,28 @@
|
|
|
184
194
|
|
|
185
195
|
```ts
|
|
186
196
|
type InlineChunkTestFunction = (params: {
|
|
187
|
-
size: number
|
|
188
|
-
name: string
|
|
189
|
-
}) => boolean
|
|
197
|
+
size: number;
|
|
198
|
+
name: string;
|
|
199
|
+
}) => boolean;
|
|
190
200
|
|
|
191
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
201
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction;
|
|
192
202
|
|
|
193
203
|
type InlineChunkConfig =
|
|
194
204
|
| boolean
|
|
195
205
|
| InlineChunkTest
|
|
196
|
-
| { enable?: boolean |
|
|
206
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
197
207
|
```
|
|
198
208
|
|
|
199
209
|
```ts
|
|
200
|
-
import { defineConfig } from
|
|
210
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
201
211
|
|
|
202
212
|
export default defineConfig({
|
|
203
213
|
output: {
|
|
204
214
|
inlineScripts: ({ name, size }) => {
|
|
205
|
-
return name.includes(
|
|
215
|
+
return name.includes("foo") && size < 1000;
|
|
206
216
|
},
|
|
207
217
|
},
|
|
208
|
-
})
|
|
218
|
+
});
|
|
209
219
|
```
|
|
210
220
|
|
|
211
221
|
- 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)]:
|
|
@@ -285,13 +295,13 @@
|
|
|
285
295
|
example:
|
|
286
296
|
|
|
287
297
|
```js
|
|
288
|
-
import { defineConfig } from
|
|
298
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
289
299
|
|
|
290
300
|
export default defineConfig({
|
|
291
301
|
output: {
|
|
292
302
|
inlineScripts: false,
|
|
293
303
|
},
|
|
294
|
-
})
|
|
304
|
+
});
|
|
295
305
|
```
|
|
296
306
|
|
|
297
307
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -378,7 +388,7 @@
|
|
|
378
388
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
379
389
|
|
|
380
390
|
```js
|
|
381
|
-
import { defineConfig } from
|
|
391
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
382
392
|
|
|
383
393
|
export default defineConfig({
|
|
384
394
|
tools: {
|
|
@@ -390,7 +400,7 @@
|
|
|
390
400
|
},
|
|
391
401
|
},
|
|
392
402
|
},
|
|
393
|
-
})
|
|
403
|
+
});
|
|
394
404
|
```
|
|
395
405
|
|
|
396
406
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -566,7 +576,7 @@
|
|
|
566
576
|
You may turn it off using `output.minify.css: false`:
|
|
567
577
|
|
|
568
578
|
```js
|
|
569
|
-
import { defineConfig } from
|
|
579
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
570
580
|
|
|
571
581
|
export default defineConfig({
|
|
572
582
|
output: {
|
|
@@ -574,18 +584,18 @@
|
|
|
574
584
|
css: false,
|
|
575
585
|
},
|
|
576
586
|
},
|
|
577
|
-
})
|
|
587
|
+
});
|
|
578
588
|
```
|
|
579
589
|
|
|
580
590
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
581
591
|
|
|
582
592
|
```js
|
|
583
|
-
import { defineConfig } from
|
|
584
|
-
import { pluginCssMinimizer } from
|
|
593
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
594
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
585
595
|
|
|
586
596
|
export default defineConfig({
|
|
587
597
|
plugins: [pluginCssMinimizer()],
|
|
588
|
-
})
|
|
598
|
+
});
|
|
589
599
|
```
|
|
590
600
|
|
|
591
601
|
### Patch Changes
|
|
@@ -665,18 +675,18 @@
|
|
|
665
675
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
666
676
|
|
|
667
677
|
```js
|
|
668
|
-
import { pluginReactLynx } from
|
|
669
|
-
import { defineConfig } from
|
|
678
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
679
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
670
680
|
|
|
671
681
|
export default defineConfig({
|
|
672
682
|
plugins: [
|
|
673
683
|
pluginReactLynx({
|
|
674
684
|
defineDCE: {
|
|
675
|
-
__SOME_FALSE_DEFINE__:
|
|
685
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
676
686
|
},
|
|
677
687
|
}),
|
|
678
688
|
],
|
|
679
|
-
})
|
|
689
|
+
});
|
|
680
690
|
```
|
|
681
691
|
|
|
682
692
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -684,20 +694,20 @@
|
|
|
684
694
|
For example, `import` initialized by dead code will be removed:
|
|
685
695
|
|
|
686
696
|
```js
|
|
687
|
-
import { foo } from
|
|
697
|
+
import { foo } from "bar";
|
|
688
698
|
|
|
689
699
|
if (__SOME_FALSE_DEFINE__) {
|
|
690
|
-
foo()
|
|
691
|
-
console.log(
|
|
700
|
+
foo();
|
|
701
|
+
console.log("dead code");
|
|
692
702
|
} else {
|
|
693
|
-
console.log(
|
|
703
|
+
console.log("reachable code");
|
|
694
704
|
}
|
|
695
705
|
```
|
|
696
706
|
|
|
697
707
|
will be transformed to:
|
|
698
708
|
|
|
699
709
|
```js
|
|
700
|
-
console.log(
|
|
710
|
+
console.log("reachable code");
|
|
701
711
|
```
|
|
702
712
|
|
|
703
713
|
- Updated dependencies [8dd6cca]
|
|
@@ -740,18 +750,18 @@
|
|
|
740
750
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
741
751
|
|
|
742
752
|
```js
|
|
743
|
-
import { pluginReactLynx } from
|
|
744
|
-
import { defineConfig } from
|
|
753
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
754
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
745
755
|
|
|
746
756
|
export default defineConfig({
|
|
747
757
|
plugins: [
|
|
748
758
|
pluginReactLynx({
|
|
749
759
|
compat: {
|
|
750
|
-
removeComponentAttrRegex:
|
|
760
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
751
761
|
},
|
|
752
762
|
}),
|
|
753
763
|
],
|
|
754
|
-
})
|
|
764
|
+
});
|
|
755
765
|
```
|
|
756
766
|
|
|
757
767
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -770,11 +780,11 @@
|
|
|
770
780
|
|
|
771
781
|
```javascript
|
|
772
782
|
// bar.ts
|
|
773
|
-
import
|
|
783
|
+
import "background-only";
|
|
774
784
|
|
|
775
785
|
export const bar = () => {
|
|
776
|
-
return
|
|
777
|
-
}
|
|
786
|
+
return "bar";
|
|
787
|
+
};
|
|
778
788
|
```
|
|
779
789
|
|
|
780
790
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -783,15 +793,15 @@
|
|
|
783
793
|
|
|
784
794
|
```tsx
|
|
785
795
|
// App.tsx
|
|
786
|
-
import { bar } from
|
|
796
|
+
import { bar } from "./bar.js";
|
|
787
797
|
|
|
788
798
|
function App() {
|
|
789
|
-
bar()
|
|
799
|
+
bar();
|
|
790
800
|
return (
|
|
791
801
|
<view>
|
|
792
802
|
<text>Hello, Lynx x rspeedy</text>
|
|
793
803
|
</view>
|
|
794
|
-
)
|
|
804
|
+
);
|
|
795
805
|
}
|
|
796
806
|
```
|
|
797
807
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3-canary-20251029-96545dd9",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.3-canary-20251029-96545dd9",
|
|
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.1",
|
|
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.9.
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.9.1-canary-20251029-96545dd9",
|
|
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
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "7.52.15",
|
|
46
46
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
47
|
-
"@rsbuild/core": "1.5.
|
|
47
|
+
"@rsbuild/core": "1.5.17",
|
|
48
48
|
"@rsbuild/plugin-sass": "1.4.0",
|
|
49
49
|
"@rsbuild/plugin-typed-css-modules": "1.1.1",
|
|
50
50
|
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"type-fest": "^5.0.1",
|
|
54
54
|
"typia": "9.7.2",
|
|
55
55
|
"typia-rspack-plugin": "2.2.2",
|
|
56
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.3",
|
|
57
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
|
-
"@lynx-js/
|
|
59
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.8-canary-20251029-96545dd9"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|