@vertz/ui-server 0.2.42 → 0.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -163,8 +163,7 @@ declare class AotDiagnostics {
163
163
  /** Produce a JSON-serializable snapshot for the diagnostic endpoint. */
164
164
  getSnapshot(): AotDiagnosticsSnapshot;
165
165
  }
166
- import { CompiledRoute, FontFallbackMetrics, Theme } from "@vertz/ui";
167
- import { SSRAuth as SSRAuth_jq1nwm } from "@vertz/ui/internals";
166
+ import { CompiledRoute, Theme } from "@vertz/ui";
168
167
  interface SSRModule {
169
168
  default?: () => unknown;
170
169
  App?: () => unknown;
@@ -202,35 +201,6 @@ interface SSRRenderResult {
202
201
  to: string;
203
202
  };
204
203
  }
205
- interface SSRDiscoverResult {
206
- resolved: Array<{
207
- key: string;
208
- data: unknown;
209
- }>;
210
- pending: string[];
211
- }
212
- /**
213
- * Render an SSR module to an HTML string with CSS and pre-fetched query data.
214
- *
215
- * Performs a two-pass render:
216
- * - Pass 1: Discovery — calls the app to trigger query() registrations, awaits them
217
- * - Pass 2: Render — calls the app again with data populated, renders to HTML
218
- */
219
- declare function ssrRenderToString(module: SSRModule, url: string, options?: {
220
- ssrTimeout?: number;
221
- /** Pre-computed font fallback metrics (computed at server startup). */
222
- fallbackMetrics?: Record<string, FontFallbackMetrics>;
223
- /** Auth state resolved from session cookie. Passed to SSRRenderContext for AuthProvider. */
224
- ssrAuth?: SSRAuth_jq1nwm;
225
- }): Promise<SSRRenderResult>;
226
- /**
227
- * Discover queries for a given URL without rendering.
228
- * Runs only Pass 1 (query registration + resolution), no Pass 2 render.
229
- * Used by the production handler to pre-fetch query data for client-side navigations.
230
- */
231
- declare function ssrDiscoverQueries(module: SSRModule, url: string, options?: {
232
- ssrTimeout?: number;
233
- }): Promise<SSRDiscoverResult>;
234
204
  import { FontFallbackMetrics as FontFallbackMetrics2 } from "@vertz/ui";
235
205
  import { SSRAuth } from "@vertz/ui/internals";
