@vertz/ui-server 0.2.25 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bun-dev-server.js +250 -4
- package/dist/bun-plugin/index.d.ts +1 -1
- package/dist/index.d.ts +346 -86
- package/dist/index.js +658 -154
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { FallbackFontName as FallbackFontName2, FontFallbackMetrics as
|
|
1
|
+
import { FallbackFontName as FallbackFontName2, FontFallbackMetrics as FontFallbackMetrics7 } from "@vertz/ui";
|
|
2
|
+
interface AotBuildComponentEntry {
|
|
3
|
+
tier: "static" | "data-driven" | "conditional" | "runtime-fallback";
|
|
4
|
+
holes: string[];
|
|
5
|
+
}
|
|
6
|
+
interface AotBuildManifest {
|
|
7
|
+
components: Record<string, AotBuildComponentEntry>;
|
|
8
|
+
classificationLog: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Scan all TSX files in srcDir and generate an AOT build manifest.
|
|
12
|
+
*/
|
|
13
|
+
declare function generateAotBuildManifest(srcDir: string): AotBuildManifest;
|
|
2
14
|
/** A raw HTML string that bypasses escaping during serialization. */
|
|
3
15
|
interface RawHtml {
|
|
4
16
|
__raw: true;
|
|
@@ -369,8 +381,20 @@ type PrefetchSession = {
|
|
|
369
381
|
status: "unauthenticated";
|
|
370
382
|
};
|
|
371
383
|
/**
|
|
384
|
+
* Minimal shape of an AccessSet for entitlement extraction.
|
|
385
|
+
* Avoids importing @vertz/server types into the SSR pipeline.
|
|
386
|
+
*/
|
|
387
|
+
interface AccessSetLike {
|
|
388
|
+
entitlements: Record<string, {
|
|
389
|
+
allowed: boolean;
|
|
390
|
+
}>;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
372
393
|
* Convert SSRAuth (from the JWT/session resolver) to PrefetchSession
|
|
373
394
|
* for entity access evaluation during SSR prefetching.
|
|
395
|
+
*
|
|
396
|
+
* @param ssrAuth - Auth state from session resolver
|
|
397
|
+
* @param accessSet - Access set from JWT acl claim (null = overflow, undefined = not configured)
|
|
374
398
|
*/
|
|
375
399
|
declare function toPrefetchSession(ssrAuth: {
|
|
376
400
|
status: string;
|
|
@@ -378,7 +402,7 @@ declare function toPrefetchSession(ssrAuth: {
|
|
|
378
402
|
role?: string;
|
|
379
403
|
[key: string]: unknown;
|
|
380
404
|
};
|
|
381
|
-
} | undefined): PrefetchSession;
|
|
405
|
+
} | undefined, accessSet?: AccessSetLike | null): PrefetchSession;
|
|
382
406
|
/**
|
|
383
407
|
* Evaluate a serialized access rule against the current session.
|
|
384
408
|
*
|
|
@@ -422,38 +446,114 @@ import { RenderAdapter } from "@vertz/ui/internals";
|
|
|
422
446
|
* Replaces `installDomShim()` — no global mutation needed.
|
|
423
447
|
*/
|
|
424
448
|
declare function createSSRAdapter(): RenderAdapter;
|
|
425
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
426
|
-
import { SSRQueryEntry, SSRRenderContext } from "@vertz/ui/internals";
|
|
427
|
-
import { SSRQueryEntry as SSRQueryEntry2 } from "@vertz/ui/internals";
|
|
428
|
-
declare const ssrStorage: AsyncLocalStorage<SSRRenderContext>;
|
|
429
|
-
declare function isInSSR(): boolean;
|
|
430
|
-
declare function getSSRUrl(): string | undefined;
|
|
431
|
-
/**
|
|
432
|
-
* Register an SSR query for awaiting before final render.
|
|
433
|
-
* No-op when called outside an SSR context.
|
|
434
|
-
*/
|
|
435
|
-
declare function registerSSRQuery(entry: SSRQueryEntry): void;
|
|
436
|
-
/**
|
|
437
|
-
* Get all registered SSR queries for the current render.
|
|
438
|
-
* Returns an empty array when called outside an SSR context.
|
|
439
|
-
*/
|
|
440
|
-
declare function getSSRQueries(): SSRRenderContext["queries"];
|
|
441
449
|
/**
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
|
|
446
|
-
declare function setGlobalSSRTimeout(timeout: number): void;
|
|
447
|
-
/**
|
|
448
|
-
* Clear the global SSR timeout (cleanup after render).
|
|
450
|
+
* AOT SSR Diagnostics
|
|
451
|
+
*
|
|
452
|
+
* Tracks AOT compilation results and provides a JSON snapshot
|
|
453
|
+
* for the `/__vertz_ssr_aot` dev endpoint.
|
|
449
454
|
*/
|
|
450
|
-
|
|
455
|
+
/** AOT tier classification (mirrored from @vertz/ui-compiler to avoid cross-package dependency). */
|
|
456
|
+
type AotTier = "static" | "data-driven" | "conditional" | "runtime-fallback";
|
|
457
|
+
/** Per-component diagnostic entry in the snapshot. */
|
|
458
|
+
interface AotComponentDiagnostic {
|
|
459
|
+
tier: AotTier;
|
|
460
|
+
holes: string[];
|
|
461
|
+
}
|
|
462
|
+
/** A recorded divergence between AOT and DOM shim output. */
|
|
463
|
+
interface AotDivergenceEntry {
|
|
464
|
+
component: string;
|
|
465
|
+
aotHtml: string;
|
|
466
|
+
domHtml: string;
|
|
467
|
+
timestamp: string;
|
|
468
|
+
}
|
|
469
|
+
/** JSON snapshot returned by the `/__vertz_ssr_aot` endpoint. */
|
|
470
|
+
interface AotDiagnosticsSnapshot {
|
|
471
|
+
components: Record<string, AotComponentDiagnostic>;
|
|
472
|
+
coverage: {
|
|
473
|
+
total: number;
|
|
474
|
+
aot: number;
|
|
475
|
+
runtime: number;
|
|
476
|
+
percentage: number;
|
|
477
|
+
};
|
|
478
|
+
divergences: AotDivergenceEntry[];
|
|
479
|
+
}
|
|
480
|
+
/** Input shape matching AotComponentInfo from @vertz/ui-compiler. */
|
|
481
|
+
interface ComponentInput {
|
|
482
|
+
name: string;
|
|
483
|
+
tier: AotTier;
|
|
484
|
+
holes: string[];
|
|
485
|
+
}
|
|
451
486
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
487
|
+
* Collects AOT compilation diagnostics and produces JSON snapshots.
|
|
488
|
+
*
|
|
489
|
+
* Used by the dev server to power the `/__vertz_ssr_aot` endpoint
|
|
490
|
+
* and by the build pipeline for classification logging.
|
|
454
491
|
*/
|
|
455
|
-
declare
|
|
456
|
-
|
|
492
|
+
declare class AotDiagnostics {
|
|
493
|
+
private _components;
|
|
494
|
+
private _divergences;
|
|
495
|
+
/**
|
|
496
|
+
* Record components from an AOT compilation result.
|
|
497
|
+
* Called once per file during compilation or hot rebuild.
|
|
498
|
+
*/
|
|
499
|
+
recordCompilation(components: ComponentInput[]): void;
|
|
500
|
+
/** Record a divergence between AOT and DOM shim HTML output. */
|
|
501
|
+
recordDivergence(component: string, aotHtml: string, domHtml: string): void;
|
|
502
|
+
/** Clear all recorded data (used during full rebuild). */
|
|
503
|
+
clear(): void;
|
|
504
|
+
/** Clear only component classifications (preserves divergences). */
|
|
505
|
+
clearComponents(): void;
|
|
506
|
+
/**
|
|
507
|
+
* Generate per-component classification log lines.
|
|
508
|
+
* Used by the build pipeline and VERTZ_DEBUG=aot logging.
|
|
509
|
+
*
|
|
510
|
+
* Returns lines like:
|
|
511
|
+
* - "Header: static"
|
|
512
|
+
* - "Dashboard: conditional, 1 hole (SidePanel)"
|
|
513
|
+
* - "Coverage: 3/4 components (75%)"
|
|
514
|
+
*/
|
|
515
|
+
getClassificationLog(): string[];
|
|
516
|
+
/** Produce a JSON-serializable snapshot for the diagnostic endpoint. */
|
|
517
|
+
getSnapshot(): AotDiagnosticsSnapshot;
|
|
518
|
+
}
|
|
519
|
+
/** Per-component entry in the dev AOT manifest. */
|
|
520
|
+
interface AotDevComponentEntry {
|
|
521
|
+
tier: "static" | "data-driven" | "conditional" | "runtime-fallback";
|
|
522
|
+
holes: string[];
|
|
523
|
+
/** The file this component was compiled from. */
|
|
524
|
+
file: string;
|
|
525
|
+
}
|
|
526
|
+
/** Dev-mode AOT manifest — tracks all components across all files. */
|
|
527
|
+
interface AotDevManifest {
|
|
528
|
+
components: Record<string, AotDevComponentEntry>;
|
|
529
|
+
}
|
|
530
|
+
interface AotManifestSnapshot {
|
|
531
|
+
manifest: AotDevManifest | null;
|
|
532
|
+
rebuildCount: number;
|
|
533
|
+
lastRebuildMs: number | null;
|
|
534
|
+
lastRebuildAt: string | null;
|
|
535
|
+
}
|
|
536
|
+
interface AotManifestManagerOptions {
|
|
537
|
+
/** Read a file's contents. Returns undefined if file doesn't exist. */
|
|
538
|
+
readFile: (path: string) => string | undefined;
|
|
539
|
+
/** List all files in the source directory (absolute paths). */
|
|
540
|
+
listFiles: () => string[];
|
|
541
|
+
}
|
|
542
|
+
interface AotManifestManager {
|
|
543
|
+
/** Initial full build — compile all TSX files. */
|
|
544
|
+
build(): void;
|
|
545
|
+
/** Handle a file change — recompile a single file. */
|
|
546
|
+
onFileChange(filePath: string, sourceText: string): void;
|
|
547
|
+
/** Get the current manifest (atomic read). */
|
|
548
|
+
getManifest(): AotDevManifest | null;
|
|
549
|
+
/** Get diagnostic snapshot for endpoints. */
|
|
550
|
+
getSnapshot(): AotManifestSnapshot;
|
|
551
|
+
/** Get AotDiagnostics instance for the diagnostics endpoint. */
|
|
552
|
+
getDiagnostics(): AotDiagnostics;
|
|
553
|
+
}
|
|
554
|
+
declare function createAotManifestManager(options: AotManifestManagerOptions): AotManifestManager;
|
|
555
|
+
import { FontFallbackMetrics as FontFallbackMetrics5 } from "@vertz/ui";
|
|
556
|
+
import { SSRAuth as SSRAuth2 } from "@vertz/ui/internals";
|
|
457
557
|
import { CompiledRoute, FontFallbackMetrics as FontFallbackMetrics3, Theme as Theme2 } from "@vertz/ui";
|
|
458
558
|
import { SSRAuth as SSRAuth_jq1nwm } from "@vertz/ui/internals";
|
|
459
559
|
interface SSRModule {
|
|
@@ -522,6 +622,206 @@ declare function ssrRenderToString(module: SSRModule, url: string, options?: {
|
|
|
522
622
|
declare function ssrDiscoverQueries(module: SSRModule, url: string, options?: {
|
|
523
623
|
ssrTimeout?: number;
|
|
524
624
|
}): Promise<SSRDiscoverResult>;
|
|
625
|
+
import { FontFallbackMetrics as FontFallbackMetrics4 } from "@vertz/ui";
|
|
626
|
+
import { SSRAuth } from "@vertz/ui/internals";
|
|
627
|
+
import { ExtractedQuery } from "@vertz/ui-compiler";
|
|
628
|
+
/** Serialized entity access rules from the prefetch manifest. */
|
|
629
|
+
type EntityAccessMap = Record<string, Partial<Record<string, SerializedAccessRule>>>;
|
|
630
|
+
interface SSRPrefetchManifest {
|
|
631
|
+
/** Route patterns present in the manifest. */
|
|
632
|
+
routePatterns: string[];
|
|
633
|
+
/** Entity access rules keyed by entity name → operation → serialized rule. */
|
|
634
|
+
entityAccess?: EntityAccessMap;
|
|
635
|
+
/** Route entries with query binding metadata for zero-discovery prefetch. */
|
|
636
|
+
routeEntries?: Record<string, {
|
|
637
|
+
queries: ExtractedQuery[];
|
|
638
|
+
}>;
|
|
639
|
+
}
|
|
640
|
+
interface SSRSinglePassOptions {
|
|
641
|
+
ssrTimeout?: number;
|
|
642
|
+
/** Pre-computed font fallback metrics (computed at server startup). */
|
|
643
|
+
fallbackMetrics?: Record<string, FontFallbackMetrics4>;
|
|
644
|
+
/** Auth state resolved from session cookie. */
|
|
645
|
+
ssrAuth?: SSRAuth;
|
|
646
|
+
/** Set to false to fall back to two-pass rendering. Default: true. */
|
|
647
|
+
prefetch?: boolean;
|
|
648
|
+
/** Prefetch manifest for entity access filtering. */
|
|
649
|
+
manifest?: SSRPrefetchManifest;
|
|
650
|
+
/** Session data for access rule evaluation. */
|
|
651
|
+
prefetchSession?: PrefetchSession;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Render an SSR module in a single pass via discovery-only execution.
|
|
655
|
+
*
|
|
656
|
+
* 1. Discovery: Run the app factory to capture query registrations (no stream render)
|
|
657
|
+
* 2. Prefetch: Await all discovered queries with timeout
|
|
658
|
+
* 3. Render: Create a fresh context with pre-populated cache, render once
|
|
659
|
+
*
|
|
660
|
+
* Falls back to two-pass (`ssrRenderToString`) when:
|
|
661
|
+
* - `prefetch: false` is set
|
|
662
|
+
* - A redirect is detected during discovery
|
|
663
|
+
*/
|
|
664
|
+
declare function ssrRenderSinglePass(module: SSRModule, url: string, options?: SSRSinglePassOptions): Promise<SSRRenderResult>;
|
|
665
|
+
/** Context passed to AOT render functions for accessing data and runtime holes. */
|
|
666
|
+
interface SSRAotContext {
|
|
667
|
+
/** Pre-generated closures for runtime-rendered components. */
|
|
668
|
+
holes: Record<string, () => string>;
|
|
669
|
+
/** Access query data by cache key. */
|
|
670
|
+
getData(key: string): unknown;
|
|
671
|
+
/** Auth session for conditional rendering. */
|
|
672
|
+
session: PrefetchSession | undefined;
|
|
673
|
+
/** Route params for the current request. */
|
|
674
|
+
params: Record<string, string>;
|
|
675
|
+
}
|
|
676
|
+
/** An AOT render function: takes props/data and context, returns HTML string. */
|
|
677
|
+
type AotRenderFn = (data: Record<string, unknown>, ctx: SSRAotContext) => string;
|
|
678
|
+
/** Per-route AOT entry in the manifest. */
|
|
679
|
+
interface AotRouteEntry {
|
|
680
|
+
/** The pre-compiled render function. */
|
|
681
|
+
render: AotRenderFn;
|
|
682
|
+
/** Component names that need runtime fallback (holes). */
|
|
683
|
+
holes: string[];
|
|
684
|
+
/** Query cache keys this route reads via ctx.getData(). */
|
|
685
|
+
queryKeys?: string[];
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* AOT manifest — maps route patterns to pre-compiled render functions.
|
|
689
|
+
*
|
|
690
|
+
* Generated at build time by the AOT compiler pipeline.
|
|
691
|
+
*/
|
|
692
|
+
interface AotManifest {
|
|
693
|
+
/** Route pattern → AOT entry. */
|
|
694
|
+
routes: Record<string, AotRouteEntry>;
|
|
695
|
+
}
|
|
696
|
+
/** Options for `ssrRenderAot()`. */
|
|
697
|
+
interface SSRRenderAotOptions {
|
|
698
|
+
/** AOT manifest with pre-compiled render functions. */
|
|
699
|
+
aotManifest: AotManifest;
|
|
700
|
+
/** Prefetch manifest for route matching and data fetching. */
|
|
701
|
+
manifest?: SSRPrefetchManifest;
|
|
702
|
+
/** SSR timeout in ms. */
|
|
703
|
+
ssrTimeout?: number;
|
|
704
|
+
/** Pre-computed font fallback metrics. */
|
|
705
|
+
fallbackMetrics?: Record<string, FontFallbackMetrics5>;
|
|
706
|
+
/** Auth state resolved from session cookie. */
|
|
707
|
+
ssrAuth?: SSRAuth2;
|
|
708
|
+
/** Session data for access rule evaluation. */
|
|
709
|
+
prefetchSession?: PrefetchSession;
|
|
710
|
+
/** AOT diagnostics collector (dev mode). When provided with VERTZ_DEBUG=aot, enables dual rendering and divergence detection. */
|
|
711
|
+
diagnostics?: AotDiagnostics;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Create closure-based runtime fallback renderers for components
|
|
715
|
+
* that cannot be AOT-compiled.
|
|
716
|
+
*
|
|
717
|
+
* Each hole closure:
|
|
718
|
+
* 1. Runs inside `ssrStorage.run()` to provide SSRRenderContext
|
|
719
|
+
* 2. Calls the component factory via the SSR module
|
|
720
|
+
* 3. Converts the result to VNode and serializes to HTML string
|
|
721
|
+
* 4. Shares the query cache with the AOT function
|
|
722
|
+
*
|
|
723
|
+
* @param holeNames - Component names that need runtime rendering
|
|
724
|
+
* @param module - SSR module with component factories
|
|
725
|
+
* @param url - Request URL for context
|
|
726
|
+
* @param queryCache - Pre-populated query cache (shared with AOT)
|
|
727
|
+
* @param ssrAuth - Auth state for the request
|
|
728
|
+
*/
|
|
729
|
+
declare function createHoles(holeNames: string[], module: SSRModule, url: string, queryCache: Map<string, unknown>, ssrAuth?: SSRAuth2): Record<string, () => string>;
|
|
730
|
+
/**
|
|
731
|
+
* Render a page using pre-compiled AOT string-builder functions.
|
|
732
|
+
*
|
|
733
|
+
* Falls back to `ssrRenderSinglePass()` when:
|
|
734
|
+
* - No route match in the AOT manifest
|
|
735
|
+
* - No prefetch manifest for route matching
|
|
736
|
+
*
|
|
737
|
+
* Pipeline:
|
|
738
|
+
* 1. Match URL to route pattern
|
|
739
|
+
* 2. Look up AOT entry in manifest
|
|
740
|
+
* 3. Prefetch query data (reuses single-pass prefetch logic)
|
|
741
|
+
* 4. Create runtime holes (closures for non-AOT components)
|
|
742
|
+
* 5. Call AOT render function with data + context
|
|
743
|
+
* 6. Collect CSS, ssrData, headTags
|
|
744
|
+
* 7. Return SSRRenderResult
|
|
745
|
+
*/
|
|
746
|
+
declare function ssrRenderAot(module: SSRModule, url: string, options: SSRRenderAotOptions): Promise<SSRRenderResult>;
|
|
747
|
+
/** Check if VERTZ_DEBUG includes the 'aot' category. */
|
|
748
|
+
declare function isAotDebugEnabled(): boolean;
|
|
749
|
+
/**
|
|
750
|
+
* SSR AOT Runtime Helpers
|
|
751
|
+
*
|
|
752
|
+
* Lightweight runtime functions used by AOT-compiled SSR string-builder
|
|
753
|
+
* functions. These are injected at the top of compiled output and called
|
|
754
|
+
* inline during string concatenation.
|
|
755
|
+
*
|
|
756
|
+
* Design constraints:
|
|
757
|
+
* - Must produce identical output to html-serializer.ts escapeHtml/escapeAttr
|
|
758
|
+
* - Must be fast — called per-element, per-attribute during SSR
|
|
759
|
+
* - No dependencies beyond this file
|
|
760
|
+
*/
|
|
761
|
+
type Renderable = any;
|
|
762
|
+
/**
|
|
763
|
+
* Escape HTML text content. Matches escapeHtml() from html-serializer.ts exactly.
|
|
764
|
+
*
|
|
765
|
+
* Handles: null, undefined, false → '', true → 'true', numbers → string,
|
|
766
|
+
* arrays → recursive join.
|
|
767
|
+
*/
|
|
768
|
+
declare function __esc(value: Renderable): string;
|
|
769
|
+
/**
|
|
770
|
+
* Escape HTML attribute value. Matches escapeAttr() from html-serializer.ts exactly.
|
|
771
|
+
*/
|
|
772
|
+
declare function __esc_attr(value: Renderable): string;
|
|
773
|
+
/**
|
|
774
|
+
* Render a props object as an HTML attribute string for spread attributes.
|
|
775
|
+
*
|
|
776
|
+
* - Skips null/undefined/false values
|
|
777
|
+
* - Skips event handlers (on* props)
|
|
778
|
+
* - Maps className → class
|
|
779
|
+
* - Boolean true → attribute name only (no value)
|
|
780
|
+
* - Escapes string values
|
|
781
|
+
*/
|
|
782
|
+
declare function __ssr_spread(props: Record<string, Renderable>): string;
|
|
783
|
+
/**
|
|
784
|
+
* Convert a style object to a CSS string.
|
|
785
|
+
*
|
|
786
|
+
* - camelCase → kebab-case
|
|
787
|
+
* - Numeric values get 'px' appended for non-unitless properties
|
|
788
|
+
* - Zero is never suffixed with 'px'
|
|
789
|
+
* - Skips null, undefined, empty string values
|
|
790
|
+
* - Preserves CSS custom properties and vendor prefixes
|
|
791
|
+
*/
|
|
792
|
+
declare function __ssr_style_object(style: Record<string, Renderable>): string;
|
|
793
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
794
|
+
import { SSRQueryEntry, SSRRenderContext as SSRRenderContext2 } from "@vertz/ui/internals";
|
|
795
|
+
import { SSRQueryEntry as SSRQueryEntry2 } from "@vertz/ui/internals";
|
|
796
|
+
declare const ssrStorage: AsyncLocalStorage<SSRRenderContext2>;
|
|
797
|
+
declare function isInSSR(): boolean;
|
|
798
|
+
declare function getSSRUrl(): string | undefined;
|
|
799
|
+
/**
|
|
800
|
+
* Register an SSR query for awaiting before final render.
|
|
801
|
+
* No-op when called outside an SSR context.
|
|
802
|
+
*/
|
|
803
|
+
declare function registerSSRQuery(entry: SSRQueryEntry): void;
|
|
804
|
+
/**
|
|
805
|
+
* Get all registered SSR queries for the current render.
|
|
806
|
+
* Returns an empty array when called outside an SSR context.
|
|
807
|
+
*/
|
|
808
|
+
declare function getSSRQueries(): SSRRenderContext2["queries"];
|
|
809
|
+
/**
|
|
810
|
+
* Set the global SSR timeout for queries that don't specify their own.
|
|
811
|
+
* Called by the virtual SSR entry to propagate the plugin-level ssrTimeout.
|
|
812
|
+
* Stored in the per-request SSR context (AsyncLocalStorage), not on globalThis.
|
|
813
|
+
*/
|
|
814
|
+
declare function setGlobalSSRTimeout(timeout: number): void;
|
|
815
|
+
/**
|
|
816
|
+
* Clear the global SSR timeout (cleanup after render).
|
|
817
|
+
*/
|
|
818
|
+
declare function clearGlobalSSRTimeout(): void;
|
|
819
|
+
/**
|
|
820
|
+
* Get the global SSR timeout for the current SSR context.
|
|
821
|
+
* Returns undefined if not set or outside SSR context.
|
|
822
|
+
*/
|
|
823
|
+
declare function getGlobalSSRTimeout(): number | undefined;
|
|
824
|
+
import { FontFallbackMetrics as FontFallbackMetrics6 } from "@vertz/ui";
|
|
525
825
|
import { AccessSet as AccessSet2 } from "@vertz/ui/auth";
|
|
526
826
|
interface SessionData {
|
|
527
827
|
user: {
|
|
@@ -583,7 +883,7 @@ interface SSRHandlerOptions {
|
|
|
583
883
|
*/
|
|
584
884
|
nonce?: string;
|
|
585
885
|
/** Pre-computed font fallback metrics (computed at server startup). */
|
|
586
|
-
fallbackMetrics?: Record<string,
|
|
886
|
+
fallbackMetrics?: Record<string, FontFallbackMetrics6>;
|
|
587
887
|
/** Paths to inject as `<link rel="modulepreload">` in `<head>`. */
|
|
588
888
|
modulepreload?: string[];
|
|
589
889
|
/**
|
|
@@ -621,47 +921,24 @@ interface GenerateSSRHtmlOptions {
|
|
|
621
921
|
* Generate a complete HTML document from SSR render results.
|
|
622
922
|
*/
|
|
623
923
|
declare function generateSSRHtml(options: GenerateSSRHtmlOptions): string;
|
|
624
|
-
import {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
/** Serialized entity access rules from the prefetch manifest. */
|
|
629
|
-
type EntityAccessMap = Record<string, Partial<Record<string, SerializedAccessRule>>>;
|
|
630
|
-
interface SSRPrefetchManifest {
|
|
631
|
-
/** Route patterns present in the manifest. */
|
|
632
|
-
routePatterns: string[];
|
|
633
|
-
/** Entity access rules keyed by entity name → operation → serialized rule. */
|
|
634
|
-
entityAccess?: EntityAccessMap;
|
|
635
|
-
/** Route entries with query binding metadata for zero-discovery prefetch. */
|
|
636
|
-
routeEntries?: Record<string, {
|
|
637
|
-
queries: ExtractedQuery[];
|
|
638
|
-
}>;
|
|
639
|
-
}
|
|
640
|
-
interface SSRSinglePassOptions {
|
|
641
|
-
ssrTimeout?: number;
|
|
642
|
-
/** Pre-computed font fallback metrics (computed at server startup). */
|
|
643
|
-
fallbackMetrics?: Record<string, FontFallbackMetrics5>;
|
|
644
|
-
/** Auth state resolved from session cookie. */
|
|
645
|
-
ssrAuth?: SSRAuth;
|
|
646
|
-
/** Set to false to fall back to two-pass rendering. Default: true. */
|
|
647
|
-
prefetch?: boolean;
|
|
648
|
-
/** Prefetch manifest for entity access filtering. */
|
|
649
|
-
manifest?: SSRPrefetchManifest;
|
|
650
|
-
/** Session data for access rule evaluation. */
|
|
651
|
-
prefetchSession?: PrefetchSession;
|
|
924
|
+
import { ExtractedQuery as ExtractedQuery2 } from "@vertz/ui-compiler";
|
|
925
|
+
interface ReconstructedDescriptor {
|
|
926
|
+
key: string;
|
|
927
|
+
fetch: () => Promise<unknown>;
|
|
652
928
|
}
|
|
653
929
|
/**
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
* 2. Prefetch: Await all discovered queries with timeout
|
|
658
|
-
* 3. Render: Create a fresh context with pre-populated cache, render once
|
|
930
|
+
* Reconstruct QueryDescriptors from manifest metadata by calling the
|
|
931
|
+
* real API client factories. Returns descriptors with correct `_key`
|
|
932
|
+
* and `_fetch` for pre-populating the SSR query cache.
|
|
659
933
|
*
|
|
660
|
-
*
|
|
661
|
-
* -
|
|
662
|
-
* -
|
|
934
|
+
* Skips queries that:
|
|
935
|
+
* - Have no entity/operation (variable references)
|
|
936
|
+
* - Reference entities or operations not in the API client
|
|
937
|
+
* - Have unresolvable where bindings (null = dynamic value)
|
|
938
|
+
* - Reference route params not present in the URL
|
|
663
939
|
*/
|
|
664
|
-
declare function
|
|
940
|
+
declare function reconstructDescriptors(queries: ExtractedQuery2[], routeParams: Record<string, string>, apiClient: Record<string, Record<string, (...args: unknown[]) => unknown>> | undefined): ReconstructedDescriptor[];
|
|
941
|
+
import { PrefetchManifest } from "@vertz/ui-compiler";
|
|
665
942
|
interface PrefetchManifestManagerOptions {
|
|
666
943
|
/** Absolute path to the router file. */
|
|
667
944
|
routerPath: string;
|
|
@@ -687,23 +964,6 @@ interface PrefetchManifestManager {
|
|
|
687
964
|
getSnapshot(): PrefetchManifestSnapshot;
|
|
688
965
|
}
|
|
689
966
|
declare function createPrefetchManifestManager(options: PrefetchManifestManagerOptions): PrefetchManifestManager;
|
|
690
|
-
import { ExtractedQuery as ExtractedQuery2 } from "@vertz/ui-compiler";
|
|
691
|
-
interface ReconstructedDescriptor {
|
|
692
|
-
key: string;
|
|
693
|
-
fetch: () => Promise<unknown>;
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* Reconstruct QueryDescriptors from manifest metadata by calling the
|
|
697
|
-
* real API client factories. Returns descriptors with correct `_key`
|
|
698
|
-
* and `_fetch` for pre-populating the SSR query cache.
|
|
699
|
-
*
|
|
700
|
-
* Skips queries that:
|
|
701
|
-
* - Have no entity/operation (variable references)
|
|
702
|
-
* - Reference entities or operations not in the API client
|
|
703
|
-
* - Have unresolvable where bindings (null = dynamic value)
|
|
704
|
-
* - Reference route params not present in the URL
|
|
705
|
-
*/
|
|
706
|
-
declare function reconstructDescriptors(queries: ExtractedQuery2[], routeParams: Record<string, string>, apiClient: Record<string, Record<string, (...args: unknown[]) => unknown>> | undefined): ReconstructedDescriptor[];
|
|
707
967
|
/**
|
|
708
968
|
* SSR route matcher — matches URLs to manifest route patterns.
|
|
709
969
|
*
|
|
@@ -774,4 +1034,4 @@ declare function collectStreamChunks(stream: ReadableStream<Uint8Array>): Promis
|
|
|
774
1034
|
* @param nonce - Optional CSP nonce to add to the inline script tag.
|
|
775
1035
|
*/
|
|
776
1036
|
declare function createTemplateChunk(slotId: number, resolvedHtml: string, nonce?: string): string;
|
|
777
|
-
export { wrapWithHydrationMarkers, toPrefetchSession, streamToString, ssrStorage, ssrRenderToString, ssrRenderSinglePass, ssrDiscoverQueries, setGlobalSSRTimeout, serializeToHtml, safeSerialize, resetSlotCounter, renderToStream, renderToHTMLStream, renderToHTML, renderPage, renderHeadToHtml, renderAssetTags, registerSSRQuery, reconstructDescriptors, rawHtml, matchUrlToPatterns, isInSSR, inlineCriticalCss, getStreamingRuntimeScript, getSSRUrl, getSSRQueries, getGlobalSSRTimeout, getAccessSetForSSR, generateSSRHtml, extractFontMetrics, evaluateAccessRule, encodeChunk, detectFallbackFont, createTemplateChunk, createSlotPlaceholder, createSessionScript, createSSRHandler, createSSRDataChunk, createSSRAdapter, createPrefetchManifestManager, createAccessSetScript, collectStreamChunks, clearGlobalSSRTimeout, VNode, SessionResolver, SessionData, SerializedAccessRule, SSRSinglePassOptions, SSRSessionInfo, SSRRenderResult, SSRQueryEntry2 as SSRQueryEntry, SSRPrefetchManifest, SSRModule, SSRHandlerOptions, SSRDiscoverResult, RenderToStreamOptions, RenderToHTMLStreamOptions, RenderToHTMLOptions, ReconstructedDescriptor, RawHtml, PrefetchSession, PrefetchManifestSnapshot, PrefetchManifestManagerOptions, PrefetchManifestManager, PageOptions, MatchedRoute, HydrationOptions, HeadEntry, HeadCollector, GenerateSSRHtmlOptions,
|
|
1037
|
+
export { wrapWithHydrationMarkers, toPrefetchSession, streamToString, ssrStorage, ssrRenderToString, ssrRenderSinglePass, ssrRenderAot, ssrDiscoverQueries, setGlobalSSRTimeout, serializeToHtml, safeSerialize, resetSlotCounter, renderToStream, renderToHTMLStream, renderToHTML, renderPage, renderHeadToHtml, renderAssetTags, registerSSRQuery, reconstructDescriptors, rawHtml, matchUrlToPatterns, isInSSR, isAotDebugEnabled, inlineCriticalCss, getStreamingRuntimeScript, getSSRUrl, getSSRQueries, getGlobalSSRTimeout, getAccessSetForSSR, generateSSRHtml, generateAotBuildManifest, extractFontMetrics, evaluateAccessRule, encodeChunk, detectFallbackFont, createTemplateChunk, createSlotPlaceholder, createSessionScript, createSSRHandler, createSSRDataChunk, createSSRAdapter, createPrefetchManifestManager, createHoles, createAotManifestManager, createAccessSetScript, collectStreamChunks, clearGlobalSSRTimeout, __ssr_style_object, __ssr_spread, __esc_attr, __esc, VNode, SessionResolver, SessionData, SerializedAccessRule, SSRSinglePassOptions, SSRSessionInfo, SSRRenderResult, SSRRenderAotOptions, SSRQueryEntry2 as SSRQueryEntry, SSRPrefetchManifest, SSRModule, SSRHandlerOptions, SSRDiscoverResult, SSRAotContext, RenderToStreamOptions, RenderToHTMLStreamOptions, RenderToHTMLOptions, ReconstructedDescriptor, RawHtml, PrefetchSession, PrefetchManifestSnapshot, PrefetchManifestManagerOptions, PrefetchManifestManager, PageOptions, MatchedRoute, HydrationOptions, HeadEntry, HeadCollector, GenerateSSRHtmlOptions, FontFallbackMetrics7 as FontFallbackMetrics, FallbackFontName2 as FallbackFontName, EntityAccessMap, AssetDescriptor, AotTier, AotRouteEntry, AotRenderFn, AotManifestSnapshot, AotManifestManagerOptions, AotManifestManager, AotManifest, AotDivergenceEntry, AotDiagnosticsSnapshot, AotDiagnostics, AotDevManifest, AotDevComponentEntry, AotComponentDiagnostic, AotBuildManifest, AotBuildComponentEntry };
|