@lynx-js/react-rsbuild-plugin-canary 0.12.4-canary-20260104-f4b90f3a → 0.12.4
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 +45 -46
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.12.4
|
|
3
|
+
## 0.12.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- ([#2051](https://github.com/lynx-family/lynx-stack/pull/2051))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- @lynx-js/react@0.
|
|
11
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.12.4-canary-20260104112511-f4b90f3a4dfd0a6871d81ef95521aaa42d9d07dd
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.12.4
|
|
12
11
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
13
12
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
14
13
|
- @lynx-js/react-webpack-plugin@0.7.3
|
|
@@ -79,8 +78,8 @@
|
|
|
79
78
|
With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
|
|
80
79
|
|
|
81
80
|
```js
|
|
82
|
-
import { defineConfig } from
|
|
83
|
-
import { pluginBabel } from
|
|
81
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
82
|
+
import { pluginBabel } from '@rsbuild/plugin-babel'
|
|
84
83
|
|
|
85
84
|
export default defineConfig({
|
|
86
85
|
plugins: [
|
|
@@ -88,17 +87,17 @@
|
|
|
88
87
|
include: /\.(?:jsx|tsx)$/,
|
|
89
88
|
babelLoaderOptions(opts) {
|
|
90
89
|
opts.plugins?.unshift([
|
|
91
|
-
|
|
90
|
+
'babel-plugin-react-compiler',
|
|
92
91
|
// See https://react.dev/reference/react-compiler/configuration for config
|
|
93
92
|
{
|
|
94
93
|
// ReactLynx only supports target to version 17
|
|
95
|
-
target:
|
|
94
|
+
target: '17',
|
|
96
95
|
},
|
|
97
|
-
])
|
|
96
|
+
])
|
|
98
97
|
},
|
|
99
98
|
}),
|
|
100
99
|
],
|
|
101
|
-
})
|
|
100
|
+
})
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
- Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
@@ -301,28 +300,28 @@
|
|
|
301
300
|
|
|
302
301
|
```ts
|
|
303
302
|
type InlineChunkTestFunction = (params: {
|
|
304
|
-
size: number
|
|
305
|
-
name: string
|
|
306
|
-
}) => boolean
|
|
303
|
+
size: number
|
|
304
|
+
name: string
|
|
305
|
+
}) => boolean
|
|
307
306
|
|
|
308
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
307
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
309
308
|
|
|
310
309
|
type InlineChunkConfig =
|
|
311
310
|
| boolean
|
|
312
311
|
| InlineChunkTest
|
|
313
|
-
| { enable?: boolean |
|
|
312
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
314
313
|
```
|
|
315
314
|
|
|
316
315
|
```ts
|
|
317
|
-
import { defineConfig } from
|
|
316
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
318
317
|
|
|
319
318
|
export default defineConfig({
|
|
320
319
|
output: {
|
|
321
320
|
inlineScripts: ({ name, size }) => {
|
|
322
|
-
return name.includes(
|
|
321
|
+
return name.includes('foo') && size < 1000
|
|
323
322
|
},
|
|
324
323
|
},
|
|
325
|
-
})
|
|
324
|
+
})
|
|
326
325
|
```
|
|
327
326
|
|
|
328
327
|
- 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)]:
|
|
@@ -402,13 +401,13 @@
|
|
|
402
401
|
example:
|
|
403
402
|
|
|
404
403
|
```js
|
|
405
|
-
import { defineConfig } from
|
|
404
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
406
405
|
|
|
407
406
|
export default defineConfig({
|
|
408
407
|
output: {
|
|
409
408
|
inlineScripts: false,
|
|
410
409
|
},
|
|
411
|
-
})
|
|
410
|
+
})
|
|
412
411
|
```
|
|
413
412
|
|
|
414
413
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -495,7 +494,7 @@
|
|
|
495
494
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
496
495
|
|
|
497
496
|
```js
|
|
498
|
-
import { defineConfig } from
|
|
497
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
499
498
|
|
|
500
499
|
export default defineConfig({
|
|
501
500
|
tools: {
|
|
@@ -507,7 +506,7 @@
|
|
|
507
506
|
},
|
|
508
507
|
},
|
|
509
508
|
},
|
|
510
|
-
})
|
|
509
|
+
})
|
|
511
510
|
```
|
|
512
511
|
|
|
513
512
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -683,7 +682,7 @@
|
|
|
683
682
|
You may turn it off using `output.minify.css: false`:
|
|
684
683
|
|
|
685
684
|
```js
|
|
686
|
-
import { defineConfig } from
|
|
685
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
687
686
|
|
|
688
687
|
export default defineConfig({
|
|
689
688
|
output: {
|
|
@@ -691,18 +690,18 @@
|
|
|
691
690
|
css: false,
|
|
692
691
|
},
|
|
693
692
|
},
|
|
694
|
-
})
|
|
693
|
+
})
|
|
695
694
|
```
|
|
696
695
|
|
|
697
696
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
698
697
|
|
|
699
698
|
```js
|
|
700
|
-
import { defineConfig } from
|
|
701
|
-
import { pluginCssMinimizer } from
|
|
699
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
700
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
702
701
|
|
|
703
702
|
export default defineConfig({
|
|
704
703
|
plugins: [pluginCssMinimizer()],
|
|
705
|
-
})
|
|
704
|
+
})
|
|
706
705
|
```
|
|
707
706
|
|
|
708
707
|
### Patch Changes
|
|
@@ -782,18 +781,18 @@
|
|
|
782
781
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
783
782
|
|
|
784
783
|
```js
|
|
785
|
-
import { pluginReactLynx } from
|
|
786
|
-
import { defineConfig } from
|
|
784
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
785
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
787
786
|
|
|
788
787
|
export default defineConfig({
|
|
789
788
|
plugins: [
|
|
790
789
|
pluginReactLynx({
|
|
791
790
|
defineDCE: {
|
|
792
|
-
__SOME_FALSE_DEFINE__:
|
|
791
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
793
792
|
},
|
|
794
793
|
}),
|
|
795
794
|
],
|
|
796
|
-
})
|
|
795
|
+
})
|
|
797
796
|
```
|
|
798
797
|
|
|
799
798
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -801,20 +800,20 @@
|
|
|
801
800
|
For example, `import` initialized by dead code will be removed:
|
|
802
801
|
|
|
803
802
|
```js
|
|
804
|
-
import { foo } from
|
|
803
|
+
import { foo } from 'bar'
|
|
805
804
|
|
|
806
805
|
if (__SOME_FALSE_DEFINE__) {
|
|
807
|
-
foo()
|
|
808
|
-
console.log(
|
|
806
|
+
foo()
|
|
807
|
+
console.log('dead code')
|
|
809
808
|
} else {
|
|
810
|
-
console.log(
|
|
809
|
+
console.log('reachable code')
|
|
811
810
|
}
|
|
812
811
|
```
|
|
813
812
|
|
|
814
813
|
will be transformed to:
|
|
815
814
|
|
|
816
815
|
```js
|
|
817
|
-
console.log(
|
|
816
|
+
console.log('reachable code')
|
|
818
817
|
```
|
|
819
818
|
|
|
820
819
|
- Updated dependencies [8dd6cca]
|
|
@@ -857,18 +856,18 @@
|
|
|
857
856
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
858
857
|
|
|
859
858
|
```js
|
|
860
|
-
import { pluginReactLynx } from
|
|
861
|
-
import { defineConfig } from
|
|
859
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
860
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
862
861
|
|
|
863
862
|
export default defineConfig({
|
|
864
863
|
plugins: [
|
|
865
864
|
pluginReactLynx({
|
|
866
865
|
compat: {
|
|
867
|
-
removeComponentAttrRegex:
|
|
866
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
868
867
|
},
|
|
869
868
|
}),
|
|
870
869
|
],
|
|
871
|
-
})
|
|
870
|
+
})
|
|
872
871
|
```
|
|
873
872
|
|
|
874
873
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -887,11 +886,11 @@
|
|
|
887
886
|
|
|
888
887
|
```javascript
|
|
889
888
|
// bar.ts
|
|
890
|
-
import
|
|
889
|
+
import 'background-only'
|
|
891
890
|
|
|
892
891
|
export const bar = () => {
|
|
893
|
-
return
|
|
894
|
-
}
|
|
892
|
+
return 'bar'
|
|
893
|
+
}
|
|
895
894
|
```
|
|
896
895
|
|
|
897
896
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -900,15 +899,15 @@
|
|
|
900
899
|
|
|
901
900
|
```tsx
|
|
902
901
|
// App.tsx
|
|
903
|
-
import { bar } from
|
|
902
|
+
import { bar } from './bar.js'
|
|
904
903
|
|
|
905
904
|
function App() {
|
|
906
|
-
bar()
|
|
905
|
+
bar()
|
|
907
906
|
return (
|
|
908
907
|
<view>
|
|
909
908
|
<text>Hello, Lynx x rspeedy</text>
|
|
910
909
|
</view>
|
|
911
|
-
)
|
|
910
|
+
)
|
|
912
911
|
}
|
|
913
912
|
```
|
|
914
913
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.12.4
|
|
3
|
+
"version": "0.12.4",
|
|
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.7.0",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.4
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.4",
|
|
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.3",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"type-fest": "^5.0.1",
|
|
55
55
|
"typia": "10.1.0",
|
|
56
56
|
"typia-rspack-plugin": "2.2.2",
|
|
57
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.115.3-canary-20260104-f4b90f3a",
|
|
58
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/vitest-setup": "0.0.0"
|
|
58
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.115.3",
|
|
59
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
60
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|