@lynx-js/react-rsbuild-plugin-canary 0.11.3-canary-20251030-b736b6e2 → 0.11.3
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 +39 -39
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.11.3
|
|
3
|
+
## 0.11.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`96545dd`](https://github.com/lynx-family/lynx-stack/commit/96545dd9f966c07aa64437aefc781a9f3e260861)]:
|
|
8
|
-
- @lynx-js/template-webpack-plugin@0.9.1
|
|
8
|
+
- @lynx-js/template-webpack-plugin@0.9.1
|
|
9
9
|
- @lynx-js/css-extract-webpack-plugin@0.6.4
|
|
10
10
|
- @lynx-js/react-webpack-plugin@0.7.1
|
|
11
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.11.3
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.3
|
|
12
12
|
|
|
13
13
|
## 0.11.2
|
|
14
14
|
|
|
@@ -194,28 +194,28 @@
|
|
|
194
194
|
|
|
195
195
|
```ts
|
|
196
196
|
type InlineChunkTestFunction = (params: {
|
|
197
|
-
size: number
|
|
198
|
-
name: string
|
|
199
|
-
}) => boolean
|
|
197
|
+
size: number
|
|
198
|
+
name: string
|
|
199
|
+
}) => boolean
|
|
200
200
|
|
|
201
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
201
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
202
202
|
|
|
203
203
|
type InlineChunkConfig =
|
|
204
204
|
| boolean
|
|
205
205
|
| InlineChunkTest
|
|
206
|
-
| { enable?: boolean |
|
|
206
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
207
207
|
```
|
|
208
208
|
|
|
209
209
|
```ts
|
|
210
|
-
import { defineConfig } from
|
|
210
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
211
211
|
|
|
212
212
|
export default defineConfig({
|
|
213
213
|
output: {
|
|
214
214
|
inlineScripts: ({ name, size }) => {
|
|
215
|
-
return name.includes(
|
|
215
|
+
return name.includes('foo') && size < 1000
|
|
216
216
|
},
|
|
217
217
|
},
|
|
218
|
-
})
|
|
218
|
+
})
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
- 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)]:
|
|
@@ -295,13 +295,13 @@
|
|
|
295
295
|
example:
|
|
296
296
|
|
|
297
297
|
```js
|
|
298
|
-
import { defineConfig } from
|
|
298
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
299
299
|
|
|
300
300
|
export default defineConfig({
|
|
301
301
|
output: {
|
|
302
302
|
inlineScripts: false,
|
|
303
303
|
},
|
|
304
|
-
})
|
|
304
|
+
})
|
|
305
305
|
```
|
|
306
306
|
|
|
307
307
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
389
389
|
|
|
390
390
|
```js
|
|
391
|
-
import { defineConfig } from
|
|
391
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
392
392
|
|
|
393
393
|
export default defineConfig({
|
|
394
394
|
tools: {
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
},
|
|
401
401
|
},
|
|
402
402
|
},
|
|
403
|
-
})
|
|
403
|
+
})
|
|
404
404
|
```
|
|
405
405
|
|
|
406
406
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -576,7 +576,7 @@
|
|
|
576
576
|
You may turn it off using `output.minify.css: false`:
|
|
577
577
|
|
|
578
578
|
```js
|
|
579
|
-
import { defineConfig } from
|
|
579
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
580
580
|
|
|
581
581
|
export default defineConfig({
|
|
582
582
|
output: {
|
|
@@ -584,18 +584,18 @@
|
|
|
584
584
|
css: false,
|
|
585
585
|
},
|
|
586
586
|
},
|
|
587
|
-
})
|
|
587
|
+
})
|
|
588
588
|
```
|
|
589
589
|
|
|
590
590
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
591
591
|
|
|
592
592
|
```js
|
|
593
|
-
import { defineConfig } from
|
|
594
|
-
import { pluginCssMinimizer } from
|
|
593
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
594
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
595
595
|
|
|
596
596
|
export default defineConfig({
|
|
597
597
|
plugins: [pluginCssMinimizer()],
|
|
598
|
-
})
|
|
598
|
+
})
|
|
599
599
|
```
|
|
600
600
|
|
|
601
601
|
### Patch Changes
|
|
@@ -675,18 +675,18 @@
|
|
|
675
675
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
676
676
|
|
|
677
677
|
```js
|
|
678
|
-
import { pluginReactLynx } from
|
|
679
|
-
import { defineConfig } from
|
|
678
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
679
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
680
680
|
|
|
681
681
|
export default defineConfig({
|
|
682
682
|
plugins: [
|
|
683
683
|
pluginReactLynx({
|
|
684
684
|
defineDCE: {
|
|
685
|
-
__SOME_FALSE_DEFINE__:
|
|
685
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
686
686
|
},
|
|
687
687
|
}),
|
|
688
688
|
],
|
|
689
|
-
})
|
|
689
|
+
})
|
|
690
690
|
```
|
|
691
691
|
|
|
692
692
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -694,20 +694,20 @@
|
|
|
694
694
|
For example, `import` initialized by dead code will be removed:
|
|
695
695
|
|
|
696
696
|
```js
|
|
697
|
-
import { foo } from
|
|
697
|
+
import { foo } from 'bar'
|
|
698
698
|
|
|
699
699
|
if (__SOME_FALSE_DEFINE__) {
|
|
700
|
-
foo()
|
|
701
|
-
console.log(
|
|
700
|
+
foo()
|
|
701
|
+
console.log('dead code')
|
|
702
702
|
} else {
|
|
703
|
-
console.log(
|
|
703
|
+
console.log('reachable code')
|
|
704
704
|
}
|
|
705
705
|
```
|
|
706
706
|
|
|
707
707
|
will be transformed to:
|
|
708
708
|
|
|
709
709
|
```js
|
|
710
|
-
console.log(
|
|
710
|
+
console.log('reachable code')
|
|
711
711
|
```
|
|
712
712
|
|
|
713
713
|
- Updated dependencies [8dd6cca]
|
|
@@ -750,18 +750,18 @@
|
|
|
750
750
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
751
751
|
|
|
752
752
|
```js
|
|
753
|
-
import { pluginReactLynx } from
|
|
754
|
-
import { defineConfig } from
|
|
753
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
754
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
755
755
|
|
|
756
756
|
export default defineConfig({
|
|
757
757
|
plugins: [
|
|
758
758
|
pluginReactLynx({
|
|
759
759
|
compat: {
|
|
760
|
-
removeComponentAttrRegex:
|
|
760
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
761
761
|
},
|
|
762
762
|
}),
|
|
763
763
|
],
|
|
764
|
-
})
|
|
764
|
+
})
|
|
765
765
|
```
|
|
766
766
|
|
|
767
767
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -780,11 +780,11 @@
|
|
|
780
780
|
|
|
781
781
|
```javascript
|
|
782
782
|
// bar.ts
|
|
783
|
-
import
|
|
783
|
+
import 'background-only'
|
|
784
784
|
|
|
785
785
|
export const bar = () => {
|
|
786
|
-
return
|
|
787
|
-
}
|
|
786
|
+
return 'bar'
|
|
787
|
+
}
|
|
788
788
|
```
|
|
789
789
|
|
|
790
790
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -793,15 +793,15 @@
|
|
|
793
793
|
|
|
794
794
|
```tsx
|
|
795
795
|
// App.tsx
|
|
796
|
-
import { bar } from
|
|
796
|
+
import { bar } from './bar.js'
|
|
797
797
|
|
|
798
798
|
function App() {
|
|
799
|
-
bar()
|
|
799
|
+
bar()
|
|
800
800
|
return (
|
|
801
801
|
<view>
|
|
802
802
|
<text>Hello, Lynx x rspeedy</text>
|
|
803
803
|
</view>
|
|
804
|
-
)
|
|
804
|
+
)
|
|
805
805
|
}
|
|
806
806
|
```
|
|
807
807
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.11.3
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.6.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.3
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.3",
|
|
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.1",
|
|
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.9.1
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.9.1",
|
|
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,9 +54,9 @@
|
|
|
54
54
|
"typia": "9.7.2",
|
|
55
55
|
"typia-rspack-plugin": "2.2.2",
|
|
56
56
|
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.3",
|
|
57
|
-
"@lynx-js/
|
|
58
|
-
"@lynx-js/
|
|
59
|
-
"@lynx-js/
|
|
57
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.8",
|
|
58
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
|
+
"@lynx-js/react-transform": "0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|