@lynx-js/react-rsbuild-plugin-canary 0.10.11-canary-20250809-c8ce6aa3 → 0.10.11
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 +39 -40
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.11
|
|
3
|
+
## 0.10.11
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [[`
|
|
8
|
-
- @lynx-js/react@0.
|
|
9
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.11-canary-20250809042721-c8ce6aa33abf42a7954e1e345b3a36febe76d048
|
|
7
|
+
- Updated dependencies [[`c8ce6aa`](https://github.com/lynx-family/lynx-stack/commit/c8ce6aa33abf42a7954e1e345b3a36febe76d048)]:
|
|
8
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.11
|
|
10
9
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
11
10
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
12
11
|
- @lynx-js/react-webpack-plugin@0.6.19
|
|
@@ -89,28 +88,28 @@
|
|
|
89
88
|
|
|
90
89
|
```ts
|
|
91
90
|
type InlineChunkTestFunction = (params: {
|
|
92
|
-
size: number
|
|
93
|
-
name: string
|
|
94
|
-
}) => boolean
|
|
91
|
+
size: number
|
|
92
|
+
name: string
|
|
93
|
+
}) => boolean
|
|
95
94
|
|
|
96
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
95
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
97
96
|
|
|
98
97
|
type InlineChunkConfig =
|
|
99
98
|
| boolean
|
|
100
99
|
| InlineChunkTest
|
|
101
|
-
| { enable?: boolean |
|
|
100
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
```ts
|
|
105
|
-
import { defineConfig } from
|
|
104
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
106
105
|
|
|
107
106
|
export default defineConfig({
|
|
108
107
|
output: {
|
|
109
108
|
inlineScripts: ({ name, size }) => {
|
|
110
|
-
return name.includes(
|
|
109
|
+
return name.includes('foo') && size < 1000
|
|
111
110
|
},
|
|
112
111
|
},
|
|
113
|
-
})
|
|
112
|
+
})
|
|
114
113
|
```
|
|
115
114
|
|
|
116
115
|
- 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)]:
|
|
@@ -190,13 +189,13 @@
|
|
|
190
189
|
example:
|
|
191
190
|
|
|
192
191
|
```js
|
|
193
|
-
import { defineConfig } from
|
|
192
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
194
193
|
|
|
195
194
|
export default defineConfig({
|
|
196
195
|
output: {
|
|
197
196
|
inlineScripts: false,
|
|
198
197
|
},
|
|
199
|
-
})
|
|
198
|
+
})
|
|
200
199
|
```
|
|
201
200
|
|
|
202
201
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -283,7 +282,7 @@
|
|
|
283
282
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
284
283
|
|
|
285
284
|
```js
|
|
286
|
-
import { defineConfig } from
|
|
285
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
287
286
|
|
|
288
287
|
export default defineConfig({
|
|
289
288
|
tools: {
|
|
@@ -295,7 +294,7 @@
|
|
|
295
294
|
},
|
|
296
295
|
},
|
|
297
296
|
},
|
|
298
|
-
})
|
|
297
|
+
})
|
|
299
298
|
```
|
|
300
299
|
|
|
301
300
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -471,7 +470,7 @@
|
|
|
471
470
|
You may turn it off using `output.minify.css: false`:
|
|
472
471
|
|
|
473
472
|
```js
|
|
474
|
-
import { defineConfig } from
|
|
473
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
475
474
|
|
|
476
475
|
export default defineConfig({
|
|
477
476
|
output: {
|
|
@@ -479,18 +478,18 @@
|
|
|
479
478
|
css: false,
|
|
480
479
|
},
|
|
481
480
|
},
|
|
482
|
-
})
|
|
481
|
+
})
|
|
483
482
|
```
|
|
484
483
|
|
|
485
484
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
486
485
|
|
|
487
486
|
```js
|
|
488
|
-
import { defineConfig } from
|
|
489
|
-
import { pluginCssMinimizer } from
|
|
487
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
488
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
490
489
|
|
|
491
490
|
export default defineConfig({
|
|
492
491
|
plugins: [pluginCssMinimizer()],
|
|
493
|
-
})
|
|
492
|
+
})
|
|
494
493
|
```
|
|
495
494
|
|
|
496
495
|
### Patch Changes
|
|
@@ -570,18 +569,18 @@
|
|
|
570
569
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
571
570
|
|
|
572
571
|
```js
|
|
573
|
-
import { pluginReactLynx } from
|
|
574
|
-
import { defineConfig } from
|
|
572
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
573
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
575
574
|
|
|
576
575
|
export default defineConfig({
|
|
577
576
|
plugins: [
|
|
578
577
|
pluginReactLynx({
|
|
579
578
|
defineDCE: {
|
|
580
|
-
__SOME_FALSE_DEFINE__:
|
|
579
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
581
580
|
},
|
|
582
581
|
}),
|
|
583
582
|
],
|
|
584
|
-
})
|
|
583
|
+
})
|
|
585
584
|
```
|
|
586
585
|
|
|
587
586
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -589,20 +588,20 @@
|
|
|
589
588
|
For example, `import` initialized by dead code will be removed:
|
|
590
589
|
|
|
591
590
|
```js
|
|
592
|
-
import { foo } from
|
|
591
|
+
import { foo } from 'bar'
|
|
593
592
|
|
|
594
593
|
if (__SOME_FALSE_DEFINE__) {
|
|
595
|
-
foo()
|
|
596
|
-
console.log(
|
|
594
|
+
foo()
|
|
595
|
+
console.log('dead code')
|
|
597
596
|
} else {
|
|
598
|
-
console.log(
|
|
597
|
+
console.log('reachable code')
|
|
599
598
|
}
|
|
600
599
|
```
|
|
601
600
|
|
|
602
601
|
will be transformed to:
|
|
603
602
|
|
|
604
603
|
```js
|
|
605
|
-
console.log(
|
|
604
|
+
console.log('reachable code')
|
|
606
605
|
```
|
|
607
606
|
|
|
608
607
|
- Updated dependencies [8dd6cca]
|
|
@@ -645,18 +644,18 @@
|
|
|
645
644
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
646
645
|
|
|
647
646
|
```js
|
|
648
|
-
import { pluginReactLynx } from
|
|
649
|
-
import { defineConfig } from
|
|
647
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
648
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
650
649
|
|
|
651
650
|
export default defineConfig({
|
|
652
651
|
plugins: [
|
|
653
652
|
pluginReactLynx({
|
|
654
653
|
compat: {
|
|
655
|
-
removeComponentAttrRegex:
|
|
654
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
656
655
|
},
|
|
657
656
|
}),
|
|
658
657
|
],
|
|
659
|
-
})
|
|
658
|
+
})
|
|
660
659
|
```
|
|
661
660
|
|
|
662
661
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -675,11 +674,11 @@
|
|
|
675
674
|
|
|
676
675
|
```javascript
|
|
677
676
|
// bar.ts
|
|
678
|
-
import
|
|
677
|
+
import 'background-only'
|
|
679
678
|
|
|
680
679
|
export const bar = () => {
|
|
681
|
-
return
|
|
682
|
-
}
|
|
680
|
+
return 'bar'
|
|
681
|
+
}
|
|
683
682
|
```
|
|
684
683
|
|
|
685
684
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -688,15 +687,15 @@
|
|
|
688
687
|
|
|
689
688
|
```tsx
|
|
690
689
|
// App.tsx
|
|
691
|
-
import { bar } from
|
|
690
|
+
import { bar } from './bar.js'
|
|
692
691
|
|
|
693
692
|
function App() {
|
|
694
|
-
bar()
|
|
693
|
+
bar()
|
|
695
694
|
return (
|
|
696
695
|
<view>
|
|
697
696
|
<text>Hello, Lynx x rspeedy</text>
|
|
698
697
|
</view>
|
|
699
|
-
)
|
|
698
|
+
)
|
|
700
699
|
}
|
|
701
700
|
```
|
|
702
701
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.11
|
|
3
|
+
"version": "0.10.11",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.1",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.11
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.11",
|
|
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.6.19",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.2",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"type-fest": "^4.41.0",
|
|
53
53
|
"typia": "9.6.1",
|
|
54
54
|
"typia-rspack-plugin": "2.2.0",
|
|
55
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.2",
|
|
55
56
|
"@lynx-js/react-transform": "0.2.0",
|
|
56
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.10.6
|
|
57
|
-
"@lynx-js/vitest-setup": "0.0.0"
|
|
58
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.2-canary-20250809-c8ce6aa3"
|
|
57
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.10.6",
|
|
58
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@lynx-js/react": "*"
|