@lynx-js/react-rsbuild-plugin-canary 0.11.2-canary-20251012-dd7c14a8 → 0.11.2
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 -40
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.11.2
|
|
3
|
+
## 0.11.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fix using wrong version of `@lynx-js/react/refresh`. ([#1756](https://github.com/lynx-family/lynx-stack/pull/1756))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- @lynx-js/react@0.
|
|
11
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.11.2-canary-20251012050336-dd7c14a838a10804949a953d0f5b54f34ba7cc67
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.2
|
|
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.1
|
|
@@ -185,28 +184,28 @@
|
|
|
185
184
|
|
|
186
185
|
```ts
|
|
187
186
|
type InlineChunkTestFunction = (params: {
|
|
188
|
-
size: number
|
|
189
|
-
name: string
|
|
190
|
-
}) => boolean
|
|
187
|
+
size: number
|
|
188
|
+
name: string
|
|
189
|
+
}) => boolean
|
|
191
190
|
|
|
192
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
191
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
193
192
|
|
|
194
193
|
type InlineChunkConfig =
|
|
195
194
|
| boolean
|
|
196
195
|
| InlineChunkTest
|
|
197
|
-
| { enable?: boolean |
|
|
196
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
198
197
|
```
|
|
199
198
|
|
|
200
199
|
```ts
|
|
201
|
-
import { defineConfig } from
|
|
200
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
202
201
|
|
|
203
202
|
export default defineConfig({
|
|
204
203
|
output: {
|
|
205
204
|
inlineScripts: ({ name, size }) => {
|
|
206
|
-
return name.includes(
|
|
205
|
+
return name.includes('foo') && size < 1000
|
|
207
206
|
},
|
|
208
207
|
},
|
|
209
|
-
})
|
|
208
|
+
})
|
|
210
209
|
```
|
|
211
210
|
|
|
212
211
|
- 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)]:
|
|
@@ -286,13 +285,13 @@
|
|
|
286
285
|
example:
|
|
287
286
|
|
|
288
287
|
```js
|
|
289
|
-
import { defineConfig } from
|
|
288
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
290
289
|
|
|
291
290
|
export default defineConfig({
|
|
292
291
|
output: {
|
|
293
292
|
inlineScripts: false,
|
|
294
293
|
},
|
|
295
|
-
})
|
|
294
|
+
})
|
|
296
295
|
```
|
|
297
296
|
|
|
298
297
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -379,7 +378,7 @@
|
|
|
379
378
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
380
379
|
|
|
381
380
|
```js
|
|
382
|
-
import { defineConfig } from
|
|
381
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
383
382
|
|
|
384
383
|
export default defineConfig({
|
|
385
384
|
tools: {
|
|
@@ -391,7 +390,7 @@
|
|
|
391
390
|
},
|
|
392
391
|
},
|
|
393
392
|
},
|
|
394
|
-
})
|
|
393
|
+
})
|
|
395
394
|
```
|
|
396
395
|
|
|
397
396
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -567,7 +566,7 @@
|
|
|
567
566
|
You may turn it off using `output.minify.css: false`:
|
|
568
567
|
|
|
569
568
|
```js
|
|
570
|
-
import { defineConfig } from
|
|
569
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
571
570
|
|
|
572
571
|
export default defineConfig({
|
|
573
572
|
output: {
|
|
@@ -575,18 +574,18 @@
|
|
|
575
574
|
css: false,
|
|
576
575
|
},
|
|
577
576
|
},
|
|
578
|
-
})
|
|
577
|
+
})
|
|
579
578
|
```
|
|
580
579
|
|
|
581
580
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
582
581
|
|
|
583
582
|
```js
|
|
584
|
-
import { defineConfig } from
|
|
585
|
-
import { pluginCssMinimizer } from
|
|
583
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
584
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
586
585
|
|
|
587
586
|
export default defineConfig({
|
|
588
587
|
plugins: [pluginCssMinimizer()],
|
|
589
|
-
})
|
|
588
|
+
})
|
|
590
589
|
```
|
|
591
590
|
|
|
592
591
|
### Patch Changes
|
|
@@ -666,18 +665,18 @@
|
|
|
666
665
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
667
666
|
|
|
668
667
|
```js
|
|
669
|
-
import { pluginReactLynx } from
|
|
670
|
-
import { defineConfig } from
|
|
668
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
669
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
671
670
|
|
|
672
671
|
export default defineConfig({
|
|
673
672
|
plugins: [
|
|
674
673
|
pluginReactLynx({
|
|
675
674
|
defineDCE: {
|
|
676
|
-
__SOME_FALSE_DEFINE__:
|
|
675
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
677
676
|
},
|
|
678
677
|
}),
|
|
679
678
|
],
|
|
680
|
-
})
|
|
679
|
+
})
|
|
681
680
|
```
|
|
682
681
|
|
|
683
682
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -685,20 +684,20 @@
|
|
|
685
684
|
For example, `import` initialized by dead code will be removed:
|
|
686
685
|
|
|
687
686
|
```js
|
|
688
|
-
import { foo } from
|
|
687
|
+
import { foo } from 'bar'
|
|
689
688
|
|
|
690
689
|
if (__SOME_FALSE_DEFINE__) {
|
|
691
|
-
foo()
|
|
692
|
-
console.log(
|
|
690
|
+
foo()
|
|
691
|
+
console.log('dead code')
|
|
693
692
|
} else {
|
|
694
|
-
console.log(
|
|
693
|
+
console.log('reachable code')
|
|
695
694
|
}
|
|
696
695
|
```
|
|
697
696
|
|
|
698
697
|
will be transformed to:
|
|
699
698
|
|
|
700
699
|
```js
|
|
701
|
-
console.log(
|
|
700
|
+
console.log('reachable code')
|
|
702
701
|
```
|
|
703
702
|
|
|
704
703
|
- Updated dependencies [8dd6cca]
|
|
@@ -741,18 +740,18 @@
|
|
|
741
740
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
742
741
|
|
|
743
742
|
```js
|
|
744
|
-
import { pluginReactLynx } from
|
|
745
|
-
import { defineConfig } from
|
|
743
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
744
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
746
745
|
|
|
747
746
|
export default defineConfig({
|
|
748
747
|
plugins: [
|
|
749
748
|
pluginReactLynx({
|
|
750
749
|
compat: {
|
|
751
|
-
removeComponentAttrRegex:
|
|
750
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
752
751
|
},
|
|
753
752
|
}),
|
|
754
753
|
],
|
|
755
|
-
})
|
|
754
|
+
})
|
|
756
755
|
```
|
|
757
756
|
|
|
758
757
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -771,11 +770,11 @@
|
|
|
771
770
|
|
|
772
771
|
```javascript
|
|
773
772
|
// bar.ts
|
|
774
|
-
import
|
|
773
|
+
import 'background-only'
|
|
775
774
|
|
|
776
775
|
export const bar = () => {
|
|
777
|
-
return
|
|
778
|
-
}
|
|
776
|
+
return 'bar'
|
|
777
|
+
}
|
|
779
778
|
```
|
|
780
779
|
|
|
781
780
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -784,15 +783,15 @@
|
|
|
784
783
|
|
|
785
784
|
```tsx
|
|
786
785
|
// App.tsx
|
|
787
|
-
import { bar } from
|
|
786
|
+
import { bar } from './bar.js'
|
|
788
787
|
|
|
789
788
|
function App() {
|
|
790
|
-
bar()
|
|
789
|
+
bar()
|
|
791
790
|
return (
|
|
792
791
|
<view>
|
|
793
792
|
<text>Hello, Lynx x rspeedy</text>
|
|
794
793
|
</view>
|
|
795
|
-
)
|
|
794
|
+
)
|
|
796
795
|
}
|
|
797
796
|
```
|
|
798
797
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.11.2
|
|
3
|
+
"version": "0.11.2",
|
|
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.6.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.2
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.2",
|
|
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",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"type-fest": "^5.0.1",
|
|
54
54
|
"typia": "9.7.2",
|
|
55
55
|
"typia-rspack-plugin": "2.2.2",
|
|
56
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.2
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.2",
|
|
57
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
|
-
"@lynx-js/
|
|
59
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.6",
|
|
59
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|