@lynx-js/react-rsbuild-plugin-canary 0.9.4-canary-20250331-e295379a → 0.9.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 +29 -30
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.9.4
|
|
3
|
+
## 0.9.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
- Convert background-only files from js to ts ([#346](https://github.com/lynx-family/lynx-stack/pull/346))
|
|
10
10
|
|
|
11
|
-
- Updated dependencies [[`f849117`](https://github.com/lynx-family/lynx-stack/commit/f84911731faa4d0f6373d1202b9b2cabb0bafc48), [`d730101`](https://github.com/lynx-family/lynx-stack/commit/d7301017a383b8825cdc813a649ef26ce1c37641), [`42217c2`](https://github.com/lynx-family/lynx-stack/commit/42217c2c77a33e729977fc7108b218a1cb868e6a), [`f03bd4a`](https://github.com/lynx-family/lynx-stack/commit/f03bd4a62f81902ba55caf10df56447c89743e62)
|
|
12
|
-
- @lynx-js/react-webpack-plugin@0.6.10
|
|
13
|
-
- @lynx-js/template-webpack-plugin@0.6.7
|
|
14
|
-
- @lynx-js/react@0.
|
|
15
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.9.4-canary-20250331083950-e295379ac6303fc6cd9fd475b20947f4ecbdbc80
|
|
11
|
+
- Updated dependencies [[`f849117`](https://github.com/lynx-family/lynx-stack/commit/f84911731faa4d0f6373d1202b9b2cabb0bafc48), [`d730101`](https://github.com/lynx-family/lynx-stack/commit/d7301017a383b8825cdc813a649ef26ce1c37641), [`42217c2`](https://github.com/lynx-family/lynx-stack/commit/42217c2c77a33e729977fc7108b218a1cb868e6a), [`f03bd4a`](https://github.com/lynx-family/lynx-stack/commit/f03bd4a62f81902ba55caf10df56447c89743e62)]:
|
|
12
|
+
- @lynx-js/react-webpack-plugin@0.6.10
|
|
13
|
+
- @lynx-js/template-webpack-plugin@0.6.7
|
|
14
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.9.4
|
|
16
15
|
- @lynx-js/react-refresh-webpack-plugin@0.3.2
|
|
17
16
|
- @lynx-js/css-extract-webpack-plugin@0.5.2
|
|
18
17
|
- @lynx-js/web-webpack-plugin@0.6.3
|
|
@@ -140,7 +139,7 @@
|
|
|
140
139
|
You may turn it off using `output.minify.css: false`:
|
|
141
140
|
|
|
142
141
|
```js
|
|
143
|
-
import { defineConfig } from
|
|
142
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
144
143
|
|
|
145
144
|
export default defineConfig({
|
|
146
145
|
output: {
|
|
@@ -148,18 +147,18 @@
|
|
|
148
147
|
css: false,
|
|
149
148
|
},
|
|
150
149
|
},
|
|
151
|
-
})
|
|
150
|
+
})
|
|
152
151
|
```
|
|
153
152
|
|
|
154
153
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
155
154
|
|
|
156
155
|
```js
|
|
157
|
-
import { defineConfig } from
|
|
158
|
-
import { pluginCssMinimizer } from
|
|
156
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
157
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
159
158
|
|
|
160
159
|
export default defineConfig({
|
|
161
160
|
plugins: [pluginCssMinimizer()],
|
|
162
|
-
})
|
|
161
|
+
})
|
|
163
162
|
```
|
|
164
163
|
|
|
165
164
|
### Patch Changes
|
|
@@ -239,18 +238,18 @@
|
|
|
239
238
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
240
239
|
|
|
241
240
|
```js
|
|
242
|
-
import { pluginReactLynx } from
|
|
243
|
-
import { defineConfig } from
|
|
241
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
242
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
244
243
|
|
|
245
244
|
export default defineConfig({
|
|
246
245
|
plugins: [
|
|
247
246
|
pluginReactLynx({
|
|
248
247
|
defineDCE: {
|
|
249
|
-
__SOME_FALSE_DEFINE__:
|
|
248
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
250
249
|
},
|
|
251
250
|
}),
|
|
252
251
|
],
|
|
253
|
-
})
|
|
252
|
+
})
|
|
254
253
|
```
|
|
255
254
|
|
|
256
255
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -258,20 +257,20 @@
|
|
|
258
257
|
For example, `import` initialized by dead code will be removed:
|
|
259
258
|
|
|
260
259
|
```js
|
|
261
|
-
import { foo } from
|
|
260
|
+
import { foo } from 'bar'
|
|
262
261
|
|
|
263
262
|
if (__SOME_FALSE_DEFINE__) {
|
|
264
|
-
foo()
|
|
265
|
-
console.log(
|
|
263
|
+
foo()
|
|
264
|
+
console.log('dead code')
|
|
266
265
|
} else {
|
|
267
|
-
console.log(
|
|
266
|
+
console.log('reachable code')
|
|
268
267
|
}
|
|
269
268
|
```
|
|
270
269
|
|
|
271
270
|
will be transformed to:
|
|
272
271
|
|
|
273
272
|
```js
|
|
274
|
-
console.log(
|
|
273
|
+
console.log('reachable code')
|
|
275
274
|
```
|
|
276
275
|
|
|
277
276
|
- Updated dependencies [8dd6cca]
|
|
@@ -314,18 +313,18 @@
|
|
|
314
313
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
315
314
|
|
|
316
315
|
```js
|
|
317
|
-
import { pluginReactLynx } from
|
|
318
|
-
import { defineConfig } from
|
|
316
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
317
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
319
318
|
|
|
320
319
|
export default defineConfig({
|
|
321
320
|
plugins: [
|
|
322
321
|
pluginReactLynx({
|
|
323
322
|
compat: {
|
|
324
|
-
removeComponentAttrRegex:
|
|
323
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
325
324
|
},
|
|
326
325
|
}),
|
|
327
326
|
],
|
|
328
|
-
})
|
|
327
|
+
})
|
|
329
328
|
```
|
|
330
329
|
|
|
331
330
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -344,11 +343,11 @@
|
|
|
344
343
|
|
|
345
344
|
```javascript
|
|
346
345
|
// bar.ts
|
|
347
|
-
import
|
|
346
|
+
import 'background-only'
|
|
348
347
|
|
|
349
348
|
export const bar = () => {
|
|
350
|
-
return
|
|
351
|
-
}
|
|
349
|
+
return 'bar'
|
|
350
|
+
}
|
|
352
351
|
```
|
|
353
352
|
|
|
354
353
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -357,15 +356,15 @@
|
|
|
357
356
|
|
|
358
357
|
```tsx
|
|
359
358
|
// App.tsx
|
|
360
|
-
import { bar } from
|
|
359
|
+
import { bar } from './bar.js'
|
|
361
360
|
|
|
362
361
|
function App() {
|
|
363
|
-
bar()
|
|
362
|
+
bar()
|
|
364
363
|
return (
|
|
365
364
|
<view>
|
|
366
365
|
<text>Hello, Lynx x rspeedy</text>
|
|
367
366
|
</view>
|
|
368
|
-
)
|
|
367
|
+
)
|
|
369
368
|
}
|
|
370
369
|
```
|
|
371
370
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.9.4
|
|
3
|
+
"version": "0.9.4",
|
|
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.2",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.9.4
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.9.4",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.2",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.10
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.10",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.0.9",
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.6.7
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.6.7",
|
|
41
41
|
"@lynx-js/web-webpack-plugin": "npm:@lynx-js/web-webpack-plugin-canary@0.6.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"type-fest": "^4.38.0",
|
|
53
53
|
"typia": "7.6.4",
|
|
54
54
|
"typia-rspack-plugin": "^1.0.2",
|
|
55
|
-
"@lynx-js/react": "npm:@lynx-js/react-canary@0.106.2
|
|
56
|
-
"@lynx-js/
|
|
57
|
-
"@lynx-js/
|
|
55
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.106.2",
|
|
56
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.8.7",
|
|
57
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@lynx-js/react": "*"
|