@lynx-js/react-rsbuild-plugin-canary 0.11.4-canary-20251108-3bc8903d → 0.11.4
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 +46 -47
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.11.4
|
|
3
|
+
## 0.11.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
With this change you can setup [React Compiler](https://react.dev/learn/react-compiler) for ReactLynx by `pluginBabel`:
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import { defineConfig } from
|
|
15
|
-
import { pluginBabel } from
|
|
14
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
15
|
+
import { pluginBabel } from '@rsbuild/plugin-babel'
|
|
16
16
|
|
|
17
17
|
export default defineConfig({
|
|
18
18
|
plugins: [
|
|
@@ -20,23 +20,22 @@
|
|
|
20
20
|
include: /\.(?:jsx|tsx)$/,
|
|
21
21
|
babelLoaderOptions(opts) {
|
|
22
22
|
opts.plugins?.unshift([
|
|
23
|
-
|
|
23
|
+
'babel-plugin-react-compiler',
|
|
24
24
|
// See https://react.dev/reference/react-compiler/configuration for config
|
|
25
25
|
{
|
|
26
26
|
// ReactLynx only supports target to version 17
|
|
27
|
-
target:
|
|
27
|
+
target: '17',
|
|
28
28
|
},
|
|
29
|
-
])
|
|
29
|
+
])
|
|
30
30
|
},
|
|
31
31
|
}),
|
|
32
32
|
],
|
|
33
|
-
})
|
|
33
|
+
})
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
- Updated dependencies [[`
|
|
37
|
-
- @lynx-js/react@0.
|
|
38
|
-
- @lynx-js/react-
|
|
39
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.11.4-canary-20251108032102-3bc8903d11407beb7bcc465e673ef554540d4309
|
|
36
|
+
- Updated dependencies [[`e7d186a`](https://github.com/lynx-family/lynx-stack/commit/e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3), [`0d7a4c3`](https://github.com/lynx-family/lynx-stack/commit/0d7a4c3d49d63e30d5f05c372ef99ee5cf2fcadd)]:
|
|
37
|
+
- @lynx-js/react-webpack-plugin@0.7.2
|
|
38
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.11.4
|
|
40
39
|
- @lynx-js/use-sync-external-store@1.5.0
|
|
41
40
|
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
42
41
|
|
|
@@ -234,28 +233,28 @@
|
|
|
234
233
|
|
|
235
234
|
```ts
|
|
236
235
|
type InlineChunkTestFunction = (params: {
|
|
237
|
-
size: number
|
|
238
|
-
name: string
|
|
239
|
-
}) => boolean
|
|
236
|
+
size: number
|
|
237
|
+
name: string
|
|
238
|
+
}) => boolean
|
|
240
239
|
|
|
241
|
-
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
240
|
+
type InlineChunkTest = RegExp | InlineChunkTestFunction
|
|
242
241
|
|
|
243
242
|
type InlineChunkConfig =
|
|
244
243
|
| boolean
|
|
245
244
|
| InlineChunkTest
|
|
246
|
-
| { enable?: boolean |
|
|
245
|
+
| { enable?: boolean | 'auto', test: InlineChunkTest }
|
|
247
246
|
```
|
|
248
247
|
|
|
249
248
|
```ts
|
|
250
|
-
import { defineConfig } from
|
|
249
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
251
250
|
|
|
252
251
|
export default defineConfig({
|
|
253
252
|
output: {
|
|
254
253
|
inlineScripts: ({ name, size }) => {
|
|
255
|
-
return name.includes(
|
|
254
|
+
return name.includes('foo') && size < 1000
|
|
256
255
|
},
|
|
257
256
|
},
|
|
258
|
-
})
|
|
257
|
+
})
|
|
259
258
|
```
|
|
260
259
|
|
|
261
260
|
- 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)]:
|
|
@@ -335,13 +334,13 @@
|
|
|
335
334
|
example:
|
|
336
335
|
|
|
337
336
|
```js
|
|
338
|
-
import { defineConfig } from
|
|
337
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
339
338
|
|
|
340
339
|
export default defineConfig({
|
|
341
340
|
output: {
|
|
342
341
|
inlineScripts: false,
|
|
343
342
|
},
|
|
344
|
-
})
|
|
343
|
+
})
|
|
345
344
|
```
|
|
346
345
|
|
|
347
346
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -428,7 +427,7 @@
|
|
|
428
427
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
429
428
|
|
|
430
429
|
```js
|
|
431
|
-
import { defineConfig } from
|
|
430
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
432
431
|
|
|
433
432
|
export default defineConfig({
|
|
434
433
|
tools: {
|
|
@@ -440,7 +439,7 @@
|
|
|
440
439
|
},
|
|
441
440
|
},
|
|
442
441
|
},
|
|
443
|
-
})
|
|
442
|
+
})
|
|
444
443
|
```
|
|
445
444
|
|
|
446
445
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -616,7 +615,7 @@
|
|
|
616
615
|
You may turn it off using `output.minify.css: false`:
|
|
617
616
|
|
|
618
617
|
```js
|
|
619
|
-
import { defineConfig } from
|
|
618
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
620
619
|
|
|
621
620
|
export default defineConfig({
|
|
622
621
|
output: {
|
|
@@ -624,18 +623,18 @@
|
|
|
624
623
|
css: false,
|
|
625
624
|
},
|
|
626
625
|
},
|
|
627
|
-
})
|
|
626
|
+
})
|
|
628
627
|
```
|
|
629
628
|
|
|
630
629
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
631
630
|
|
|
632
631
|
```js
|
|
633
|
-
import { defineConfig } from
|
|
634
|
-
import { pluginCssMinimizer } from
|
|
632
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
633
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
635
634
|
|
|
636
635
|
export default defineConfig({
|
|
637
636
|
plugins: [pluginCssMinimizer()],
|
|
638
|
-
})
|
|
637
|
+
})
|
|
639
638
|
```
|
|
640
639
|
|
|
641
640
|
### Patch Changes
|
|
@@ -715,18 +714,18 @@
|
|
|
715
714
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
716
715
|
|
|
717
716
|
```js
|
|
718
|
-
import { pluginReactLynx } from
|
|
719
|
-
import { defineConfig } from
|
|
717
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
718
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
720
719
|
|
|
721
720
|
export default defineConfig({
|
|
722
721
|
plugins: [
|
|
723
722
|
pluginReactLynx({
|
|
724
723
|
defineDCE: {
|
|
725
|
-
__SOME_FALSE_DEFINE__:
|
|
724
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
726
725
|
},
|
|
727
726
|
}),
|
|
728
727
|
],
|
|
729
|
-
})
|
|
728
|
+
})
|
|
730
729
|
```
|
|
731
730
|
|
|
732
731
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -734,20 +733,20 @@
|
|
|
734
733
|
For example, `import` initialized by dead code will be removed:
|
|
735
734
|
|
|
736
735
|
```js
|
|
737
|
-
import { foo } from
|
|
736
|
+
import { foo } from 'bar'
|
|
738
737
|
|
|
739
738
|
if (__SOME_FALSE_DEFINE__) {
|
|
740
|
-
foo()
|
|
741
|
-
console.log(
|
|
739
|
+
foo()
|
|
740
|
+
console.log('dead code')
|
|
742
741
|
} else {
|
|
743
|
-
console.log(
|
|
742
|
+
console.log('reachable code')
|
|
744
743
|
}
|
|
745
744
|
```
|
|
746
745
|
|
|
747
746
|
will be transformed to:
|
|
748
747
|
|
|
749
748
|
```js
|
|
750
|
-
console.log(
|
|
749
|
+
console.log('reachable code')
|
|
751
750
|
```
|
|
752
751
|
|
|
753
752
|
- Updated dependencies [8dd6cca]
|
|
@@ -790,18 +789,18 @@
|
|
|
790
789
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
791
790
|
|
|
792
791
|
```js
|
|
793
|
-
import { pluginReactLynx } from
|
|
794
|
-
import { defineConfig } from
|
|
792
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
793
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
795
794
|
|
|
796
795
|
export default defineConfig({
|
|
797
796
|
plugins: [
|
|
798
797
|
pluginReactLynx({
|
|
799
798
|
compat: {
|
|
800
|
-
removeComponentAttrRegex:
|
|
799
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
801
800
|
},
|
|
802
801
|
}),
|
|
803
802
|
],
|
|
804
|
-
})
|
|
803
|
+
})
|
|
805
804
|
```
|
|
806
805
|
|
|
807
806
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -820,11 +819,11 @@
|
|
|
820
819
|
|
|
821
820
|
```javascript
|
|
822
821
|
// bar.ts
|
|
823
|
-
import
|
|
822
|
+
import 'background-only'
|
|
824
823
|
|
|
825
824
|
export const bar = () => {
|
|
826
|
-
return
|
|
827
|
-
}
|
|
825
|
+
return 'bar'
|
|
826
|
+
}
|
|
828
827
|
```
|
|
829
828
|
|
|
830
829
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -833,15 +832,15 @@
|
|
|
833
832
|
|
|
834
833
|
```tsx
|
|
835
834
|
// App.tsx
|
|
836
|
-
import { bar } from
|
|
835
|
+
import { bar } from './bar.js'
|
|
837
836
|
|
|
838
837
|
function App() {
|
|
839
|
-
bar()
|
|
838
|
+
bar()
|
|
840
839
|
return (
|
|
841
840
|
<view>
|
|
842
841
|
<text>Hello, Lynx x rspeedy</text>
|
|
843
842
|
</view>
|
|
844
|
-
)
|
|
843
|
+
)
|
|
845
844
|
}
|
|
846
845
|
```
|
|
847
846
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.11.4
|
|
3
|
+
"version": "0.11.4",
|
|
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.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.4
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.11.4",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.4",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.2
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.7.2",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.3",
|
|
40
40
|
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.9.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": "^5.0.1",
|
|
55
55
|
"typia": "9.7.2",
|
|
56
56
|
"typia-rspack-plugin": "2.2.2",
|
|
57
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.4",
|
|
57
58
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.114.4-canary-20251108-3bc8903d",
|
|
59
59
|
"@lynx-js/vitest-setup": "0.0.0",
|
|
60
|
-
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.9
|
|
60
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.11.9"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@lynx-js/react": "*"
|