@lynx-js/react-rsbuild-plugin-canary 0.11.3 → 0.11.4-canary-20251103-c282f54b
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/dist/index.js +4 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.11.4-canary-20251103093405-c282f54b636d64e9cb899faaad7dcd8e5695544a
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- When engineVersion is greater than or equal to 3.1, use `__SetAttribute` to set text attribute for text node instead of creating a raw text node. ([#1880](https://github.com/lynx-family/lynx-stack/pull/1880))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.7.2-canary-20251103093405-c282f54b636d64e9cb899faaad7dcd8e5695544a
|
|
11
|
+
- @lynx-js/react@0.114.4-canary-20251103093405-c282f54b636d64e9cb899faaad7dcd8e5695544a
|
|
12
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.4-canary-20251103093405-c282f54b636d64e9cb899faaad7dcd8e5695544a
|
|
13
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
14
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
15
|
+
|
|
3
16
|
## 0.11.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -194,28 +207,28 @@
|
|
|
194
207
|
|
|
195
208
|
```ts
|
|
196
209
|
type InlineChunkTestFunction = (params: {
|
|
197
|
-
size: number
|
|
198
|
-
name: string
|
|
199
|
-
}) => boolean
|
|
210
|
+
size: number;
|
|
211
|
+
name: string;
|
|
212
|
+
}) => boolean;
|
|
200
213
|
|
|
201
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
214
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction;
|
|
202
215
|
|
|
203
216
|
type InlineChunkConfig =
|
|
204
217
|
| boolean
|
|
205
218
|
| InlineChunkTest
|
|
206
|
-
| { enable?: boolean |
|
|
219
|
+
| { enable?: boolean | "auto"; test: InlineChunkTest };
|
|
207
220
|
```
|
|
208
221
|
|
|
209
222
|
```ts
|
|
210
|
-
import { defineConfig } from
|
|
223
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
211
224
|
|
|
212
225
|
export default defineConfig({
|
|
213
226
|
output: {
|
|
214
227
|
inlineScripts: ({ name, size }) => {
|
|
215
|
-
return name.includes(
|
|
228
|
+
return name.includes("foo") && size < 1000;
|
|
216
229
|
},
|
|
217
230
|
},
|
|
218
|
-
})
|
|
231
|
+
});
|
|
219
232
|
```
|
|
220
233
|
|
|
221
234
|
- 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)]:
|
|
@@ -295,13 +308,13 @@
|
|
|
295
308
|
example:
|
|
296
309
|
|
|
297
310
|
```js
|
|
298
|
-
import { defineConfig } from
|
|
311
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
299
312
|
|
|
300
313
|
export default defineConfig({
|
|
301
314
|
output: {
|
|
302
315
|
inlineScripts: false,
|
|
303
316
|
},
|
|
304
|
-
})
|
|
317
|
+
});
|
|
305
318
|
```
|
|
306
319
|
|
|
307
320
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -388,7 +401,7 @@
|
|
|
388
401
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
389
402
|
|
|
390
403
|
```js
|
|
391
|
-
import { defineConfig } from
|
|
404
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
392
405
|
|
|
393
406
|
export default defineConfig({
|
|
394
407
|
tools: {
|
|
@@ -400,7 +413,7 @@
|
|
|
400
413
|
},
|
|
401
414
|
},
|
|
402
415
|
},
|
|
403
|
-
})
|
|
416
|
+
});
|
|
404
417
|
```
|
|
405
418
|
|
|
406
419
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -576,7 +589,7 @@
|
|
|
576
589
|
You may turn it off using `output.minify.css: false`:
|
|
577
590
|
|
|
578
591
|
```js
|
|
579
|
-
import { defineConfig } from
|
|
592
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
580
593
|
|
|
581
594
|
export default defineConfig({
|
|
582
595
|
output: {
|
|
@@ -584,18 +597,18 @@
|
|
|
584
597
|
css: false,
|
|
585
598
|
},
|
|
586
599
|
},
|
|
587
|
-
})
|
|
600
|
+
});
|
|
588
601
|
```
|
|
589
602
|
|
|
590
603
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
591
604
|
|
|
592
605
|
```js
|
|
593
|
-
import { defineConfig } from
|
|
594
|
-
import { pluginCssMinimizer } from
|
|
606
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
607
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
595
608
|
|
|
596
609
|
export default defineConfig({
|
|
597
610
|
plugins: [pluginCssMinimizer()],
|
|
598
|
-
})
|
|
611
|
+
});
|
|
599
612
|
```
|
|
600
613
|
|
|
601
614
|
### Patch Changes
|
|
@@ -675,18 +688,18 @@
|
|
|
675
688
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
676
689
|
|
|
677
690
|
```js
|
|
678
|
-
import { pluginReactLynx } from
|
|
679
|
-
import { defineConfig } from
|
|
691
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
692
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
680
693
|
|
|
681
694
|
export default defineConfig({
|
|
682
695
|
plugins: [
|
|
683
696
|
pluginReactLynx({
|
|
684
697
|
defineDCE: {
|
|
685
|
-
__SOME_FALSE_DEFINE__:
|
|
698
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
686
699
|
},
|
|
687
700
|
}),
|
|
688
701
|
],
|
|
689
|
-
})
|
|
702
|
+
});
|
|
690
703
|
```
|
|
691
704
|
|
|
692
705
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -694,20 +707,20 @@
|
|
|
694
707
|
For example, `import` initialized by dead code will be removed:
|
|
695
708
|
|
|
696
709
|
```js
|
|
697
|
-
import { foo } from
|
|
710
|
+
import { foo } from "bar";
|
|
698
711
|
|
|
699
712
|
if (__SOME_FALSE_DEFINE__) {
|
|
700
|
-
foo()
|
|
701
|
-
console.log(
|
|
713
|
+
foo();
|
|
714
|
+
console.log("dead code");
|
|
702
715
|
} else {
|
|
703
|
-
console.log(
|
|
716
|
+
console.log("reachable code");
|
|
704
717
|
}
|
|
705
718
|
```
|
|
706
719
|
|
|
707
720
|
will be transformed to:
|
|
708
721
|
|
|
709
722
|
```js
|
|
710
|
-
console.log(
|
|
723
|
+
console.log("reachable code");
|
|
711
724
|
```
|
|
712
725
|
|
|
713
726
|
- Updated dependencies [8dd6cca]
|
|
@@ -750,18 +763,18 @@
|
|
|
750
763
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
751
764
|
|
|
752
765
|
```js
|
|
753
|
-
import { pluginReactLynx } from
|
|
754
|
-
import { defineConfig } from
|
|
766
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
767
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
755
768
|
|
|
756
769
|
export default defineConfig({
|
|
757
770
|
plugins: [
|
|
758
771
|
pluginReactLynx({
|
|
759
772
|
compat: {
|
|
760
|
-
removeComponentAttrRegex:
|
|
773
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
761
774
|
},
|
|
762
775
|
}),
|
|
763
776
|
],
|
|
764
|
-
})
|
|
777
|
+
});
|
|
765
778
|
```
|
|
766
779
|
|
|
767
780
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -780,11 +793,11 @@
|
|
|
780
793
|
|
|
781
794
|
```javascript
|
|
782
795
|
// bar.ts
|
|
783
|
-
import
|
|
796
|
+
import "background-only";
|
|
784
797
|
|
|
785
798
|
export const bar = () => {
|
|
786
|
-
return
|
|
787
|
-
}
|
|
799
|
+
return "bar";
|
|
800
|
+
};
|
|
788
801
|
```
|
|
789
802
|
|
|
790
803
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -793,15 +806,15 @@
|
|
|
793
806
|
|
|
794
807
|
```tsx
|
|
795
808
|
// App.tsx
|
|
796
|
-
import { bar } from
|
|
809
|
+
import { bar } from "./bar.js";
|
|
797
810
|
|
|
798
811
|
function App() {
|
|
799
|
-
bar()
|
|
812
|
+
bar();
|
|
800
813
|
return (
|
|
801
814
|
<view>
|
|
802
815
|
<text>Hello, Lynx x rspeedy</text>
|
|
803
816
|
</view>
|
|
804
|
-
)
|
|
817
|
+
);
|
|
805
818
|
}
|
|
806
819
|
```
|
|
807
820
|
|
package/dist/index.js
CHANGED
|
@@ -469,7 +469,7 @@ function applyLazy(api) {
|
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
471
|
function applyLoaders(api, options) {
|
|
472
|
-
const { compat, enableRemoveCSSScope, shake, defineDCE, experimental_isLazyBundle } = options;
|
|
472
|
+
const { compat, enableRemoveCSSScope, shake, defineDCE, engineVersion, experimental_isLazyBundle } = options;
|
|
473
473
|
api.modifyBundlerChain((chain, { CHAIN_ID })=>{
|
|
474
474
|
const experiments = chain.get('experiments');
|
|
475
475
|
chain.experiments({
|
|
@@ -486,7 +486,8 @@ function applyLoaders(api, options) {
|
|
|
486
486
|
enableRemoveCSSScope,
|
|
487
487
|
isDynamicComponent: experimental_isLazyBundle,
|
|
488
488
|
inlineSourcesContent,
|
|
489
|
-
defineDCE
|
|
489
|
+
defineDCE,
|
|
490
|
+
engineVersion
|
|
490
491
|
}).end();
|
|
491
492
|
const mainThreadRule = rule.oneOf(LAYERS.MAIN_THREAD);
|
|
492
493
|
mainThreadRule.issuerLayer(LAYERS.MAIN_THREAD).uses.merge(uses).end().when(void 0 !== uses[CHAIN_ID.USE.SWC], (rule)=>{
|
|
@@ -505,6 +506,7 @@ function applyLoaders(api, options) {
|
|
|
505
506
|
enableRemoveCSSScope,
|
|
506
507
|
inlineSourcesContent,
|
|
507
508
|
isDynamicComponent: experimental_isLazyBundle,
|
|
509
|
+
engineVersion,
|
|
508
510
|
shake,
|
|
509
511
|
defineDCE
|
|
510
512
|
}).end();
|
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.4-canary-20251103-c282f54b",
|
|
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.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.4-canary-20251103-c282f54b",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.2-canary-20251103-c282f54b",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
|
|
40
40
|
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.9.1",
|
|
41
41
|
"@lynx-js/use-sync-external-store": "npm:@lynx-js/use-sync-external-store-canary@1.5.0",
|
|
@@ -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": "
|
|
56
|
+
"@lynx-js/react-transform": "0.2.0",
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.4-canary-20251103-c282f54b",
|
|
57
58
|
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.8",
|
|
58
|
-
"@lynx-js/vitest-setup": "0.0.0"
|
|
59
|
-
"@lynx-js/react-transform": "0.2.0"
|
|
59
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|