@lynx-js/react-rsbuild-plugin-canary 0.10.2-canary-20250530-5f0ce5c3 → 0.10.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 +33 -34
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.2
|
|
3
|
+
## 0.10.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fix lazy bundle build failed on Rspeedy v0.9.8 (with `output.iife: true`). ([#972](https://github.com/lynx-family/lynx-stack/pull/972))
|
|
8
8
|
|
|
9
|
-
- Updated dependencies [[`81361f3`](https://github.com/lynx-family/lynx-stack/commit/81361f3c72001ffdf07f2f9f53f8e43d2ff7c961), [`7097f52`](https://github.com/lynx-family/lynx-stack/commit/7097f52a53460527f786e2a8f150c3a907b8e722), [`
|
|
10
|
-
- @lynx-js/react-webpack-plugin@0.6.15
|
|
11
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.2
|
|
12
|
-
- @lynx-js/
|
|
13
|
-
- @lynx-js/template-webpack-plugin@0.7.1-canary-20250530131803-5f0ce5c3bc910a34e20281aa10e84228aea3a888
|
|
9
|
+
- Updated dependencies [[`81361f3`](https://github.com/lynx-family/lynx-stack/commit/81361f3c72001ffdf07f2f9f53f8e43d2ff7c961), [`7097f52`](https://github.com/lynx-family/lynx-stack/commit/7097f52a53460527f786e2a8f150c3a907b8e722), [`43cd520`](https://github.com/lynx-family/lynx-stack/commit/43cd520df78c3dc77aeb347a0be8c8f3ff62cc3f)]:
|
|
10
|
+
- @lynx-js/react-webpack-plugin@0.6.15
|
|
11
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.2
|
|
12
|
+
- @lynx-js/template-webpack-plugin@0.7.1
|
|
14
13
|
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
15
14
|
- @lynx-js/css-extract-webpack-plugin@0.5.4
|
|
16
15
|
|
|
@@ -38,13 +37,13 @@
|
|
|
38
37
|
example:
|
|
39
38
|
|
|
40
39
|
```js
|
|
41
|
-
import { defineConfig } from
|
|
40
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
42
41
|
|
|
43
42
|
export default defineConfig({
|
|
44
43
|
output: {
|
|
45
44
|
inlineScripts: false,
|
|
46
45
|
},
|
|
47
|
-
})
|
|
46
|
+
})
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -131,7 +130,7 @@
|
|
|
131
130
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
132
131
|
|
|
133
132
|
```js
|
|
134
|
-
import { defineConfig } from
|
|
133
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
135
134
|
|
|
136
135
|
export default defineConfig({
|
|
137
136
|
tools: {
|
|
@@ -143,7 +142,7 @@
|
|
|
143
142
|
},
|
|
144
143
|
},
|
|
145
144
|
},
|
|
146
|
-
})
|
|
145
|
+
})
|
|
147
146
|
```
|
|
148
147
|
|
|
149
148
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -319,7 +318,7 @@
|
|
|
319
318
|
You may turn it off using `output.minify.css: false`:
|
|
320
319
|
|
|
321
320
|
```js
|
|
322
|
-
import { defineConfig } from
|
|
321
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
323
322
|
|
|
324
323
|
export default defineConfig({
|
|
325
324
|
output: {
|
|
@@ -327,18 +326,18 @@
|
|
|
327
326
|
css: false,
|
|
328
327
|
},
|
|
329
328
|
},
|
|
330
|
-
})
|
|
329
|
+
})
|
|
331
330
|
```
|
|
332
331
|
|
|
333
332
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
334
333
|
|
|
335
334
|
```js
|
|
336
|
-
import { defineConfig } from
|
|
337
|
-
import { pluginCssMinimizer } from
|
|
335
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
336
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
338
337
|
|
|
339
338
|
export default defineConfig({
|
|
340
339
|
plugins: [pluginCssMinimizer()],
|
|
341
|
-
})
|
|
340
|
+
})
|
|
342
341
|
```
|
|
343
342
|
|
|
344
343
|
### Patch Changes
|
|
@@ -418,18 +417,18 @@
|
|
|
418
417
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
419
418
|
|
|
420
419
|
```js
|
|
421
|
-
import { pluginReactLynx } from
|
|
422
|
-
import { defineConfig } from
|
|
420
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
421
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
423
422
|
|
|
424
423
|
export default defineConfig({
|
|
425
424
|
plugins: [
|
|
426
425
|
pluginReactLynx({
|
|
427
426
|
defineDCE: {
|
|
428
|
-
__SOME_FALSE_DEFINE__:
|
|
427
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
429
428
|
},
|
|
430
429
|
}),
|
|
431
430
|
],
|
|
432
|
-
})
|
|
431
|
+
})
|
|
433
432
|
```
|
|
434
433
|
|
|
435
434
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -437,20 +436,20 @@
|
|
|
437
436
|
For example, `import` initialized by dead code will be removed:
|
|
438
437
|
|
|
439
438
|
```js
|
|
440
|
-
import { foo } from
|
|
439
|
+
import { foo } from 'bar'
|
|
441
440
|
|
|
442
441
|
if (__SOME_FALSE_DEFINE__) {
|
|
443
|
-
foo()
|
|
444
|
-
console.log(
|
|
442
|
+
foo()
|
|
443
|
+
console.log('dead code')
|
|
445
444
|
} else {
|
|
446
|
-
console.log(
|
|
445
|
+
console.log('reachable code')
|
|
447
446
|
}
|
|
448
447
|
```
|
|
449
448
|
|
|
450
449
|
will be transformed to:
|
|
451
450
|
|
|
452
451
|
```js
|
|
453
|
-
console.log(
|
|
452
|
+
console.log('reachable code')
|
|
454
453
|
```
|
|
455
454
|
|
|
456
455
|
- Updated dependencies [8dd6cca]
|
|
@@ -493,18 +492,18 @@
|
|
|
493
492
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
494
493
|
|
|
495
494
|
```js
|
|
496
|
-
import { pluginReactLynx } from
|
|
497
|
-
import { defineConfig } from
|
|
495
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
496
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
498
497
|
|
|
499
498
|
export default defineConfig({
|
|
500
499
|
plugins: [
|
|
501
500
|
pluginReactLynx({
|
|
502
501
|
compat: {
|
|
503
|
-
removeComponentAttrRegex:
|
|
502
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
504
503
|
},
|
|
505
504
|
}),
|
|
506
505
|
],
|
|
507
|
-
})
|
|
506
|
+
})
|
|
508
507
|
```
|
|
509
508
|
|
|
510
509
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -523,11 +522,11 @@
|
|
|
523
522
|
|
|
524
523
|
```javascript
|
|
525
524
|
// bar.ts
|
|
526
|
-
import
|
|
525
|
+
import 'background-only'
|
|
527
526
|
|
|
528
527
|
export const bar = () => {
|
|
529
|
-
return
|
|
530
|
-
}
|
|
528
|
+
return 'bar'
|
|
529
|
+
}
|
|
531
530
|
```
|
|
532
531
|
|
|
533
532
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -536,15 +535,15 @@
|
|
|
536
535
|
|
|
537
536
|
```tsx
|
|
538
537
|
// App.tsx
|
|
539
|
-
import { bar } from
|
|
538
|
+
import { bar } from './bar.js'
|
|
540
539
|
|
|
541
540
|
function App() {
|
|
542
|
-
bar()
|
|
541
|
+
bar()
|
|
543
542
|
return (
|
|
544
543
|
<view>
|
|
545
544
|
<text>Hello, Lynx x rspeedy</text>
|
|
546
545
|
</view>
|
|
547
|
-
)
|
|
546
|
+
)
|
|
548
547
|
}
|
|
549
548
|
```
|
|
550
549
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.2
|
|
3
|
+
"version": "0.10.2",
|
|
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.5.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.2
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.2",
|
|
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.15
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.15",
|
|
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.1
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.1",
|
|
41
41
|
"background-only": "npm:background-only-canary@0.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
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.1
|
|
57
|
-
"@lynx-js/
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.1",
|
|
57
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.8",
|
|
58
58
|
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
|
-
"@lynx-js/
|
|
59
|
+
"@lynx-js/react-transform": "0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|