@lynx-js/react 0.123.2 → 0.124.0

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.
@@ -99,8 +99,7 @@ export interface CompatVisitorConfig {
99
99
  * @public
100
100
  * Specifies the list of component package names that need compatibility processing
101
101
  *
102
- * @remarks
103
- * Default value: `['@lynx-js/react-components']`
102
+ * @defaultValue `['@lynx-js/react-components']`
104
103
  *
105
104
  * @example
106
105
  *
@@ -124,8 +123,7 @@ export interface CompatVisitorConfig {
124
123
  * @public
125
124
  * Specifies the list of old runtime package names that need compatibility processing
126
125
  *
127
- * @remarks
128
- * Default value: `['@lynx-js/react-runtime']`
126
+ * @defaultValue `['@lynx-js/react-runtime']`
129
127
  *
130
128
  * @example
131
129
  *
@@ -149,8 +147,7 @@ export interface CompatVisitorConfig {
149
147
  * @public
150
148
  * Specifies the new runtime package name
151
149
  *
152
- * @remarks
153
- * Default value: `'@lynx-js/react'`
150
+ * @defaultValue `'@lynx-js/react'`
154
151
  *
155
152
  * @example
156
153
  *
@@ -174,11 +171,11 @@ export interface CompatVisitorConfig {
174
171
  * @public
175
172
  * Specifies additional component attributes list, these attributes will be passed to the wrapped `<view>` instead of the component.
176
173
  *
174
+ * @defaultValue `[]`
175
+ *
177
176
  * @remarks
178
177
  * This only takes effect when {@link CompatVisitorConfig.addComponentElement} is enabled.
179
178
  *
180
- * Default value: `[]`
181
- *
182
179
  * @example
183
180
  *
184
181
  * ```js
@@ -201,8 +198,7 @@ export interface CompatVisitorConfig {
201
198
  * @public
202
199
  * Controls whether to add wrapper elements for components
203
200
  *
204
- * @remarks
205
- * Default value: `false`
201
+ * @defaultValue `false`
206
202
  *
207
203
  * @example
208
204
  *
@@ -259,8 +255,7 @@ export interface CompatVisitorConfig {
259
255
  *
260
256
  * Instead, use `background-only` on class methods for explicit and maintainable behavior
261
257
  *
262
- * @remarks
263
- * Default value: `false`
258
+ * @defaultValue `false`
264
259
  *
265
260
  * @example
266
261
  *
@@ -280,6 +275,17 @@ export interface CompatVisitorConfig {
280
275
  * ```
281
276
  */
282
277
  simplifyCtorLikeReactLynx2: boolean
278
+ /**
279
+ * @public
280
+ * Whether to transform legacy event attribute names on Lynx elements.
281
+ *
282
+ * When enabled, legacy event attributes such as `onClick` and
283
+ * `onClickCatch` are transformed to `bindtap` and `catchtap`.
284
+ * Disable this when another transform owns event attribute-name conversion.
285
+ *
286
+ * @defaultValue `true`
287
+ */
288
+ transformLegacyEventAttributeNames?: boolean
283
289
  /**
284
290
  * @public
285
291
  * Regular expression used to remove component attributes
@@ -288,8 +294,7 @@ export interface CompatVisitorConfig {
288
294
  *
289
295
  * 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.
290
296
  *
291
- * @remarks
292
- * Default value: `None`
297
+ * @defaultValue `undefined`
293
298
  *
294
299
  * @example
295
300
  *
@@ -313,8 +318,7 @@ export interface CompatVisitorConfig {
313
318
  * @public
314
319
  * Whether to disable deprecated warnings
315
320
  *
316
- * @remarks
317
- * Default value: `false`
321
+ * @defaultValue `false`
318
322
  *
319
323
  * @example
320
324
  *
@@ -341,8 +345,7 @@ export interface CompatVisitorConfig {
341
345
  * @deprecated
342
346
  * Dark mode configuration
343
347
  *
344
- * @remarks
345
- * Default value: `None`
348
+ * @defaultValue `undefined`
346
349
  *
347
350
  * @example
348
351
  *
@@ -477,8 +480,7 @@ export interface ExtractStrConfig {
477
480
  * @public
478
481
  * The minimum length of string literals to be extracted.
479
482
  *
480
- * @remarks
481
- * Default value: `20`.
483
+ * @defaultValue `20`
482
484
  *
483
485
  * @example
484
486
  *
@@ -531,9 +533,11 @@ export interface ShakeVisitorConfig {
531
533
  * })
532
534
  * ```
533
535
  *
536
+ * @defaultValue `['@lynx-js/react-runtime']`
537
+ *
534
538
  * @remarks
535
- * Default value: `['@lynx-js/react-runtime']`
536
539
  * The provided values will be merged with the default values instead of replacing them.
540
+ *
537
541
  * @public
538
542
  */
539
543
  pkgName: Array<string>
@@ -556,8 +560,9 @@ export interface ShakeVisitorConfig {
556
560
  * })
557
561
  * ```
558
562
  *
563
+ * @defaultValue `['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`
564
+ *
559
565
  * @remarks
560
- * Default value: `['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`
561
566
  * The provided values will be merged with the default values instead of replacing them.
562
567
  *
563
568
  * @public
@@ -582,8 +587,9 @@ export interface ShakeVisitorConfig {
582
587
  * })
583
588
  * ```
584
589
  *
590
+ * @defaultValue `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
591
+ *
585
592
  * @remarks
586
- * Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`
587
593
  * The provided values will be merged with the default values instead of replacing them.
588
594
  *
589
595
  * @public
@@ -608,8 +614,9 @@ export interface ShakeVisitorConfig {
608
614
  * })
609
615
  * ```
610
616
  *
617
+ * @defaultValue `[]`
618
+ *
611
619
  * @remarks
612
- * Default value: `[]`
613
620
  * The provided values will be merged with the default values instead of replacing them.
614
621
  *
615
622
  * @public
@@ -754,6 +761,35 @@ export interface TransformNodiffOutput {
754
761
  uiSourceMapRecords: Array<UiSourceMapRecord>
755
762
  /** @internal */
756
763
  elementTemplates?: Array<ElementTemplateAsset>
764
+ /** @internal */
765
+ definesForSnapshot?: Array<Define>
766
+ /** @internal */
767
+ definesForWorklet?: Array<Define>
768
+ }
769
+ /**
770
+ * @internal
771
+ * A snapshot or worklet definition collected from the module. The same
772
+ * definition is emitted regardless of the compile target.
773
+ */
774
+ export interface Define {
775
+ /**
776
+ * @internal
777
+ * The snapshot uid or the worklet hash. Definitions that share an id are
778
+ * interchangeable, so duplicates can be dropped.
779
+ */
780
+ id: string
781
+ /**
782
+ * @internal
783
+ * A self-contained statement list registering the definition.
784
+ */
785
+ code: string
786
+ /**
787
+ * @internal
788
+ * Set when the definition cannot run inside an injected module, e.g. a
789
+ * worklet closing over a shared-runtime import. The build must fail when
790
+ * the main thread lacks such a definition.
791
+ */
792
+ unmergeable?: boolean
757
793
  }
758
794
  /** @internal */
759
795
  export interface ElementTemplateAsset {