@lynx-js/react-rsbuild-plugin-canary 0.10.1 → 0.10.2-canary-20250530-7097f52a
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 +38 -28
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.10.2-canary-20250530062817-7097f52a53460527f786e2a8f150c3a907b8e722
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`7097f52`](https://github.com/lynx-family/lynx-stack/commit/7097f52a53460527f786e2a8f150c3a907b8e722), [`632f978`](https://github.com/lynx-family/lynx-stack/commit/632f9780424280efd5bc834cb919a49132c0f392)]:
|
|
8
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.2-canary-20250530062817-7097f52a53460527f786e2a8f150c3a907b8e722
|
|
9
|
+
- @lynx-js/react@0.109.1-canary-20250530062817-7097f52a53460527f786e2a8f150c3a907b8e722
|
|
10
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.3
|
|
11
|
+
- @lynx-js/react-webpack-plugin@0.6.14
|
|
12
|
+
|
|
3
13
|
## 0.10.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -24,13 +34,13 @@
|
|
|
24
34
|
example:
|
|
25
35
|
|
|
26
36
|
```js
|
|
27
|
-
import { defineConfig } from
|
|
37
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
28
38
|
|
|
29
39
|
export default defineConfig({
|
|
30
40
|
output: {
|
|
31
41
|
inlineScripts: false,
|
|
32
42
|
},
|
|
33
|
-
})
|
|
43
|
+
});
|
|
34
44
|
```
|
|
35
45
|
|
|
36
46
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -117,7 +127,7 @@
|
|
|
117
127
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
118
128
|
|
|
119
129
|
```js
|
|
120
|
-
import { defineConfig } from
|
|
130
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
121
131
|
|
|
122
132
|
export default defineConfig({
|
|
123
133
|
tools: {
|
|
@@ -129,7 +139,7 @@
|
|
|
129
139
|
},
|
|
130
140
|
},
|
|
131
141
|
},
|
|
132
|
-
})
|
|
142
|
+
});
|
|
133
143
|
```
|
|
134
144
|
|
|
135
145
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -305,7 +315,7 @@
|
|
|
305
315
|
You may turn it off using `output.minify.css: false`:
|
|
306
316
|
|
|
307
317
|
```js
|
|
308
|
-
import { defineConfig } from
|
|
318
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
309
319
|
|
|
310
320
|
export default defineConfig({
|
|
311
321
|
output: {
|
|
@@ -313,18 +323,18 @@
|
|
|
313
323
|
css: false,
|
|
314
324
|
},
|
|
315
325
|
},
|
|
316
|
-
})
|
|
326
|
+
});
|
|
317
327
|
```
|
|
318
328
|
|
|
319
329
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
320
330
|
|
|
321
331
|
```js
|
|
322
|
-
import { defineConfig } from
|
|
323
|
-
import { pluginCssMinimizer } from
|
|
332
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
333
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
324
334
|
|
|
325
335
|
export default defineConfig({
|
|
326
336
|
plugins: [pluginCssMinimizer()],
|
|
327
|
-
})
|
|
337
|
+
});
|
|
328
338
|
```
|
|
329
339
|
|
|
330
340
|
### Patch Changes
|
|
@@ -404,18 +414,18 @@
|
|
|
404
414
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
405
415
|
|
|
406
416
|
```js
|
|
407
|
-
import { pluginReactLynx } from
|
|
408
|
-
import { defineConfig } from
|
|
417
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
418
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
409
419
|
|
|
410
420
|
export default defineConfig({
|
|
411
421
|
plugins: [
|
|
412
422
|
pluginReactLynx({
|
|
413
423
|
defineDCE: {
|
|
414
|
-
__SOME_FALSE_DEFINE__:
|
|
424
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
415
425
|
},
|
|
416
426
|
}),
|
|
417
427
|
],
|
|
418
|
-
})
|
|
428
|
+
});
|
|
419
429
|
```
|
|
420
430
|
|
|
421
431
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -423,20 +433,20 @@
|
|
|
423
433
|
For example, `import` initialized by dead code will be removed:
|
|
424
434
|
|
|
425
435
|
```js
|
|
426
|
-
import { foo } from
|
|
436
|
+
import { foo } from "bar";
|
|
427
437
|
|
|
428
438
|
if (__SOME_FALSE_DEFINE__) {
|
|
429
|
-
foo()
|
|
430
|
-
console.log(
|
|
439
|
+
foo();
|
|
440
|
+
console.log("dead code");
|
|
431
441
|
} else {
|
|
432
|
-
console.log(
|
|
442
|
+
console.log("reachable code");
|
|
433
443
|
}
|
|
434
444
|
```
|
|
435
445
|
|
|
436
446
|
will be transformed to:
|
|
437
447
|
|
|
438
448
|
```js
|
|
439
|
-
console.log(
|
|
449
|
+
console.log("reachable code");
|
|
440
450
|
```
|
|
441
451
|
|
|
442
452
|
- Updated dependencies [8dd6cca]
|
|
@@ -479,18 +489,18 @@
|
|
|
479
489
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
480
490
|
|
|
481
491
|
```js
|
|
482
|
-
import { pluginReactLynx } from
|
|
483
|
-
import { defineConfig } from
|
|
492
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
493
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
484
494
|
|
|
485
495
|
export default defineConfig({
|
|
486
496
|
plugins: [
|
|
487
497
|
pluginReactLynx({
|
|
488
498
|
compat: {
|
|
489
|
-
removeComponentAttrRegex:
|
|
499
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
490
500
|
},
|
|
491
501
|
}),
|
|
492
502
|
],
|
|
493
|
-
})
|
|
503
|
+
});
|
|
494
504
|
```
|
|
495
505
|
|
|
496
506
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -509,11 +519,11 @@
|
|
|
509
519
|
|
|
510
520
|
```javascript
|
|
511
521
|
// bar.ts
|
|
512
|
-
import
|
|
522
|
+
import "background-only";
|
|
513
523
|
|
|
514
524
|
export const bar = () => {
|
|
515
|
-
return
|
|
516
|
-
}
|
|
525
|
+
return "bar";
|
|
526
|
+
};
|
|
517
527
|
```
|
|
518
528
|
|
|
519
529
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -522,15 +532,15 @@
|
|
|
522
532
|
|
|
523
533
|
```tsx
|
|
524
534
|
// App.tsx
|
|
525
|
-
import { bar } from
|
|
535
|
+
import { bar } from "./bar.js";
|
|
526
536
|
|
|
527
537
|
function App() {
|
|
528
|
-
bar()
|
|
538
|
+
bar();
|
|
529
539
|
return (
|
|
530
540
|
<view>
|
|
531
541
|
<text>Hello, Lynx x rspeedy</text>
|
|
532
542
|
</view>
|
|
533
|
-
)
|
|
543
|
+
);
|
|
534
544
|
}
|
|
535
545
|
```
|
|
536
546
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2-canary-20250530-7097f52a",
|
|
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.5.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.2-canary-20250530-7097f52a",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.3",
|
|
38
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
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.
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.1-canary-20250530-7097f52a",
|
|
57
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
58
|
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
59
|
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.7"
|