@lynx-js/react-rsbuild-plugin 0.9.9 → 0.10.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.
@@ -1,272 +0,0 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { CompatVisitorConfig, DefineDceVisitorConfig, JsxTransformerConfig, ShakeVisitorConfig } from '@lynx-js/react/transform';
3
- import type { ExtractStrConfig } from '@lynx-js/react-webpack-plugin';
4
- /**
5
- * Options of {@link pluginReactLynx}
6
- *
7
- * @public
8
- */
9
- export interface PluginReactLynxOptions {
10
- /**
11
- * The `compat` option controls compatibilities with ReactLynx2.0.
12
- *
13
- * @remarks
14
- *
15
- * These options should only be used for migrating from ReactLynx2.0.
16
- */
17
- compat?: Partial<CompatVisitorConfig> & {
18
- /**
19
- * Whether disable runtime warnings about using ReactLynx2.0-incompatible `SelectorQuery` APIs.
20
- *
21
- * @example
22
- * Using the following APIs will have a runtime warning by default:
23
- *
24
- * ```ts
25
- * this.createSelectorQuery()
26
- * this.getElementById()
27
- * this.getNodeRef()
28
- * this.getNodeRefFromRoot()
29
- * ```
30
- *
31
- * @defaultValue `false`
32
- */
33
- disableCreateSelectorQueryIncompatibleWarning?: boolean;
34
- } | undefined;
35
- /**
36
- * When {@link PluginReactLynxOptions.enableCSSInheritance} is enabled, `customCSSInheritanceList` can control which properties are inheritable, not just the default ones.
37
- *
38
- * @example
39
- *
40
- * By setting `customCSSInheritanceList: ['direction', 'overflow']`, only the `direction` and `overflow` properties are inheritable.
41
- *
42
- * ```js
43
- * import { defineConfig } from '@lynx-js/rspeedy'
44
- *
45
- * export default defineConfig({
46
- * plugins: [
47
- * pluginReactLynx({
48
- * enableCSSInheritance: true,
49
- * customCSSInheritanceList: ['direction', 'overflow']
50
- * }),
51
- * ],
52
- * }
53
- * ```
54
- */
55
- customCSSInheritanceList?: string[] | undefined;
56
- /**
57
- * debugInfoOutside controls whether the debug info is placed outside the template.
58
- *
59
- * @remarks
60
- * This is recommended to be set to true to reduce template size.
61
- *
62
- * @public
63
- */
64
- debugInfoOutside?: boolean;
65
- /**
66
- * defaultDisplayLinear controls whether the default value of `display` in CSS is `linear`.
67
- *
68
- * @remarks
69
- *
70
- * If `defaultDisplayLinear === false`, the default `display` would be `flex` instead of `linear`.
71
- */
72
- defaultDisplayLinear?: boolean;
73
- /**
74
- * enableAccessibilityElement set the default value of `accessibility-element` for all `<view />` elements.
75
- */
76
- enableAccessibilityElement?: boolean;
77
- /**
78
- * enableICU enables the Intl API to be enabled globally.
79
- *
80
- * If enabled, please double check the compatibility with Lynx Share Context feature to avoid using shared Intl API from other destroyed card.
81
- *
82
- * @defaultValue `false`
83
- */
84
- enableICU?: boolean;
85
- /**
86
- * enableCSSInheritance enables the default inheritance properties.
87
- *
88
- * @remarks
89
- *
90
- * The following properties are inherited by default:
91
- *
92
- * - `direction`
93
- *
94
- * - `color`
95
- *
96
- * - `font-family`
97
- *
98
- * - `font-size`
99
- *
100
- * - `font-style`
101
- *
102
- * - `font-weight`
103
- *
104
- * - `letter-spacing`
105
- *
106
- * - `line-height`
107
- *
108
- * - `line-spacing`
109
- *
110
- * - `text-align`
111
- *
112
- * - `text-decoration`
113
- *
114
- * - `text-shadow`
115
- *
116
- * It is recommended to use with {@link PluginReactLynxOptions.customCSSInheritanceList} to avoid performance issues.
117
- */
118
- enableCSSInheritance?: boolean;
119
- /**
120
- * CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the DOM is updated.
121
- *
122
- * @example
123
- *
124
- * 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.
125
- *
126
- * @remarks
127
- *
128
- * 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.
129
- *
130
- * We find that collecting invalidation nodes and updating them is a relatively time-consuming process.
131
- * If there is no such usage and better style matching performance is needed, this feature can be selectively disabled.
132
- */
133
- enableCSSInvalidation?: boolean;
134
- /**
135
- * enableCSSSelector controls whether enabling the new CSS implementation.
136
- *
137
- * @public
138
- */
139
- enableCSSSelector?: boolean;
140
- /**
141
- * enableNewGesture enables the new gesture system.
142
- *
143
- * @defaultValue `false`
144
- */
145
- enableNewGesture?: boolean;
146
- /**
147
- * enableParallelElement enables Threaded Element Resolution.
148
- *
149
- * @defaultValue `true`
150
- *
151
- * @public
152
- */
153
- enableParallelElement?: boolean;
154
- /**
155
- * enableRemoveCSSScope controls whether CSS is restrict to use in the component scope.
156
- *
157
- * `true`: All CSS files are treated as global CSS.
158
- *
159
- * `false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.
160
- *
161
- * `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.
162
- *
163
- * @defaultValue `true`
164
- *
165
- * @public
166
- */
167
- enableRemoveCSSScope?: boolean | undefined;
168
- /**
169
- * This flag controls when MainThread (Lepus) transfers control to Background after the first screen
170
- *
171
- * This flag has two options:
172
- *
173
- * `"immediately"`: Transfer immediately
174
- *
175
- * `"jsReady"`: Transfer when background (JS Runtime) is ready
176
- *
177
- * After handing over control, MainThread (Lepus) runtime can no longer respond to data updates,
178
- * and data updates will be forwarded to background (JS Runtime) and processed __asynchronously__
179
- *
180
- * @defaultValue "immediately"
181
- */
182
- firstScreenSyncTiming?: 'immediately' | 'jsReady';
183
- /**
184
- * `enableSSR` enable Lynx SSR feature for this build.
185
- *
186
- * @defaultValue `false`
187
- *
188
- * @public
189
- */
190
- enableSSR?: boolean;
191
- /**
192
- * The `jsx` option controls how JSX is transformed.
193
- */
194
- jsx?: Partial<JsxTransformerConfig> | undefined;
195
- /**
196
- * 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.
197
- *
198
- * @remarks
199
- *
200
- * Preallocate 64 bit unsigned integer for pipeline scheduler config.
201
- *
202
- * - 0 ~ 7 bit: Reserved for parsing binary bundle into C++ bundle.
203
- *
204
- * - 8 ~ 15 bit: Reserved for MTS Render.
205
- *
206
- * - 16 ~ 23 bit: Reserved for resolve stage in Pixel Pipeline.
207
- *
208
- * - 24 ~ 31 bit: Reserved for layout stage in Pixel Pipeline.
209
- *
210
- * - 32 ~ 39 bit: Reserved for execute UI OP stage in Pixel Pipeline.
211
- *
212
- * - 40 ~ 47 bit: Reserved for paint stage in Pixel Pipeline.
213
- *
214
- * - 48 ~ 63 bit: Flexible bits for extensibility.
215
- *
216
- * @defaultValue `0x00010000`
217
- */
218
- pipelineSchedulerConfig?: number;
219
- /**
220
- * removeDescendantSelectorScope is used to remove the scope of descendant selectors.
221
- */
222
- removeDescendantSelectorScope?: boolean;
223
- /**
224
- * How main-thread code will be shaken.
225
- */
226
- shake?: Partial<ShakeVisitorConfig> | undefined;
227
- /**
228
- * Like `define` in various bundlers, but this one happens at transform time, and a DCE pass will be performed.
229
- */
230
- defineDCE?: Partial<DefineDceVisitorConfig> | undefined;
231
- /**
232
- * `engineVersion` specifies the minimum Lynx Engine version required for an App bundle to function properly.
233
- *
234
- * @public
235
- */
236
- engineVersion?: string;
237
- /**
238
- * targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on.
239
- *
240
- * @public
241
- * @deprecated `targetSdkVersion` is now an alias of {@link PluginReactLynxOptions.engineVersion}. Use {@link PluginReactLynxOptions.engineVersion} instead.
242
- */
243
- targetSdkVersion?: string;
244
- /**
245
- * Merge same string literals in JS and Lepus to reduce output bundle size.
246
- * Set to `false` to disable.
247
- *
248
- * @defaultValue false
249
- */
250
- extractStr?: Partial<ExtractStrConfig> | boolean;
251
- /**
252
- * Generate standalone lazy bundle.
253
- *
254
- * @alpha
255
- */
256
- experimental_isLazyBundle?: boolean;
257
- }
258
- /**
259
- * Create a rsbuild plugin for ReactLynx.
260
- *
261
- * @example
262
- * ```ts
263
- * // rsbuild.config.ts
264
- * import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
265
- * export default {
266
- * plugins: [pluginReactLynx()]
267
- * }
268
- * ```
269
- *
270
- * @public
271
- */
272
- export declare function pluginReactLynx(userOptions?: PluginReactLynxOptions): RsbuildPlugin;
package/dist/refresh.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { RsbuildPluginAPI } from '@rsbuild/core';
2
- export declare function applyRefresh(api: RsbuildPluginAPI): void;
@@ -1,2 +0,0 @@
1
- import type { RsbuildPluginAPI } from '@rsbuild/core';
2
- export declare const applySplitChunksRule: (api: RsbuildPluginAPI) => void;
package/dist/swc.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { RsbuildPluginAPI } from '@rsbuild/core';
2
- export declare function applySWC(api: RsbuildPluginAPI): void;
@@ -1,2 +0,0 @@
1
- import type { PluginReactLynxOptions } from './pluginReactLynx.js';
2
- export declare const validateConfig: (input: unknown) => PluginReactLynxOptions | undefined;