@lynx-js/react-rsbuild-plugin 0.9.10 → 0.10.1

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/dist/index.d.ts CHANGED
@@ -1,8 +1,766 @@
1
- /**
2
- * @packageDocumentation
3
- *
4
- * A rsbuild plugin that integrates with ReactLynx.
5
- */
6
- export { pluginReactLynx } from './pluginReactLynx.js';
7
- export type { PluginReactLynxOptions } from './pluginReactLynx.js';
8
- export { LAYERS } from '@lynx-js/react-webpack-plugin';
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * A rsbuild plugin that integrates with ReactLynx.
5
+ */
6
+
7
+ import { LAYERS } from '@lynx-js/react-webpack-plugin';
8
+ import type { RsbuildPlugin } from '@rsbuild/core';
9
+
10
+ /**
11
+ * {@inheritdoc CompatVisitorConfig.addComponentElement}
12
+ * @public
13
+ */
14
+ export declare interface AddComponentElementConfig {
15
+ /**
16
+ * @public
17
+ * Whether to only add component element during compilation
18
+ *
19
+ * @example
20
+ *
21
+ * Note that this only take effects on `Component` imported from {@link CompatVisitorConfig.oldRuntimePkg}.
22
+ *
23
+ * ```js
24
+ * import { defineConfig } from '@lynx-js/rspeedy'
25
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
26
+ *
27
+ * export default defineConfig({
28
+ * plugins: [
29
+ * pluginReactLynx({
30
+ * compat: {
31
+ * addComponentElement: { compilerOnly: true }
32
+ * },
33
+ * })
34
+ * ],
35
+ * })
36
+ * ```
37
+ */
38
+ compilerOnly: boolean
39
+ }
40
+
41
+ /**
42
+ * {@inheritdoc PluginReactLynxOptions.compat}
43
+ * @public
44
+ */
45
+ export declare interface CompatVisitorConfig {
46
+ /** @internal */
47
+ target: 'LEPUS' | 'JS' | 'MIXED'
48
+ /**
49
+ * @public
50
+ * Specifies the list of component package names that need compatibility processing
51
+ *
52
+ * @remarks
53
+ * Default value: `['@lynx-js/react-components']`
54
+ *
55
+ * @example
56
+ *
57
+ * ```js
58
+ * import { defineConfig } from '@lynx-js/rspeedy'
59
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
60
+ *
61
+ * export default defineConfig({
62
+ * plugins: [
63
+ * pluginReactLynx({
64
+ * compat: {
65
+ * componentsPkg: ['@my-org/components', '@legacy/ui-kit']
66
+ * },
67
+ * })
68
+ * ],
69
+ * })
70
+ * ```
71
+ */
72
+ componentsPkg: Array<string>
73
+ /**
74
+ * @public
75
+ * Specifies the list of old runtime package names that need compatibility processing
76
+ *
77
+ * @remarks
78
+ * Default value: `['@lynx-js/react-runtime']`
79
+ *
80
+ * @example
81
+ *
82
+ * ```js
83
+ * import { defineConfig } from '@lynx-js/rspeedy'
84
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
85
+ *
86
+ * export default defineConfig({
87
+ * plugins: [
88
+ * pluginReactLynx({
89
+ * compat: {
90
+ * oldRuntimePkg: ['@my-org/runtime', '@legacy/runtime']
91
+ * },
92
+ * })
93
+ * ],
94
+ * })
95
+ * ```
96
+ */
97
+ oldRuntimePkg: Array<string>
98
+ /**
99
+ * @public
100
+ * Specifies the new runtime package name
101
+ *
102
+ * @remarks
103
+ * Default value: `'@lynx-js/react'`
104
+ *
105
+ * @example
106
+ *
107
+ * ```js
108
+ * import { defineConfig } from '@lynx-js/rspeedy'
109
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
110
+ *
111
+ * export default defineConfig({
112
+ * plugins: [
113
+ * pluginReactLynx({
114
+ * compat: {
115
+ * newRuntimePkg: '@my-org/react'
116
+ * },
117
+ * })
118
+ * ],
119
+ * })
120
+ * ```
121
+ */
122
+ newRuntimePkg: string
123
+ /**
124
+ * @public
125
+ * Specifies additional component attributes list, these attributes will be passed to the wrapped `<view>` instead of the component.
126
+ *
127
+ * @remarks
128
+ * This only takes effect when {@link CompatVisitorConfig.addComponentElement} is enabled.
129
+ *
130
+ * Default value: `[]`
131
+ *
132
+ * @example
133
+ *
134
+ * ```js
135
+ * import { defineConfig } from '@lynx-js/rspeedy'
136
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
137
+ *
138
+ * export default defineConfig({
139
+ * plugins: [
140
+ * pluginReactLynx({
141
+ * compat: {
142
+ * additionalComponentAttributes: ['custom-attr', 'data-special']
143
+ * },
144
+ * })
145
+ * ],
146
+ * })
147
+ * ```
148
+ */
149
+ additionalComponentAttributes: Array<string>
150
+ /**
151
+ * @public
152
+ * Controls whether to add wrapper elements for components
153
+ *
154
+ * @remarks
155
+ * Default value: `false`
156
+ *
157
+ * @example
158
+ *
159
+ * Add a `<view>` wrapper element for all components during runtime.
160
+ *
161
+ * ```js
162
+ * import { defineConfig } from '@lynx-js/rspeedy'
163
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
164
+ *
165
+ * export default defineConfig({
166
+ * plugins: [
167
+ * pluginReactLynx({
168
+ * compat: {
169
+ * addComponentElement: true
170
+ * },
171
+ * })
172
+ * ],
173
+ * })
174
+ * ```
175
+ *
176
+ * @example
177
+ *
178
+ * Only add component element during compilation.
179
+ * Note that this only take effects on `Component` imported from {@link CompatVisitorConfig.oldRuntimePkg}.
180
+ *
181
+ * ```js
182
+ * import { defineConfig } from '@lynx-js/rspeedy'
183
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
184
+ *
185
+ * export default defineConfig({
186
+ * plugins: [
187
+ * pluginReactLynx({
188
+ * compat: {
189
+ * addComponentElement: { compilerOnly: true }
190
+ * },
191
+ * })
192
+ * ],
193
+ * })
194
+ * ```
195
+ */
196
+ addComponentElement: boolean | AddComponentElementConfig
197
+ /**
198
+ * @public
199
+ * Whether to simplify constructor calls like ReactLynx 2
200
+ *
201
+ * @deprecated
202
+ * Using `simplifyCtorLikeReactLynx2` is not recommended as it introduces implicit behaviors that can:
203
+ *
204
+ * - Make code harder to understand and maintain
205
+ *
206
+ * - Create hidden dependencies between components
207
+ *
208
+ * - Complicate debugging and testing processes
209
+ *
210
+ * Instead, use `background-only` on class methods for explicit and maintainable behavior
211
+ *
212
+ * @remarks
213
+ * Default value: `false`
214
+ *
215
+ * @example
216
+ *
217
+ * ```js
218
+ * import { defineConfig } from '@lynx-js/rspeedy'
219
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
220
+ *
221
+ * export default defineConfig({
222
+ * plugins: [
223
+ * pluginReactLynx({
224
+ * compat: {
225
+ * simplifyCtorLikeReactLynx2: true
226
+ * },
227
+ * })
228
+ * ],
229
+ * })
230
+ * ```
231
+ */
232
+ simplifyCtorLikeReactLynx2: boolean
233
+ /**
234
+ * @public
235
+ * Regular expression used to remove component attributes
236
+ *
237
+ * @deprecated It's recommended to use `background-only`.
238
+ *
239
+ * If your code depends on this switch, when distributing it to other projects through npm packages or other means, you'll also need to enable this switch. This will lead to the proliferation of switches, which is not conducive to code reuse between different projects.
240
+ *
241
+ * @remarks
242
+ * Default value: `None`
243
+ *
244
+ * @example
245
+ *
246
+ * ```js
247
+ * import { defineConfig } from '@lynx-js/rspeedy'
248
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
249
+ *
250
+ * export default defineConfig({
251
+ * plugins: [
252
+ * pluginReactLynx({
253
+ * compat: {
254
+ * removeComponentAttrRegex: '^data-test-'
255
+ * },
256
+ * })
257
+ * ],
258
+ * })
259
+ * ```
260
+ */
261
+ removeComponentAttrRegex?: string
262
+ /**
263
+ * @public
264
+ * Whether to disable deprecated warnings
265
+ *
266
+ * @remarks
267
+ * Default value: `false`
268
+ *
269
+ * @example
270
+ *
271
+ * Disable all the `DEPRECATED:` warnings.
272
+ *
273
+ * ```js
274
+ * import { defineConfig } from '@lynx-js/rspeedy'
275
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
276
+ *
277
+ * export default defineConfig({
278
+ * plugins: [
279
+ * pluginReactLynx({
280
+ * compat: {
281
+ * disableDeprecatedWarning: true
282
+ * },
283
+ * })
284
+ * ],
285
+ * })
286
+ * ```
287
+ */
288
+ disableDeprecatedWarning: boolean
289
+ /**
290
+ * @public
291
+ * @deprecated
292
+ * Dark mode configuration
293
+ *
294
+ * @remarks
295
+ * Default value: `None`
296
+ *
297
+ * @example
298
+ *
299
+ * ```js
300
+ * import { defineConfig } from '@lynx-js/rspeedy'
301
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
302
+ *
303
+ * export default defineConfig({
304
+ * plugins: [
305
+ * pluginReactLynx({
306
+ * compat: {
307
+ * darkMode: true
308
+ * },
309
+ * })
310
+ * ],
311
+ * })
312
+ * ```
313
+ */
314
+ darkMode?: boolean | DarkModeConfig
315
+ }
316
+
317
+ declare interface DarkModeConfig {
318
+ /**
319
+ * @public
320
+ * Theme expression to be used for dark mode
321
+ */
322
+ themeExpr: string
323
+ }
324
+
325
+ /**
326
+ * {@inheritdoc PluginReactLynxOptions.defineDCE}
327
+ * @public
328
+ */
329
+ export declare interface DefineDceVisitorConfig {
330
+ /**
331
+ * @public
332
+ * Replaces variables in your code with other values or expressions at compile time.
333
+ *
334
+ * @remarks
335
+ * Caveat: differences between `source.define`
336
+ *
337
+ * `defineDCE` happens before transforming `background-only` directives.
338
+ * So it's useful for eliminating code that is only used in the background from main-thread.
339
+ *
340
+ * @example
341
+ *
342
+ * ```js
343
+ * import { defineConfig } from '@lynx-js/rspeedy'
344
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
345
+ *
346
+ * export default defineConfig({
347
+ * plugins: [
348
+ * pluginReactLynx({
349
+ * defineDCE: {
350
+ * define: {
351
+ * __FOO__: 'false',
352
+ * 'process.env.PLATFORM': '"lynx"',
353
+ * },
354
+ * },
355
+ * })
356
+ * ],
357
+ * })
358
+ * ```
359
+ *
360
+ * Then, `__FOO__` and `process.env.PLATFORM` could be used in source code.
361
+ *
362
+ * ```
363
+ * if (process.env.PLATFORM === 'lynx') {
364
+ * console.log('lynx')
365
+ * }
366
+ *
367
+ * function FooOrBar() {
368
+ * if (__FOO__) {
369
+ * return <text>foo</text>
370
+ * } else {
371
+ * return <text>bar</text>
372
+ * }
373
+ * }
374
+ * ```
375
+ */
376
+ define: Record<string, string>
377
+ }
378
+
379
+ /**
380
+ * {@inheritdoc PluginReactLynxOptions.extractStr}
381
+ * @public
382
+ */
383
+ export declare interface ExtractStrConfig {
384
+ /**
385
+ * @public
386
+ * The minimum length of string literals to be extracted.
387
+ *
388
+ * @remarks
389
+ * Default value: `20`.
390
+ *
391
+ * @example
392
+ *
393
+ * ```js
394
+ * import { defineConfig } from '@lynx-js/rspeedy'
395
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
396
+ *
397
+ * export default defineConfig({
398
+ * plugins: [
399
+ * pluginReactLynx({
400
+ * extractStr: {
401
+ * strLength: 10,
402
+ * },
403
+ * })
404
+ * ],
405
+ * })
406
+ * ```
407
+ */
408
+ strLength: number
409
+ /** @internal */
410
+ extractedStrArr?: Array<string>
411
+ }
412
+
413
+ export { LAYERS }
414
+
415
+ /**
416
+ * Create a rsbuild plugin for ReactLynx.
417
+ *
418
+ * @example
419
+ * ```ts
420
+ * // rsbuild.config.ts
421
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
422
+ * export default {
423
+ * plugins: [pluginReactLynx()]
424
+ * }
425
+ * ```
426
+ *
427
+ * @public
428
+ */
429
+ export declare function pluginReactLynx(userOptions?: PluginReactLynxOptions): RsbuildPlugin;
430
+
431
+ /**
432
+ * Options of {@link pluginReactLynx}
433
+ *
434
+ * @public
435
+ */
436
+ export declare interface PluginReactLynxOptions {
437
+ /**
438
+ * The `compat` option controls compatibilities with ReactLynx2.0.
439
+ *
440
+ * @remarks
441
+ *
442
+ * These options should only be used for migrating from ReactLynx2.0.
443
+ */
444
+ compat?: Partial<CompatVisitorConfig> & {
445
+ /**
446
+ * Whether disable runtime warnings about using ReactLynx2.0-incompatible `SelectorQuery` APIs.
447
+ *
448
+ * @example
449
+ * Using the following APIs will have a runtime warning by default:
450
+ *
451
+ * ```ts
452
+ * this.createSelectorQuery()
453
+ * this.getElementById()
454
+ * this.getNodeRef()
455
+ * this.getNodeRefFromRoot()
456
+ * ```
457
+ *
458
+ * @defaultValue `false`
459
+ */
460
+ disableCreateSelectorQueryIncompatibleWarning?: boolean;
461
+ } | undefined;
462
+ /**
463
+ * When {@link PluginReactLynxOptions.enableCSSInheritance} is enabled, `customCSSInheritanceList` can control which properties are inheritable, not just the default ones.
464
+ *
465
+ * @example
466
+ *
467
+ * By setting `customCSSInheritanceList: ['direction', 'overflow']`, only the `direction` and `overflow` properties are inheritable.
468
+ *
469
+ * ```js
470
+ * import { defineConfig } from '@lynx-js/rspeedy'
471
+ *
472
+ * export default defineConfig({
473
+ * plugins: [
474
+ * pluginReactLynx({
475
+ * enableCSSInheritance: true,
476
+ * customCSSInheritanceList: ['direction', 'overflow']
477
+ * }),
478
+ * ],
479
+ * }
480
+ * ```
481
+ */
482
+ customCSSInheritanceList?: string[] | undefined;
483
+ /**
484
+ * debugInfoOutside controls whether the debug info is placed outside the template.
485
+ *
486
+ * @remarks
487
+ * This is recommended to be set to true to reduce template size.
488
+ *
489
+ * @public
490
+ */
491
+ debugInfoOutside?: boolean;
492
+ /**
493
+ * defaultDisplayLinear controls whether the default value of `display` in CSS is `linear`.
494
+ *
495
+ * @remarks
496
+ *
497
+ * If `defaultDisplayLinear === false`, the default `display` would be `flex` instead of `linear`.
498
+ */
499
+ defaultDisplayLinear?: boolean;
500
+ /**
501
+ * enableAccessibilityElement set the default value of `accessibility-element` for all `<view />` elements.
502
+ */
503
+ enableAccessibilityElement?: boolean;
504
+ /**
505
+ * enableICU enables the Intl API to be enabled globally.
506
+ *
507
+ * If enabled, please double check the compatibility with Lynx Share Context feature to avoid using shared Intl API from other destroyed card.
508
+ *
509
+ * @defaultValue `false`
510
+ */
511
+ enableICU?: boolean;
512
+ /**
513
+ * enableCSSInheritance enables the default inheritance properties.
514
+ *
515
+ * @remarks
516
+ *
517
+ * The following properties are inherited by default:
518
+ *
519
+ * - `direction`
520
+ *
521
+ * - `color`
522
+ *
523
+ * - `font-family`
524
+ *
525
+ * - `font-size`
526
+ *
527
+ * - `font-style`
528
+ *
529
+ * - `font-weight`
530
+ *
531
+ * - `letter-spacing`
532
+ *
533
+ * - `line-height`
534
+ *
535
+ * - `line-spacing`
536
+ *
537
+ * - `text-align`
538
+ *
539
+ * - `text-decoration`
540
+ *
541
+ * - `text-shadow`
542
+ *
543
+ * It is recommended to use with {@link PluginReactLynxOptions.customCSSInheritanceList} to avoid performance issues.
544
+ */
545
+ enableCSSInheritance?: boolean;
546
+ /**
547
+ * CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the DOM is updated.
548
+ *
549
+ * @example
550
+ *
551
+ * If a descendant selector `.a .b` is defined in a CSS file, then when an element's class changes to `.a`, all nodes in its subtree with the className `.b` need to have their styles recalculated.
552
+ *
553
+ * @remarks
554
+ *
555
+ * When using combinator to determine the styles of various elements (including descendants, adjacent siblings, etc.), it is recommended to enable this feature. Otherwise, only the initial class setting can match the corresponding combinator, and subsequent updates will not recalculate the related styles.
556
+ *
557
+ * We find that collecting invalidation nodes and updating them is a relatively time-consuming process.
558
+ * If there is no such usage and better style matching performance is needed, this feature can be selectively disabled.
559
+ */
560
+ enableCSSInvalidation?: boolean;
561
+ /**
562
+ * enableCSSSelector controls whether enabling the new CSS implementation.
563
+ *
564
+ * @public
565
+ */
566
+ enableCSSSelector?: boolean;
567
+ /**
568
+ * enableNewGesture enables the new gesture system.
569
+ *
570
+ * @defaultValue `false`
571
+ */
572
+ enableNewGesture?: boolean;
573
+ /**
574
+ * enableParallelElement enables Threaded Element Resolution.
575
+ *
576
+ * @defaultValue `true`
577
+ *
578
+ * @public
579
+ */
580
+ enableParallelElement?: boolean;
581
+ /**
582
+ * enableRemoveCSSScope controls whether CSS is restrict to use in the component scope.
583
+ *
584
+ * `true`: All CSS files are treated as global CSS.
585
+ *
586
+ * `false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.
587
+ *
588
+ * `undefined`: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues.
589
+ *
590
+ * @defaultValue `true`
591
+ *
592
+ * @public
593
+ */
594
+ enableRemoveCSSScope?: boolean | undefined;
595
+ /**
596
+ * This flag controls when MainThread (Lepus) transfers control to Background after the first screen
597
+ *
598
+ * This flag has two options:
599
+ *
600
+ * `"immediately"`: Transfer immediately
601
+ *
602
+ * `"jsReady"`: Transfer when background (JS Runtime) is ready
603
+ *
604
+ * After handing over control, MainThread (Lepus) runtime can no longer respond to data updates,
605
+ * and data updates will be forwarded to background (JS Runtime) and processed __asynchronously__
606
+ *
607
+ * @defaultValue "immediately"
608
+ */
609
+ firstScreenSyncTiming?: 'immediately' | 'jsReady';
610
+ /**
611
+ * `enableSSR` enable Lynx SSR feature for this build.
612
+ *
613
+ * @defaultValue `false`
614
+ *
615
+ * @public
616
+ */
617
+ enableSSR?: boolean;
618
+ /**
619
+ * Composite configuration representing pipeline scheduling strategies, including {@link PluginReactLynxOptions.enableParallelElement} and list batch-rendering. All newly introduced scheduling strategies will be managed by this uint64 configuration.
620
+ *
621
+ * @remarks
622
+ *
623
+ * Preallocate 64 bit unsigned integer for pipeline scheduler config.
624
+ *
625
+ * - 0 ~ 7 bit: Reserved for parsing binary bundle into C++ bundle.
626
+ *
627
+ * - 8 ~ 15 bit: Reserved for MTS Render.
628
+ *
629
+ * - 16 ~ 23 bit: Reserved for resolve stage in Pixel Pipeline.
630
+ *
631
+ * - 24 ~ 31 bit: Reserved for layout stage in Pixel Pipeline.
632
+ *
633
+ * - 32 ~ 39 bit: Reserved for execute UI OP stage in Pixel Pipeline.
634
+ *
635
+ * - 40 ~ 47 bit: Reserved for paint stage in Pixel Pipeline.
636
+ *
637
+ * - 48 ~ 63 bit: Flexible bits for extensibility.
638
+ *
639
+ * @defaultValue `0x00010000`
640
+ */
641
+ pipelineSchedulerConfig?: number;
642
+ /**
643
+ * removeDescendantSelectorScope is used to remove the scope of descendant selectors.
644
+ */
645
+ removeDescendantSelectorScope?: boolean;
646
+ /**
647
+ * How main-thread code will be shaken.
648
+ */
649
+ shake?: Partial<ShakeVisitorConfig> | undefined;
650
+ /**
651
+ * Like `define` in various bundlers, but this one happens at transform time, and a DCE pass will be performed.
652
+ */
653
+ defineDCE?: Partial<DefineDceVisitorConfig> | undefined;
654
+ /**
655
+ * `engineVersion` specifies the minimum Lynx Engine version required for an App bundle to function properly.
656
+ *
657
+ * @public
658
+ */
659
+ engineVersion?: string;
660
+ /**
661
+ * targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on.
662
+ *
663
+ * @public
664
+ * @deprecated `targetSdkVersion` is now an alias of {@link PluginReactLynxOptions.engineVersion}. Use {@link PluginReactLynxOptions.engineVersion} instead.
665
+ */
666
+ targetSdkVersion?: string;
667
+ /**
668
+ * Merge same string literals in JS and Lepus to reduce output bundle size.
669
+ * Set to `false` to disable.
670
+ *
671
+ * @defaultValue false
672
+ */
673
+ extractStr?: Partial<ExtractStrConfig> | boolean;
674
+ /**
675
+ * Generate standalone lazy bundle.
676
+ *
677
+ * @alpha
678
+ */
679
+ experimental_isLazyBundle?: boolean;
680
+ }
681
+
682
+ /**
683
+ * {@inheritdoc PluginReactLynxOptions.shake}
684
+ * @public
685
+ */
686
+ export declare interface ShakeVisitorConfig {
687
+ /**
688
+ * Package names to identify runtime imports that need to be processed
689
+ *
690
+ * @example
691
+ * ```js
692
+ * import { defineConfig } from '@lynx-js/rspeedy'
693
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
694
+ *
695
+ * export default defineConfig({
696
+ * plugins: [
697
+ * pluginReactLynx({
698
+ * shake: {
699
+ * pkgName: ['@lynx-js/react-runtime']
700
+ * }
701
+ * })
702
+ * ]
703
+ * })
704
+ * ```
705
+ *
706
+ * @remarks
707
+ * Default value: `['@lynx-js/react-runtime']`
708
+ * The provided values will be merged with the default values instead of replacing them.
709
+ * @public
710
+ */
711
+ pkgName: Array<string>
712
+ /**
713
+ * Properties that should be retained in the component class
714
+ *
715
+ * @example
716
+ * ```js
717
+ * import { defineConfig } from '@lynx-js/rspeedy'
718
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
719
+ *
720
+ * export default defineConfig({
721
+ * plugins: [
722
+ * pluginReactLynx({
723
+ * shake: {
724
+ * retainProp: ['myCustomMethod']
725
+ * }
726
+ * })
727
+ * ]
728
+ * })
729
+ * ```
730
+ *
731
+ * @remarks
732
+ * Default value: `['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`
733
+ * The provided values will be merged with the default values instead of replacing them.
734
+ *
735
+ * @public
736
+ */
737
+ retainProp: Array<string>
738
+ /**
739
+ * Function names whose parameters should be removed during transformation
740
+ *
741
+ * @example
742
+ * ```js
743
+ * import { defineConfig } from '@lynx-js/rspeedy'
744
+ * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
745
+ *
746
+ * export default defineConfig({
747
+ * plugins: [
748
+ * pluginReactLynx({
749
+ * shake: {
750
+ * removeCallParams: ['useMyCustomEffect']
751
+ * }
752
+ * })
753
+ * ]
754
+ * })
755
+ * ```
756
+ *
757
+ * @remarks
758
+ * Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
759
+ * The provided values will be merged with the default values instead of replacing them.
760
+ *
761
+ * @public
762
+ */
763
+ removeCallParams: Array<string>
764
+ }
765
+
766
+ export { }