@lynx-js/react-rsbuild-plugin-canary 0.11.0 → 0.11.1-canary-20250929-c0168057
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 +48 -36
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.11.1-canary-20250929042614-c01680575aa9104945fd0b3f7176fcc80c157d28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`19f823a`](https://github.com/lynx-family/lynx-stack/commit/19f823aae4ce6d99c173d28d157b7514ae8453cf), [`7a554e2`](https://github.com/lynx-family/lynx-stack/commit/7a554e210308f0ffbc5a8dfc9ad4d17fbb9556ff)]:
|
|
8
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.4-canary-20250929042614-c01680575aa9104945fd0b3f7176fcc80c157d28
|
|
9
|
+
- @lynx-js/react@0.114.1-canary-20250929042614-c01680575aa9104945fd0b3f7176fcc80c157d28
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.7.1
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.1-canary-20250929042614-c01680575aa9104945fd0b3f7176fcc80c157d28
|
|
12
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
13
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
14
|
+
|
|
3
15
|
## 0.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -161,28 +173,28 @@
|
|
|
161
173
|
|
|
162
174
|
```ts
|
|
163
175
|
type InlineChunkTestFunction = (params: {
|
|
164
|
-
size: number
|
|
165
|
-
name: string
|
|
166
|
-
}) => boolean
|
|
176
|
+
size: number;
|
|
177
|
+
name: string;
|
|
178
|
+
}) => boolean;
|
|
167
179
|
|
|
168
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
180
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction;
|
|
169
181
|
|
|
170
182
|
type InlineChunkConfig =
|
|
171
183
|
| boolean
|
|
172
184
|
| InlineChunkTest
|
|
173
|
-
| { enable?: boolean |
|
|
185
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
174
186
|
```
|
|
175
187
|
|
|
176
188
|
```ts
|
|
177
|
-
import { defineConfig } from
|
|
189
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
178
190
|
|
|
179
191
|
export default defineConfig({
|
|
180
192
|
output: {
|
|
181
193
|
inlineScripts: ({ name, size }) => {
|
|
182
|
-
return name.includes(
|
|
194
|
+
return name.includes("foo") && size < 1000;
|
|
183
195
|
},
|
|
184
196
|
},
|
|
185
|
-
})
|
|
197
|
+
});
|
|
186
198
|
```
|
|
187
199
|
|
|
188
200
|
- 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)]:
|
|
@@ -262,13 +274,13 @@
|
|
|
262
274
|
example:
|
|
263
275
|
|
|
264
276
|
```js
|
|
265
|
-
import { defineConfig } from
|
|
277
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
266
278
|
|
|
267
279
|
export default defineConfig({
|
|
268
280
|
output: {
|
|
269
281
|
inlineScripts: false,
|
|
270
282
|
},
|
|
271
|
-
})
|
|
283
|
+
});
|
|
272
284
|
```
|
|
273
285
|
|
|
274
286
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -355,7 +367,7 @@
|
|
|
355
367
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
356
368
|
|
|
357
369
|
```js
|
|
358
|
-
import { defineConfig } from
|
|
370
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
359
371
|
|
|
360
372
|
export default defineConfig({
|
|
361
373
|
tools: {
|
|
@@ -367,7 +379,7 @@
|
|
|
367
379
|
},
|
|
368
380
|
},
|
|
369
381
|
},
|
|
370
|
-
})
|
|
382
|
+
});
|
|
371
383
|
```
|
|
372
384
|
|
|
373
385
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -543,7 +555,7 @@
|
|
|
543
555
|
You may turn it off using `output.minify.css: false`:
|
|
544
556
|
|
|
545
557
|
```js
|
|
546
|
-
import { defineConfig } from
|
|
558
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
547
559
|
|
|
548
560
|
export default defineConfig({
|
|
549
561
|
output: {
|
|
@@ -551,18 +563,18 @@
|
|
|
551
563
|
css: false,
|
|
552
564
|
},
|
|
553
565
|
},
|
|
554
|
-
})
|
|
566
|
+
});
|
|
555
567
|
```
|
|
556
568
|
|
|
557
569
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
558
570
|
|
|
559
571
|
```js
|
|
560
|
-
import { defineConfig } from
|
|
561
|
-
import { pluginCssMinimizer } from
|
|
572
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
573
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
562
574
|
|
|
563
575
|
export default defineConfig({
|
|
564
576
|
plugins: [pluginCssMinimizer()],
|
|
565
|
-
})
|
|
577
|
+
});
|
|
566
578
|
```
|
|
567
579
|
|
|
568
580
|
### Patch Changes
|
|
@@ -642,18 +654,18 @@
|
|
|
642
654
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
643
655
|
|
|
644
656
|
```js
|
|
645
|
-
import { pluginReactLynx } from
|
|
646
|
-
import { defineConfig } from
|
|
657
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
658
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
647
659
|
|
|
648
660
|
export default defineConfig({
|
|
649
661
|
plugins: [
|
|
650
662
|
pluginReactLynx({
|
|
651
663
|
defineDCE: {
|
|
652
|
-
__SOME_FALSE_DEFINE__:
|
|
664
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
653
665
|
},
|
|
654
666
|
}),
|
|
655
667
|
],
|
|
656
|
-
})
|
|
668
|
+
});
|
|
657
669
|
```
|
|
658
670
|
|
|
659
671
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -661,20 +673,20 @@
|
|
|
661
673
|
For example, `import` initialized by dead code will be removed:
|
|
662
674
|
|
|
663
675
|
```js
|
|
664
|
-
import { foo } from
|
|
676
|
+
import { foo } from "bar";
|
|
665
677
|
|
|
666
678
|
if (__SOME_FALSE_DEFINE__) {
|
|
667
|
-
foo()
|
|
668
|
-
console.log(
|
|
679
|
+
foo();
|
|
680
|
+
console.log("dead code");
|
|
669
681
|
} else {
|
|
670
|
-
console.log(
|
|
682
|
+
console.log("reachable code");
|
|
671
683
|
}
|
|
672
684
|
```
|
|
673
685
|
|
|
674
686
|
will be transformed to:
|
|
675
687
|
|
|
676
688
|
```js
|
|
677
|
-
console.log(
|
|
689
|
+
console.log("reachable code");
|
|
678
690
|
```
|
|
679
691
|
|
|
680
692
|
- Updated dependencies [8dd6cca]
|
|
@@ -717,18 +729,18 @@
|
|
|
717
729
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
718
730
|
|
|
719
731
|
```js
|
|
720
|
-
import { pluginReactLynx } from
|
|
721
|
-
import { defineConfig } from
|
|
732
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
733
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
722
734
|
|
|
723
735
|
export default defineConfig({
|
|
724
736
|
plugins: [
|
|
725
737
|
pluginReactLynx({
|
|
726
738
|
compat: {
|
|
727
|
-
removeComponentAttrRegex:
|
|
739
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
728
740
|
},
|
|
729
741
|
}),
|
|
730
742
|
],
|
|
731
|
-
})
|
|
743
|
+
});
|
|
732
744
|
```
|
|
733
745
|
|
|
734
746
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -747,11 +759,11 @@
|
|
|
747
759
|
|
|
748
760
|
```javascript
|
|
749
761
|
// bar.ts
|
|
750
|
-
import
|
|
762
|
+
import "background-only";
|
|
751
763
|
|
|
752
764
|
export const bar = () => {
|
|
753
|
-
return
|
|
754
|
-
}
|
|
765
|
+
return "bar";
|
|
766
|
+
};
|
|
755
767
|
```
|
|
756
768
|
|
|
757
769
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -760,15 +772,15 @@
|
|
|
760
772
|
|
|
761
773
|
```tsx
|
|
762
774
|
// App.tsx
|
|
763
|
-
import { bar } from
|
|
775
|
+
import { bar } from "./bar.js";
|
|
764
776
|
|
|
765
777
|
function App() {
|
|
766
|
-
bar()
|
|
778
|
+
bar();
|
|
767
779
|
return (
|
|
768
780
|
<view>
|
|
769
781
|
<text>Hello, Lynx x rspeedy</text>
|
|
770
782
|
</view>
|
|
771
|
-
)
|
|
783
|
+
);
|
|
772
784
|
}
|
|
773
785
|
```
|
|
774
786
|
|
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.1-canary-20250929-c0168057",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"README.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.
|
|
35
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.4-canary-20250929-c0168057",
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.1-canary-20250929-c0168057",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "7.52.13",
|
|
46
46
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
47
|
-
"@rsbuild/core": "1.5.
|
|
47
|
+
"@rsbuild/core": "1.5.12",
|
|
48
48
|
"@rsbuild/plugin-sass": "1.4.0",
|
|
49
49
|
"@rsbuild/plugin-typed-css-modules": "1.1.0",
|
|
50
50
|
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"type-fest": "^4.41.0",
|
|
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.
|
|
57
|
-
"@lynx-js/
|
|
58
|
-
"@lynx-js/
|
|
59
|
-
"@lynx-js/
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.1-canary-20250929-c0168057",
|
|
57
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.4",
|
|
58
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
|
+
"@lynx-js/react-transform": "0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|