@lynx-js/react-rsbuild-plugin-canary 0.10.12-canary-20250815-7e47c4a7 → 0.10.12
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 +41 -42
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.12
|
|
3
|
+
## 0.10.12
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- `output.inlineScripts` defaults to `false` when chunkSplit strategy is not `'all-in-one'` ([#1504](https://github.com/lynx-family/lynx-stack/pull/1504))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [[`
|
|
10
|
-
- @lynx-js/
|
|
11
|
-
- @lynx-js/
|
|
12
|
-
- @lynx-js/
|
|
13
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.12-canary-20250815124729-7e47c4a777441a6782bc8aac31298b9af34b6f3e
|
|
9
|
+
- Updated dependencies [[`51a0b19`](https://github.com/lynx-family/lynx-stack/commit/51a0b19078cb18c13f4f3e2ca4f471aa4ddeaa05), [`b391ef5`](https://github.com/lynx-family/lynx-stack/commit/b391ef5c6dd0a0945e68b38f40807df7e1ef672e)]:
|
|
10
|
+
- @lynx-js/template-webpack-plugin@0.8.4
|
|
11
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.2
|
|
12
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.12
|
|
14
13
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
15
14
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
16
15
|
- @lynx-js/react-webpack-plugin@0.6.19
|
|
@@ -103,28 +102,28 @@
|
|
|
103
102
|
|
|
104
103
|
```ts
|
|
105
104
|
type InlineChunkTestFunction = (params: {
|
|
106
|
-
size: number
|
|
107
|
-
name: string
|
|
108
|
-
}) => boolean
|
|
105
|
+
size: number
|
|
106
|
+
name: string
|
|
107
|
+
}) => boolean
|
|
109
108
|
|
|
110
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
109
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
111
110
|
|
|
112
111
|
type InlineChunkConfig =
|
|
113
112
|
| boolean
|
|
114
113
|
| InlineChunkTest
|
|
115
|
-
| { enable?: boolean |
|
|
114
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
116
115
|
```
|
|
117
116
|
|
|
118
117
|
```ts
|
|
119
|
-
import { defineConfig } from
|
|
118
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
120
119
|
|
|
121
120
|
export default defineConfig({
|
|
122
121
|
output: {
|
|
123
122
|
inlineScripts: ({ name, size }) => {
|
|
124
|
-
return name.includes(
|
|
123
|
+
return name.includes('foo') && size < 1000
|
|
125
124
|
},
|
|
126
125
|
},
|
|
127
|
-
})
|
|
126
|
+
})
|
|
128
127
|
```
|
|
129
128
|
|
|
130
129
|
- 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)]:
|
|
@@ -204,13 +203,13 @@
|
|
|
204
203
|
example:
|
|
205
204
|
|
|
206
205
|
```js
|
|
207
|
-
import { defineConfig } from
|
|
206
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
208
207
|
|
|
209
208
|
export default defineConfig({
|
|
210
209
|
output: {
|
|
211
210
|
inlineScripts: false,
|
|
212
211
|
},
|
|
213
|
-
})
|
|
212
|
+
})
|
|
214
213
|
```
|
|
215
214
|
|
|
216
215
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -297,7 +296,7 @@
|
|
|
297
296
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
298
297
|
|
|
299
298
|
```js
|
|
300
|
-
import { defineConfig } from
|
|
299
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
301
300
|
|
|
302
301
|
export default defineConfig({
|
|
303
302
|
tools: {
|
|
@@ -309,7 +308,7 @@
|
|
|
309
308
|
},
|
|
310
309
|
},
|
|
311
310
|
},
|
|
312
|
-
})
|
|
311
|
+
})
|
|
313
312
|
```
|
|
314
313
|
|
|
315
314
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -485,7 +484,7 @@
|
|
|
485
484
|
You may turn it off using `output.minify.css: false`:
|
|
486
485
|
|
|
487
486
|
```js
|
|
488
|
-
import { defineConfig } from
|
|
487
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
489
488
|
|
|
490
489
|
export default defineConfig({
|
|
491
490
|
output: {
|
|
@@ -493,18 +492,18 @@
|
|
|
493
492
|
css: false,
|
|
494
493
|
},
|
|
495
494
|
},
|
|
496
|
-
})
|
|
495
|
+
})
|
|
497
496
|
```
|
|
498
497
|
|
|
499
498
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
500
499
|
|
|
501
500
|
```js
|
|
502
|
-
import { defineConfig } from
|
|
503
|
-
import { pluginCssMinimizer } from
|
|
501
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
502
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
504
503
|
|
|
505
504
|
export default defineConfig({
|
|
506
505
|
plugins: [pluginCssMinimizer()],
|
|
507
|
-
})
|
|
506
|
+
})
|
|
508
507
|
```
|
|
509
508
|
|
|
510
509
|
### Patch Changes
|
|
@@ -584,18 +583,18 @@
|
|
|
584
583
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
585
584
|
|
|
586
585
|
```js
|
|
587
|
-
import { pluginReactLynx } from
|
|
588
|
-
import { defineConfig } from
|
|
586
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
587
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
589
588
|
|
|
590
589
|
export default defineConfig({
|
|
591
590
|
plugins: [
|
|
592
591
|
pluginReactLynx({
|
|
593
592
|
defineDCE: {
|
|
594
|
-
__SOME_FALSE_DEFINE__:
|
|
593
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
595
594
|
},
|
|
596
595
|
}),
|
|
597
596
|
],
|
|
598
|
-
})
|
|
597
|
+
})
|
|
599
598
|
```
|
|
600
599
|
|
|
601
600
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -603,20 +602,20 @@
|
|
|
603
602
|
For example, `import` initialized by dead code will be removed:
|
|
604
603
|
|
|
605
604
|
```js
|
|
606
|
-
import { foo } from
|
|
605
|
+
import { foo } from 'bar'
|
|
607
606
|
|
|
608
607
|
if (__SOME_FALSE_DEFINE__) {
|
|
609
|
-
foo()
|
|
610
|
-
console.log(
|
|
608
|
+
foo()
|
|
609
|
+
console.log('dead code')
|
|
611
610
|
} else {
|
|
612
|
-
console.log(
|
|
611
|
+
console.log('reachable code')
|
|
613
612
|
}
|
|
614
613
|
```
|
|
615
614
|
|
|
616
615
|
will be transformed to:
|
|
617
616
|
|
|
618
617
|
```js
|
|
619
|
-
console.log(
|
|
618
|
+
console.log('reachable code')
|
|
620
619
|
```
|
|
621
620
|
|
|
622
621
|
- Updated dependencies [8dd6cca]
|
|
@@ -659,18 +658,18 @@
|
|
|
659
658
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
660
659
|
|
|
661
660
|
```js
|
|
662
|
-
import { pluginReactLynx } from
|
|
663
|
-
import { defineConfig } from
|
|
661
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
662
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
664
663
|
|
|
665
664
|
export default defineConfig({
|
|
666
665
|
plugins: [
|
|
667
666
|
pluginReactLynx({
|
|
668
667
|
compat: {
|
|
669
|
-
removeComponentAttrRegex:
|
|
668
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
670
669
|
},
|
|
671
670
|
}),
|
|
672
671
|
],
|
|
673
|
-
})
|
|
672
|
+
})
|
|
674
673
|
```
|
|
675
674
|
|
|
676
675
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -689,11 +688,11 @@
|
|
|
689
688
|
|
|
690
689
|
```javascript
|
|
691
690
|
// bar.ts
|
|
692
|
-
import
|
|
691
|
+
import 'background-only'
|
|
693
692
|
|
|
694
693
|
export const bar = () => {
|
|
695
|
-
return
|
|
696
|
-
}
|
|
694
|
+
return 'bar'
|
|
695
|
+
}
|
|
697
696
|
```
|
|
698
697
|
|
|
699
698
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -702,15 +701,15 @@
|
|
|
702
701
|
|
|
703
702
|
```tsx
|
|
704
703
|
// App.tsx
|
|
705
|
-
import { bar } from
|
|
704
|
+
import { bar } from './bar.js'
|
|
706
705
|
|
|
707
706
|
function App() {
|
|
708
|
-
bar()
|
|
707
|
+
bar()
|
|
709
708
|
return (
|
|
710
709
|
<view>
|
|
711
710
|
<text>Hello, Lynx x rspeedy</text>
|
|
712
711
|
</view>
|
|
713
|
-
)
|
|
712
|
+
)
|
|
714
713
|
}
|
|
715
714
|
```
|
|
716
715
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.12
|
|
3
|
+
"version": "0.10.12",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -32,12 +32,12 @@
|
|
|
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.2
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.12
|
|
35
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.2",
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.12",
|
|
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",
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.4
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.4",
|
|
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
|
},
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"type-fest": "^4.41.0",
|
|
52
52
|
"typia": "9.7.1",
|
|
53
53
|
"typia-rspack-plugin": "2.2.1",
|
|
54
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.3
|
|
55
|
-
"@lynx-js/
|
|
56
|
-
"@lynx-js/
|
|
57
|
-
"@lynx-js/
|
|
54
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.3",
|
|
55
|
+
"@lynx-js/react-transform": "0.2.0",
|
|
56
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.10.7",
|
|
57
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@lynx-js/react": "*"
|