@yak/react 10.0.0-rc.0 → 10.0.0-rc.2
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/README.md +15 -3
- package/dist/context/baseContext.d.ts +1 -2
- package/dist/context/index.d.ts +5 -6
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.server.d.ts +2 -3
- package/dist/cross-file-resolver/index.d.ts +12 -12
- package/dist/cross-file-resolver/index.js +58 -5
- package/dist/cross-file-resolver/index.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +139 -139
- package/dist/isolated-source-eval/index.d.ts +2 -2
- package/dist/isolated-source-eval/index.js +2 -2
- package/dist/isolated-source-eval/index.js.map +1 -1
- package/dist/isolated-source-eval/worker.js +4 -1
- package/dist/isolated-source-eval/worker.js.map +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/loaders/{turbo-loader.d.cts → turbo-loader.d.ts} +11 -3
- package/dist/loaders/{turbo-loader.cjs → turbo-loader.js} +81 -49
- package/dist/loaders/turbo-loader.js.map +1 -0
- package/dist/loaders/vite-plugin.d.ts +15 -25
- package/dist/loaders/vite-plugin.js +95 -67
- package/dist/loaders/vite-plugin.js.map +1 -1
- package/dist/loaders/{webpack-loader.d.cts → webpack-loader.d.ts} +3 -3
- package/dist/loaders/{webpack-loader.cjs → webpack-loader.js} +69 -37
- package/dist/loaders/webpack-loader.js.map +1 -0
- package/dist/rsbuild/index.d.ts +2 -2
- package/dist/rsbuild/index.js +3 -3
- package/dist/rsbuild/index.js.map +1 -1
- package/dist/static/index.js +1 -1
- package/dist/static/index.js.map +1 -1
- package/dist/withYak/index.d.ts +15 -24
- package/dist/withYak/index.js +8 -14
- package/dist/withYak/index.js.map +1 -1
- package/loaders/lib/resolveCrossFileSelectors.ts +0 -1
- package/loaders/turbo-loader.ts +32 -11
- package/loaders/webpack-loader.ts +3 -6
- package/package.json +47 -106
- package/rsbuild/index.ts +3 -4
- package/runtime/context/index.tsx +3 -3
- package/withYak/allow-global-css.ts +1 -1
- package/withYak/index.ts +7 -21
- package/dist/context/baseContext.cjs +0 -9
- package/dist/context/baseContext.cjs.map +0 -1
- package/dist/context/baseContext.d.cts +0 -6
- package/dist/context/index.cjs +0 -45
- package/dist/context/index.cjs.map +0 -1
- package/dist/context/index.d.cts +0 -21
- package/dist/context/index.server.cjs +0 -47
- package/dist/context/index.server.cjs.map +0 -1
- package/dist/context/index.server.d.cts +0 -10
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -320
- package/dist/internal.cjs +0 -544
- package/dist/internal.cjs.map +0 -1
- package/dist/internal.d.cts +0 -452
- package/dist/jsx-dev-runtime.cjs +0 -2
- package/dist/jsx-dev-runtime.cjs.map +0 -1
- package/dist/jsx-dev-runtime.d.cts +0 -7
- package/dist/jsx-runtime.cjs +0 -2
- package/dist/jsx-runtime.cjs.map +0 -1
- package/dist/jsx-runtime.d.cts +0 -38
- package/dist/loaders/turbo-loader.cjs.map +0 -1
- package/dist/loaders/webpack-loader.cjs.map +0 -1
- package/dist/static/index.cjs +0 -2
- package/dist/static/index.cjs.map +0 -1
- package/dist/static/index.d.cts +0 -28
- package/dist/withYak/index.cjs +0 -208
- package/dist/withYak/index.cjs.map +0 -1
- package/dist/withYak/index.d.cts +0 -121
package/dist/internal.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ type RuntimeStyleProcessor<T> = ((props: T, classNames: ClassNameCollector, styl
|
|
|
123
123
|
* `;
|
|
124
124
|
* ```
|
|
125
125
|
*/
|
|
126
|
-
declare const atoms: <T>(...atoms: (string | RuntimeStyleProcessor<T> | false)[]) => ComponentStyles<T>;
|
|
126
|
+
export declare const atoms: <T>(...atoms: (string | RuntimeStyleProcessor<T> | false)[]) => ComponentStyles<T>;
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region runtime/keyframes.d.ts
|
|
129
129
|
/**
|
|
@@ -148,7 +148,7 @@ declare const atoms: <T>(...atoms: (string | RuntimeStyleProcessor<T> | false)[]
|
|
|
148
148
|
* `;
|
|
149
149
|
* ```
|
|
150
150
|
*/
|
|
151
|
-
declare const keyframes: <T extends (string | number | bigint)[] = never>(styles: TemplateStringsArray, ..._dynamic: T) => string;
|
|
151
|
+
export declare const keyframes: <T extends (string | number | bigint)[] = never>(styles: TemplateStringsArray, ..._dynamic: T) => string;
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region runtime/styled.d.ts
|
|
154
154
|
/**
|
|
@@ -164,7 +164,7 @@ declare const keyframes: <T extends (string | number | bigint)[] = never>(styles
|
|
|
164
164
|
* `;
|
|
165
165
|
* ```
|
|
166
166
|
*/
|
|
167
|
-
declare const styled: Styled;
|
|
167
|
+
export declare const styled: Styled;
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region runtime/globalStyle.d.ts
|
|
170
170
|
/**
|
|
@@ -211,7 +211,7 @@ type GlobalStyleInterpolation = string | number | ComponentStyles<{}> | YakCompo
|
|
|
211
211
|
* `;
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
declare const globalStyle: (_styles: TemplateStringsArray, ..._values: Array<GlobalStyleInterpolation>) => void;
|
|
214
|
+
export declare const globalStyle: (_styles: TemplateStringsArray, ..._values: Array<GlobalStyleInterpolation>) => void;
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region runtime/cssLiteral.d.ts
|
|
217
217
|
declare const yakComponentSymbol: unique symbol;
|
|
@@ -240,7 +240,7 @@ type CSSInterpolation<TProps> = string | number | undefined | null | false | Com
|
|
|
240
240
|
* (or creates new ones if needed) that are passed as arguments. These functions receive the props, classNames, and style object as arguments
|
|
241
241
|
* and operate directly on the classNames and style objects.
|
|
242
242
|
*/
|
|
243
|
-
declare function css<TProps>(styles: TemplateStringsArray, ...values: CSSInterpolation<NoInfer<TProps> & {
|
|
243
|
+
export declare function css<TProps>(styles: TemplateStringsArray, ...values: CSSInterpolation<NoInfer<TProps> & {
|
|
244
244
|
theme: YakTheme;
|
|
245
245
|
}>[]): ComponentStyles<TProps>;
|
|
246
246
|
//#endregion
|
|
@@ -314,139 +314,139 @@ declare const mergeCssProp: (cssProp: RuntimeStyleProcessor<unknown> | false | n
|
|
|
314
314
|
declare const mergeClassNames: (a: string | false | null | undefined, b: string | false | null | undefined) => string | undefined;
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region runtime/styledDom.d.ts
|
|
317
|
-
declare const __yak_a: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
318
|
-
declare const __yak_abbr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
319
|
-
declare const __yak_address: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
320
|
-
declare const __yak_area: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
321
|
-
declare const __yak_article: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
322
|
-
declare const __yak_aside: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
323
|
-
declare const __yak_audio: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
324
|
-
declare const __yak_b: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
325
|
-
declare const __yak_base: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
326
|
-
declare const __yak_bdi: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
327
|
-
declare const __yak_bdo: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
328
|
-
declare const __yak_big: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
329
|
-
declare const __yak_blockquote: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
330
|
-
declare const __yak_body: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
331
|
-
declare const __yak_br: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
332
|
-
declare const __yak_button: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
333
|
-
declare const __yak_canvas: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
334
|
-
declare const __yak_caption: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
335
|
-
declare const __yak_cite: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
336
|
-
declare const __yak_code: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
337
|
-
declare const __yak_col: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
338
|
-
declare const __yak_colgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
339
|
-
declare const __yak_data: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
340
|
-
declare const __yak_datalist: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
341
|
-
declare const __yak_dd: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
342
|
-
declare const __yak_del: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
343
|
-
declare const __yak_details: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
344
|
-
declare const __yak_dfn: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
345
|
-
declare const __yak_dialog: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
346
|
-
declare const __yak_div: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
347
|
-
declare const __yak_dl: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
348
|
-
declare const __yak_dt: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
349
|
-
declare const __yak_em: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
350
|
-
declare const __yak_embed: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
351
|
-
declare const __yak_fieldset: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
352
|
-
declare const __yak_figcaption: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
353
|
-
declare const __yak_figure: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
354
|
-
declare const __yak_footer: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
355
|
-
declare const __yak_form: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
356
|
-
declare const __yak_h1: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
357
|
-
declare const __yak_h2: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
358
|
-
declare const __yak_h3: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
359
|
-
declare const __yak_h4: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
360
|
-
declare const __yak_h5: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
361
|
-
declare const __yak_h6: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
362
|
-
declare const __yak_header: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
363
|
-
declare const __yak_hgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
364
|
-
declare const __yak_hr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
365
|
-
declare const __yak_html: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
366
|
-
declare const __yak_i: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
367
|
-
declare const __yak_iframe: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
368
|
-
declare const __yak_img: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
369
|
-
declare const __yak_input: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
370
|
-
declare const __yak_ins: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
371
|
-
declare const __yak_kbd: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
372
|
-
declare const __yak_keygen: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
373
|
-
declare const __yak_label: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
374
|
-
declare const __yak_legend: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
375
|
-
declare const __yak_li: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
376
|
-
declare const __yak_link: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
377
|
-
declare const __yak_main: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
378
|
-
declare const __yak_map: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
379
|
-
declare const __yak_mark: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
380
|
-
declare const __yak_menu: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
381
|
-
declare const __yak_menuitem: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
382
|
-
declare const __yak_meta: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
383
|
-
declare const __yak_meter: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
384
|
-
declare const __yak_nav: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
385
|
-
declare const __yak_noscript: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
386
|
-
declare const __yak_object: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
387
|
-
declare const __yak_ol: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
388
|
-
declare const __yak_optgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
389
|
-
declare const __yak_option: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
390
|
-
declare const __yak_output: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
391
|
-
declare const __yak_p: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
392
|
-
declare const __yak_param: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
393
|
-
declare const __yak_picture: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
394
|
-
declare const __yak_pre: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
395
|
-
declare const __yak_progress: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
396
|
-
declare const __yak_q: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
397
|
-
declare const __yak_rp: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
398
|
-
declare const __yak_rt: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
399
|
-
declare const __yak_ruby: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
400
|
-
declare const __yak_s: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
401
|
-
declare const __yak_samp: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
402
|
-
declare const __yak_script: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
403
|
-
declare const __yak_section: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
404
|
-
declare const __yak_select: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
405
|
-
declare const __yak_small: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
406
|
-
declare const __yak_source: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
407
|
-
declare const __yak_span: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
408
|
-
declare const __yak_strong: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
409
|
-
declare const __yak_style: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
410
|
-
declare const __yak_sub: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
411
|
-
declare const __yak_summary: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
412
|
-
declare const __yak_sup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
413
|
-
declare const __yak_table: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
414
|
-
declare const __yak_tbody: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
415
|
-
declare const __yak_td: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
416
|
-
declare const __yak_textarea: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
417
|
-
declare const __yak_tfoot: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
418
|
-
declare const __yak_th: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
419
|
-
declare const __yak_thead: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
420
|
-
declare const __yak_time: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
421
|
-
declare const __yak_tr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
422
|
-
declare const __yak_track: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
423
|
-
declare const __yak_u: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
424
|
-
declare const __yak_ul: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
425
|
-
declare const __yak_use: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
426
|
-
declare const __yak_var: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
427
|
-
declare const __yak_video: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
428
|
-
declare const __yak_wbr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
429
|
-
declare const __yak_circle: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
430
|
-
declare const __yak_clipPath: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
431
|
-
declare const __yak_defs: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
432
|
-
declare const __yak_ellipse: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
433
|
-
declare const __yak_foreignObject: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
434
|
-
declare const __yak_g: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
435
|
-
declare const __yak_image: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
436
|
-
declare const __yak_line: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
437
|
-
declare const __yak_linearGradient: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
438
|
-
declare const __yak_marker: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
439
|
-
declare const __yak_mask: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
440
|
-
declare const __yak_path: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
441
|
-
declare const __yak_pattern: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
442
|
-
declare const __yak_polygon: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
443
|
-
declare const __yak_polyline: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
444
|
-
declare const __yak_radialGradient: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
445
|
-
declare const __yak_rect: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
446
|
-
declare const __yak_stop: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
447
|
-
declare const __yak_svg: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
448
|
-
declare const __yak_text: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
449
|
-
declare const __yak_tspan: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
317
|
+
export declare const __yak_a: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
318
|
+
export declare const __yak_abbr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
319
|
+
export declare const __yak_address: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
320
|
+
export declare const __yak_area: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
321
|
+
export declare const __yak_article: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
322
|
+
export declare const __yak_aside: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
323
|
+
export declare const __yak_audio: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
324
|
+
export declare const __yak_b: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
325
|
+
export declare const __yak_base: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
326
|
+
export declare const __yak_bdi: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
327
|
+
export declare const __yak_bdo: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
328
|
+
export declare const __yak_big: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
329
|
+
export declare const __yak_blockquote: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
330
|
+
export declare const __yak_body: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
331
|
+
export declare const __yak_br: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
332
|
+
export declare const __yak_button: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
333
|
+
export declare const __yak_canvas: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
334
|
+
export declare const __yak_caption: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
335
|
+
export declare const __yak_cite: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
336
|
+
export declare const __yak_code: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
337
|
+
export declare const __yak_col: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
338
|
+
export declare const __yak_colgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
339
|
+
export declare const __yak_data: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
340
|
+
export declare const __yak_datalist: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
341
|
+
export declare const __yak_dd: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
342
|
+
export declare const __yak_del: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
343
|
+
export declare const __yak_details: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
344
|
+
export declare const __yak_dfn: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
345
|
+
export declare const __yak_dialog: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
346
|
+
export declare const __yak_div: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
347
|
+
export declare const __yak_dl: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
348
|
+
export declare const __yak_dt: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
349
|
+
export declare const __yak_em: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
350
|
+
export declare const __yak_embed: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
351
|
+
export declare const __yak_fieldset: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
352
|
+
export declare const __yak_figcaption: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
353
|
+
export declare const __yak_figure: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
354
|
+
export declare const __yak_footer: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
355
|
+
export declare const __yak_form: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
356
|
+
export declare const __yak_h1: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
357
|
+
export declare const __yak_h2: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
358
|
+
export declare const __yak_h3: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
359
|
+
export declare const __yak_h4: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
360
|
+
export declare const __yak_h5: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
361
|
+
export declare const __yak_h6: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
362
|
+
export declare const __yak_header: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
363
|
+
export declare const __yak_hgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
364
|
+
export declare const __yak_hr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
365
|
+
export declare const __yak_html: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
366
|
+
export declare const __yak_i: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
367
|
+
export declare const __yak_iframe: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
368
|
+
export declare const __yak_img: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
369
|
+
export declare const __yak_input: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
370
|
+
export declare const __yak_ins: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
371
|
+
export declare const __yak_kbd: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
372
|
+
export declare const __yak_keygen: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
373
|
+
export declare const __yak_label: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
374
|
+
export declare const __yak_legend: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
375
|
+
export declare const __yak_li: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
376
|
+
export declare const __yak_link: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
377
|
+
export declare const __yak_main: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
378
|
+
export declare const __yak_map: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
379
|
+
export declare const __yak_mark: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
380
|
+
export declare const __yak_menu: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
381
|
+
export declare const __yak_menuitem: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
382
|
+
export declare const __yak_meta: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
383
|
+
export declare const __yak_meter: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
384
|
+
export declare const __yak_nav: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
385
|
+
export declare const __yak_noscript: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
386
|
+
export declare const __yak_object: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
387
|
+
export declare const __yak_ol: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
388
|
+
export declare const __yak_optgroup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
389
|
+
export declare const __yak_option: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
390
|
+
export declare const __yak_output: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
391
|
+
export declare const __yak_p: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
392
|
+
export declare const __yak_param: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
393
|
+
export declare const __yak_picture: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
394
|
+
export declare const __yak_pre: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
395
|
+
export declare const __yak_progress: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
396
|
+
export declare const __yak_q: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
397
|
+
export declare const __yak_rp: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
398
|
+
export declare const __yak_rt: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
399
|
+
export declare const __yak_ruby: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
400
|
+
export declare const __yak_s: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
401
|
+
export declare const __yak_samp: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
402
|
+
export declare const __yak_script: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
403
|
+
export declare const __yak_section: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
404
|
+
export declare const __yak_select: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
405
|
+
export declare const __yak_small: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
406
|
+
export declare const __yak_source: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
407
|
+
export declare const __yak_span: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
408
|
+
export declare const __yak_strong: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
409
|
+
export declare const __yak_style: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
410
|
+
export declare const __yak_sub: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
411
|
+
export declare const __yak_summary: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
412
|
+
export declare const __yak_sup: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
413
|
+
export declare const __yak_table: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
414
|
+
export declare const __yak_tbody: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
415
|
+
export declare const __yak_td: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
416
|
+
export declare const __yak_textarea: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
417
|
+
export declare const __yak_tfoot: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
418
|
+
export declare const __yak_th: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
419
|
+
export declare const __yak_thead: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
420
|
+
export declare const __yak_time: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
421
|
+
export declare const __yak_tr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
422
|
+
export declare const __yak_track: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
423
|
+
export declare const __yak_u: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
424
|
+
export declare const __yak_ul: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
425
|
+
export declare const __yak_use: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
426
|
+
export declare const __yak_var: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
427
|
+
export declare const __yak_video: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
428
|
+
export declare const __yak_wbr: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
429
|
+
export declare const __yak_circle: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
430
|
+
export declare const __yak_clipPath: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
431
|
+
export declare const __yak_defs: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
432
|
+
export declare const __yak_ellipse: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
433
|
+
export declare const __yak_foreignObject: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
434
|
+
export declare const __yak_g: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
435
|
+
export declare const __yak_image: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
436
|
+
export declare const __yak_line: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
437
|
+
export declare const __yak_linearGradient: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
438
|
+
export declare const __yak_marker: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
439
|
+
export declare const __yak_mask: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
440
|
+
export declare const __yak_path: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
441
|
+
export declare const __yak_pattern: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
442
|
+
export declare const __yak_polygon: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
443
|
+
export declare const __yak_polyline: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
444
|
+
export declare const __yak_radialGradient: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
445
|
+
export declare const __yak_rect: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
446
|
+
export declare const __yak_stop: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
447
|
+
export declare const __yak_svg: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
448
|
+
export declare const __yak_text: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
449
|
+
export declare const __yak_tspan: LiteralWithAttrs<import("react").DOMAttributes<Element> & import("react").RefAttributes<Element>>;
|
|
450
450
|
//#endregion
|
|
451
|
-
export { YakThemeProvider,
|
|
451
|
+
export { YakThemeProvider, mergeClassNames as __yak_mergeClassNames, mergeCssProp as __yak_mergeCssProp, unitPostFix as __yak_unitPostFix, useTheme };
|
|
452
452
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -24,7 +24,7 @@ interface Evaluator {
|
|
|
24
24
|
[Symbol.asyncDispose](): Promise<void>;
|
|
25
25
|
}
|
|
26
26
|
/** Creates an evaluator that runs modules in isolated worker threads with dependency tracking. */
|
|
27
|
-
declare function createEvaluator(): Promise<Evaluator>;
|
|
27
|
+
export declare function createEvaluator(): Promise<Evaluator>;
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export type { EvaluateResult, Evaluator };
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import { isAbsolute } from "node:path";
|
|
2
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
5
5
|
//#region ../yak-internals/isolated-source-eval/loader-hooks.ts
|
|
@@ -35,7 +35,7 @@ function createLoaderDataUrl() {
|
|
|
35
35
|
function resolveWorkerPath() {
|
|
36
36
|
const jsPath = fileURLToPath(new URL("./worker.js", import.meta.url));
|
|
37
37
|
if (existsSync(jsPath)) return jsPath;
|
|
38
|
-
return fileURLToPath(
|
|
38
|
+
return join(dirname(fileURLToPath(import.meta.url)), "worker.ts");
|
|
39
39
|
}
|
|
40
40
|
function bootWorker() {
|
|
41
41
|
const workerPath = resolveWorkerPath();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../yak-internals/isolated-source-eval/loader-hooks.ts","../../../yak-internals/isolated-source-eval/evaluator.ts"],"sourcesContent":["/**\n * ESM loader hook source, embedded as a string constant.\n *\n * This MUST be plain JavaScript — not TypeScript. The loader thread receives\n * this code via a `data:` URL passed to `module.register()`. Node's loader\n * thread does not run data: URLs through strip-types, so any TypeScript\n * syntax here would cause a SyntaxError at registration time.\n *\n * The hook uses a MessagePort (received in `initialize`) to communicate\n * collected dependencies back to the worker thread on demand. Dependencies\n * are accumulated in a Set during `resolve()` calls, then flushed as a\n * batch when the worker requests them after an evaluation completes. This\n * batching avoids per-import message overhead and keeps dependency tracking\n * tightly coupled to a single evaluation.\n *\n * Only `file://` URLs outside of `node_modules` are tracked. Node built-ins\n * (`node:*`) and third-party packages are excluded because consumers only\n * need to invalidate on project source file changes.\n *\n * `fileURLToPath` converts `file://` URLs into platform-correct absolute\n * paths (avoids the leading-slash issue `URL.pathname` has on Windows).\n */\nconst LOADER_HOOK_SOURCE = `\nimport { fileURLToPath } from \"node:url\";\n\nlet port;\nconst deps = new Set();\n\nexport function initialize(data) {\n port = data.port;\n port.on(\"message\", (msg) => {\n if (msg === \"getDeps\") {\n port.postMessage([...deps]);\n deps.clear();\n }\n });\n}\n\nexport async function resolve(specifier, context, nextResolve) {\n const result = await nextResolve(specifier);\n if (result.url.startsWith(\"file://\") && !result.url.includes(\"/node_modules/\")) {\n deps.add(fileURLToPath(result.url));\n }\n return result;\n}\n`;\n\n/**\n * Pre-computed data URL for the loader hook source.\n *\n * The same URL is reused across workers — each `module.register()` call\n * creates an independent loader instance with its own dependency Set\n * regardless of URL identity.\n */\nconst LOADER_DATA_URL = `data:text/javascript;base64,${Buffer.from(LOADER_HOOK_SOURCE).toString(\"base64\")}`;\n\n/** Returns the loader hook as a base64 `data:` URL. */\nexport function createLoaderDataUrl(): string {\n return LOADER_DATA_URL;\n}\n","import { existsSync } from \"node:fs\";\nimport { isAbsolute } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { Worker } from \"node:worker_threads\";\nimport { createLoaderDataUrl } from \"./loader-hooks.ts\";\n\nexport type EvaluateResult =\n | { ok: true; value: Record<string, unknown>; dependencies: string[] }\n | { ok: false; error: { message: string; stack: string } };\n\nexport interface Evaluator {\n /** Evaluate a module and return its exports plus the full transitive dependency list. */\n evaluate(absolutePath: string): Promise<EvaluateResult>;\n /** Clear cached results for every entry point that transitively depends on the given file(s). */\n invalidate(...absolutePaths: string[]): void;\n /** Clear the entire result cache and swap workers. */\n invalidateAll(): void;\n /** Return entry point paths that would be affected by invalidate(absolutePath). */\n getDependentsOf(absolutePath: string): string[];\n /** Terminate both workers and reject any pending evaluations. */\n dispose(): Promise<void>;\n [Symbol.asyncDispose](): Promise<void>;\n}\n\n/** Wire format for messages from the worker back to the main thread. */\ntype WorkerResult =\n | {\n type: \"result\";\n id: number;\n ok: true;\n value: Record<string, unknown>;\n dependencies: string[];\n }\n | {\n type: \"result\";\n id: number;\n ok: false;\n error: { message: string; stack: string };\n dependencies: string[];\n };\n\ninterface PendingEvaluation {\n id: number;\n absolutePath: string;\n resolve: (result: EvaluateResult) => void;\n reject: (error: Error) => void;\n /** Number of times this evaluation has been retried due to staleness detection. */\n retryCount: number;\n}\n\n/**\n * Resolves the worker entry point path.\n *\n * In production the compiled `.js` file exists in `dist/` — we prefer that.\n * During development (vitest runs against source), only the `.ts` file exists.\n * Node 22.18.0+ handles `.ts` natively via strip-types, so the fallback works\n * without any flags or loaders.\n */\nfunction resolveWorkerPath(): string {\n const jsPath = fileURLToPath(new URL(\"./worker.js\", import.meta.url));\n if (existsSync(jsPath)) {\n return jsPath;\n }\n return fileURLToPath(new URL(\"./worker.ts\", import.meta.url));\n}\n\n/**\n * Boots a worker and returns a handle with a ready promise.\n *\n * The loader hook data URL is passed via `workerData` rather than having\n * the worker import it from a sibling module. This avoids a module\n * resolution mismatch: source files use `.ts` extensions (required by\n * Node strip-types) while compiled output uses `.js` (rewritten by tsc\n * via `rewriteRelativeImportExtensions`). Since the worker file would need\n * to import loader-hooks with the right extension for its context, passing\n * the data URL through workerData eliminates the problem entirely.\n */\nfunction bootWorker(): { worker: Worker; ready: Promise<void> } {\n const workerPath = resolveWorkerPath();\n const loaderDataUrl = createLoaderDataUrl();\n const worker = new Worker(workerPath, {\n workerData: { loaderDataUrl },\n });\n const ready = new Promise<void>((resolve) => {\n const onMessage = (msg: { type: string }) => {\n if (msg.type === \"ready\") {\n worker.off(\"message\", onMessage);\n resolve();\n }\n };\n worker.on(\"message\", onMessage);\n });\n return { worker, ready };\n}\n\n/** Default timeout for a single evaluation in milliseconds. */\nconst DEFAULT_EVAL_TIMEOUT_MS = 30_000;\n\n/** Maximum number of staleness retries before giving up with an error. */\nconst MAX_STALENESS_RETRIES = 3;\n\n/** Creates an evaluator that runs modules in isolated worker threads with dependency tracking. */\nexport async function createEvaluator(): Promise<Evaluator> {\n const resultCache = new Map<string, EvaluateResult>();\n /**\n * Tracks in-flight evaluation promises by path. When `evaluate()` is called\n * for a path that's already queued or being evaluated, the same promise is\n * returned instead of queuing a duplicate. This prevents a second worker\n * evaluation from producing incomplete dependencies (the ESM resolve hook\n * only fires on cache misses — a second import on the same worker would\n * miss transitive deps that are already in the ESM cache).\n */\n const inflight = new Map<string, Promise<EvaluateResult>>();\n\n /**\n * Two dependency maps provide O(1) lookups in both directions:\n *\n * - `reverseDeps`: file path → set of entry points that depend on it.\n * Consulted during `invalidate()` to find which cached results to clear.\n *\n * - `forwardDeps`: entry point → set of all its transitive dependencies.\n * Needed to clean up stale reverse entries when an entry point is\n * re-evaluated and its dependency tree has changed (e.g. an import\n * was removed). Without this, removed dependencies would accumulate\n * phantom reverse entries that never get cleaned up.\n */\n const reverseDeps = new Map<string, Set<string>>();\n const forwardDeps = new Map<string, Set<string>>();\n\n let nextId = 0;\n let currentEval: PendingEvaluation | null = null;\n let currentTimeout: ReturnType<typeof setTimeout> | null = null;\n const queue: PendingEvaluation[] = [];\n /**\n * Tracks files passed to `invalidate()` while an evaluation is in-flight.\n * When an evaluation completes, `handleResult()` checks whether any reported\n * dependency intersects this set. If so, the result is stale — it's discarded,\n * workers are swapped, and the evaluation is retried on a clean worker.\n *\n * This closes the \"cold start\" gap: if `evaluate(\"A\")` is dispatched before\n * `invalidate(\"B\")` is called, and A depends on B, the dependency graph\n * doesn't know about A→B yet. Without this set, the invalidation would be\n * silently missed.\n *\n * Cleared in `swapWorkers()` because the new primary has a clean ESM cache.\n */\n const invalidatedDuringEval = new Set<string>();\n let disposed = false;\n\n /**\n * Two workers are maintained at all times:\n *\n * - **primary**: handles all evaluate() calls. Accumulates Node's ESM\n * module cache over time, making repeated evaluations fast (~1-3ms).\n *\n * - **shadow**: pre-booted but completely idle. Never evaluates anything,\n * so its module cache stays empty. On invalidation, the primary is\n * terminated (stale cache) and the shadow is promoted to primary\n * instantly (no boot latency). A new shadow is booted in the background.\n *\n * This pattern trades ~30ms of background boot time for instant\n * invalidation. The alternative — reusing a single worker and clearing\n * its ESM cache — isn't possible because Node doesn't expose an API\n * to clear the module cache.\n */\n let primary = bootWorker();\n let shadow = bootWorker();\n\n await Promise.all([primary.ready, shadow.ready]);\n\n /**\n * Allow the process to exit naturally when the event loop is otherwise empty.\n * Without this, the workers keep the event loop alive indefinitely — causing\n * hangs in multi-environment Vite builds where no hook reliably disposes\n * the evaluator after all environments are done.\n * Must be called after setupMessageHandler since .on() can re-ref the worker.\n */\n function unrefWorkers(primaryWorker: Worker, shadowWorker: Worker) {\n primaryWorker.unref();\n shadowWorker.unref();\n }\n\n function setupMessageHandler(workerObj: { worker: Worker }) {\n workerObj.worker.on(\"message\", (msg: WorkerResult) => {\n if (msg.type !== \"result\") return;\n handleResult(msg);\n });\n\n workerObj.worker.on(\"error\", (err: Error) => {\n if (currentEval) {\n clearEvalTimeout();\n const pending = currentEval;\n currentEval = null;\n const result: EvaluateResult = {\n ok: false,\n error: { message: err.message, stack: err.stack ?? \"\" },\n };\n updateDeps(pending.absolutePath, [pending.absolutePath]);\n resultCache.set(pending.absolutePath, result);\n inflight.delete(pending.absolutePath);\n pending.resolve(result);\n processQueue();\n }\n });\n }\n\n setupMessageHandler(primary);\n unrefWorkers(primary.worker, shadow.worker);\n\n function clearEvalTimeout() {\n if (currentTimeout !== null) {\n clearTimeout(currentTimeout);\n currentTimeout = null;\n }\n }\n\n function handleResult(msg: WorkerResult) {\n if (!currentEval) return;\n if (msg.id !== currentEval.id) return;\n\n clearEvalTimeout();\n\n const pending = currentEval;\n currentEval = null;\n\n // Staleness check: if a file was invalidated while this evaluation was\n // in-flight and the result depends on it, discard the result and retry\n // on a clean worker. Only checked for successes — errors don't report\n // deps, and the file watcher will trigger another invalidation when the\n // source is fixed.\n if (msg.ok && invalidatedDuringEval.size > 0) {\n const isStale = msg.dependencies.some((dep) => invalidatedDuringEval.has(dep));\n if (isStale) {\n if (pending.retryCount >= MAX_STALENESS_RETRIES) {\n pending.resolve({\n ok: false,\n error: {\n message: `Evaluation of ${pending.absolutePath} exceeded maximum staleness retries (${MAX_STALENESS_RETRIES})`,\n stack: \"\",\n },\n });\n processQueue();\n return;\n }\n pending.retryCount++;\n swapWorkers();\n queue.unshift(pending);\n processQueue();\n return;\n }\n }\n\n let result: EvaluateResult;\n if (msg.ok) {\n result = { ok: true, value: msg.value, dependencies: msg.dependencies };\n updateDeps(pending.absolutePath, msg.dependencies);\n } else {\n result = { ok: false, error: msg.error };\n // Use the partial dependencies reported by the worker (files resolved\n // before the error). This ensures transitive deps are registered in\n // reverseDeps so that fixing a broken file triggers re-evaluation.\n updateDeps(pending.absolutePath, msg.dependencies);\n }\n\n resultCache.set(pending.absolutePath, result);\n inflight.delete(pending.absolutePath);\n pending.resolve(result);\n processQueue();\n }\n\n /**\n * Reconciles the dependency graph after an evaluation.\n *\n * First removes all old reverse entries for this entry point (using\n * forwardDeps as the source of truth), then writes the new forward\n * and reverse mappings. This ensures that if a dependency was removed\n * between evaluations, it no longer points back to this entry point.\n */\n function updateDeps(entryPoint: string, deps: string[]) {\n const oldDeps = forwardDeps.get(entryPoint);\n if (oldDeps) {\n for (const dep of oldDeps) {\n const entries = reverseDeps.get(dep);\n if (entries) {\n entries.delete(entryPoint);\n if (entries.size === 0) {\n reverseDeps.delete(dep);\n }\n }\n }\n }\n\n const depSet = new Set(deps);\n forwardDeps.set(entryPoint, depSet);\n\n for (const dep of depSet) {\n let entries = reverseDeps.get(dep);\n if (!entries) {\n entries = new Set();\n reverseDeps.set(dep, entries);\n }\n entries.add(entryPoint);\n }\n }\n\n /**\n * Evaluations are serialized — one at a time per worker. This prevents\n * interleaved dependency tracking: the loader hook accumulates deps in\n * a single Set and flushes it after each evaluation. Concurrent imports\n * would mix dependencies from different entry points.\n *\n * Waits for the primary worker to be ready before sending work. This\n * matters after a swap: the promoted shadow may still be booting.\n */\n function processQueue() {\n if (currentEval || queue.length === 0 || disposed) return;\n\n const next = queue.shift()!;\n\n // A prior evaluation for the same path may have completed and cached\n // while this item was queued (e.g. after invalidation + re-queue).\n // Resolving from cache avoids dispatching to a worker where the module\n // is already in the ESM cache (which would produce incomplete deps).\n const alreadyCached = resultCache.get(next.absolutePath);\n if (alreadyCached) {\n inflight.delete(next.absolutePath);\n next.resolve(alreadyCached);\n processQueue();\n return;\n }\n\n currentEval = next;\n\n primary.ready.then(() => {\n if (disposed || currentEval !== next) return;\n primary.worker.postMessage({\n type: \"evaluate\",\n id: next.id,\n absolutePath: next.absolutePath,\n });\n\n currentTimeout = setTimeout(() => {\n if (currentEval !== next) return;\n currentEval = null;\n currentTimeout = null;\n\n const result: EvaluateResult = {\n ok: false,\n error: {\n message: `Evaluation of ${next.absolutePath} timed out after ${DEFAULT_EVAL_TIMEOUT_MS}ms`,\n stack: \"\",\n },\n };\n updateDeps(next.absolutePath, [next.absolutePath]);\n resultCache.set(next.absolutePath, result);\n inflight.delete(next.absolutePath);\n next.resolve(result);\n\n swapWorkers();\n processQueue();\n }, DEFAULT_EVAL_TIMEOUT_MS);\n });\n }\n\n /**\n * Terminates the primary (stale module cache), promotes the shadow\n * (clean cache, instant), and boots a new shadow in the background.\n *\n * `removeAllListeners` prevents the terminated worker from delivering\n * late messages or error events that would confuse the result handler.\n */\n function swapWorkers() {\n primary.worker.removeAllListeners();\n primary.worker.terminate();\n\n primary = shadow;\n setupMessageHandler(primary);\n\n shadow = bootWorker();\n unrefWorkers(primary.worker, shadow.worker);\n\n // The new primary has a clean ESM cache, so any previously tracked\n // invalidations are no longer relevant — the fresh worker will\n // re-import everything from disk.\n invalidatedDuringEval.clear();\n }\n\n function evaluate(absolutePath: string): Promise<EvaluateResult> {\n if (disposed) {\n return Promise.reject(new Error(\"Evaluator has been disposed\"));\n }\n\n if (!isAbsolute(absolutePath)) {\n return Promise.reject(\n new Error(`evaluate() requires an absolute path, got: ${absolutePath}`),\n );\n }\n\n const cached = resultCache.get(absolutePath);\n if (cached) {\n return Promise.resolve(cached);\n }\n\n // Deduplicate: if an evaluation is already queued or in-flight for this\n // path, return the same promise. This prevents a second worker evaluation\n // that would produce incomplete dependencies (the ESM resolve hook only\n // fires on cache misses).\n const pending = inflight.get(absolutePath);\n if (pending) return pending;\n\n const promise = new Promise<EvaluateResult>((resolve, reject) => {\n const id = nextId++;\n queue.push({ id, absolutePath, resolve, reject, retryCount: 0 });\n processQueue();\n });\n\n inflight.set(absolutePath, promise);\n return promise;\n }\n\n function invalidate(...absolutePaths: string[]): void {\n if (absolutePaths.length === 0) return;\n\n // Track all invalidations for cold-start detection (in-flight evaluations\n // whose dependency graph isn't populated yet).\n for (const path of absolutePaths) {\n invalidatedDuringEval.add(path);\n }\n\n // Collect all affected entry points across all changed files.\n const allEntryPoints = new Set<string>();\n for (const path of absolutePaths) {\n const entryPoints = reverseDeps.get(path);\n if (entryPoints) {\n for (const entry of entryPoints) {\n allEntryPoints.add(entry);\n }\n }\n }\n\n // If no cached entry points are affected, return early. The cold-start\n // set (invalidatedDuringEval) will catch in-flight evaluations.\n if (allEntryPoints.size === 0) return;\n\n // Clear caches and clean dependency graphs for all affected entry points.\n for (const entry of allEntryPoints) {\n resultCache.delete(entry);\n inflight.delete(entry);\n\n const deps = forwardDeps.get(entry);\n if (deps) {\n for (const dep of deps) {\n const entries = reverseDeps.get(dep);\n if (entries) {\n entries.delete(entry);\n if (entries.size === 0) {\n reverseDeps.delete(dep);\n }\n }\n }\n forwardDeps.delete(entry);\n }\n }\n\n // If an evaluation is in-flight on the worker we're about to terminate,\n // capture it and re-queue at the front. The caller's promise will\n // resolve transparently with the result from the promoted shadow worker.\n clearEvalTimeout();\n const inflightEval = currentEval;\n currentEval = null;\n\n swapWorkers();\n\n if (inflightEval) {\n queue.unshift(inflightEval);\n }\n\n processQueue();\n }\n\n function invalidateAll(): void {\n resultCache.clear();\n inflight.clear();\n forwardDeps.clear();\n reverseDeps.clear();\n\n clearEvalTimeout();\n const inflightEval = currentEval;\n currentEval = null;\n\n swapWorkers();\n\n if (inflightEval) {\n queue.unshift(inflightEval);\n }\n\n processQueue();\n }\n\n function getDependentsOf(absolutePath: string): string[] {\n const entryPoints = reverseDeps.get(absolutePath);\n if (!entryPoints) return [];\n return [...entryPoints];\n }\n\n async function dispose(): Promise<void> {\n if (disposed) return;\n disposed = true;\n\n clearEvalTimeout();\n\n if (currentEval) {\n currentEval.reject(new Error(\"Evaluator has been disposed\"));\n currentEval = null;\n }\n for (const pending of queue) {\n pending.reject(new Error(\"Evaluator has been disposed\"));\n }\n queue.length = 0;\n inflight.clear();\n\n await Promise.all([primary.worker.terminate(), shadow.worker.terminate()]);\n }\n\n return {\n evaluate,\n invalidate,\n invalidateAll,\n getDependentsOf,\n dispose,\n [Symbol.asyncDispose]: dispose,\n };\n}\n"],"mappings":";;;;;AAsDA,MAAM,kBAAkB,+BAA+B,OAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAAkB,CAAC,CAAC,SAAS,QAAQ;AAGxG,SAAgB,sBAA8B;CAC5C,OAAO;AACT;;;ACDA,SAAS,oBAA4B;CACnC,MAAM,SAAS,cAAc,IAAI,IAAI,eAAe,YAAY,GAAG,CAAC;CACpE,IAAI,WAAW,MAAM,GACnB,OAAO;CAET,OAAO,cAAc,IAAI,IAAI,eAAe,YAAY,GAAG,CAAC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,OAAO,KAAK;MACpB,IAAI,QAAQ,SAAS,GACnB,YAAY,OAAO,GAAG;KAE1B;IACF;IACA,YAAY,OAAO,KAAK;GAC1B;EACF;EAKA,iBAAiB;EACjB,MAAM,eAAe;EACrB,cAAc;EAEd,YAAY;EAEZ,IAAI,cACF,MAAM,QAAQ,YAAY;EAG5B,aAAa;CACf;CAEA,SAAS,gBAAsB;EAC7B,YAAY,MAAM;EAClB,SAAS,MAAM;EACf,YAAY,MAAM;EAClB,YAAY,MAAM;EAElB,iBAAiB;EACjB,MAAM,eAAe;EACrB,cAAc;EAEd,YAAY;EAEZ,IAAI,cACF,MAAM,QAAQ,YAAY;EAG5B,aAAa;CACf;CAEA,SAAS,gBAAgB,cAAgC;EACvD,MAAM,cAAc,YAAY,IAAI,YAAY;EAChD,IAAI,CAAC,aAAa,OAAO,CAAC;EAC1B,OAAO,CAAC,GAAG,WAAW;CACxB;CAEA,eAAe,UAAyB;EACtC,IAAI,UAAU;EACd,WAAW;EAEX,iBAAiB;EAEjB,IAAI,aAAa;GACf,YAAY,uBAAO,IAAI,MAAM,6BAA6B,CAAC;GAC3D,cAAc;EAChB;EACA,KAAK,MAAM,WAAW,OACpB,QAAQ,uBAAO,IAAI,MAAM,6BAA6B,CAAC;EAEzD,MAAM,SAAS;EACf,SAAS,MAAM;EAEf,MAAM,QAAQ,IAAI,CAAC,QAAQ,OAAO,UAAU,GAAG,OAAO,OAAO,UAAU,CAAC,CAAC;CAC3E;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;GACC,OAAO,eAAe;CACzB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../yak-internals/isolated-source-eval/loader-hooks.ts","../../../yak-internals/isolated-source-eval/evaluator.ts"],"sourcesContent":["/**\n * ESM loader hook source, embedded as a string constant.\n *\n * This MUST be plain JavaScript — not TypeScript. The loader thread receives\n * this code via a `data:` URL passed to `module.register()`. Node's loader\n * thread does not run data: URLs through strip-types, so any TypeScript\n * syntax here would cause a SyntaxError at registration time.\n *\n * The hook uses a MessagePort (received in `initialize`) to communicate\n * collected dependencies back to the worker thread on demand. Dependencies\n * are accumulated in a Set during `resolve()` calls, then flushed as a\n * batch when the worker requests them after an evaluation completes. This\n * batching avoids per-import message overhead and keeps dependency tracking\n * tightly coupled to a single evaluation.\n *\n * Only `file://` URLs outside of `node_modules` are tracked. Node built-ins\n * (`node:*`) and third-party packages are excluded because consumers only\n * need to invalidate on project source file changes.\n *\n * `fileURLToPath` converts `file://` URLs into platform-correct absolute\n * paths (avoids the leading-slash issue `URL.pathname` has on Windows).\n */\nconst LOADER_HOOK_SOURCE = `\nimport { fileURLToPath } from \"node:url\";\n\nlet port;\nconst deps = new Set();\n\nexport function initialize(data) {\n port = data.port;\n port.on(\"message\", (msg) => {\n if (msg === \"getDeps\") {\n port.postMessage([...deps]);\n deps.clear();\n }\n });\n}\n\nexport async function resolve(specifier, context, nextResolve) {\n const result = await nextResolve(specifier);\n if (result.url.startsWith(\"file://\") && !result.url.includes(\"/node_modules/\")) {\n deps.add(fileURLToPath(result.url));\n }\n return result;\n}\n`;\n\n/**\n * Pre-computed data URL for the loader hook source.\n *\n * The same URL is reused across workers — each `module.register()` call\n * creates an independent loader instance with its own dependency Set\n * regardless of URL identity.\n */\nconst LOADER_DATA_URL = `data:text/javascript;base64,${Buffer.from(LOADER_HOOK_SOURCE).toString(\"base64\")}`;\n\n/** Returns the loader hook as a base64 `data:` URL. */\nexport function createLoaderDataUrl(): string {\n return LOADER_DATA_URL;\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, isAbsolute, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { Worker } from \"node:worker_threads\";\nimport { createLoaderDataUrl } from \"./loader-hooks.ts\";\n\nexport type EvaluateResult =\n | { ok: true; value: Record<string, unknown>; dependencies: string[] }\n | { ok: false; error: { message: string; stack: string } };\n\nexport interface Evaluator {\n /** Evaluate a module and return its exports plus the full transitive dependency list. */\n evaluate(absolutePath: string): Promise<EvaluateResult>;\n /** Clear cached results for every entry point that transitively depends on the given file(s). */\n invalidate(...absolutePaths: string[]): void;\n /** Clear the entire result cache and swap workers. */\n invalidateAll(): void;\n /** Return entry point paths that would be affected by invalidate(absolutePath). */\n getDependentsOf(absolutePath: string): string[];\n /** Terminate both workers and reject any pending evaluations. */\n dispose(): Promise<void>;\n [Symbol.asyncDispose](): Promise<void>;\n}\n\n/** Wire format for messages from the worker back to the main thread. */\ntype WorkerResult =\n | {\n type: \"result\";\n id: number;\n ok: true;\n value: Record<string, unknown>;\n dependencies: string[];\n }\n | {\n type: \"result\";\n id: number;\n ok: false;\n error: { message: string; stack: string };\n dependencies: string[];\n };\n\ninterface PendingEvaluation {\n id: number;\n absolutePath: string;\n resolve: (result: EvaluateResult) => void;\n reject: (error: Error) => void;\n /** Number of times this evaluation has been retried due to staleness detection. */\n retryCount: number;\n}\n\n/**\n * Resolves the worker entry point path.\n *\n * In production the compiled `.js` file exists in `dist/` — we prefer that.\n * During development (vitest runs against source), only the `.ts` file exists.\n * Node 22.18.0+ handles `.ts` natively via strip-types, so the fallback works\n * without any flags or loaders.\n */\nfunction resolveWorkerPath(): string {\n const jsPath = fileURLToPath(new URL(\"./worker.js\", import.meta.url));\n if (existsSync(jsPath)) {\n return jsPath;\n }\n // No `new URL()` here: turbopack resolve it statically and warns, because `dist/` has no `.ts` file\n return join(dirname(fileURLToPath(import.meta.url)), \"worker.ts\");\n}\n\n/**\n * Boots a worker and returns a handle with a ready promise.\n *\n * The loader hook data URL is passed via `workerData` rather than having\n * the worker import it from a sibling module. This avoids a module\n * resolution mismatch: source files use `.ts` extensions (required by\n * Node strip-types) while compiled output uses `.js` (rewritten by tsc\n * via `rewriteRelativeImportExtensions`). Since the worker file would need\n * to import loader-hooks with the right extension for its context, passing\n * the data URL through workerData eliminates the problem entirely.\n */\nfunction bootWorker(): { worker: Worker; ready: Promise<void> } {\n const workerPath = resolveWorkerPath();\n const loaderDataUrl = createLoaderDataUrl();\n const worker = new Worker(workerPath, {\n workerData: { loaderDataUrl },\n });\n const ready = new Promise<void>((resolve) => {\n const onMessage = (msg: { type: string }) => {\n if (msg.type === \"ready\") {\n worker.off(\"message\", onMessage);\n resolve();\n }\n };\n worker.on(\"message\", onMessage);\n });\n return { worker, ready };\n}\n\n/** Default timeout for a single evaluation in milliseconds. */\nconst DEFAULT_EVAL_TIMEOUT_MS = 30_000;\n\n/** Maximum number of staleness retries before giving up with an error. */\nconst MAX_STALENESS_RETRIES = 3;\n\n/** Creates an evaluator that runs modules in isolated worker threads with dependency tracking. */\nexport async function createEvaluator(): Promise<Evaluator> {\n const resultCache = new Map<string, EvaluateResult>();\n /**\n * Tracks in-flight evaluation promises by path. When `evaluate()` is called\n * for a path that's already queued or being evaluated, the same promise is\n * returned instead of queuing a duplicate. This prevents a second worker\n * evaluation from producing incomplete dependencies (the ESM resolve hook\n * only fires on cache misses — a second import on the same worker would\n * miss transitive deps that are already in the ESM cache).\n */\n const inflight = new Map<string, Promise<EvaluateResult>>();\n\n /**\n * Two dependency maps provide O(1) lookups in both directions:\n *\n * - `reverseDeps`: file path → set of entry points that depend on it.\n * Consulted during `invalidate()` to find which cached results to clear.\n *\n * - `forwardDeps`: entry point → set of all its transitive dependencies.\n * Needed to clean up stale reverse entries when an entry point is\n * re-evaluated and its dependency tree has changed (e.g. an import\n * was removed). Without this, removed dependencies would accumulate\n * phantom reverse entries that never get cleaned up.\n */\n const reverseDeps = new Map<string, Set<string>>();\n const forwardDeps = new Map<string, Set<string>>();\n\n let nextId = 0;\n let currentEval: PendingEvaluation | null = null;\n let currentTimeout: ReturnType<typeof setTimeout> | null = null;\n const queue: PendingEvaluation[] = [];\n /**\n * Tracks files passed to `invalidate()` while an evaluation is in-flight.\n * When an evaluation completes, `handleResult()` checks whether any reported\n * dependency intersects this set. If so, the result is stale — it's discarded,\n * workers are swapped, and the evaluation is retried on a clean worker.\n *\n * This closes the \"cold start\" gap: if `evaluate(\"A\")` is dispatched before\n * `invalidate(\"B\")` is called, and A depends on B, the dependency graph\n * doesn't know about A→B yet. Without this set, the invalidation would be\n * silently missed.\n *\n * Cleared in `swapWorkers()` because the new primary has a clean ESM cache.\n */\n const invalidatedDuringEval = new Set<string>();\n let disposed = false;\n\n /**\n * Two workers are maintained at all times:\n *\n * - **primary**: handles all evaluate() calls. Accumulates Node's ESM\n * module cache over time, making repeated evaluations fast (~1-3ms).\n *\n * - **shadow**: pre-booted but completely idle. Never evaluates anything,\n * so its module cache stays empty. On invalidation, the primary is\n * terminated (stale cache) and the shadow is promoted to primary\n * instantly (no boot latency). A new shadow is booted in the background.\n *\n * This pattern trades ~30ms of background boot time for instant\n * invalidation. The alternative — reusing a single worker and clearing\n * its ESM cache — isn't possible because Node doesn't expose an API\n * to clear the module cache.\n */\n let primary = bootWorker();\n let shadow = bootWorker();\n\n await Promise.all([primary.ready, shadow.ready]);\n\n /**\n * Allow the process to exit naturally when the event loop is otherwise empty.\n * Without this, the workers keep the event loop alive indefinitely — causing\n * hangs in multi-environment Vite builds where no hook reliably disposes\n * the evaluator after all environments are done.\n * Must be called after setupMessageHandler since .on() can re-ref the worker.\n */\n function unrefWorkers(primaryWorker: Worker, shadowWorker: Worker) {\n primaryWorker.unref();\n shadowWorker.unref();\n }\n\n function setupMessageHandler(workerObj: { worker: Worker }) {\n workerObj.worker.on(\"message\", (msg: WorkerResult) => {\n if (msg.type !== \"result\") return;\n handleResult(msg);\n });\n\n workerObj.worker.on(\"error\", (err: Error) => {\n if (currentEval) {\n clearEvalTimeout();\n const pending = currentEval;\n currentEval = null;\n const result: EvaluateResult = {\n ok: false,\n error: { message: err.message, stack: err.stack ?? \"\" },\n };\n updateDeps(pending.absolutePath, [pending.absolutePath]);\n resultCache.set(pending.absolutePath, result);\n inflight.delete(pending.absolutePath);\n pending.resolve(result);\n processQueue();\n }\n });\n }\n\n setupMessageHandler(primary);\n unrefWorkers(primary.worker, shadow.worker);\n\n function clearEvalTimeout() {\n if (currentTimeout !== null) {\n clearTimeout(currentTimeout);\n currentTimeout = null;\n }\n }\n\n function handleResult(msg: WorkerResult) {\n if (!currentEval) return;\n if (msg.id !== currentEval.id) return;\n\n clearEvalTimeout();\n\n const pending = currentEval;\n currentEval = null;\n\n // Staleness check: if a file was invalidated while this evaluation was\n // in-flight and the result depends on it, discard the result and retry\n // on a clean worker. Only checked for successes — errors don't report\n // deps, and the file watcher will trigger another invalidation when the\n // source is fixed.\n if (msg.ok && invalidatedDuringEval.size > 0) {\n const isStale = msg.dependencies.some((dep) => invalidatedDuringEval.has(dep));\n if (isStale) {\n if (pending.retryCount >= MAX_STALENESS_RETRIES) {\n pending.resolve({\n ok: false,\n error: {\n message: `Evaluation of ${pending.absolutePath} exceeded maximum staleness retries (${MAX_STALENESS_RETRIES})`,\n stack: \"\",\n },\n });\n processQueue();\n return;\n }\n pending.retryCount++;\n swapWorkers();\n queue.unshift(pending);\n processQueue();\n return;\n }\n }\n\n let result: EvaluateResult;\n if (msg.ok) {\n result = { ok: true, value: msg.value, dependencies: msg.dependencies };\n updateDeps(pending.absolutePath, msg.dependencies);\n } else {\n result = { ok: false, error: msg.error };\n // Use the partial dependencies reported by the worker (files resolved\n // before the error). This ensures transitive deps are registered in\n // reverseDeps so that fixing a broken file triggers re-evaluation.\n updateDeps(pending.absolutePath, msg.dependencies);\n }\n\n resultCache.set(pending.absolutePath, result);\n inflight.delete(pending.absolutePath);\n pending.resolve(result);\n processQueue();\n }\n\n /**\n * Reconciles the dependency graph after an evaluation.\n *\n * First removes all old reverse entries for this entry point (using\n * forwardDeps as the source of truth), then writes the new forward\n * and reverse mappings. This ensures that if a dependency was removed\n * between evaluations, it no longer points back to this entry point.\n */\n function updateDeps(entryPoint: string, deps: string[]) {\n const oldDeps = forwardDeps.get(entryPoint);\n if (oldDeps) {\n for (const dep of oldDeps) {\n const entries = reverseDeps.get(dep);\n if (entries) {\n entries.delete(entryPoint);\n if (entries.size === 0) {\n reverseDeps.delete(dep);\n }\n }\n }\n }\n\n const depSet = new Set(deps);\n forwardDeps.set(entryPoint, depSet);\n\n for (const dep of depSet) {\n let entries = reverseDeps.get(dep);\n if (!entries) {\n entries = new Set();\n reverseDeps.set(dep, entries);\n }\n entries.add(entryPoint);\n }\n }\n\n /**\n * Evaluations are serialized — one at a time per worker. This prevents\n * interleaved dependency tracking: the loader hook accumulates deps in\n * a single Set and flushes it after each evaluation. Concurrent imports\n * would mix dependencies from different entry points.\n *\n * Waits for the primary worker to be ready before sending work. This\n * matters after a swap: the promoted shadow may still be booting.\n */\n function processQueue() {\n if (currentEval || queue.length === 0 || disposed) return;\n\n const next = queue.shift()!;\n\n // A prior evaluation for the same path may have completed and cached\n // while this item was queued (e.g. after invalidation + re-queue).\n // Resolving from cache avoids dispatching to a worker where the module\n // is already in the ESM cache (which would produce incomplete deps).\n const alreadyCached = resultCache.get(next.absolutePath);\n if (alreadyCached) {\n inflight.delete(next.absolutePath);\n next.resolve(alreadyCached);\n processQueue();\n return;\n }\n\n currentEval = next;\n\n primary.ready.then(() => {\n if (disposed || currentEval !== next) return;\n primary.worker.postMessage({\n type: \"evaluate\",\n id: next.id,\n absolutePath: next.absolutePath,\n });\n\n currentTimeout = setTimeout(() => {\n if (currentEval !== next) return;\n currentEval = null;\n currentTimeout = null;\n\n const result: EvaluateResult = {\n ok: false,\n error: {\n message: `Evaluation of ${next.absolutePath} timed out after ${DEFAULT_EVAL_TIMEOUT_MS}ms`,\n stack: \"\",\n },\n };\n updateDeps(next.absolutePath, [next.absolutePath]);\n resultCache.set(next.absolutePath, result);\n inflight.delete(next.absolutePath);\n next.resolve(result);\n\n swapWorkers();\n processQueue();\n }, DEFAULT_EVAL_TIMEOUT_MS);\n });\n }\n\n /**\n * Terminates the primary (stale module cache), promotes the shadow\n * (clean cache, instant), and boots a new shadow in the background.\n *\n * `removeAllListeners` prevents the terminated worker from delivering\n * late messages or error events that would confuse the result handler.\n */\n function swapWorkers() {\n primary.worker.removeAllListeners();\n primary.worker.terminate();\n\n primary = shadow;\n setupMessageHandler(primary);\n\n shadow = bootWorker();\n unrefWorkers(primary.worker, shadow.worker);\n\n // The new primary has a clean ESM cache, so any previously tracked\n // invalidations are no longer relevant — the fresh worker will\n // re-import everything from disk.\n invalidatedDuringEval.clear();\n }\n\n function evaluate(absolutePath: string): Promise<EvaluateResult> {\n if (disposed) {\n return Promise.reject(new Error(\"Evaluator has been disposed\"));\n }\n\n if (!isAbsolute(absolutePath)) {\n return Promise.reject(\n new Error(`evaluate() requires an absolute path, got: ${absolutePath}`),\n );\n }\n\n const cached = resultCache.get(absolutePath);\n if (cached) {\n return Promise.resolve(cached);\n }\n\n // Deduplicate: if an evaluation is already queued or in-flight for this\n // path, return the same promise. This prevents a second worker evaluation\n // that would produce incomplete dependencies (the ESM resolve hook only\n // fires on cache misses).\n const pending = inflight.get(absolutePath);\n if (pending) return pending;\n\n const promise = new Promise<EvaluateResult>((resolve, reject) => {\n const id = nextId++;\n queue.push({ id, absolutePath, resolve, reject, retryCount: 0 });\n processQueue();\n });\n\n inflight.set(absolutePath, promise);\n return promise;\n }\n\n function invalidate(...absolutePaths: string[]): void {\n if (absolutePaths.length === 0) return;\n\n // Track all invalidations for cold-start detection (in-flight evaluations\n // whose dependency graph isn't populated yet).\n for (const path of absolutePaths) {\n invalidatedDuringEval.add(path);\n }\n\n // Collect all affected entry points across all changed files.\n const allEntryPoints = new Set<string>();\n for (const path of absolutePaths) {\n const entryPoints = reverseDeps.get(path);\n if (entryPoints) {\n for (const entry of entryPoints) {\n allEntryPoints.add(entry);\n }\n }\n }\n\n // If no cached entry points are affected, return early. The cold-start\n // set (invalidatedDuringEval) will catch in-flight evaluations.\n if (allEntryPoints.size === 0) return;\n\n // Clear caches and clean dependency graphs for all affected entry points.\n for (const entry of allEntryPoints) {\n resultCache.delete(entry);\n inflight.delete(entry);\n\n const deps = forwardDeps.get(entry);\n if (deps) {\n for (const dep of deps) {\n const entries = reverseDeps.get(dep);\n if (entries) {\n entries.delete(entry);\n if (entries.size === 0) {\n reverseDeps.delete(dep);\n }\n }\n }\n forwardDeps.delete(entry);\n }\n }\n\n // If an evaluation is in-flight on the worker we're about to terminate,\n // capture it and re-queue at the front. The caller's promise will\n // resolve transparently with the result from the promoted shadow worker.\n clearEvalTimeout();\n const inflightEval = currentEval;\n currentEval = null;\n\n swapWorkers();\n\n if (inflightEval) {\n queue.unshift(inflightEval);\n }\n\n processQueue();\n }\n\n function invalidateAll(): void {\n resultCache.clear();\n inflight.clear();\n forwardDeps.clear();\n reverseDeps.clear();\n\n clearEvalTimeout();\n const inflightEval = currentEval;\n currentEval = null;\n\n swapWorkers();\n\n if (inflightEval) {\n queue.unshift(inflightEval);\n }\n\n processQueue();\n }\n\n function getDependentsOf(absolutePath: string): string[] {\n const entryPoints = reverseDeps.get(absolutePath);\n if (!entryPoints) return [];\n return [...entryPoints];\n }\n\n async function dispose(): Promise<void> {\n if (disposed) return;\n disposed = true;\n\n clearEvalTimeout();\n\n if (currentEval) {\n currentEval.reject(new Error(\"Evaluator has been disposed\"));\n currentEval = null;\n }\n for (const pending of queue) {\n pending.reject(new Error(\"Evaluator has been disposed\"));\n }\n queue.length = 0;\n inflight.clear();\n\n await Promise.all([primary.worker.terminate(), shadow.worker.terminate()]);\n }\n\n return {\n evaluate,\n invalidate,\n invalidateAll,\n getDependentsOf,\n dispose,\n [Symbol.asyncDispose]: dispose,\n };\n}\n"],"mappings":";;;;;AAsDA,MAAM,kBAAkB,+BAA+B,OAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAAkB,CAAC,CAAC,SAAS,QAAQ;AAGxG,SAAgB,sBAA8B;CAC5C,OAAO;AACT;;;ACDA,SAAS,oBAA4B;CACnC,MAAM,SAAS,cAAc,IAAI,IAAI,eAAe,YAAY,GAAG,CAAC;CACpE,IAAI,WAAW,MAAM,GACnB,OAAO;CAGT,OAAO,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,WAAW;AAClE;AAaA,SAAS,aAAuD;CAC9D,MAAM,aAAa,kBAAkB;CACrC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AG;KAE1B;IACF;IACA,YAAY,OAAO,KAAK;GAC1B;EACF;EAKA,iBAAiB;EACjB,MAAM,eAAe;EACrB,cAAc;EAEd,YAAY;EAEZ,IAAI,cACF,MAAM,QAAQ,YAAY;EAG5B,aAAa;CACf;CAEA,SAAS,gBAAsB;EAC7B,YAAY,MAAM;EAClB,SAAS,MAAM;EACf,YAAY,MAAM;EAClB,YAAY,MAAM;EAElB,iBAAiB;EACjB,MAAM,eAAe;EACrB,cAAc;EAEd,YAAY;EAEZ,IAAI,cACF,MAAM,QAAQ,YAAY;EAG5B,aAAa;CACf;CAEA,SAAS,gBAAgB,cAAgC;EACvD,MAAM,cAAc,YAAY,IAAI,YAAY;EAChD,IAAI,CAAC,aAAa,OAAO,CAAC;EAC1B,OAAO,CAAC,GAAG,WAAW;CACxB;CAEA,eAAe,UAAyB;EACtC,IAAI,UAAU;EACd,WAAW;EAEX,iBAAiB;EAEjB,IAAI,aAAa;GACf,YAAY,uBAAO,IAAI,MAAM,6BAA6B,CAAC;GAC3D,cAAc;EAChB;EACA,KAAK,MAAM,WAAW,OACpB,QAAQ,uBAAO,IAAI,MAAM,6BAA6B,CAAC;EAEzD,MAAM,SAAS;EACf,SAAS,MAAM;EAEf,MAAM,QAAQ,IAAI,CAAC,QAAQ,OAAO,UAAU,GAAG,OAAO,OAAO,UAAU,CAAC,CAAC;CAC3E;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;GACC,OAAO,eAAe;CACzB;AACF"}
|
|
@@ -21,7 +21,10 @@ function requestDeps() {
|
|
|
21
21
|
parentPort.on("message", async (msg) => {
|
|
22
22
|
if (msg.type !== "evaluate") return;
|
|
23
23
|
try {
|
|
24
|
-
const ns = await import(
|
|
24
|
+
const ns = await import(
|
|
25
|
+
/* turbopackIgnore: true */
|
|
26
|
+
pathToFileURL(msg.absolutePath).href
|
|
27
|
+
);
|
|
25
28
|
const deps = await requestDeps();
|
|
26
29
|
if (!deps.includes(msg.absolutePath)) deps.unshift(msg.absolutePath);
|
|
27
30
|
const value = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","names":[],"sources":["../../../yak-internals/isolated-source-eval/worker.ts"],"sourcesContent":["/**\n * Worker thread entry point for isolated module evaluation.\n *\n * Each worker is a full Node.js environment with its own ESM module cache.\n * Modules are loaded via dynamic `import()` — Node 22.18.0+ strips TypeScript\n * types natively, so no compilation step or flags are needed.\n *\n * The loader hook data URL is received via `workerData` rather than\n * importing it from a sibling module. This avoids a cross-file import\n * resolution problem: Node's strip-types requires `.ts` extensions in\n * source, but compiled output uses `.js`. Passing the URL through\n * `workerData` sidesteps this entirely since the worker file has no\n * local imports beyond node built-ins.\n */\nimport { parentPort, workerData } from \"node:worker_threads\";\nimport { MessageChannel } from \"node:worker_threads\";\nimport { pathToFileURL } from \"node:url\";\n\n/**\n * We import `register` from `node:module` instead of calling `module.register()`\n * directly. Node's strip-types parser sees the bare `module` identifier as a\n * CJS global, and combined with top-level `await` (or other ESM syntax), it\n * throws \"Cannot determine intended module format\". Using the explicit import\n * avoids this ambiguity entirely.\n */\nimport { register } from \"node:module\";\n\nif (!parentPort) {\n throw new Error(\"This file must be run as a worker thread\");\n}\n\nconst loaderDataUrl: string = workerData.loaderDataUrl;\n\n/**\n * MessageChannel for communicating with the loader hook.\n * port1 stays in this worker thread; port2 is transferred to the loader\n * thread via `register()`'s transferList. This is the only way to get\n * data out of loader hooks, since they run in an isolated loader thread\n * that cannot access worker_threads.parentPort.\n */\nconst { port1, port2 } = new MessageChannel();\n\nregister(loaderDataUrl, {\n parentURL: import.meta.url,\n data: { port: port2 },\n transferList: [port2],\n});\n\n/**\n * Requests the accumulated dependency list from the loader hook.\n *\n * Called after each `import()` completes. The loader hook clears its\n * internal Set on each request, so dependencies are scoped to the\n * most recent evaluation. This is safe because evaluations are\n * serialized — only one runs at a time per worker.\n */\nfunction requestDeps(): Promise<string[]> {\n return new Promise((resolve) => {\n port1.once(\"message\", (deps: string[]) => {\n resolve(deps);\n });\n port1.postMessage(\"getDeps\");\n });\n}\n\nparentPort.on(\"message\", async (msg: { type: string; id: number; absolutePath: string }) => {\n if (msg.type !== \"evaluate\") return;\n\n try {\n const fileUrl = pathToFileURL(msg.absolutePath).href;\n const ns = await import(fileUrl);\n\n const deps = await requestDeps();\n\n // The entry point may not appear in the loader hook's dependency set\n // if it was already in the ESM cache from a previous evaluation.\n // The resolve hook only fires on cache misses.\n if (!deps.includes(msg.absolutePath)) {\n deps.unshift(msg.absolutePath);\n }\n\n // Module namespace objects are exotic objects that fail structured clone\n // (postMessage would throw). Copying to a plain object is required.\n const value: Record<string, unknown> = {};\n for (const key of Object.keys(ns)) {\n value[key] = ns[key];\n }\n\n parentPort!.postMessage({\n type: \"result\",\n id: msg.id,\n ok: true,\n value,\n dependencies: deps,\n });\n } catch (err: unknown) {\n // Catches both evaluation errors (syntax errors, runtime exceptions)\n // and structured clone failures (e.g. when exports contain functions,\n // Symbols, or other non-cloneable values). Both are returned as\n // { ok: false } results — the caller does not need to distinguish.\n const error =\n err instanceof Error\n ? { message: err.message, stack: err.stack ?? \"\" }\n : { message: String(err), stack: \"\" };\n\n // Flush partial dependencies that the loader hook tracked before the\n // error. This allows the evaluator to register them in the reverse\n // dep map so that fixing the broken file triggers re-evaluation.\n const deps = await requestDeps();\n if (!deps.includes(msg.absolutePath)) {\n deps.unshift(msg.absolutePath);\n }\n\n parentPort!.postMessage({\n type: \"result\",\n id: msg.id,\n ok: false,\n error,\n dependencies: deps,\n });\n }\n});\n\nparentPort.postMessage({ type: \"ready\" });\n"],"mappings":";;;;AA2BA,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,0CAA0C;AAG5D,MAAM,gBAAwB,WAAW;AASzC,MAAM,EAAE,OAAO,UAAU,IAAI,eAAe;AAE5C,SAAS,eAAe;CACtB,WAAW,YAAY;CACvB,MAAM,EAAE,MAAM,MAAM;CACpB,cAAc,CAAC,KAAK;AACtB,CAAC;AAUD,SAAS,cAAiC;CACxC,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,KAAK,YAAY,SAAmB;GACxC,QAAQ,IAAI;EACd,CAAC;EACD,MAAM,YAAY,SAAS;CAC7B,CAAC;AACH;AAEA,WAAW,GAAG,WAAW,OAAO,QAA4D;CAC1F,IAAI,IAAI,SAAS,YAAY;CAE7B,IAAI;
|
|
1
|
+
{"version":3,"file":"worker.js","names":[],"sources":["../../../yak-internals/isolated-source-eval/worker.ts"],"sourcesContent":["/**\n * Worker thread entry point for isolated module evaluation.\n *\n * Each worker is a full Node.js environment with its own ESM module cache.\n * Modules are loaded via dynamic `import()` — Node 22.18.0+ strips TypeScript\n * types natively, so no compilation step or flags are needed.\n *\n * The loader hook data URL is received via `workerData` rather than\n * importing it from a sibling module. This avoids a cross-file import\n * resolution problem: Node's strip-types requires `.ts` extensions in\n * source, but compiled output uses `.js`. Passing the URL through\n * `workerData` sidesteps this entirely since the worker file has no\n * local imports beyond node built-ins.\n */\nimport { parentPort, workerData } from \"node:worker_threads\";\nimport { MessageChannel } from \"node:worker_threads\";\nimport { pathToFileURL } from \"node:url\";\n\n/**\n * We import `register` from `node:module` instead of calling `module.register()`\n * directly. Node's strip-types parser sees the bare `module` identifier as a\n * CJS global, and combined with top-level `await` (or other ESM syntax), it\n * throws \"Cannot determine intended module format\". Using the explicit import\n * avoids this ambiguity entirely.\n */\nimport { register } from \"node:module\";\n\nif (!parentPort) {\n throw new Error(\"This file must be run as a worker thread\");\n}\n\nconst loaderDataUrl: string = workerData.loaderDataUrl;\n\n/**\n * MessageChannel for communicating with the loader hook.\n * port1 stays in this worker thread; port2 is transferred to the loader\n * thread via `register()`'s transferList. This is the only way to get\n * data out of loader hooks, since they run in an isolated loader thread\n * that cannot access worker_threads.parentPort.\n */\nconst { port1, port2 } = new MessageChannel();\n\nregister(loaderDataUrl, {\n parentURL: import.meta.url,\n data: { port: port2 },\n transferList: [port2],\n});\n\n/**\n * Requests the accumulated dependency list from the loader hook.\n *\n * Called after each `import()` completes. The loader hook clears its\n * internal Set on each request, so dependencies are scoped to the\n * most recent evaluation. This is safe because evaluations are\n * serialized — only one runs at a time per worker.\n */\nfunction requestDeps(): Promise<string[]> {\n return new Promise((resolve) => {\n port1.once(\"message\", (deps: string[]) => {\n resolve(deps);\n });\n port1.postMessage(\"getDeps\");\n });\n}\n\nparentPort.on(\"message\", async (msg: { type: string; id: number; absolutePath: string }) => {\n if (msg.type !== \"evaluate\") return;\n\n try {\n const fileUrl = pathToFileURL(msg.absolutePath).href;\n // The path is only known at runtime, so bundlers must not try to resolve it\n const ns = await import(/* turbopackIgnore: true */ fileUrl);\n\n const deps = await requestDeps();\n\n // The entry point may not appear in the loader hook's dependency set\n // if it was already in the ESM cache from a previous evaluation.\n // The resolve hook only fires on cache misses.\n if (!deps.includes(msg.absolutePath)) {\n deps.unshift(msg.absolutePath);\n }\n\n // Module namespace objects are exotic objects that fail structured clone\n // (postMessage would throw). Copying to a plain object is required.\n const value: Record<string, unknown> = {};\n for (const key of Object.keys(ns)) {\n value[key] = ns[key];\n }\n\n parentPort!.postMessage({\n type: \"result\",\n id: msg.id,\n ok: true,\n value,\n dependencies: deps,\n });\n } catch (err: unknown) {\n // Catches both evaluation errors (syntax errors, runtime exceptions)\n // and structured clone failures (e.g. when exports contain functions,\n // Symbols, or other non-cloneable values). Both are returned as\n // { ok: false } results — the caller does not need to distinguish.\n const error =\n err instanceof Error\n ? { message: err.message, stack: err.stack ?? \"\" }\n : { message: String(err), stack: \"\" };\n\n // Flush partial dependencies that the loader hook tracked before the\n // error. This allows the evaluator to register them in the reverse\n // dep map so that fixing the broken file triggers re-evaluation.\n const deps = await requestDeps();\n if (!deps.includes(msg.absolutePath)) {\n deps.unshift(msg.absolutePath);\n }\n\n parentPort!.postMessage({\n type: \"result\",\n id: msg.id,\n ok: false,\n error,\n dependencies: deps,\n });\n }\n});\n\nparentPort.postMessage({ type: \"ready\" });\n"],"mappings":";;;;AA2BA,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,0CAA0C;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ime/jsx-dev-runtime.ts"],"sourcesContent":["import ReactJSXRuntimeDev from \"react/jsx-dev-runtime\";\n\nconst Fragment = ReactJSXRuntimeDev.Fragment;\nconst jsxDEV = ReactJSXRuntimeDev.jsxDEV;\n\nexport { Fragment, jsxDEV };\n"],"mappings":"qCAEA,
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","names":["ReactJSXRuntimeDev","Fragment","jsxDEV"],"sources":["../runtime/jsx-dev-runtime.ts"],"sourcesContent":["import ReactJSXRuntimeDev from \"react/jsx-dev-runtime\";\n\nconst Fragment = ReactJSXRuntimeDev.Fragment;\nconst jsxDEV = ReactJSXRuntimeDev.jsxDEV;\n\nexport { Fragment, jsxDEV };\n"],"mappings":"A,qCAEA,MAAMC,EAAWD,EAAmB,SAC9BE,EAASF,EAAmB,O"}
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ type WithConditionalCSSProp<P> = "className" | "style" extends keyof P ? string
|
|
|
20
20
|
declare const Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
21
21
|
declare const jsx: typeof ReactJSXRuntime.jsx;
|
|
22
22
|
declare const jsxs: typeof ReactJSXRuntime.jsxs;
|
|
23
|
-
declare namespace YakJSX {
|
|
23
|
+
export declare namespace YakJSX {
|
|
24
24
|
type Element = React.JSX.Element;
|
|
25
25
|
type ElementType = React.JSX.ElementType;
|
|
26
26
|
type ElementClass = React.JSX.ElementClass;
|
|
@@ -34,5 +34,5 @@ declare namespace YakJSX {
|
|
|
34
34
|
}; };
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
|
-
export { Fragment, type YakJSX as JSX,
|
|
37
|
+
export { Fragment, type YakJSX as JSX, jsx, jsxs };
|
|
38
38
|
//# sourceMappingURL=jsx-runtime.d.ts.map
|