@vertz/ui-server 0.2.29 → 0.2.30
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.d.ts +24 -1
- package/dist/bun-dev-server.js +99 -68
- package/dist/bun-plugin/index.d.ts +2 -2
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -476
- package/dist/shared/chunk-bd0sgykf.js +1468 -0
- package/dist/ssr/index.d.ts +75 -2
- package/dist/ssr/index.js +1 -1
- package/package.json +5 -5
- package/dist/shared/chunk-yr65qdge.js +0 -764
package/dist/ssr/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ declare function stripScriptsFromStaticHTML(html: string): string;
|
|
|
128
128
|
* - Routes without `prerender` or `generateParams` are not collected
|
|
129
129
|
*/
|
|
130
130
|
declare function collectPrerenderPaths(routes: CompiledRoute2[], prefix?: string): Promise<string[]>;
|
|
131
|
-
import { FontFallbackMetrics as
|
|
131
|
+
import { FontFallbackMetrics as FontFallbackMetrics4 } from "@vertz/ui";
|
|
132
132
|
import { AccessSet } from "@vertz/ui/auth";
|
|
133
133
|
interface SessionData {
|
|
134
134
|
user: {
|
|
@@ -156,6 +156,58 @@ interface SSRSessionInfo {
|
|
|
156
156
|
* Returns null when no valid session exists (expired, missing, or invalid cookie).
|
|
157
157
|
*/
|
|
158
158
|
type SessionResolver = (request: Request) => Promise<SSRSessionInfo | null>;
|
|
159
|
+
import { ExtractedQuery } from "@vertz/ui-compiler";
|
|
160
|
+
/**
|
|
161
|
+
* SSR prefetch access rule evaluator.
|
|
162
|
+
*
|
|
163
|
+
* Evaluates serialized entity access rules against the current session
|
|
164
|
+
* to determine whether a query should be prefetched during SSR.
|
|
165
|
+
*
|
|
166
|
+
* The serialized rules come from the prefetch manifest (generated at build time).
|
|
167
|
+
* The session comes from the JWT decoded at request time.
|
|
168
|
+
*/
|
|
169
|
+
/**
|
|
170
|
+
* Serialized access rule — the JSON-friendly format stored in the manifest.
|
|
171
|
+
* Mirrors SerializedRule from @vertz/server/auth/rules but defined here
|
|
172
|
+
* to avoid importing the server package into the SSR pipeline.
|
|
173
|
+
*/
|
|
174
|
+
type SerializedAccessRule = {
|
|
175
|
+
type: "public";
|
|
176
|
+
} | {
|
|
177
|
+
type: "authenticated";
|
|
178
|
+
} | {
|
|
179
|
+
type: "role";
|
|
180
|
+
roles: string[];
|
|
181
|
+
} | {
|
|
182
|
+
type: "entitlement";
|
|
183
|
+
value: string;
|
|
184
|
+
} | {
|
|
185
|
+
type: "where";
|
|
186
|
+
conditions: Record<string, unknown>;
|
|
187
|
+
} | {
|
|
188
|
+
type: "all";
|
|
189
|
+
rules: SerializedAccessRule[];
|
|
190
|
+
} | {
|
|
191
|
+
type: "any";
|
|
192
|
+
rules: SerializedAccessRule[];
|
|
193
|
+
} | {
|
|
194
|
+
type: "fva";
|
|
195
|
+
maxAge: number;
|
|
196
|
+
} | {
|
|
197
|
+
type: "deny";
|
|
198
|
+
};
|
|
199
|
+
/** Serialized entity access rules from the prefetch manifest. */
|
|
200
|
+
type EntityAccessMap = Record<string, Partial<Record<string, SerializedAccessRule>>>;
|
|
201
|
+
interface SSRPrefetchManifest {
|
|
202
|
+
/** Route patterns present in the manifest. */
|
|
203
|
+
routePatterns: string[];
|
|
204
|
+
/** Entity access rules keyed by entity name → operation → serialized rule. */
|
|
205
|
+
entityAccess?: EntityAccessMap;
|
|
206
|
+
/** Route entries with query binding metadata for zero-discovery prefetch. */
|
|
207
|
+
routeEntries?: Record<string, {
|
|
208
|
+
queries: ExtractedQuery[];
|
|
209
|
+
}>;
|
|
210
|
+
}
|
|
159
211
|
interface SSRHandlerOptions {
|
|
160
212
|
/** The loaded SSR module (import('./dist/server/index.js')) */
|
|
161
213
|
module: SSRModule;
|
|
@@ -182,7 +234,7 @@ interface SSRHandlerOptions {
|
|
|
182
234
|
*/
|
|
183
235
|
nonce?: string;
|
|
184
236
|
/** Pre-computed font fallback metrics (computed at server startup). */
|
|
185
|
-
fallbackMetrics?: Record<string,
|
|
237
|
+
fallbackMetrics?: Record<string, FontFallbackMetrics4>;
|
|
186
238
|
/** Paths to inject as `<link rel="modulepreload">` in `<head>`. */
|
|
187
239
|
modulepreload?: string[];
|
|
188
240
|
/**
|
|
@@ -200,6 +252,27 @@ interface SSRHandlerOptions {
|
|
|
200
252
|
* optionally `window.__VERTZ_ACCESS_SET__` for instant auth hydration.
|
|
201
253
|
*/
|
|
202
254
|
sessionResolver?: SessionResolver;
|
|
255
|
+
/**
|
|
256
|
+
* Prefetch manifest for single-pass SSR optimization.
|
|
257
|
+
*
|
|
258
|
+
* When provided with route entries and an API client export, enables
|
|
259
|
+
* zero-discovery rendering — queries are prefetched from the manifest
|
|
260
|
+
* without executing the component tree, then a single render pass
|
|
261
|
+
* produces the HTML. Without a manifest, SSR still uses the single-pass
|
|
262
|
+
* discovery-then-render approach (cheaper than two-pass).
|
|
263
|
+
*/
|
|
264
|
+
manifest?: SSRPrefetchManifest;
|
|
265
|
+
/**
|
|
266
|
+
* Enable progressive HTML streaming. Default: false.
|
|
267
|
+
*
|
|
268
|
+
* When true, the Response body is a ReadableStream that sends `<head>`
|
|
269
|
+
* content (CSS, preloads, fonts) before `<body>` rendering is complete.
|
|
270
|
+
* This improves TTFB and FCP.
|
|
271
|
+
*
|
|
272
|
+
* Has no effect on zero-discovery routes (manifest with routeEntries),
|
|
273
|
+
* which always use buffered rendering.
|
|
274
|
+
*/
|
|
275
|
+
progressiveHTML?: boolean;
|
|
203
276
|
}
|
|
204
277
|
declare function createSSRHandler(options: SSRHandlerOptions): (request: Request) => Promise<Response>;
|
|
205
278
|
interface InjectIntoTemplateOptions {
|
package/dist/ssr/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI server-side rendering runtime",
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
"@ampproject/remapping": "^2.3.0",
|
|
59
59
|
"@capsizecss/unpack": "^4.0.0",
|
|
60
60
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
61
|
-
"@vertz/core": "^0.2.
|
|
62
|
-
"@vertz/ui": "^0.2.
|
|
63
|
-
"@vertz/ui-compiler": "^0.2.
|
|
61
|
+
"@vertz/core": "^0.2.29",
|
|
62
|
+
"@vertz/ui": "^0.2.29",
|
|
63
|
+
"@vertz/ui-compiler": "^0.2.29",
|
|
64
64
|
"magic-string": "^0.30.0",
|
|
65
65
|
"sharp": "^0.34.5",
|
|
66
66
|
"ts-morph": "^27.0.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@vertz/codegen": "^0.2.
|
|
69
|
+
"@vertz/codegen": "^0.2.29",
|
|
70
70
|
"@vertz/ui-auth": "^0.2.19",
|
|
71
71
|
"bun-types": "^1.3.10",
|
|
72
72
|
"bunup": "^0.16.31",
|