236
206
  interface QueryBindings {
@@ -302,8 +272,6 @@ interface SSRSinglePassOptions {
302
272
  fallbackMetrics?: Record<string, FontFallbackMetrics2>;
303
273
  /** Auth state resolved from session cookie. */
304
274
  ssrAuth?: SSRAuth;
305
- /** Set to false to fall back to two-pass rendering. Default: true. */
306
- prefetch?: boolean;
307
275
  /** Prefetch manifest for entity access filtering. */
308
276
  manifest?: SSRPrefetchManifest;
309
277
  /** Session data for access rule evaluation. */
@@ -321,12 +289,27 @@ interface SSRSinglePassOptions {
321
289
  * 1. Discovery: Run the app factory to capture query registrations (no stream render)
322
290
  * 2. Prefetch: Await all discovered queries with timeout
323
291
  * 3. Render: Create a fresh context with pre-populated cache, render once
324
- *
325
- * Falls back to two-pass (`ssrRenderToString`) when:
326
- * - `prefetch: false` is set
327
- * - A redirect is detected during discovery
328
292
  */
329
293
  declare function ssrRenderSinglePass(module: SSRModule, url: string, options?: SSRSinglePassOptions): Promise<SSRRenderResult>;
294
+ /**
295
+ * Stream nav query results as individual SSE events.
296
+ *
297
+ * Returns a `ReadableStream` that emits each query result as it settles:
298
+ * - `event: data` for resolved queries (with key + data)
299
+ * - `event: done` when all queries have settled
300
+ *
301
+ * Timed-out or rejected queries are silently dropped (no event sent).
302
+ * The client's `doneHandler` detects missing data and falls back to
303
+ * client-side fetch.
304
+ *
305
+ * The render lock is released after query discovery, before
306
+ * streaming begins. This allows concurrent SSR renders while queries
307
+ * are still resolving.
308
+ */
309
+ declare function ssrStreamNavQueries(module: SSRModule, url: string, options?: {
310
+ ssrTimeout?: number;
311
+ navSsrTimeout?: number;
312
+ }): Promise<ReadableStream<Uint8Array>>;
330
313
  /** Context passed to AOT render functions for accessing data and runtime holes. */
331
314
  interface SSRAotContext {
332
315
  /** Pre-generated closures for runtime-rendered components. */
@@ -1387,4 +1370,4 @@ declare function collectStreamChunks(stream: ReadableStream<Uint8Array>): Promis
1387
1370
  * @param nonce - Optional CSP nonce to add to the inline script tag.
1388
1371
  */
1389
1372
  declare function createTemplateChunk(slotId: number, resolvedHtml: string, nonce?: string): string;
1390
- export { wrapWithHydrationMarkers, toPrefetchSession, streamToString, ssrStorage, ssrRenderToString, ssrRenderSinglePass, ssrRenderAot, ssrDiscoverQueries, setGlobalSSRTimeout, serializeToHtml, safeSerialize, resetSlotCounter, renderToStream, renderToHTMLStream, renderToHTML, renderPage, renderHeadToHtml, renderAssetTags, registerSSRQuery, reconstructDescriptors, rawHtml, matchUrlToPatterns, loadNativeCompiler, loadAotManifest, isInSSR, isAotDebugEnabled, inlineCriticalCss, getStreamingRuntimeScript, getSSRUrl, getSSRQueries, getGlobalSSRTimeout, getAccessSetForSSR, generateSSRHtml, generateAotBuildManifest, generateAotBarrel, findAppComponent, extractRoutes, extractFontMetrics, evaluateAccessRule, encodeChunk, detectFallbackFont, createVertzLibraryPlugin, createTemplateChunk, createSlotPlaceholder, createSessionScript, createSSRHandler, createSSRDataChunk, createSSRAdapter, createPrefetchManifestManager, createNodeHandler, createHoles, createAotManifestManager, createAccessSetScript, compileForSsrAot, compile, collectStreamChunks, clearRouteCssCache, clearGlobalSSRTimeout, buildAotRouteMap, attachPerRouteCss, __ssr_style_object, __ssr_spread, __esc_attr, __esc, VertzLibraryPluginOptions, 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, NodeHandlerOptions, NativeCompiler, NativeCompileResult, NativeCompileOptions, MatchedRoute, MatchOptions, HydrationOptions, HeadEntry, HeadCollector, GenerateSSRHtmlOptions, FontFallbackMetrics7 as FontFallbackMetrics, FallbackFontName2 as FallbackFontName, ExtractedRoute, EntityAccessMap, AssetDescriptor, AotTier, AotRouteMapEntry, AotRouteEntry, AotRenderFn, AotManifestSnapshot, AotManifestManagerOptions, AotManifestManager, AotManifest, AotDivergenceEntry, AotDiagnosticsSnapshot, AotDiagnostics, AotDevManifest, AotDevComponentEntry, AotDataResolver, AotComponentDiagnostic, AotCompiledFile, AotBuildManifest, AotBuildComponentEntry, AotBarrelResult };
1373
+ export { wrapWithHydrationMarkers, toPrefetchSession, streamToString, ssrStreamNavQueries, ssrStorage, ssrRenderSinglePass, ssrRenderAot, setGlobalSSRTimeout, serializeToHtml, safeSerialize, resetSlotCounter, renderToStream, renderToHTMLStream, renderToHTML, renderPage, renderHeadToHtml, renderAssetTags, registerSSRQuery, reconstructDescriptors, rawHtml, matchUrlToPatterns, loadNativeCompiler, loadAotManifest, isInSSR, isAotDebugEnabled, inlineCriticalCss, getStreamingRuntimeScript, getSSRUrl, getSSRQueries, getGlobalSSRTimeout, getAccessSetForSSR, generateSSRHtml, generateAotBuildManifest, generateAotBarrel, findAppComponent, extractRoutes, extractFontMetrics, evaluateAccessRule, encodeChunk, detectFallbackFont, createVertzLibraryPlugin, createTemplateChunk, createSlotPlaceholder, createSessionScript, createSSRHandler, createSSRDataChunk, createSSRAdapter, createPrefetchManifestManager, createNodeHandler, createHoles, createAotManifestManager, createAccessSetScript, compileForSsrAot, compile, collectStreamChunks, clearRouteCssCache, clearGlobalSSRTimeout, buildAotRouteMap, attachPerRouteCss, __ssr_style_object, __ssr_spread, __esc_attr, __esc, VertzLibraryPluginOptions, VNode, SessionResolver, SessionData, SerializedAccessRule, SSRSinglePassOptions, SSRSessionInfo, SSRRenderResult, SSRRenderAotOptions, SSRQueryEntry2 as SSRQueryEntry, SSRPrefetchManifest, SSRModule, SSRHandlerOptions, SSRAotContext, RenderToStreamOptions, RenderToHTMLStreamOptions, RenderToHTMLOptions, ReconstructedDescriptor, RawHtml, PrefetchSession, PrefetchManifestSnapshot, PrefetchManifestManagerOptions, PrefetchManifestManager, PageOptions, NodeHandlerOptions, NativeCompiler, NativeCompileResult, NativeCompileOptions, MatchedRoute, MatchOptions, HydrationOptions, HeadEntry, HeadCollector, GenerateSSRHtmlOptions, FontFallbackMetrics7 as FontFallbackMetrics, FallbackFontName2 as FallbackFontName, ExtractedRoute, EntityAccessMap, AssetDescriptor, AotTier, AotRouteMapEntry, AotRouteEntry, AotRenderFn, AotManifestSnapshot, AotManifestManagerOptions, AotManifestManager, AotManifest, AotDivergenceEntry, AotDiagnosticsSnapshot, AotDiagnostics, AotDevManifest, AotDevComponentEntry, AotDataResolver, AotComponentDiagnostic, AotCompiledFile, AotBuildManifest, AotBuildComponentEntry, AotBarrelResult };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createSSRHandler,
3
3
  loadAotManifest
4
- } from "./shared/chunk-tnsz18ac.js";
4
+ } from "./shared/chunk-05hadnnd.js";
5
5
  import {
6
6
  createNodeHandler
7
- } from "./shared/chunk-phe490jc.js";
7
+ } from "./shared/chunk-hd03dkxf.js";
8
8
  import {
9
9
  clearRouteCssCache,
10
10
  collectStreamChunks,
@@ -29,13 +29,12 @@ import {
29
29
  resetSlotCounter,
30
30
  safeSerialize,
31
31
  serializeToHtml,
32
- ssrDiscoverQueries,
33
32
  ssrRenderAot,
34
33
  ssrRenderSinglePass,
35
- ssrRenderToString,
34
+ ssrStreamNavQueries,
36
35
  streamToString,
37
36
  toPrefetchSession
38
- } from "./shared/chunk-r1pf7cf2.js";
37
+ } from "./shared/chunk-1v0wakka.js";
39
38
  import {
40
39
  clearGlobalSSRTimeout,
41
40
  createSSRAdapter,
@@ -172570,11 +172569,10 @@ export {
172570
172569
  wrapWithHydrationMarkers,
172571
172570
  toPrefetchSession,
172572
172571
  streamToString,
172572
+ ssrStreamNavQueries,
172573
172573
  ssrStorage,
172574
- ssrRenderToString,
172575
172574
  ssrRenderSinglePass,
172576
172575
  ssrRenderAot,
172577
- ssrDiscoverQueries,
172578
172576
  setGlobalSSRTimeout,
172579
172577
  serializeToHtml,
172580
172578
  safeSerialize,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createNodeHandler
3
- } from "./shared/chunk-phe490jc.js";
4
- import"./shared/chunk-r1pf7cf2.js";
3
+ } from "./shared/chunk-hd03dkxf.js";
4
+ import"./shared/chunk-1v0wakka.js";
5
5
  import"./shared/chunk-szvdd1qq.js";
6
6
  import"./shared/chunk-bt1px3c4.js";
7
7
  export {
@@ -11,7 +11,7 @@ import {
11
11
  ssrRenderSinglePass,
12
12
  ssrStreamNavQueries,
13
13
  toPrefetchSession
14
- } from "./chunk-r1pf7cf2.js";
14
+ } from "./chunk-1v0wakka.js";
15
15
 
16
16
  // src/aot-manifest-loader.ts
17
17
  import { existsSync, readFileSync } from "node:fs";