@lynx-js/react-rsbuild-plugin-canary 0.10.0 → 0.10.1-canary-20250526-06f2fa10

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @lynx-js/react-rsbuild-plugin
2
2
 
3
+ ## 0.10.1-canary-20250526102746-06f2fa10ef3880495c80d25680163a8f41f7462a
4
+
5
+ ### Patch Changes
6
+
7
+ - The default value of `output.inlineScripts` should be `true` on `@lynx-js/rspeedy` <= v0.9.6. ([#914](https://github.com/lynx-family/lynx-stack/pull/914))
8
+
9
+ - Updated dependencies []:
10
+ - @lynx-js/react-alias-rsbuild-plugin@0.10.1-canary-20250526102746-06f2fa10ef3880495c80d25680163a8f41f7462a
11
+
3
12
  ## 0.10.0
4
13
 
5
14
  ### Minor Changes
@@ -15,13 +24,13 @@
15
24
  example:
16
25
 
17
26
  ```js
18
- import { defineConfig } from '@lynx-js/rspeedy'
27
+ import { defineConfig } from "@lynx-js/rspeedy";
19
28
 
20
29
  export default defineConfig({
21
30
  output: {
22
31
  inlineScripts: false,
23
32
  },
24
- })
33
+ });
25
34
  ```
26
35
 
27
36
  - Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
@@ -108,7 +117,7 @@
108
117
  Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
109
118
 
110
119
  ```js
111
- import { defineConfig } from '@lynx-js/rspeedy'
120
+ import { defineConfig } from "@lynx-js/rspeedy";
112
121
 
113
122
  export default defineConfig({
114
123
  tools: {
@@ -120,7 +129,7 @@
120
129
  },
121
130
  },
122
131
  },
123
- })
132
+ });
124
133
  ```
125
134
 
126
135
  - Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
@@ -296,7 +305,7 @@
296
305
  You may turn it off using `output.minify.css: false`:
297
306
 
298
307
  ```js
299
- import { defineConfig } from '@lynx-js/rspeedy'
308
+ import { defineConfig } from "@lynx-js/rspeedy";
300
309
 
301
310
  export default defineConfig({
302
311
  output: {
@@ -304,18 +313,18 @@
304
313
  css: false,
305
314
  },
306
315
  },
307
- })
316
+ });
308
317
  ```
309
318
 
310
319
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
311
320
 
312
321
  ```js
313
- import { defineConfig } from '@lynx-js/rspeedy'
314
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
322
+ import { defineConfig } from "@lynx-js/rspeedy";
323
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
315
324
 
316
325
  export default defineConfig({
317
326
  plugins: [pluginCssMinimizer()],
318
- })
327
+ });
319
328
  ```
320
329
 
321
330
  ### Patch Changes
@@ -395,18 +404,18 @@
395
404
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
396
405
 
397
406
  ```js
398
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
399
- import { defineConfig } from '@lynx-js/rspeedy'
407
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
408
+ import { defineConfig } from "@lynx-js/rspeedy";
400
409
 
401
410
  export default defineConfig({
402
411
  plugins: [
403
412
  pluginReactLynx({
404
413
  defineDCE: {
405
- __SOME_FALSE_DEFINE__: 'false',
414
+ __SOME_FALSE_DEFINE__: "false",
406
415
  },
407
416
  }),
408
417
  ],
409
- })
418
+ });
410
419
  ```
411
420
 
412
421
  Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
@@ -414,20 +423,20 @@
414
423
  For example, `import` initialized by dead code will be removed:
415
424
 
416
425
  ```js
417
- import { foo } from 'bar'
426
+ import { foo } from "bar";
418
427
 
419
428
  if (__SOME_FALSE_DEFINE__) {
420
- foo()
421
- console.log('dead code')
429
+ foo();
430
+ console.log("dead code");
422
431
  } else {
423
- console.log('reachable code')
432
+ console.log("reachable code");
424
433
  }
425
434
  ```
426
435
 
427
436
  will be transformed to:
428
437
 
429
438
  ```js
430
- console.log('reachable code')
439
+ console.log("reachable code");
431
440
  ```
432
441
 
433
442
  - Updated dependencies [8dd6cca]
@@ -470,18 +479,18 @@
470
479
  - a30c83d: Add `compat.removeComponentAttrRegex`.
471
480
 
472
481
  ```js
473
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
474
- import { defineConfig } from '@lynx-js/rspeedy'
482
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
483
+ import { defineConfig } from "@lynx-js/rspeedy";
475
484
 
476
485
  export default defineConfig({
477
486
  plugins: [
478
487
  pluginReactLynx({
479
488
  compat: {
480
- removeComponentAttrRegex: 'YOUR REGEX',
489
+ removeComponentAttrRegex: "YOUR REGEX",
481
490
  },
482
491
  }),
483
492
  ],
484
- })
493
+ });
485
494
  ```
486
495
 
487
496
  NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
@@ -500,11 +509,11 @@
500
509
 
501
510
  ```javascript
502
511
  // bar.ts
503
- import 'background-only'
512
+ import "background-only";
504
513
 
505
514
  export const bar = () => {
506
- return 'bar'
507
- }
515
+ return "bar";
516
+ };
508
517
  ```
509
518
 
510
519
  If `bar` is called in `main-thread`, build time error will be triggered.
@@ -513,15 +522,15 @@
513
522
 
514
523
  ```tsx
515
524
  // App.tsx
516
- import { bar } from './bar.js'
525
+ import { bar } from "./bar.js";
517
526
 
518
527
  function App() {
519
- bar()
528
+ bar();
520
529
  return (
521
530
  <view>
522
531
  <text>Hello, Lynx x rspeedy</text>
523
532
  </view>
524
- )
533
+ );
525
534
  }
526
535
  ```
527
536
 
package/dist/index.js CHANGED
@@ -1146,13 +1146,18 @@ function pluginReactLynx(userOptions) {
1146
1146
  applySWC(api);
1147
1147
  api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
1148
1148
  const userConfig = api.getRsbuildConfig('original');
1149
- if (void 0 === userConfig.source?.include) return mergeRsbuildConfig(config, {
1149
+ if (void 0 === userConfig.source?.include) config = mergeRsbuildConfig(config, {
1150
1150
  source: {
1151
1151
  include: [
1152
1152
  /\.(?:js|mjs|cjs)$/
1153
1153
  ]
1154
1154
  }
1155
1155
  });
1156
+ if (void 0 === userConfig.output?.inlineScripts) config = mergeRsbuildConfig(config, {
1157
+ output: {
1158
+ inlineScripts: true
1159
+ }
1160
+ });
1156
1161
  return config;
1157
1162
  });
1158
1163
  if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-rsbuild-plugin-canary",
3
- "version": "0.10.0",
3
+ "version": "0.10.1-canary-20250526-06f2fa10",
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.0",
36
+ "@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.1-canary-20250526-06f2fa10",
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",
@@ -54,9 +54,9 @@
54
54
  "typia": "9.3.1",
55
55
  "typia-rspack-plugin": "2.1.0",
56
56
  "@lynx-js/react": "npm:@lynx-js/react-canary@0.109.0",
57
+ "@lynx-js/vitest-setup": "0.0.0",
57
58
  "@lynx-js/react-transform": "0.2.0",
58
- "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.6",
59
- "@lynx-js/vitest-setup": "0.0.0"
59
+ "@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.7-canary-20250526-06f2fa10"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@lynx-js/react": "*"