@lynx-js/react-rsbuild-plugin-canary 0.10.0-canary-20250523-5ddec124 → 0.10.0
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 +35 -36
- 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.0
|
|
3
|
+
## 0.10.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -15,26 +15,25 @@
|
|
|
15
15
|
example:
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
|
-
import { defineConfig } from
|
|
18
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
19
19
|
|
|
20
20
|
export default defineConfig({
|
|
21
21
|
output: {
|
|
22
22
|
inlineScripts: false,
|
|
23
23
|
},
|
|
24
|
-
})
|
|
24
|
+
})
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
28
28
|
|
|
29
29
|
- Use `WebEncodePlugin` instead of `WebWebpackPlugin`. ([#904](https://github.com/lynx-family/lynx-stack/pull/904))
|
|
30
30
|
|
|
31
|
-
- Updated dependencies [[`7beb35e`](https://github.com/lynx-family/lynx-stack/commit/7beb35ebf72f9475c0a200c93c6b9bdaa7980e1b), [`
|
|
32
|
-
- @lynx-js/template-webpack-plugin@0.7.0
|
|
33
|
-
- @lynx-js/
|
|
34
|
-
- @lynx-js/
|
|
35
|
-
- @lynx-js/react-
|
|
36
|
-
- @lynx-js/react-
|
|
37
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.0-canary-20250523154624-5ddec124ab26e61e415576d575a400e76c7bd8d2
|
|
31
|
+
- Updated dependencies [[`7beb35e`](https://github.com/lynx-family/lynx-stack/commit/7beb35ebf72f9475c0a200c93c6b9bdaa7980e1b), [`b6e27da`](https://github.com/lynx-family/lynx-stack/commit/b6e27daf865b0627b1c3238228a4fdf65ad87ee3), [`5ddec12`](https://github.com/lynx-family/lynx-stack/commit/5ddec124ab26e61e415576d575a400e76c7bd8d2), [`77524bc`](https://github.com/lynx-family/lynx-stack/commit/77524bcf502675a182923823bf5c892846e0c729), [`fdab5dc`](https://github.com/lynx-family/lynx-stack/commit/fdab5dc9d624de0b39957695599cc8eebab90973), [`ff63b58`](https://github.com/lynx-family/lynx-stack/commit/ff63b58af137be5265458cb08db9af0aaa69c416), [`fdab5dc`](https://github.com/lynx-family/lynx-stack/commit/fdab5dc9d624de0b39957695599cc8eebab90973), [`2b83934`](https://github.com/lynx-family/lynx-stack/commit/2b83934f12c9ad9ed46ef76233d5bb12a1e6af23), [`3520031`](https://github.com/lynx-family/lynx-stack/commit/352003113596692c34d98644db401ece362bc936)]:
|
|
32
|
+
- @lynx-js/template-webpack-plugin@0.7.0
|
|
33
|
+
- @lynx-js/css-extract-webpack-plugin@0.5.4
|
|
34
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
35
|
+
- @lynx-js/react-webpack-plugin@0.6.14
|
|
36
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.0
|
|
38
37
|
|
|
39
38
|
## 0.9.10
|
|
40
39
|
|
|
@@ -109,7 +108,7 @@
|
|
|
109
108
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
110
109
|
|
|
111
110
|
```js
|
|
112
|
-
import { defineConfig } from
|
|
111
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
113
112
|
|
|
114
113
|
export default defineConfig({
|
|
115
114
|
tools: {
|
|
@@ -121,7 +120,7 @@
|
|
|
121
120
|
},
|
|
122
121
|
},
|
|
123
122
|
},
|
|
124
|
-
})
|
|
123
|
+
})
|
|
125
124
|
```
|
|
126
125
|
|
|
127
126
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -297,7 +296,7 @@
|
|
|
297
296
|
You may turn it off using `output.minify.css: false`:
|
|
298
297
|
|
|
299
298
|
```js
|
|
300
|
-
import { defineConfig } from
|
|
299
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
301
300
|
|
|
302
301
|
export default defineConfig({
|
|
303
302
|
output: {
|
|
@@ -305,18 +304,18 @@
|
|
|
305
304
|
css: false,
|
|
306
305
|
},
|
|
307
306
|
},
|
|
308
|
-
})
|
|
307
|
+
})
|
|
309
308
|
```
|
|
310
309
|
|
|
311
310
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
312
311
|
|
|
313
312
|
```js
|
|
314
|
-
import { defineConfig } from
|
|
315
|
-
import { pluginCssMinimizer } from
|
|
313
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
314
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
316
315
|
|
|
317
316
|
export default defineConfig({
|
|
318
317
|
plugins: [pluginCssMinimizer()],
|
|
319
|
-
})
|
|
318
|
+
})
|
|
320
319
|
```
|
|
321
320
|
|
|
322
321
|
### Patch Changes
|
|
@@ -396,18 +395,18 @@
|
|
|
396
395
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
397
396
|
|
|
398
397
|
```js
|
|
399
|
-
import { pluginReactLynx } from
|
|
400
|
-
import { defineConfig } from
|
|
398
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
399
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
401
400
|
|
|
402
401
|
export default defineConfig({
|
|
403
402
|
plugins: [
|
|
404
403
|
pluginReactLynx({
|
|
405
404
|
defineDCE: {
|
|
406
|
-
__SOME_FALSE_DEFINE__:
|
|
405
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
407
406
|
},
|
|
408
407
|
}),
|
|
409
408
|
],
|
|
410
|
-
})
|
|
409
|
+
})
|
|
411
410
|
```
|
|
412
411
|
|
|
413
412
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -415,20 +414,20 @@
|
|
|
415
414
|
For example, `import` initialized by dead code will be removed:
|
|
416
415
|
|
|
417
416
|
```js
|
|
418
|
-
import { foo } from
|
|
417
|
+
import { foo } from 'bar'
|
|
419
418
|
|
|
420
419
|
if (__SOME_FALSE_DEFINE__) {
|
|
421
|
-
foo()
|
|
422
|
-
console.log(
|
|
420
|
+
foo()
|
|
421
|
+
console.log('dead code')
|
|
423
422
|
} else {
|
|
424
|
-
console.log(
|
|
423
|
+
console.log('reachable code')
|
|
425
424
|
}
|
|
426
425
|
```
|
|
427
426
|
|
|
428
427
|
will be transformed to:
|
|
429
428
|
|
|
430
429
|
```js
|
|
431
|
-
console.log(
|
|
430
|
+
console.log('reachable code')
|
|
432
431
|
```
|
|
433
432
|
|
|
434
433
|
- Updated dependencies [8dd6cca]
|
|
@@ -471,18 +470,18 @@
|
|
|
471
470
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
472
471
|
|
|
473
472
|
```js
|
|
474
|
-
import { pluginReactLynx } from
|
|
475
|
-
import { defineConfig } from
|
|
473
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
474
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
476
475
|
|
|
477
476
|
export default defineConfig({
|
|
478
477
|
plugins: [
|
|
479
478
|
pluginReactLynx({
|
|
480
479
|
compat: {
|
|
481
|
-
removeComponentAttrRegex:
|
|
480
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
482
481
|
},
|
|
483
482
|
}),
|
|
484
483
|
],
|
|
485
|
-
})
|
|
484
|
+
})
|
|
486
485
|
```
|
|
487
486
|
|
|
488
487
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -501,11 +500,11 @@
|
|
|
501
500
|
|
|
502
501
|
```javascript
|
|
503
502
|
// bar.ts
|
|
504
|
-
import
|
|
503
|
+
import 'background-only'
|
|
505
504
|
|
|
506
505
|
export const bar = () => {
|
|
507
|
-
return
|
|
508
|
-
}
|
|
506
|
+
return 'bar'
|
|
507
|
+
}
|
|
509
508
|
```
|
|
510
509
|
|
|
511
510
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -514,15 +513,15 @@
|
|
|
514
513
|
|
|
515
514
|
```tsx
|
|
516
515
|
// App.tsx
|
|
517
|
-
import { bar } from
|
|
516
|
+
import { bar } from './bar.js'
|
|
518
517
|
|
|
519
518
|
function App() {
|
|
520
|
-
bar()
|
|
519
|
+
bar()
|
|
521
520
|
return (
|
|
522
521
|
<view>
|
|
523
522
|
<text>Hello, Lynx x rspeedy</text>
|
|
524
523
|
</view>
|
|
525
|
-
)
|
|
524
|
+
)
|
|
526
525
|
}
|
|
527
526
|
```
|
|
528
527
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.0
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"README.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.4
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.0
|
|
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.14
|
|
35
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.4",
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.0",
|
|
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.14",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.0",
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.0
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.0",
|
|
41
41
|
"background-only": "npm:background-only-canary@0.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"type-fest": "^4.41.0",
|
|
54
54
|
"typia": "9.3.1",
|
|
55
55
|
"typia-rspack-plugin": "2.1.0",
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.0",
|
|
56
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
57
|
-
"@lynx-js/
|
|
58
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.6-canary-20250523-5ddec124",
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.6",
|
|
59
59
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|