@lynx-js/react-rsbuild-plugin-canary 0.12.1-canary-20251212-9c715ffe → 0.12.1
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 +48 -49
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.12.1
|
|
3
|
+
## 0.12.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Avoid injecting hot update runtime when dev.hmr or dev.liveReload is set to false. ([#1980](https://github.com/lynx-family/lynx-stack/pull/1980))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [[`
|
|
10
|
-
- @lynx-js/react@0.
|
|
11
|
-
- @lynx-js/
|
|
12
|
-
- @lynx-js/
|
|
13
|
-
- @lynx-js/
|
|
14
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.12.1-canary-20251212100312-9c715ffe5ee3eb738b473010f1b8151583fb9124
|
|
9
|
+
- Updated dependencies [[`553ece1`](https://github.com/lynx-family/lynx-stack/commit/553ece1e025b1f4feae353310c21b2e159f1f03a), [`8cdb69d`](https://github.com/lynx-family/lynx-stack/commit/8cdb69d4b2cc3e9925a2494ee8a889d7af17e2e9), [`8cdb69d`](https://github.com/lynx-family/lynx-stack/commit/8cdb69d4b2cc3e9925a2494ee8a889d7af17e2e9)]:
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.7.3
|
|
11
|
+
- @lynx-js/css-extract-webpack-plugin@0.7.0
|
|
12
|
+
- @lynx-js/template-webpack-plugin@0.10.0
|
|
13
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.12.1
|
|
15
14
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
16
15
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
17
16
|
|
|
@@ -44,8 +43,8 @@
|
|
|
44
43
|
With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
|
|
45
44
|
|
|
46
45
|
```js
|
|
47
|
-
import { defineConfig } from
|
|
48
|
-
import { pluginBabel } from
|
|
46
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
47
|
+
import { pluginBabel } from '@rsbuild/plugin-babel'
|
|
49
48
|
|
|
50
49
|
export default defineConfig({
|
|
51
50
|
plugins: [
|
|
@@ -53,17 +52,17 @@
|
|
|
53
52
|
include: /\.(?:jsx|tsx)$/,
|
|
54
53
|
babelLoaderOptions(opts) {
|
|
55
54
|
opts.plugins?.unshift([
|
|
56
|
-
|
|
55
|
+
'babel-plugin-react-compiler',
|
|
57
56
|
// See https://react.dev/reference/react-compiler/configuration for config
|
|
58
57
|
{
|
|
59
58
|
// ReactLynx only supports target to version 17
|
|
60
|
-
target:
|
|
59
|
+
target: '17',
|
|
61
60
|
},
|
|
62
|
-
])
|
|
61
|
+
])
|
|
63
62
|
},
|
|
64
63
|
}),
|
|
65
64
|
],
|
|
66
|
-
})
|
|
65
|
+
})
|
|
67
66
|
```
|
|
68
67
|
|
|
69
68
|
- Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
@@ -266,28 +265,28 @@
|
|
|
266
265
|
|
|
267
266
|
```ts
|
|
268
267
|
type InlineChunkTestFunction = (params: {
|
|
269
|
-
size: number
|
|
270
|
-
name: string
|
|
271
|
-
}) => boolean
|
|
268
|
+
size: number
|
|
269
|
+
name: string
|
|
270
|
+
}) => boolean
|
|
272
271
|
|
|
273
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
272
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
274
273
|
|
|
275
274
|
type InlineChunkConfig =
|
|
276
275
|
| boolean
|
|
277
276
|
| InlineChunkTest
|
|
278
|
-
| { enable?: boolean |
|
|
277
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
279
278
|
```
|
|
280
279
|
|
|
281
280
|
```ts
|
|
282
|
-
import { defineConfig } from
|
|
281
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
283
282
|
|
|
284
283
|
export default defineConfig({
|
|
285
284
|
output: {
|
|
286
285
|
inlineScripts: ({ name, size }) => {
|
|
287
|
-
return name.includes(
|
|
286
|
+
return name.includes('foo') && size < 1000
|
|
288
287
|
},
|
|
289
288
|
},
|
|
290
|
-
})
|
|
289
|
+
})
|
|
291
290
|
```
|
|
292
291
|
|
|
293
292
|
- 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)]:
|
|
@@ -367,13 +366,13 @@
|
|
|
367
366
|
example:
|
|
368
367
|
|
|
369
368
|
```js
|
|
370
|
-
import { defineConfig } from
|
|
369
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
371
370
|
|
|
372
371
|
export default defineConfig({
|
|
373
372
|
output: {
|
|
374
373
|
inlineScripts: false,
|
|
375
374
|
},
|
|
376
|
-
})
|
|
375
|
+
})
|
|
377
376
|
```
|
|
378
377
|
|
|
379
378
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -460,7 +459,7 @@
|
|
|
460
459
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
461
460
|
|
|
462
461
|
```js
|
|
463
|
-
import { defineConfig } from
|
|
462
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
464
463
|
|
|
465
464
|
export default defineConfig({
|
|
466
465
|
tools: {
|
|
@@ -472,7 +471,7 @@
|
|
|
472
471
|
},
|
|
473
472
|
},
|
|
474
473
|
},
|
|
475
|
-
})
|
|
474
|
+
})
|
|
476
475
|
```
|
|
477
476
|
|
|
478
477
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -648,7 +647,7 @@
|
|
|
648
647
|
You may turn it off using `output.minify.css: false`:
|
|
649
648
|
|
|
650
649
|
```js
|
|
651
|
-
import { defineConfig } from
|
|
650
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
652
651
|
|
|
653
652
|
export default defineConfig({
|
|
654
653
|
output: {
|
|
@@ -656,18 +655,18 @@
|
|
|
656
655
|
css: false,
|
|
657
656
|
},
|
|
658
657
|
},
|
|
659
|
-
})
|
|
658
|
+
})
|
|
660
659
|
```
|
|
661
660
|
|
|
662
661
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
663
662
|
|
|
664
663
|
```js
|
|
665
|
-
import { defineConfig } from
|
|
666
|
-
import { pluginCssMinimizer } from
|
|
664
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
665
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
667
666
|
|
|
668
667
|
export default defineConfig({
|
|
669
668
|
plugins: [pluginCssMinimizer()],
|
|
670
|
-
})
|
|
669
|
+
})
|
|
671
670
|
```
|
|
672
671
|
|
|
673
672
|
### Patch Changes
|
|
@@ -747,18 +746,18 @@
|
|
|
747
746
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
748
747
|
|
|
749
748
|
```js
|
|
750
|
-
import { pluginReactLynx } from
|
|
751
|
-
import { defineConfig } from
|
|
749
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
750
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
752
751
|
|
|
753
752
|
export default defineConfig({
|
|
754
753
|
plugins: [
|
|
755
754
|
pluginReactLynx({
|
|
756
755
|
defineDCE: {
|
|
757
|
-
__SOME_FALSE_DEFINE__:
|
|
756
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
758
757
|
},
|
|
759
758
|
}),
|
|
760
759
|
],
|
|
761
|
-
})
|
|
760
|
+
})
|
|
762
761
|
```
|
|
763
762
|
|
|
764
763
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -766,20 +765,20 @@
|
|
|
766
765
|
For example, `import` initialized by dead code will be removed:
|
|
767
766
|
|
|
768
767
|
```js
|
|
769
|
-
import { foo } from
|
|
768
|
+
import { foo } from 'bar'
|
|
770
769
|
|
|
771
770
|
if (__SOME_FALSE_DEFINE__) {
|
|
772
|
-
foo()
|
|
773
|
-
console.log(
|
|
771
|
+
foo()
|
|
772
|
+
console.log('dead code')
|
|
774
773
|
} else {
|
|
775
|
-
console.log(
|
|
774
|
+
console.log('reachable code')
|
|
776
775
|
}
|
|
777
776
|
```
|
|
778
777
|
|
|
779
778
|
will be transformed to:
|
|
780
779
|
|
|
781
780
|
```js
|
|
782
|
-
console.log(
|
|
781
|
+
console.log('reachable code')
|
|
783
782
|
```
|
|
784
783
|
|
|
785
784
|
- Updated dependencies [8dd6cca]
|
|
@@ -822,18 +821,18 @@
|
|
|
822
821
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
823
822
|
|
|
824
823
|
```js
|
|
825
|
-
import { pluginReactLynx } from
|
|
826
|
-
import { defineConfig } from
|
|
824
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
825
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
827
826
|
|
|
828
827
|
export default defineConfig({
|
|
829
828
|
plugins: [
|
|
830
829
|
pluginReactLynx({
|
|
831
830
|
compat: {
|
|
832
|
-
removeComponentAttrRegex:
|
|
831
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
833
832
|
},
|
|
834
833
|
}),
|
|
835
834
|
],
|
|
836
|
-
})
|
|
835
|
+
})
|
|
837
836
|
```
|
|
838
837
|
|
|
839
838
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -852,11 +851,11 @@
|
|
|
852
851
|
|
|
853
852
|
```javascript
|
|
854
853
|
// bar.ts
|
|
855
|
-
import
|
|
854
|
+
import 'background-only'
|
|
856
855
|
|
|
857
856
|
export const bar = () => {
|
|
858
|
-
return
|
|
859
|
-
}
|
|
857
|
+
return 'bar'
|
|
858
|
+
}
|
|
860
859
|
```
|
|
861
860
|
|
|
862
861
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -865,15 +864,15 @@
|
|
|
865
864
|
|
|
866
865
|
```tsx
|
|
867
866
|
// App.tsx
|
|
868
|
-
import { bar } from
|
|
867
|
+
import { bar } from './bar.js'
|
|
869
868
|
|
|
870
869
|
function App() {
|
|
871
|
-
bar()
|
|
870
|
+
bar()
|
|
872
871
|
return (
|
|
873
872
|
<view>
|
|
874
873
|
<text>Hello, Lynx x rspeedy</text>
|
|
875
874
|
</view>
|
|
876
|
-
)
|
|
875
|
+
)
|
|
877
876
|
}
|
|
878
877
|
```
|
|
879
878
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.12.1
|
|
3
|
+
"version": "0.12.1",
|
|
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.7.0
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.12.1
|
|
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.1",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.3
|
|
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",
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.0
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.0",
|
|
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
|
},
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"typia": "9.7.2",
|
|
56
56
|
"typia-rspack-plugin": "2.2.2",
|
|
57
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.12.2",
|
|
59
59
|
"@lynx-js/vitest-setup": "0.0.0",
|
|
60
|
-
"@lynx-js/
|
|
60
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.115.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|