@lynx-js/react-rsbuild-plugin-canary 0.12.5-canary-20260111-9646114b → 0.12.5
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.5
|
|
3
|
+
## 0.12.5
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Support reading config from `pluginLynxConfig`. ([#2054](https://github.com/lynx-family/lynx-stack/pull/2054))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- @lynx-js/react@0.
|
|
11
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.12.5-canary-20260111163415-9646114ba965de25ef18230718c6df291f0ea479
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.12.5
|
|
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
|
|
@@ -91,8 +90,8 @@
|
|
|
91
90
|
With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
|
|
92
91
|
|
|
93
92
|
```js
|
|
94
|
-
import { defineConfig } from
|
|
95
|
-
import { pluginBabel } from
|
|
93
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
94
|
+
import { pluginBabel } from '@rsbuild/plugin-babel'
|
|
96
95
|
|
|
97
96
|
export default defineConfig({
|
|
98
97
|
plugins: [
|
|
@@ -100,17 +99,17 @@
|
|
|
100
99
|
include: /\.(?:jsx|tsx)$/,
|
|
101
100
|
babelLoaderOptions(opts) {
|
|
102
101
|
opts.plugins?.unshift([
|
|
103
|
-
|
|
102
|
+
'babel-plugin-react-compiler',
|
|
104
103
|
// See https://react.dev/reference/react-compiler/configuration for config
|
|
105
104
|
{
|
|
106
105
|
// ReactLynx only supports target to version 17
|
|
107
|
-
target:
|
|
106
|
+
target: '17',
|
|
108
107
|
},
|
|
109
|
-
])
|
|
108
|
+
])
|
|
110
109
|
},
|
|
111
110
|
}),
|
|
112
111
|
],
|
|
113
|
-
})
|
|
112
|
+
})
|
|
114
113
|
```
|
|
115
114
|
|
|
116
115
|
- Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
@@ -313,28 +312,28 @@
|
|
|
313
312
|
|
|
314
313
|
```ts
|
|
315
314
|
type InlineChunkTestFunction = (params: {
|
|
316
|
-
size: number
|
|
317
|
-
name: string
|
|
318
|
-
}) => boolean
|
|
315
|
+
size: number
|
|
316
|
+
name: string
|
|
317
|
+
}) => boolean
|
|
319
318
|
|
|
320
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
319
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
321
320
|
|
|
322
321
|
type InlineChunkConfig =
|
|
323
322
|
| boolean
|
|
324
323
|
| InlineChunkTest
|
|
325
|
-
| { enable?: boolean |
|
|
324
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
326
325
|
```
|
|
327
326
|
|
|
328
327
|
```ts
|
|
329
|
-
import { defineConfig } from
|
|
328
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
330
329
|
|
|
331
330
|
export default defineConfig({
|
|
332
331
|
output: {
|
|
333
332
|
inlineScripts: ({ name, size }) => {
|
|
334
|
-
return name.includes(
|
|
333
|
+
return name.includes('foo') && size < 1000
|
|
335
334
|
},
|
|
336
335
|
},
|
|
337
|
-
})
|
|
336
|
+
})
|
|
338
337
|
```
|
|
339
338
|
|
|
340
339
|
- 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)]:
|
|
@@ -414,13 +413,13 @@
|
|
|
414
413
|
example:
|
|
415
414
|
|
|
416
415
|
```js
|
|
417
|
-
import { defineConfig } from
|
|
416
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
418
417
|
|
|
419
418
|
export default defineConfig({
|
|
420
419
|
output: {
|
|
421
420
|
inlineScripts: false,
|
|
422
421
|
},
|
|
423
|
-
})
|
|
422
|
+
})
|
|
424
423
|
```
|
|
425
424
|
|
|
426
425
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -507,7 +506,7 @@
|
|
|
507
506
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
508
507
|
|
|
509
508
|
```js
|
|
510
|
-
import { defineConfig } from
|
|
509
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
511
510
|
|
|
512
511
|
export default defineConfig({
|
|
513
512
|
tools: {
|
|
@@ -519,7 +518,7 @@
|
|
|
519
518
|
},
|
|
520
519
|
},
|
|
521
520
|
},
|
|
522
|
-
})
|
|
521
|
+
})
|
|
523
522
|
```
|
|
524
523
|
|
|
525
524
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -695,7 +694,7 @@
|
|
|
695
694
|
You may turn it off using `output.minify.css: false`:
|
|
696
695
|
|
|
697
696
|
```js
|
|
698
|
-
import { defineConfig } from
|
|
697
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
699
698
|
|
|
700
699
|
export default defineConfig({
|
|
701
700
|
output: {
|
|
@@ -703,18 +702,18 @@
|
|
|
703
702
|
css: false,
|
|
704
703
|
},
|
|
705
704
|
},
|
|
706
|
-
})
|
|
705
|
+
})
|
|
707
706
|
```
|
|
708
707
|
|
|
709
708
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
710
709
|
|
|
711
710
|
```js
|
|
712
|
-
import { defineConfig } from
|
|
713
|
-
import { pluginCssMinimizer } from
|
|
711
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
712
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
714
713
|
|
|
715
714
|
export default defineConfig({
|
|
716
715
|
plugins: [pluginCssMinimizer()],
|
|
717
|
-
})
|
|
716
|
+
})
|
|
718
717
|
```
|
|
719
718
|
|
|
720
719
|
### Patch Changes
|
|
@@ -794,18 +793,18 @@
|
|
|
794
793
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
795
794
|
|
|
796
795
|
```js
|
|
797
|
-
import { pluginReactLynx } from
|
|
798
|
-
import { defineConfig } from
|
|
796
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
797
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
799
798
|
|
|
800
799
|
export default defineConfig({
|
|
801
800
|
plugins: [
|
|
802
801
|
pluginReactLynx({
|
|
803
802
|
defineDCE: {
|
|
804
|
-
__SOME_FALSE_DEFINE__:
|
|
803
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
805
804
|
},
|
|
806
805
|
}),
|
|
807
806
|
],
|
|
808
|
-
})
|
|
807
|
+
})
|
|
809
808
|
```
|
|
810
809
|
|
|
811
810
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -813,20 +812,20 @@
|
|
|
813
812
|
For example, `import` initialized by dead code will be removed:
|
|
814
813
|
|
|
815
814
|
```js
|
|
816
|
-
import { foo } from
|
|
815
|
+
import { foo } from 'bar'
|
|
817
816
|
|
|
818
817
|
if (__SOME_FALSE_DEFINE__) {
|
|
819
|
-
foo()
|
|
820
|
-
console.log(
|
|
818
|
+
foo()
|
|
819
|
+
console.log('dead code')
|
|
821
820
|
} else {
|
|
822
|
-
console.log(
|
|
821
|
+
console.log('reachable code')
|
|
823
822
|
}
|
|
824
823
|
```
|
|
825
824
|
|
|
826
825
|
will be transformed to:
|
|
827
826
|
|
|
828
827
|
```js
|
|
829
|
-
console.log(
|
|
828
|
+
console.log('reachable code')
|
|
830
829
|
```
|
|
831
830
|
|
|
832
831
|
- Updated dependencies [8dd6cca]
|
|
@@ -869,18 +868,18 @@
|
|
|
869
868
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
870
869
|
|
|
871
870
|
```js
|
|
872
|
-
import { pluginReactLynx } from
|
|
873
|
-
import { defineConfig } from
|
|
871
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
872
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
874
873
|
|
|
875
874
|
export default defineConfig({
|
|
876
875
|
plugins: [
|
|
877
876
|
pluginReactLynx({
|
|
878
877
|
compat: {
|
|
879
|
-
removeComponentAttrRegex:
|
|
878
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
880
879
|
},
|
|
881
880
|
}),
|
|
882
881
|
],
|
|
883
|
-
})
|
|
882
|
+
})
|
|
884
883
|
```
|
|
885
884
|
|
|
886
885
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -899,11 +898,11 @@
|
|
|
899
898
|
|
|
900
899
|
```javascript
|
|
901
900
|
// bar.ts
|
|
902
|
-
import
|
|
901
|
+
import 'background-only'
|
|
903
902
|
|
|
904
903
|
export const bar = () => {
|
|
905
|
-
return
|
|
906
|
-
}
|
|
904
|
+
return 'bar'
|
|
905
|
+
}
|
|
907
906
|
```
|
|
908
907
|
|
|
909
908
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -912,15 +911,15 @@
|
|
|
912
911
|
|
|
913
912
|
```tsx
|
|
914
913
|
// App.tsx
|
|
915
|
-
import { bar } from
|
|
914
|
+
import { bar } from './bar.js'
|
|
916
915
|
|
|
917
916
|
function App() {
|
|
918
|
-
bar()
|
|
917
|
+
bar()
|
|
919
918
|
return (
|
|
920
919
|
<view>
|
|
921
920
|
<text>Hello, Lynx x rspeedy</text>
|
|
922
921
|
</view>
|
|
923
|
-
)
|
|
922
|
+
)
|
|
924
923
|
}
|
|
925
924
|
```
|
|
926
925
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.12.5
|
|
3
|
+
"version": "0.12.5",
|
|
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.5
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.5",
|
|
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/config-rsbuild-plugin": "npm:@lynx-js/config-rsbuild-plugin-canary@0.0.1
|
|
57
|
+
"@lynx-js/config-rsbuild-plugin": "npm:@lynx-js/config-rsbuild-plugin-canary@0.0.1",
|
|
58
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.115.4",
|
|
58
59
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.13.0-canary-20260111-9646114b",
|
|
60
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.13.0",
|
|
61
61
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|