@lynx-js/react-rsbuild-plugin-canary 0.10.10-canary-20250801-22ca433e → 0.10.10
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 +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.10
|
|
3
|
+
## 0.10.10
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [[`e9edca0`](https://github.com/lynx-family/lynx-stack/commit/e9edca0183c172b496f9d23ed17581ce3cb3d21d), [`
|
|
8
|
-
- @lynx-js/template-webpack-plugin@0.8.3
|
|
9
|
-
- @lynx-js/
|
|
10
|
-
- @lynx-js/css-extract-webpack-plugin@0.6.1-canary-20250801085747-22ca433eb96b39724c6eb47ce0a938d291bbdef2
|
|
7
|
+
- Updated dependencies [[`e9edca0`](https://github.com/lynx-family/lynx-stack/commit/e9edca0183c172b496f9d23ed17581ce3cb3d21d), [`6f37db2`](https://github.com/lynx-family/lynx-stack/commit/6f37db2bd4438ca60322b60f5144220e8d062074)]:
|
|
8
|
+
- @lynx-js/template-webpack-plugin@0.8.3
|
|
9
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.1
|
|
11
10
|
- @lynx-js/react-webpack-plugin@0.6.19
|
|
12
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.10
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.10
|
|
13
12
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
14
13
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
15
14
|
|
|
@@ -79,28 +78,28 @@
|
|
|
79
78
|
|
|
80
79
|
```ts
|
|
81
80
|
type InlineChunkTestFunction = (params: {
|
|
82
|
-
size: number
|
|
83
|
-
name: string
|
|
84
|
-
}) => boolean
|
|
81
|
+
size: number
|
|
82
|
+
name: string
|
|
83
|
+
}) => boolean
|
|
85
84
|
|
|
86
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
85
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
87
86
|
|
|
88
87
|
type InlineChunkConfig =
|
|
89
88
|
| boolean
|
|
90
89
|
| InlineChunkTest
|
|
91
|
-
| { enable?: boolean |
|
|
90
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
92
91
|
```
|
|
93
92
|
|
|
94
93
|
```ts
|
|
95
|
-
import { defineConfig } from
|
|
94
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
96
95
|
|
|
97
96
|
export default defineConfig({
|
|
98
97
|
output: {
|
|
99
98
|
inlineScripts: ({ name, size }) => {
|
|
100
|
-
return name.includes(
|
|
99
|
+
return name.includes('foo') && size < 1000
|
|
101
100
|
},
|
|
102
101
|
},
|
|
103
|
-
})
|
|
102
|
+
})
|
|
104
103
|
```
|
|
105
104
|
|
|
106
105
|
- 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)]:
|
|
@@ -180,13 +179,13 @@
|
|
|
180
179
|
example:
|
|
181
180
|
|
|
182
181
|
```js
|
|
183
|
-
import { defineConfig } from
|
|
182
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
184
183
|
|
|
185
184
|
export default defineConfig({
|
|
186
185
|
output: {
|
|
187
186
|
inlineScripts: false,
|
|
188
187
|
},
|
|
189
|
-
})
|
|
188
|
+
})
|
|
190
189
|
```
|
|
191
190
|
|
|
192
191
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -273,7 +272,7 @@
|
|
|
273
272
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
274
273
|
|
|
275
274
|
```js
|
|
276
|
-
import { defineConfig } from
|
|
275
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
277
276
|
|
|
278
277
|
export default defineConfig({
|
|
279
278
|
tools: {
|
|
@@ -285,7 +284,7 @@
|
|
|
285
284
|
},
|
|
286
285
|
},
|
|
287
286
|
},
|
|
288
|
-
})
|
|
287
|
+
})
|
|
289
288
|
```
|
|
290
289
|
|
|
291
290
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -461,7 +460,7 @@
|
|
|
461
460
|
You may turn it off using `output.minify.css: false`:
|
|
462
461
|
|
|
463
462
|
```js
|
|
464
|
-
import { defineConfig } from
|
|
463
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
465
464
|
|
|
466
465
|
export default defineConfig({
|
|
467
466
|
output: {
|
|
@@ -469,18 +468,18 @@
|
|
|
469
468
|
css: false,
|
|
470
469
|
},
|
|
471
470
|
},
|
|
472
|
-
})
|
|
471
|
+
})
|
|
473
472
|
```
|
|
474
473
|
|
|
475
474
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
476
475
|
|
|
477
476
|
```js
|
|
478
|
-
import { defineConfig } from
|
|
479
|
-
import { pluginCssMinimizer } from
|
|
477
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
478
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
480
479
|
|
|
481
480
|
export default defineConfig({
|
|
482
481
|
plugins: [pluginCssMinimizer()],
|
|
483
|
-
})
|
|
482
|
+
})
|
|
484
483
|
```
|
|
485
484
|
|
|
486
485
|
### Patch Changes
|
|
@@ -560,18 +559,18 @@
|
|
|
560
559
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
561
560
|
|
|
562
561
|
```js
|
|
563
|
-
import { pluginReactLynx } from
|
|
564
|
-
import { defineConfig } from
|
|
562
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
563
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
565
564
|
|
|
566
565
|
export default defineConfig({
|
|
567
566
|
plugins: [
|
|
568
567
|
pluginReactLynx({
|
|
569
568
|
defineDCE: {
|
|
570
|
-
__SOME_FALSE_DEFINE__:
|
|
569
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
571
570
|
},
|
|
572
571
|
}),
|
|
573
572
|
],
|
|
574
|
-
})
|
|
573
|
+
})
|
|
575
574
|
```
|
|
576
575
|
|
|
577
576
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -579,20 +578,20 @@
|
|
|
579
578
|
For example, `import` initialized by dead code will be removed:
|
|
580
579
|
|
|
581
580
|
```js
|
|
582
|
-
import { foo } from
|
|
581
|
+
import { foo } from 'bar'
|
|
583
582
|
|
|
584
583
|
if (__SOME_FALSE_DEFINE__) {
|
|
585
|
-
foo()
|
|
586
|
-
console.log(
|
|
584
|
+
foo()
|
|
585
|
+
console.log('dead code')
|
|
587
586
|
} else {
|
|
588
|
-
console.log(
|
|
587
|
+
console.log('reachable code')
|
|
589
588
|
}
|
|
590
589
|
```
|
|
591
590
|
|
|
592
591
|
will be transformed to:
|
|
593
592
|
|
|
594
593
|
```js
|
|
595
|
-
console.log(
|
|
594
|
+
console.log('reachable code')
|
|
596
595
|
```
|
|
597
596
|
|
|
598
597
|
- Updated dependencies [8dd6cca]
|
|
@@ -635,18 +634,18 @@
|
|
|
635
634
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
636
635
|
|
|
637
636
|
```js
|
|
638
|
-
import { pluginReactLynx } from
|
|
639
|
-
import { defineConfig } from
|
|
637
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
638
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
640
639
|
|
|
641
640
|
export default defineConfig({
|
|
642
641
|
plugins: [
|
|
643
642
|
pluginReactLynx({
|
|
644
643
|
compat: {
|
|
645
|
-
removeComponentAttrRegex:
|
|
644
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
646
645
|
},
|
|
647
646
|
}),
|
|
648
647
|
],
|
|
649
|
-
})
|
|
648
|
+
})
|
|
650
649
|
```
|
|
651
650
|
|
|
652
651
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -665,11 +664,11 @@
|
|
|
665
664
|
|
|
666
665
|
```javascript
|
|
667
666
|
// bar.ts
|
|
668
|
-
import
|
|
667
|
+
import 'background-only'
|
|
669
668
|
|
|
670
669
|
export const bar = () => {
|
|
671
|
-
return
|
|
672
|
-
}
|
|
670
|
+
return 'bar'
|
|
671
|
+
}
|
|
673
672
|
```
|
|
674
673
|
|
|
675
674
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -678,15 +677,15 @@
|
|
|
678
677
|
|
|
679
678
|
```tsx
|
|
680
679
|
// App.tsx
|
|
681
|
-
import { bar } from
|
|
680
|
+
import { bar } from './bar.js'
|
|
682
681
|
|
|
683
682
|
function App() {
|
|
684
|
-
bar()
|
|
683
|
+
bar()
|
|
685
684
|
return (
|
|
686
685
|
<view>
|
|
687
686
|
<text>Hello, Lynx x rspeedy</text>
|
|
688
687
|
</view>
|
|
689
|
-
)
|
|
688
|
+
)
|
|
690
689
|
}
|
|
691
690
|
```
|
|
692
691
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.10
|
|
3
|
+
"version": "0.10.10",
|
|
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.1
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.10
|
|
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.10",
|
|
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.3
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.3",
|
|
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
|
},
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"type-fest": "^4.41.0",
|
|
55
55
|
"typia": "9.3.1",
|
|
56
56
|
"typia-rspack-plugin": "2.1.0",
|
|
57
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.1
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.112.1",
|
|
58
58
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/
|
|
59
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
60
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.10.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|