@lynx-js/react-rsbuild-plugin-canary 0.10.6-canary-20250704-782a6b3a → 0.10.6
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 +40 -41
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.6
|
|
3
|
+
## 0.10.6
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Be compat with `@lynx-js/react` v0.111.0 ([#204](https://github.com/lynx-family/lynx-stack/pull/204))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [[`
|
|
10
|
-
- @lynx-js/react@0.
|
|
11
|
-
- @lynx-js/react-
|
|
12
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.6-canary-20250704154700-782a6b3a163565b59d7da53b231830da4ec08fbb
|
|
9
|
+
- Updated dependencies [[`99a3557`](https://github.com/lynx-family/lynx-stack/commit/99a355719ad3106d20118dc1ea3abf34ddbdb9ad)]:
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.6.18
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.6
|
|
13
12
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
14
13
|
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
15
14
|
|
|
@@ -23,28 +22,28 @@
|
|
|
23
22
|
|
|
24
23
|
```ts
|
|
25
24
|
type InlineChunkTestFunction = (params: {
|
|
26
|
-
size: number
|
|
27
|
-
name: string
|
|
28
|
-
}) => boolean
|
|
25
|
+
size: number
|
|
26
|
+
name: string
|
|
27
|
+
}) => boolean
|
|
29
28
|
|
|
30
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
29
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
31
30
|
|
|
32
31
|
type InlineChunkConfig =
|
|
33
32
|
| boolean
|
|
34
33
|
| InlineChunkTest
|
|
35
|
-
| { enable?: boolean |
|
|
34
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
```ts
|
|
39
|
-
import { defineConfig } from
|
|
38
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
40
39
|
|
|
41
40
|
export default defineConfig({
|
|
42
41
|
output: {
|
|
43
42
|
inlineScripts: ({ name, size }) => {
|
|
44
|
-
return name.includes(
|
|
43
|
+
return name.includes('foo') && size < 1000
|
|
45
44
|
},
|
|
46
45
|
},
|
|
47
|
-
})
|
|
46
|
+
})
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
- 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)]:
|
|
@@ -124,13 +123,13 @@
|
|
|
124
123
|
example:
|
|
125
124
|
|
|
126
125
|
```js
|
|
127
|
-
import { defineConfig } from
|
|
126
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
128
127
|
|
|
129
128
|
export default defineConfig({
|
|
130
129
|
output: {
|
|
131
130
|
inlineScripts: false,
|
|
132
131
|
},
|
|
133
|
-
})
|
|
132
|
+
})
|
|
134
133
|
```
|
|
135
134
|
|
|
136
135
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -217,7 +216,7 @@
|
|
|
217
216
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
218
217
|
|
|
219
218
|
```js
|
|
220
|
-
import { defineConfig } from
|
|
219
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
221
220
|
|
|
222
221
|
export default defineConfig({
|
|
223
222
|
tools: {
|
|
@@ -229,7 +228,7 @@
|
|
|
229
228
|
},
|
|
230
229
|
},
|
|
231
230
|
},
|
|
232
|
-
})
|
|
231
|
+
})
|
|
233
232
|
```
|
|
234
233
|
|
|
235
234
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -405,7 +404,7 @@
|
|
|
405
404
|
You may turn it off using `output.minify.css: false`:
|
|
406
405
|
|
|
407
406
|
```js
|
|
408
|
-
import { defineConfig } from
|
|
407
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
409
408
|
|
|
410
409
|
export default defineConfig({
|
|
411
410
|
output: {
|
|
@@ -413,18 +412,18 @@
|
|
|
413
412
|
css: false,
|
|
414
413
|
},
|
|
415
414
|
},
|
|
416
|
-
})
|
|
415
|
+
})
|
|
417
416
|
```
|
|
418
417
|
|
|
419
418
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
420
419
|
|
|
421
420
|
```js
|
|
422
|
-
import { defineConfig } from
|
|
423
|
-
import { pluginCssMinimizer } from
|
|
421
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
422
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
424
423
|
|
|
425
424
|
export default defineConfig({
|
|
426
425
|
plugins: [pluginCssMinimizer()],
|
|
427
|
-
})
|
|
426
|
+
})
|
|
428
427
|
```
|
|
429
428
|
|
|
430
429
|
### Patch Changes
|
|
@@ -504,18 +503,18 @@
|
|
|
504
503
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
505
504
|
|
|
506
505
|
```js
|
|
507
|
-
import { pluginReactLynx } from
|
|
508
|
-
import { defineConfig } from
|
|
506
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
507
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
509
508
|
|
|
510
509
|
export default defineConfig({
|
|
511
510
|
plugins: [
|
|
512
511
|
pluginReactLynx({
|
|
513
512
|
defineDCE: {
|
|
514
|
-
__SOME_FALSE_DEFINE__:
|
|
513
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
515
514
|
},
|
|
516
515
|
}),
|
|
517
516
|
],
|
|
518
|
-
})
|
|
517
|
+
})
|
|
519
518
|
```
|
|
520
519
|
|
|
521
520
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -523,20 +522,20 @@
|
|
|
523
522
|
For example, `import` initialized by dead code will be removed:
|
|
524
523
|
|
|
525
524
|
```js
|
|
526
|
-
import { foo } from
|
|
525
|
+
import { foo } from 'bar'
|
|
527
526
|
|
|
528
527
|
if (__SOME_FALSE_DEFINE__) {
|
|
529
|
-
foo()
|
|
530
|
-
console.log(
|
|
528
|
+
foo()
|
|
529
|
+
console.log('dead code')
|
|
531
530
|
} else {
|
|
532
|
-
console.log(
|
|
531
|
+
console.log('reachable code')
|
|
533
532
|
}
|
|
534
533
|
```
|
|
535
534
|
|
|
536
535
|
will be transformed to:
|
|
537
536
|
|
|
538
537
|
```js
|
|
539
|
-
console.log(
|
|
538
|
+
console.log('reachable code')
|
|
540
539
|
```
|
|
541
540
|
|
|
542
541
|
- Updated dependencies [8dd6cca]
|
|
@@ -579,18 +578,18 @@
|
|
|
579
578
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
580
579
|
|
|
581
580
|
```js
|
|
582
|
-
import { pluginReactLynx } from
|
|
583
|
-
import { defineConfig } from
|
|
581
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
582
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
584
583
|
|
|
585
584
|
export default defineConfig({
|
|
586
585
|
plugins: [
|
|
587
586
|
pluginReactLynx({
|
|
588
587
|
compat: {
|
|
589
|
-
removeComponentAttrRegex:
|
|
588
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
590
589
|
},
|
|
591
590
|
}),
|
|
592
591
|
],
|
|
593
|
-
})
|
|
592
|
+
})
|
|
594
593
|
```
|
|
595
594
|
|
|
596
595
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -609,11 +608,11 @@
|
|
|
609
608
|
|
|
610
609
|
```javascript
|
|
611
610
|
// bar.ts
|
|
612
|
-
import
|
|
611
|
+
import 'background-only'
|
|
613
612
|
|
|
614
613
|
export const bar = () => {
|
|
615
|
-
return
|
|
616
|
-
}
|
|
614
|
+
return 'bar'
|
|
615
|
+
}
|
|
617
616
|
```
|
|
618
617
|
|
|
619
618
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -622,15 +621,15 @@
|
|
|
622
621
|
|
|
623
622
|
```tsx
|
|
624
623
|
// App.tsx
|
|
625
|
-
import { bar } from
|
|
624
|
+
import { bar } from './bar.js'
|
|
626
625
|
|
|
627
626
|
function App() {
|
|
628
|
-
bar()
|
|
627
|
+
bar()
|
|
629
628
|
return (
|
|
630
629
|
<view>
|
|
631
630
|
<text>Hello, Lynx x rspeedy</text>
|
|
632
631
|
</view>
|
|
633
|
-
)
|
|
632
|
+
)
|
|
634
633
|
}
|
|
635
634
|
```
|
|
636
635
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.6
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,9 +33,9 @@
|
|
|
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.6
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.6",
|
|
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.18
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.18",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.2",
|
|
40
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",
|
|
@@ -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.111.0-canary-20250704-782a6b3a",
|
|
58
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
59
|
-
"@lynx-js/
|
|
60
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.10.0",
|
|
59
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.111.0",
|
|
60
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|