@lynx-js/react-rsbuild-plugin-canary 0.10.5-canary-20250630-51cb73dd → 0.10.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 +42 -43
- 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.5
|
|
3
|
+
## 0.10.5
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -10,36 +10,35 @@
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
type InlineChunkTestFunction = (params: {
|
|
13
|
-
size: number
|
|
14
|
-
name: string
|
|
15
|
-
}) => boolean
|
|
13
|
+
size: number
|
|
14
|
+
name: string
|
|
15
|
+
}) => boolean
|
|
16
16
|
|
|
17
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
17
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
18
18
|
|
|
19
19
|
type InlineChunkConfig =
|
|
20
20
|
| boolean
|
|
21
21
|
| InlineChunkTest
|
|
22
|
-
| { enable?: boolean |
|
|
22
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
import { defineConfig } from
|
|
26
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
27
27
|
|
|
28
28
|
export default defineConfig({
|
|
29
29
|
output: {
|
|
30
30
|
inlineScripts: ({ name, size }) => {
|
|
31
|
-
return name.includes(
|
|
31
|
+
return name.includes('foo') && size < 1000
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
})
|
|
34
|
+
})
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
- Updated dependencies [[`51cb73d`](https://github.com/lynx-family/lynx-stack/commit/51cb73dd0b77d35540644cdd2e6c37db856f0e8a), [`
|
|
38
|
-
- @lynx-js/runtime-wrapper-webpack-plugin@0.1.2
|
|
39
|
-
- @lynx-js/
|
|
40
|
-
- @lynx-js/
|
|
41
|
-
- @lynx-js/react-
|
|
42
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.5-canary-20250630161818-51cb73dd0b77d35540644cdd2e6c37db856f0e8a
|
|
37
|
+
- 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)]:
|
|
38
|
+
- @lynx-js/runtime-wrapper-webpack-plugin@0.1.2
|
|
39
|
+
- @lynx-js/template-webpack-plugin@0.8.1
|
|
40
|
+
- @lynx-js/react-webpack-plugin@0.6.17
|
|
41
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.5
|
|
43
42
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
44
43
|
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
45
44
|
- @lynx-js/css-extract-webpack-plugin@0.6.0
|
|
@@ -112,13 +111,13 @@
|
|
|
112
111
|
example:
|
|
113
112
|
|
|
114
113
|
```js
|
|
115
|
-
import { defineConfig } from
|
|
114
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
116
115
|
|
|
117
116
|
export default defineConfig({
|
|
118
117
|
output: {
|
|
119
118
|
inlineScripts: false,
|
|
120
119
|
},
|
|
121
|
-
})
|
|
120
|
+
})
|
|
122
121
|
```
|
|
123
122
|
|
|
124
123
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -205,7 +204,7 @@
|
|
|
205
204
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
206
205
|
|
|
207
206
|
```js
|
|
208
|
-
import { defineConfig } from
|
|
207
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
209
208
|
|
|
210
209
|
export default defineConfig({
|
|
211
210
|
tools: {
|
|
@@ -217,7 +216,7 @@
|
|
|
217
216
|
},
|
|
218
217
|
},
|
|
219
218
|
},
|
|
220
|
-
})
|
|
219
|
+
})
|
|
221
220
|
```
|
|
222
221
|
|
|
223
222
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -393,7 +392,7 @@
|
|
|
393
392
|
You may turn it off using `output.minify.css: false`:
|
|
394
393
|
|
|
395
394
|
```js
|
|
396
|
-
import { defineConfig } from
|
|
395
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
397
396
|
|
|
398
397
|
export default defineConfig({
|
|
399
398
|
output: {
|
|
@@ -401,18 +400,18 @@
|
|
|
401
400
|
css: false,
|
|
402
401
|
},
|
|
403
402
|
},
|
|
404
|
-
})
|
|
403
|
+
})
|
|
405
404
|
```
|
|
406
405
|
|
|
407
406
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
408
407
|
|
|
409
408
|
```js
|
|
410
|
-
import { defineConfig } from
|
|
411
|
-
import { pluginCssMinimizer } from
|
|
409
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
410
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
412
411
|
|
|
413
412
|
export default defineConfig({
|
|
414
413
|
plugins: [pluginCssMinimizer()],
|
|
415
|
-
})
|
|
414
|
+
})
|
|
416
415
|
```
|
|
417
416
|
|
|
418
417
|
### Patch Changes
|
|
@@ -492,18 +491,18 @@
|
|
|
492
491
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
493
492
|
|
|
494
493
|
```js
|
|
495
|
-
import { pluginReactLynx } from
|
|
496
|
-
import { defineConfig } from
|
|
494
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
495
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
497
496
|
|
|
498
497
|
export default defineConfig({
|
|
499
498
|
plugins: [
|
|
500
499
|
pluginReactLynx({
|
|
501
500
|
defineDCE: {
|
|
502
|
-
__SOME_FALSE_DEFINE__:
|
|
501
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
503
502
|
},
|
|
504
503
|
}),
|
|
505
504
|
],
|
|
506
|
-
})
|
|
505
|
+
})
|
|
507
506
|
```
|
|
508
507
|
|
|
509
508
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -511,20 +510,20 @@
|
|
|
511
510
|
For example, `import` initialized by dead code will be removed:
|
|
512
511
|
|
|
513
512
|
```js
|
|
514
|
-
import { foo } from
|
|
513
|
+
import { foo } from 'bar'
|
|
515
514
|
|
|
516
515
|
if (__SOME_FALSE_DEFINE__) {
|
|
517
|
-
foo()
|
|
518
|
-
console.log(
|
|
516
|
+
foo()
|
|
517
|
+
console.log('dead code')
|
|
519
518
|
} else {
|
|
520
|
-
console.log(
|
|
519
|
+
console.log('reachable code')
|
|
521
520
|
}
|
|
522
521
|
```
|
|
523
522
|
|
|
524
523
|
will be transformed to:
|
|
525
524
|
|
|
526
525
|
```js
|
|
527
|
-
console.log(
|
|
526
|
+
console.log('reachable code')
|
|
528
527
|
```
|
|
529
528
|
|
|
530
529
|
- Updated dependencies [8dd6cca]
|
|
@@ -567,18 +566,18 @@
|
|
|
567
566
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
568
567
|
|
|
569
568
|
```js
|
|
570
|
-
import { pluginReactLynx } from
|
|
571
|
-
import { defineConfig } from
|
|
569
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
570
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
572
571
|
|
|
573
572
|
export default defineConfig({
|
|
574
573
|
plugins: [
|
|
575
574
|
pluginReactLynx({
|
|
576
575
|
compat: {
|
|
577
|
-
removeComponentAttrRegex:
|
|
576
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
578
577
|
},
|
|
579
578
|
}),
|
|
580
579
|
],
|
|
581
|
-
})
|
|
580
|
+
})
|
|
582
581
|
```
|
|
583
582
|
|
|
584
583
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -597,11 +596,11 @@
|
|
|
597
596
|
|
|
598
597
|
```javascript
|
|
599
598
|
// bar.ts
|
|
600
|
-
import
|
|
599
|
+
import 'background-only'
|
|
601
600
|
|
|
602
601
|
export const bar = () => {
|
|
603
|
-
return
|
|
604
|
-
}
|
|
602
|
+
return 'bar'
|
|
603
|
+
}
|
|
605
604
|
```
|
|
606
605
|
|
|
607
606
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -610,15 +609,15 @@
|
|
|
610
609
|
|
|
611
610
|
```tsx
|
|
612
611
|
// App.tsx
|
|
613
|
-
import { bar } from
|
|
612
|
+
import { bar } from './bar.js'
|
|
614
613
|
|
|
615
614
|
function App() {
|
|
616
|
-
bar()
|
|
615
|
+
bar()
|
|
617
616
|
return (
|
|
618
617
|
<view>
|
|
619
618
|
<text>Hello, Lynx x rspeedy</text>
|
|
620
619
|
</view>
|
|
621
|
-
)
|
|
620
|
+
)
|
|
622
621
|
}
|
|
623
622
|
```
|
|
624
623
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.5
|
|
3
|
+
"version": "0.10.5",
|
|
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.0",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.5
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.5",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.3",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.17
|
|
39
|
-
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.2
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.1
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.17",
|
|
39
|
+
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.2",
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.8.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,10 +54,10 @@
|
|
|
54
54
|
"type-fest": "^4.41.0",
|
|
55
55
|
"typia": "9.3.1",
|
|
56
56
|
"typia-rspack-plugin": "2.1.0",
|
|
57
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.110.1
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.110.1",
|
|
58
58
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/
|
|
59
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
60
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.11"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|