@lynx-js/react-rsbuild-plugin-canary 0.9.6 → 0.9.7-canary-20250416-8ca9fcbb
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 +54 -24
- package/dist/index.js +21 -21
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.9.7-canary-20250416092416-8ca9fcbbc86b0f0ac05ee4319876cdd5dd08d668
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Support overriding SWC configuration. ([#563](https://github.com/lynx-family/lynx-stack/pull/563))
|
|
8
|
+
|
|
9
|
+
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
tools: {
|
|
16
|
+
swc: {
|
|
17
|
+
jsc: {
|
|
18
|
+
transform: {
|
|
19
|
+
useDefineForClassFields: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`c0f06ba`](https://github.com/lynx-family/lynx-stack/commit/c0f06ba2398fcf1a0496c160db6b3d3c471a8937)]:
|
|
28
|
+
- @lynx-js/react@0.106.5-canary-20250416092416-8ca9fcbbc86b0f0ac05ee4319876cdd5dd08d668
|
|
29
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.9.7-canary-20250416092416-8ca9fcbbc86b0f0ac05ee4319876cdd5dd08d668
|
|
30
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.2
|
|
31
|
+
- @lynx-js/react-webpack-plugin@0.6.10
|
|
32
|
+
|
|
3
33
|
## 0.9.6
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -167,7 +197,7 @@
|
|
|
167
197
|
You may turn it off using `output.minify.css: false`:
|
|
168
198
|
|
|
169
199
|
```js
|
|
170
|
-
import { defineConfig } from
|
|
200
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
171
201
|
|
|
172
202
|
export default defineConfig({
|
|
173
203
|
output: {
|
|
@@ -175,18 +205,18 @@
|
|
|
175
205
|
css: false,
|
|
176
206
|
},
|
|
177
207
|
},
|
|
178
|
-
})
|
|
208
|
+
});
|
|
179
209
|
```
|
|
180
210
|
|
|
181
211
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
182
212
|
|
|
183
213
|
```js
|
|
184
|
-
import { defineConfig } from
|
|
185
|
-
import { pluginCssMinimizer } from
|
|
214
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
215
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
186
216
|
|
|
187
217
|
export default defineConfig({
|
|
188
218
|
plugins: [pluginCssMinimizer()],
|
|
189
|
-
})
|
|
219
|
+
});
|
|
190
220
|
```
|
|
191
221
|
|
|
192
222
|
### Patch Changes
|
|
@@ -266,18 +296,18 @@
|
|
|
266
296
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
267
297
|
|
|
268
298
|
```js
|
|
269
|
-
import { pluginReactLynx } from
|
|
270
|
-
import { defineConfig } from
|
|
299
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
300
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
271
301
|
|
|
272
302
|
export default defineConfig({
|
|
273
303
|
plugins: [
|
|
274
304
|
pluginReactLynx({
|
|
275
305
|
defineDCE: {
|
|
276
|
-
__SOME_FALSE_DEFINE__:
|
|
306
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
277
307
|
},
|
|
278
308
|
}),
|
|
279
309
|
],
|
|
280
|
-
})
|
|
310
|
+
});
|
|
281
311
|
```
|
|
282
312
|
|
|
283
313
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -285,20 +315,20 @@
|
|
|
285
315
|
For example, `import` initialized by dead code will be removed:
|
|
286
316
|
|
|
287
317
|
```js
|
|
288
|
-
import { foo } from
|
|
318
|
+
import { foo } from "bar";
|
|
289
319
|
|
|
290
320
|
if (__SOME_FALSE_DEFINE__) {
|
|
291
|
-
foo()
|
|
292
|
-
console.log(
|
|
321
|
+
foo();
|
|
322
|
+
console.log("dead code");
|
|
293
323
|
} else {
|
|
294
|
-
console.log(
|
|
324
|
+
console.log("reachable code");
|
|
295
325
|
}
|
|
296
326
|
```
|
|
297
327
|
|
|
298
328
|
will be transformed to:
|
|
299
329
|
|
|
300
330
|
```js
|
|
301
|
-
console.log(
|
|
331
|
+
console.log("reachable code");
|
|
302
332
|
```
|
|
303
333
|
|
|
304
334
|
- Updated dependencies [8dd6cca]
|
|
@@ -341,18 +371,18 @@
|
|
|
341
371
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
342
372
|
|
|
343
373
|
```js
|
|
344
|
-
import { pluginReactLynx } from
|
|
345
|
-
import { defineConfig } from
|
|
374
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
375
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
346
376
|
|
|
347
377
|
export default defineConfig({
|
|
348
378
|
plugins: [
|
|
349
379
|
pluginReactLynx({
|
|
350
380
|
compat: {
|
|
351
|
-
removeComponentAttrRegex:
|
|
381
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
352
382
|
},
|
|
353
383
|
}),
|
|
354
384
|
],
|
|
355
|
-
})
|
|
385
|
+
});
|
|
356
386
|
```
|
|
357
387
|
|
|
358
388
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -371,11 +401,11 @@
|
|
|
371
401
|
|
|
372
402
|
```javascript
|
|
373
403
|
// bar.ts
|
|
374
|
-
import
|
|
404
|
+
import "background-only";
|
|
375
405
|
|
|
376
406
|
export const bar = () => {
|
|
377
|
-
return
|
|
378
|
-
}
|
|
407
|
+
return "bar";
|
|
408
|
+
};
|
|
379
409
|
```
|
|
380
410
|
|
|
381
411
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -384,15 +414,15 @@
|
|
|
384
414
|
|
|
385
415
|
```tsx
|
|
386
416
|
// App.tsx
|
|
387
|
-
import { bar } from
|
|
417
|
+
import { bar } from "./bar.js";
|
|
388
418
|
|
|
389
419
|
function App() {
|
|
390
|
-
bar()
|
|
420
|
+
bar();
|
|
391
421
|
return (
|
|
392
422
|
<view>
|
|
393
423
|
<text>Hello, Lynx x rspeedy</text>
|
|
394
424
|
</view>
|
|
395
|
-
)
|
|
425
|
+
);
|
|
396
426
|
}
|
|
397
427
|
```
|
|
398
428
|
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27
|
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_web_webpack_plugin_6ba19e5a__ from "@lynx-js/web-webpack-plugin";
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_refresh_webpack_plugin_a01c5e97__ from "@lynx-js/react-refresh-webpack-plugin";
|
|
10
10
|
var __webpack_modules__ = {
|
|
11
|
-
"../../../node_modules/.pnpm/typia@9.
|
|
11
|
+
"../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
|
|
12
12
|
exports._accessExpressionAsString = void 0;
|
|
13
13
|
const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
|
|
14
14
|
exports._accessExpressionAsString = _accessExpressionAsString;
|
|
@@ -53,9 +53,9 @@ var __webpack_modules__ = {
|
|
|
53
53
|
"with"
|
|
54
54
|
]);
|
|
55
55
|
},
|
|
56
|
-
"../../../node_modules/.pnpm/typia@9.
|
|
56
|
+
"../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
57
57
|
exports._assertGuard = void 0;
|
|
58
|
-
const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.
|
|
58
|
+
const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs");
|
|
59
59
|
const _assertGuard = (exceptionable, props, factory)=>{
|
|
60
60
|
if (true === exceptionable) if (factory) throw factory(props);
|
|
61
61
|
else throw new TypeGuardError_1.TypeGuardError(props);
|
|
@@ -63,7 +63,7 @@ var __webpack_modules__ = {
|
|
|
63
63
|
};
|
|
64
64
|
exports._assertGuard = _assertGuard;
|
|
65
65
|
},
|
|
66
|
-
"../../../node_modules/.pnpm/typia@9.
|
|
66
|
+
"../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
67
67
|
__webpack_require__.r(__webpack_exports__);
|
|
68
68
|
__webpack_require__.d(__webpack_exports__, {
|
|
69
69
|
TypeGuardError: ()=>TypeGuardError
|
|
@@ -479,28 +479,28 @@ const applySplitChunksRule = (api)=>{
|
|
|
479
479
|
});
|
|
480
480
|
};
|
|
481
481
|
function applySWC(api) {
|
|
482
|
-
api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(
|
|
482
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig({
|
|
483
483
|
tools: {
|
|
484
|
-
swc
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
484
|
+
swc: {
|
|
485
|
+
jsc: {
|
|
486
|
+
transform: {
|
|
487
|
+
useDefineForClassFields: false,
|
|
488
|
+
optimizer: {
|
|
489
|
+
simplify: true
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
parser: {
|
|
493
|
+
syntax: "typescript",
|
|
494
|
+
tsx: false,
|
|
495
|
+
decorators: true
|
|
496
|
+
}
|
|
496
497
|
}
|
|
497
|
-
return config;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
}));
|
|
500
|
+
}, config));
|
|
501
501
|
}
|
|
502
|
-
var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.
|
|
503
|
-
var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.
|
|
502
|
+
var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
|
|
503
|
+
var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.1.1_@samchon+openapi@4.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_assertGuard.js");
|
|
504
504
|
const validateConfig = (()=>{
|
|
505
505
|
const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.enableSSR || "boolean" == typeof input.enableSSR) && (void 0 === input.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io4(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io5(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io6(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && null !== input.extractStr && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || "object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) && _io8(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
|
|
506
506
|
if ([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7-canary-20250416-8ca9fcbb",
|
|
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.3",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.9.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.9.7-canary-20250416-8ca9fcbb",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.2",
|
|
38
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",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "7.52.3",
|
|
45
45
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
46
|
-
"@rsbuild/core": "1.3.
|
|
46
|
+
"@rsbuild/core": "1.3.6",
|
|
47
47
|
"@rsbuild/plugin-sass": "1.3.1",
|
|
48
48
|
"@rsbuild/plugin-typed-css-modules": "1.0.2",
|
|
49
49
|
"@rsbuild/plugin-webpack-swc": "1.1.0",
|
|
50
50
|
"@rsbuild/webpack": "1.3.0",
|
|
51
|
-
"@samchon/openapi": "4.
|
|
51
|
+
"@samchon/openapi": "4.1.0",
|
|
52
52
|
"tailwindcss": "^3.4.17",
|
|
53
53
|
"type-fest": "^4.39.1",
|
|
54
|
-
"typia": "9.
|
|
55
|
-
"typia-rspack-plugin": "2.0.
|
|
56
|
-
"@lynx-js/
|
|
54
|
+
"typia": "9.1.1",
|
|
55
|
+
"typia-rspack-plugin": "2.0.1",
|
|
56
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.106.5-canary-20250416-8ca9fcbb",
|
|
57
57
|
"@lynx-js/vitest-setup": "0.0.0",
|
|
58
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.2-canary-20250416-8ca9fcbb"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@lynx-js/react": "*"
|