@lynx-js/react-rsbuild-plugin-canary 0.10.14-canary-20250915-59a0d600 → 0.10.14
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 +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.14
|
|
3
|
+
## 0.10.14
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
- Disable `builtin:lightningcss-loader` for `environments.web`. ([#1732](https://github.com/lynx-family/lynx-stack/pull/1732))
|
|
12
12
|
|
|
13
|
-
- Updated dependencies [[`5ad38e6`](https://github.com/lynx-family/lynx-stack/commit/5ad38e6b3970a537f13d7f4caf0d765d16b6b322), [`
|
|
14
|
-
- @lynx-js/template-webpack-plugin@0.8.6
|
|
15
|
-
- @lynx-js/react@0.
|
|
16
|
-
- @lynx-js/react-
|
|
17
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.14-canary-20250915090032-59a0d600e111d2ae5136f5ee7cd768bc38de018b
|
|
13
|
+
- Updated dependencies [[`5ad38e6`](https://github.com/lynx-family/lynx-stack/commit/5ad38e6b3970a537f13d7f4caf0d765d16b6b322), [`69b3ae0`](https://github.com/lynx-family/lynx-stack/commit/69b3ae031a24161b8513cc804bf6b82c03da6d0c), [`69b3ae0`](https://github.com/lynx-family/lynx-stack/commit/69b3ae031a24161b8513cc804bf6b82c03da6d0c), [`c2f90bd`](https://github.com/lynx-family/lynx-stack/commit/c2f90bdb0ce465702b0b4a46108b16e78678225f)]:
|
|
14
|
+
- @lynx-js/template-webpack-plugin@0.8.6
|
|
15
|
+
- @lynx-js/react-webpack-plugin@0.7.0
|
|
16
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.14
|
|
18
17
|
- @lynx-js/css-extract-webpack-plugin@0.6.2
|
|
19
18
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
20
19
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
@@ -140,28 +139,28 @@
|
|
|
140
139
|
|
|
141
140
|
```ts
|
|
142
141
|
type InlineChunkTestFunction = (params: {
|
|
143
|
-
size: number
|
|
144
|
-
name: string
|
|
145
|
-
}) => boolean
|
|
142
|
+
size: number
|
|
143
|
+
name: string
|
|
144
|
+
}) => boolean
|
|
146
145
|
|
|
147
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
146
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
148
147
|
|
|
149
148
|
type InlineChunkConfig =
|
|
150
149
|
| boolean
|
|
151
150
|
| InlineChunkTest
|
|
152
|
-
| { enable?: boolean |
|
|
151
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
153
152
|
```
|
|
154
153
|
|
|
155
154
|
```ts
|
|
156
|
-
import { defineConfig } from
|
|
155
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
157
156
|
|
|
158
157
|
export default defineConfig({
|
|
159
158
|
output: {
|
|
160
159
|
inlineScripts: ({ name, size }) => {
|
|
161
|
-
return name.includes(
|
|
160
|
+
return name.includes('foo') && size < 1000
|
|
162
161
|
},
|
|
163
162
|
},
|
|
164
|
-
})
|
|
163
|
+
})
|
|
165
164
|
```
|
|
166
165
|
|
|
167
166
|
- 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)]:
|
|
@@ -241,13 +240,13 @@
|
|
|
241
240
|
example:
|
|
242
241
|
|
|
243
242
|
```js
|
|
244
|
-
import { defineConfig } from
|
|
243
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
245
244
|
|
|
246
245
|
export default defineConfig({
|
|
247
246
|
output: {
|
|
248
247
|
inlineScripts: false,
|
|
249
248
|
},
|
|
250
|
-
})
|
|
249
|
+
})
|
|
251
250
|
```
|
|
252
251
|
|
|
253
252
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -334,7 +333,7 @@
|
|
|
334
333
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
335
334
|
|
|
336
335
|
```js
|
|
337
|
-
import { defineConfig } from
|
|
336
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
338
337
|
|
|
339
338
|
export default defineConfig({
|
|
340
339
|
tools: {
|
|
@@ -346,7 +345,7 @@
|
|
|
346
345
|
},
|
|
347
346
|
},
|
|
348
347
|
},
|
|
349
|
-
})
|
|
348
|
+
})
|
|
350
349
|
```
|
|
351
350
|
|
|
352
351
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -522,7 +521,7 @@
|
|
|
522
521
|
You may turn it off using `output.minify.css: false`:
|
|
523
522
|
|
|
524
523
|
```js
|
|
525
|
-
import { defineConfig } from
|
|
524
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
526
525
|
|
|
527
526
|
export default defineConfig({
|
|
528
527
|
output: {
|
|
@@ -530,18 +529,18 @@
|
|
|
530
529
|
css: false,
|
|
531
530
|
},
|
|
532
531
|
},
|
|
533
|
-
})
|
|
532
|
+
})
|
|
534
533
|
```
|
|
535
534
|
|
|
536
535
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
537
536
|
|
|
538
537
|
```js
|
|
539
|
-
import { defineConfig } from
|
|
540
|
-
import { pluginCssMinimizer } from
|
|
538
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
539
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
541
540
|
|
|
542
541
|
export default defineConfig({
|
|
543
542
|
plugins: [pluginCssMinimizer()],
|
|
544
|
-
})
|
|
543
|
+
})
|
|
545
544
|
```
|
|
546
545
|
|
|
547
546
|
### Patch Changes
|
|
@@ -621,18 +620,18 @@
|
|
|
621
620
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
622
621
|
|
|
623
622
|
```js
|
|
624
|
-
import { pluginReactLynx } from
|
|
625
|
-
import { defineConfig } from
|
|
623
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
624
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
626
625
|
|
|
627
626
|
export default defineConfig({
|
|
628
627
|
plugins: [
|
|
629
628
|
pluginReactLynx({
|
|
630
629
|
defineDCE: {
|
|
631
|
-
__SOME_FALSE_DEFINE__:
|
|
630
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
632
631
|
},
|
|
633
632
|
}),
|
|
634
633
|
],
|
|
635
|
-
})
|
|
634
|
+
})
|
|
636
635
|
```
|
|
637
636
|
|
|
638
637
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -640,20 +639,20 @@
|
|
|
640
639
|
For example, `import` initialized by dead code will be removed:
|
|
641
640
|
|
|
642
641
|
```js
|
|
643
|
-
import { foo } from
|
|
642
|
+
import { foo } from 'bar'
|
|
644
643
|
|
|
645
644
|
if (__SOME_FALSE_DEFINE__) {
|
|
646
|
-
foo()
|
|
647
|
-
console.log(
|
|
645
|
+
foo()
|
|
646
|
+
console.log('dead code')
|
|
648
647
|
} else {
|
|
649
|
-
console.log(
|
|
648
|
+
console.log('reachable code')
|
|
650
649
|
}
|
|
651
650
|
```
|
|
652
651
|
|
|
653
652
|
will be transformed to:
|
|
654
653
|
|
|
655
654
|
```js
|
|
656
|
-
console.log(
|
|
655
|
+
console.log('reachable code')
|
|
657
656
|
```
|
|
658
657
|
|
|
659
658
|
- Updated dependencies [8dd6cca]
|
|
@@ -696,18 +695,18 @@
|
|
|
696
695
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
697
696
|
|
|
698
697
|
```js
|
|
699
|
-
import { pluginReactLynx } from
|
|
700
|
-
import { defineConfig } from
|
|
698
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
699
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
701
700
|
|
|
702
701
|
export default defineConfig({
|
|
703
702
|
plugins: [
|
|
704
703
|
pluginReactLynx({
|
|
705
704
|
compat: {
|
|
706
|
-
removeComponentAttrRegex:
|
|
705
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
707
706
|
},
|
|
708
707
|
}),
|
|
709
708
|
],
|
|
710
|
-
})
|
|
709
|
+
})
|
|
711
710
|
```
|
|
712
711
|
|
|
713
712
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -726,11 +725,11 @@
|
|
|
726
725
|
|
|
727
726
|
```javascript
|
|
728
727
|
// bar.ts
|
|
729
|
-
import
|
|
728
|
+
import 'background-only'
|
|
730
729
|
|
|
731
730
|
export const bar = () => {
|
|
732
|
-
return
|
|
733
|
-
}
|
|
731
|
+
return 'bar'
|
|
732
|
+
}
|
|
734
733
|
```
|
|
735
734
|
|
|
736
735
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -739,15 +738,15 @@
|
|
|
739
738
|
|
|
740
739
|
```tsx
|
|
741
740
|
// App.tsx
|
|
742
|
-
import { bar } from
|
|
741
|
+
import { bar } from './bar.js'
|
|
743
742
|
|
|
744
743
|
function App() {
|
|
745
|
-
bar()
|
|
744
|
+
bar()
|
|
746
745
|
return (
|
|
747
746
|
<view>
|
|
748
747
|
<text>Hello, Lynx x rspeedy</text>
|
|
749
748
|
</view>
|
|
750
|
-
)
|
|
749
|
+
)
|
|
751
750
|
}
|
|
752
751
|
```
|
|
753
752
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.14
|
|
3
|
+
"version": "0.10.14",
|
|
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.2",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.14
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.14",
|
|
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.0
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.0",
|
|
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.8.6
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.6",
|
|
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
|
},
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"type-fest": "^4.41.0",
|
|
54
54
|
"typia": "9.7.2",
|
|
55
55
|
"typia-rspack-plugin": "2.2.2",
|
|
56
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.113.0
|
|
57
|
-
"@lynx-js/
|
|
58
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.2
|
|
59
|
-
"@lynx-js/
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.113.0",
|
|
57
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.2",
|
|
59
|
+
"@lynx-js/react-transform": "0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|