vue-ssr-lite 0.1.3 → 0.1.4
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/SsrApplicationRuntime.d.ts.map +1 -1
- package/dist/SsrBrowserRuntime.d.ts.map +1 -1
- package/dist/SsrRenderRuntime.d.ts.map +1 -1
- package/dist/SsrRuntimeTypes.d.ts +4 -2
- package/dist/SsrRuntimeTypes.d.ts.map +1 -1
- package/dist/chunks/SsrApplicationRuntime-lj5EmDGU.mjs +65 -0
- package/dist/chunks/{SsrServerRuntime-D9hwT6rl.mjs → SsrServerRuntime-3f0yAnNL.mjs} +290 -275
- package/dist/cli.mjs +1 -1
- package/dist/client.mjs +30 -19
- package/dist/index.mjs +1 -1
- package/dist/server/SsrServerRuntime.d.ts.map +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +3 -2
- package/dist/chunks/SsrApplicationRuntime-B-6cXN5-.mjs +0 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrApplicationRuntime.d.ts","sourceRoot":"","sources":["../src/SsrApplicationRuntime.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,WAAW,2BAA2B,CAC1C,iBAAiB,EACjB,aAAa;IAEb,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACxC,cAAc,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG,IAAI,CAAA;CAC5E;AAED,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,aAAa,GAAG,OAAO,EACvB,UAAU,GAAG,OAAO,EAEpB,YAAY,wBAAwB,CAClC,iBAAiB,EACjB,aAAa,EACb,UAAU,CACX,EACD,SAAS,2BAA2B,CAAC,iBAAiB,EAAE,aAAa,CAAC,KACrE,OAAO,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,aAAa,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"SsrApplicationRuntime.d.ts","sourceRoot":"","sources":["../src/SsrApplicationRuntime.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,WAAW,2BAA2B,CAC1C,iBAAiB,EACjB,aAAa;IAEb,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACxC,cAAc,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG,IAAI,CAAA;CAC5E;AAED,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,aAAa,GAAG,OAAO,EACvB,UAAU,GAAG,OAAO,EAEpB,YAAY,wBAAwB,CAClC,iBAAiB,EACjB,aAAa,EACb,UAAU,CACX,EACD,SAAS,2BAA2B,CAAC,iBAAiB,EAAE,aAAa,CAAC,KACrE,OAAO,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,aAAa,EAAE,UAAU,CAAC,CAoG7E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrBrowserRuntime.d.ts","sourceRoot":"","sources":["../src/SsrBrowserRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,qBAAqB,GAChC,YAAY,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACnD,UAAS,iBAAsB,KAC9B,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"SsrBrowserRuntime.d.ts","sourceRoot":"","sources":["../src/SsrBrowserRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,qBAAqB,GAChC,YAAY,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACnD,UAAS,iBAAsB,KAC9B,OAAO,CAAC,IAAI,CAsDd,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrRenderRuntime.d.ts","sourceRoot":"","sources":["../src/SsrRenderRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EAExB,gBAAgB,EAChB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAK1B,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,aAAa,GAAG,OAAO,EACvB,UAAU,GAAG,OAAO,EAEpB,YAAY,wBAAwB,CAClC,iBAAiB,EACjB,aAAa,EACb,UAAU,CACX,EACD,SAAS,gBAAgB,CAAC,aAAa,CAAC,KACvC,OAAO,CAAC,eAAe,CAAC,iBAAiB,EAAE,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"SsrRenderRuntime.d.ts","sourceRoot":"","sources":["../src/SsrRenderRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EAExB,gBAAgB,EAChB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAK1B,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,aAAa,GAAG,OAAO,EACvB,UAAU,GAAG,OAAO,EAEpB,YAAY,wBAAwB,CAClC,iBAAiB,EACjB,aAAa,EACb,UAAU,CACX,EACD,SAAS,gBAAgB,CAAC,aAAa,CAAC,KACvC,OAAO,CAAC,eAAe,CAAC,iBAAiB,EAAE,aAAa,CAAC,CA0E3D,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { App, Component } from 'vue';
|
|
2
2
|
import { Router, RouteRecordRaw } from 'vue-router';
|
|
3
|
-
import { VueApolloClientOptions, VueApolloState, VueApolloClients } from 'vue-apollo-client';
|
|
3
|
+
import { VueApolloClientOptions, VueApolloRuntime, VueApolloState, VueApolloClients } from 'vue-apollo-client';
|
|
4
4
|
export type SsrHeaderValue = string | string[] | undefined;
|
|
5
5
|
export type SsrHeaders = Record<string, SsrHeaderValue>;
|
|
6
6
|
export interface SsrHeadPayload {
|
|
@@ -172,7 +172,9 @@ export interface SsrEndpointDefinition<TPublicConfig = unknown> {
|
|
|
172
172
|
handle: (request: SsrHttpRequest<TPublicConfig>, tools: SsrEndpointTools) => SsrHttpResponse | null | Promise<SsrHttpResponse | null>;
|
|
173
173
|
}
|
|
174
174
|
export interface SsrEndpointTools {
|
|
175
|
-
/** Creates isolated
|
|
175
|
+
/** Creates an isolated typed operation runtime stopped after the request. */
|
|
176
|
+
createApolloRuntime: (options: VueApolloClientOptions) => VueApolloRuntime;
|
|
177
|
+
/** @deprecated Use `createApolloRuntime` and its typed execution methods. */
|
|
176
178
|
createApolloClients: (options: VueApolloClientOptions) => VueApolloClients;
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oB,CAAC,aAAa,GAAG,OAAO;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACvC,SAAS,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,EAAE,CAAA;IAClD,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAA;CAChC;AAED,MAAM,MAAM,0BAA0B,CAAC,aAAa,GAAG,OAAO,IAC1D,oBAAoB,CAAC,aAAa,CAAC,GACnC,CAAC,MAAM,oBAAoB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { inject as C, ref as R, createSSRApp as i } from "vue";
|
|
2
|
+
import { createRouter as v, createMemoryHistory as f, createWebHistory as w } from "vue-router";
|
|
3
|
+
import { createApollo as b } from "vue-apollo-client";
|
|
4
|
+
const p = /* @__PURE__ */ Symbol("vue-ssr-lite-request-context"), E = () => {
|
|
5
|
+
const e = C(p);
|
|
6
|
+
if (!e) throw new Error("vue-ssr-lite request context is not installed.");
|
|
7
|
+
return e;
|
|
8
|
+
}, M = async (e, t) => {
|
|
9
|
+
if (!e?.id || !e.rootComponent)
|
|
10
|
+
throw new Error("An SSR application requires an id and rootComponent.");
|
|
11
|
+
if (t.hydrationState && t.hydrationState.applicationId !== e.id)
|
|
12
|
+
throw new Error("Hydration state belongs to a different SSR application.");
|
|
13
|
+
const a = typeof e.routes == "function" ? e.routes() : e.routes, s = a ? v({
|
|
14
|
+
history: t.server ? f() : w(),
|
|
15
|
+
routes: a,
|
|
16
|
+
scrollBehavior(r, y, n) {
|
|
17
|
+
if (n) return n;
|
|
18
|
+
if (r.hash) return { el: r.hash, top: 24 };
|
|
19
|
+
if (r.fullPath !== y.fullPath)
|
|
20
|
+
return { left: 0, top: 0 };
|
|
21
|
+
}
|
|
22
|
+
}) : null, h = t.hydrationState?.application ?? e.createInitialState?.() ?? {}, q = {
|
|
23
|
+
statusCode: 200,
|
|
24
|
+
headers: {},
|
|
25
|
+
redirect: null
|
|
26
|
+
}, u = {
|
|
27
|
+
request: t.request,
|
|
28
|
+
url: new URL(t.request.url),
|
|
29
|
+
host: t.request.host,
|
|
30
|
+
publicConfig: t.request.publicConfig,
|
|
31
|
+
state: h,
|
|
32
|
+
head: R(null),
|
|
33
|
+
response: q,
|
|
34
|
+
apolloClients: null
|
|
35
|
+
}, S = e.createExtension ? await e.createExtension(u) : void 0, o = { ...u, extension: S }, c = e.apollo ? typeof e.apollo == "function" ? await e.apollo({
|
|
36
|
+
request: t.request,
|
|
37
|
+
publicConfig: t.request.publicConfig,
|
|
38
|
+
server: t.server
|
|
39
|
+
}) : e.apollo : null, m = typeof e.apolloRequestTimeoutMs == "function" ? e.apolloRequestTimeoutMs(t.request.publicConfig) : e.apolloRequestTimeoutMs, l = c ? b(c, {
|
|
40
|
+
server: t.server,
|
|
41
|
+
registerGlobal: !t.server,
|
|
42
|
+
headers: t.request.apolloHeaders,
|
|
43
|
+
initialState: t.hydrationState?.apollo,
|
|
44
|
+
signal: t.request.signal,
|
|
45
|
+
requestTimeoutMs: m ?? t.request.apolloRequestTimeoutMs
|
|
46
|
+
}) : null;
|
|
47
|
+
o.apolloClients = l?.clients ?? null;
|
|
48
|
+
try {
|
|
49
|
+
const r = i(e.rootComponent);
|
|
50
|
+
return s && r.use(s), l && r.use(l), r.provide(p, o), await e.install?.({
|
|
51
|
+
app: r,
|
|
52
|
+
router: s,
|
|
53
|
+
context: o,
|
|
54
|
+
apolloClients: l?.clients ?? null,
|
|
55
|
+
server: t.server
|
|
56
|
+
}), { app: r, router: s, context: o, apollo: l };
|
|
57
|
+
} catch (r) {
|
|
58
|
+
throw l?.stop(), r;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
p as S,
|
|
63
|
+
M as c,
|
|
64
|
+
E as u
|
|
65
|
+
};
|
|
@@ -1,49 +1,63 @@
|
|
|
1
|
-
import { createServer as
|
|
2
|
-
import { stat as _, readFile as
|
|
3
|
-
import { resolve as j, sep as
|
|
4
|
-
import { createApollo as
|
|
5
|
-
import { renderToString as
|
|
6
|
-
import { c as
|
|
7
|
-
import { a as
|
|
8
|
-
import { r as B, p as
|
|
9
|
-
const D = () => globalThis.performance?.now?.() ?? Date.now(),
|
|
10
|
-
const s = D(), r = await
|
|
1
|
+
import { createServer as ie } from "node:http";
|
|
2
|
+
import { stat as _, readFile as re } from "node:fs/promises";
|
|
3
|
+
import { resolve as j, sep as Z, extname as oe } from "node:path";
|
|
4
|
+
import { createApollo as ce } from "vue-apollo-client";
|
|
5
|
+
import { renderToString as le } from "@vue/server-renderer";
|
|
6
|
+
import { c as de } from "./SsrApplicationRuntime-lj5EmDGU.mjs";
|
|
7
|
+
import { a as ue } from "./SsrSerialization-k-3aCFYt.mjs";
|
|
8
|
+
import { r as B, p as he, i as me } from "./SsrHtmlRuntime-cTFsMSAZ.mjs";
|
|
9
|
+
const D = () => globalThis.performance?.now?.() ?? Date.now(), Q = (e) => new TextEncoder().encode(e).byteLength, fe = async (e, t) => {
|
|
10
|
+
const s = D(), r = await de(e, {
|
|
11
11
|
server: !0,
|
|
12
12
|
request: t
|
|
13
|
-
}),
|
|
13
|
+
}), c = D();
|
|
14
|
+
let n;
|
|
14
15
|
try {
|
|
15
16
|
if (r.router) {
|
|
16
|
-
const
|
|
17
|
-
await r.router.push(`${
|
|
17
|
+
const h = new URL(t.url);
|
|
18
|
+
await r.router.push(`${h.pathname}${h.search}${h.hash}`), await r.router.isReady(), r.router.currentRoute.value.matched.length === 0 && (r.context.response.statusCode = 404);
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
+
const i = D(), p = {}, C = await le(r.app, p), w = D(), f = await e.resolveHead?.(r.context) ?? r.context.head.value, y = {
|
|
20
21
|
version: 1,
|
|
21
22
|
applicationId: e.id,
|
|
22
23
|
publicConfig: t.publicConfig,
|
|
23
24
|
application: r.context.state,
|
|
24
25
|
apollo: r.apollo?.extract()
|
|
25
|
-
},
|
|
26
|
+
}, o = Q(ue(y)), a = D();
|
|
26
27
|
return {
|
|
27
|
-
html:
|
|
28
|
-
teleports:
|
|
28
|
+
html: C,
|
|
29
|
+
teleports: p.teleports?.body ?? "",
|
|
29
30
|
head: f,
|
|
30
31
|
response: r.context.response,
|
|
31
|
-
hydrationState:
|
|
32
|
+
hydrationState: y,
|
|
32
33
|
metrics: {
|
|
33
34
|
requestId: t.requestId,
|
|
34
35
|
applicationId: e.id,
|
|
35
|
-
contextDurationMs:
|
|
36
|
-
routeDurationMs:
|
|
37
|
-
renderDurationMs:
|
|
38
|
-
totalDurationMs:
|
|
39
|
-
htmlBytes:
|
|
40
|
-
stateBytes:
|
|
36
|
+
contextDurationMs: c - s,
|
|
37
|
+
routeDurationMs: i - c,
|
|
38
|
+
renderDurationMs: w - i,
|
|
39
|
+
totalDurationMs: a - s,
|
|
40
|
+
htmlBytes: Q(C),
|
|
41
|
+
stateBytes: o
|
|
41
42
|
}
|
|
42
43
|
};
|
|
44
|
+
} catch (i) {
|
|
45
|
+
throw n = i, i;
|
|
43
46
|
} finally {
|
|
44
|
-
|
|
47
|
+
let i;
|
|
48
|
+
try {
|
|
49
|
+
await e.cleanup?.(r.context);
|
|
50
|
+
} catch (p) {
|
|
51
|
+
i = p, console.error("[vue-ssr-lite] application cleanup failed", p);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
r.apollo?.stop();
|
|
55
|
+
} catch (p) {
|
|
56
|
+
console.error("[vue-ssr-lite] Apollo cleanup failed", p), i || (i = p);
|
|
57
|
+
}
|
|
58
|
+
if (!n && i) throw i;
|
|
45
59
|
}
|
|
46
|
-
},
|
|
60
|
+
}, pe = {
|
|
47
61
|
".css": "text/css; charset=utf-8",
|
|
48
62
|
".gif": "image/gif",
|
|
49
63
|
".html": "text/html; charset=utf-8",
|
|
@@ -60,16 +74,16 @@ const D = () => globalThis.performance?.now?.() ?? Date.now(), Z = (e) => new Te
|
|
|
60
74
|
".woff": "font/woff",
|
|
61
75
|
".woff2": "font/woff2",
|
|
62
76
|
".xml": "application/xml; charset=utf-8"
|
|
63
|
-
},
|
|
77
|
+
}, we = async (e, t, s) => {
|
|
64
78
|
try {
|
|
65
79
|
const r = decodeURIComponent(t).replace(/^\/+/, "");
|
|
66
80
|
if (!r || s.includes(r)) return null;
|
|
67
|
-
const
|
|
68
|
-
return !
|
|
81
|
+
const c = j(e, r), n = e.endsWith(Z) ? e : `${e}${Z}`;
|
|
82
|
+
return !c.startsWith(n) || !(await _(c)).isFile() ? null : {
|
|
69
83
|
statusCode: 200,
|
|
70
|
-
body: await
|
|
84
|
+
body: await re(c),
|
|
71
85
|
headers: {
|
|
72
|
-
"content-type":
|
|
86
|
+
"content-type": pe[oe(c)] || "application/octet-stream",
|
|
73
87
|
"cache-control": t.startsWith("/assets/") ? "public, max-age=31536000, immutable" : "public, max-age=3600"
|
|
74
88
|
}
|
|
75
89
|
};
|
|
@@ -84,8 +98,8 @@ const D = () => globalThis.performance?.now?.() ?? Date.now(), Z = (e) => new Te
|
|
|
84
98
|
const s = t.includes(":") && t.split(":").length > 2 && !t.startsWith("[") ? `[${t}]` : t, r = new URL(`http://${s}`);
|
|
85
99
|
if (r.username || r.password || r.pathname !== "/" || r.search || r.hash)
|
|
86
100
|
return "";
|
|
87
|
-
const
|
|
88
|
-
return
|
|
101
|
+
const c = r.hostname.toLowerCase().replace(/\.$/, "");
|
|
102
|
+
return c ? `${c.includes(":") && !c.startsWith("[") ? `[${c}]` : c}${r.port ? `:${r.port}` : ""}` : "";
|
|
89
103
|
} catch {
|
|
90
104
|
return "";
|
|
91
105
|
}
|
|
@@ -97,7 +111,7 @@ const D = () => globalThis.performance?.now?.() ?? Date.now(), Z = (e) => new Te
|
|
|
97
111
|
return s > 0 ? t.slice(1, s) : "";
|
|
98
112
|
}
|
|
99
113
|
return t.replace(/:\d+$/, "");
|
|
100
|
-
},
|
|
114
|
+
}, ye = (e) => {
|
|
101
115
|
const t = e.trim().toLowerCase();
|
|
102
116
|
if (t === "*") return "*";
|
|
103
117
|
if (t.startsWith("*.")) {
|
|
@@ -106,77 +120,77 @@ const D = () => globalThis.performance?.now?.() ?? Date.now(), Z = (e) => new Te
|
|
|
106
120
|
}
|
|
107
121
|
return U(t);
|
|
108
122
|
}, ge = (e, t) => {
|
|
109
|
-
const s = G(e), r =
|
|
123
|
+
const s = G(e), r = ye(t);
|
|
110
124
|
return !s || !r ? !1 : r === "*" ? !0 : r.startsWith("*.") ? s.endsWith(`.${r.slice(2)}`) : U(e) === r || s === G(r);
|
|
111
|
-
},
|
|
125
|
+
}, ve = (e, t, s = !1) => U(s && J(e) || t), Se = (e, t, s = !1) => {
|
|
112
126
|
if (!s) return t;
|
|
113
127
|
const r = J(e).toLowerCase();
|
|
114
128
|
return r === "http" || r === "https" ? r : t;
|
|
115
|
-
},
|
|
129
|
+
}, xe = (e, t, s) => {
|
|
116
130
|
const r = e.find(
|
|
117
|
-
(
|
|
118
|
-
(
|
|
131
|
+
(n) => n.hosts.some(
|
|
132
|
+
(i) => i !== "*" && ge(t, i)
|
|
119
133
|
)
|
|
120
134
|
);
|
|
121
135
|
if (r) return r;
|
|
122
|
-
const
|
|
123
|
-
return
|
|
124
|
-
},
|
|
125
|
-
const r = new Set(t.filter((
|
|
136
|
+
const c = e.find((n) => n.hosts.includes("*"));
|
|
137
|
+
return c || (e.find((n) => n.id === s) ?? null);
|
|
138
|
+
}, Y = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/, be = (e, t = [], s = []) => {
|
|
139
|
+
const r = new Set(t.filter((i) => Y.test(i))), c = new Set(s.filter((i) => Y.test(i)));
|
|
126
140
|
if (!e || r.size === 0) return;
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const C =
|
|
131
|
-
return r.has(C) && !
|
|
141
|
+
const n = String(e).split(";").map((i) => i.trim()).filter(Boolean).filter((i) => {
|
|
142
|
+
const p = i.indexOf("=");
|
|
143
|
+
if (p <= 0) return !1;
|
|
144
|
+
const C = i.slice(0, p).trim();
|
|
145
|
+
return r.has(C) && !c.has(C);
|
|
132
146
|
});
|
|
133
|
-
return
|
|
134
|
-
},
|
|
147
|
+
return n.length ? n.join("; ") : void 0;
|
|
148
|
+
}, Ee = (e) => typeof e == "string" ? new TextEncoder().encode(e).byteLength : e?.byteLength ?? 0, q = (e) => ({
|
|
135
149
|
statusCode: e.statusCode,
|
|
136
150
|
body: e.body instanceof Uint8Array ? e.body.slice() : e.body,
|
|
137
151
|
headers: e.headers ? { ...e.headers } : void 0
|
|
138
|
-
}),
|
|
139
|
-
const t = Number(e.maxEntries ?? 500), s = Number(e.maxBytes ?? 32 * 1024 * 1024), r = Number.isFinite(t) ? Math.max(1, Math.floor(t)) : 500,
|
|
140
|
-
let
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
return
|
|
152
|
+
}), Ne = (e = {}) => {
|
|
153
|
+
const t = Number(e.maxEntries ?? 500), s = Number(e.maxBytes ?? 32 * 1024 * 1024), r = Number.isFinite(t) ? Math.max(1, Math.floor(t)) : 500, c = Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 32 * 1024 * 1024, n = /* @__PURE__ */ new Map();
|
|
154
|
+
let i = 0;
|
|
155
|
+
const p = (w) => {
|
|
156
|
+
const f = n.get(w);
|
|
157
|
+
return f ? (n.delete(w), i -= f.size, !0) : !1;
|
|
144
158
|
}, C = () => {
|
|
145
|
-
const
|
|
146
|
-
for (const [
|
|
147
|
-
|
|
148
|
-
for (;
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
151
|
-
|
|
159
|
+
const w = Date.now();
|
|
160
|
+
for (const [f, y] of n)
|
|
161
|
+
y.expiresAt <= w && p(f);
|
|
162
|
+
for (; n.size > r || i > c; ) {
|
|
163
|
+
const f = n.keys().next().value;
|
|
164
|
+
if (!f) break;
|
|
165
|
+
p(f);
|
|
152
166
|
}
|
|
153
167
|
};
|
|
154
168
|
return {
|
|
155
|
-
get(
|
|
156
|
-
const
|
|
157
|
-
return
|
|
169
|
+
get(w) {
|
|
170
|
+
const f = n.get(w);
|
|
171
|
+
return f ? f.expiresAt <= Date.now() ? (p(w), null) : (n.delete(w), n.set(w, f), q(f.response)) : null;
|
|
158
172
|
},
|
|
159
|
-
set(
|
|
160
|
-
const o = Number(
|
|
173
|
+
set(w, f, y) {
|
|
174
|
+
const o = Number(y.ttlMs);
|
|
161
175
|
if (!Number.isFinite(o) || o <= 0) return;
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
response:
|
|
176
|
+
p(w);
|
|
177
|
+
const a = q(f), h = Ee(a.body);
|
|
178
|
+
h > c || (n.set(w, {
|
|
179
|
+
response: a,
|
|
166
180
|
expiresAt: Date.now() + o,
|
|
167
|
-
size:
|
|
168
|
-
tags: new Set(
|
|
169
|
-
}),
|
|
181
|
+
size: h,
|
|
182
|
+
tags: new Set(y.tags ?? [])
|
|
183
|
+
}), i += h, C());
|
|
170
184
|
},
|
|
171
|
-
invalidate(
|
|
172
|
-
const
|
|
185
|
+
invalidate(w = {}) {
|
|
186
|
+
const f = new Set(w.keys ?? []), y = new Set(w.tags ?? []);
|
|
173
187
|
let o = 0;
|
|
174
|
-
for (const [
|
|
175
|
-
(!
|
|
188
|
+
for (const [a, h] of n)
|
|
189
|
+
(!f.size && !y.size || f.has(a) || [...y].some((S) => h.tags.has(S))) && p(a) && (o += 1);
|
|
176
190
|
return o;
|
|
177
191
|
}
|
|
178
192
|
};
|
|
179
|
-
},
|
|
193
|
+
}, Re = async (e, t, s) => {
|
|
180
194
|
if (!s || t.method !== "GET" || t.cookie || !Number.isFinite(s.ttlMs) || s.ttlMs <= 0)
|
|
181
195
|
return null;
|
|
182
196
|
const r = s.vary ? await s.vary(t) : "";
|
|
@@ -188,197 +202,197 @@ const D = () => globalThis.performance?.now?.() ?? Date.now(), Z = (e) => new Te
|
|
|
188
202
|
t.search,
|
|
189
203
|
r
|
|
190
204
|
]);
|
|
191
|
-
},
|
|
192
|
-
const r = Object.entries(e.headers ?? {}),
|
|
193
|
-
r.find(([
|
|
205
|
+
}, Ce = (e, t, s) => {
|
|
206
|
+
const r = Object.entries(e.headers ?? {}), c = String(
|
|
207
|
+
r.find(([i]) => i.toLowerCase() === "cache-control")?.[1] || ""
|
|
194
208
|
).toLowerCase();
|
|
195
|
-
return e.statusCode === 200 && typeof e.body == "string" && !r.some(([
|
|
209
|
+
return e.statusCode === 200 && typeof e.body == "string" && !r.some(([i]) => i.toLowerCase() === "set-cookie") && !c.includes("private") && !c.includes("no-store") && (s.shouldCache?.(e, t) ?? !0);
|
|
196
210
|
};
|
|
197
|
-
class
|
|
211
|
+
class se extends Error {
|
|
198
212
|
constructor() {
|
|
199
213
|
super("SSR request timed out."), this.name = "SsrRequestTimeoutError";
|
|
200
214
|
}
|
|
201
215
|
}
|
|
202
|
-
const
|
|
216
|
+
const Ae = (e) => {
|
|
203
217
|
const t = e ?? 4173;
|
|
204
218
|
if (!Number.isInteger(t) || t < 0 || t > 65535)
|
|
205
219
|
throw new Error("SSR server port must be an integer between 0 and 65535.");
|
|
206
220
|
return t;
|
|
207
|
-
},
|
|
221
|
+
}, ee = async (e) => {
|
|
208
222
|
const s = e?.default ?? e, r = typeof s == "function" ? await s() : s;
|
|
209
223
|
if (!r?.name || !Array.isArray(r.entries) || !r.server)
|
|
210
224
|
throw new Error("The SSR runtime module does not export a valid runtime definition.");
|
|
211
|
-
const
|
|
212
|
-
for (const
|
|
213
|
-
if (!
|
|
225
|
+
const c = /* @__PURE__ */ new Set();
|
|
226
|
+
for (const n of r.entries) {
|
|
227
|
+
if (!n.id || c.has(n.id))
|
|
214
228
|
throw new Error("SSR runtime entry ids must be present and unique.");
|
|
215
|
-
if (
|
|
216
|
-
throw new Error(`SSR runtime entry "${
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
throw new Error(`SSR entry "${
|
|
229
|
+
if (c.add(n.id), !n.template || !n.hosts?.length)
|
|
230
|
+
throw new Error(`SSR runtime entry "${n.id}" requires a template and hosts.`);
|
|
231
|
+
const i = !n.roles?.length || !r.server.role || n.roles.includes(r.server.role);
|
|
232
|
+
if (n.kind === "ssr" && i && !n.application)
|
|
233
|
+
throw new Error(`SSR entry "${n.id}" requires an application definition.`);
|
|
220
234
|
}
|
|
221
235
|
return r;
|
|
222
|
-
},
|
|
236
|
+
}, P = {
|
|
223
237
|
"referrer-policy": "strict-origin-when-cross-origin",
|
|
224
238
|
"x-content-type-options": "nosniff",
|
|
225
239
|
"x-frame-options": "SAMEORIGIN"
|
|
226
|
-
},
|
|
240
|
+
}, T = (e, t) => {
|
|
227
241
|
if (e.method !== "GET" && e.method !== "HEAD") return !1;
|
|
228
242
|
if (e.headers["sec-fetch-mode"] === "navigate") return !0;
|
|
229
243
|
const s = String(e.headers.accept || "");
|
|
230
|
-
return s.includes("text/html") ? !0 : (!s || s === "*/*") && !
|
|
244
|
+
return s.includes("text/html") ? !0 : (!s || s === "*/*") && !oe(t);
|
|
231
245
|
}, Me = (e, t, s = "") => t.end(e.method === "HEAD" ? "" : s), E = (e, t, s) => {
|
|
232
246
|
t.writeHead(s.statusCode, s.headers ?? {}), Me(e, t, s.body ?? "");
|
|
233
|
-
},
|
|
247
|
+
}, $ = (e, t, s, r) => E(e, t, {
|
|
234
248
|
statusCode: s,
|
|
235
249
|
body: JSON.stringify(r),
|
|
236
250
|
headers: {
|
|
237
251
|
"content-type": "application/json; charset=utf-8",
|
|
238
252
|
"cache-control": "no-store"
|
|
239
253
|
}
|
|
240
|
-
}),
|
|
254
|
+
}), te = async (e, t, s) => {
|
|
241
255
|
if (!Number.isFinite(t) || t <= 0) return e;
|
|
242
256
|
let r;
|
|
243
|
-
const
|
|
257
|
+
const c = new Promise((n, i) => {
|
|
244
258
|
r = setTimeout(() => {
|
|
245
|
-
s.abort(),
|
|
259
|
+
s.abort(), i(new se());
|
|
246
260
|
}, t);
|
|
247
261
|
});
|
|
248
262
|
try {
|
|
249
|
-
return await Promise.race([e,
|
|
263
|
+
return await Promise.race([e, c]);
|
|
250
264
|
} finally {
|
|
251
265
|
r && clearTimeout(r);
|
|
252
266
|
}
|
|
253
|
-
}, $e = (e) => e.headers, Pe = (e, t, s) => new Promise((r,
|
|
254
|
-
e.middlewares(t, s, (
|
|
255
|
-
|
|
267
|
+
}, $e = (e) => e.headers, Pe = (e, t, s) => new Promise((r, c) => {
|
|
268
|
+
e.middlewares(t, s, (n) => {
|
|
269
|
+
n ? c(n) : r();
|
|
256
270
|
});
|
|
257
|
-
}),
|
|
271
|
+
}), Ue = async (e) => {
|
|
258
272
|
let t = !1;
|
|
259
|
-
const s = await
|
|
273
|
+
const s = await ee(await e.loadRuntime()), r = s.server, c = r.host || "0.0.0.0", n = Ae(r.port), i = j(
|
|
260
274
|
r.root || e.root,
|
|
261
275
|
r.clientOutDir || "dist/client"
|
|
262
|
-
),
|
|
263
|
-
const
|
|
264
|
-
j(e.production ?
|
|
276
|
+
), p = async () => e.production ? s : ee(await e.loadRuntime()), C = async (o, a, h) => {
|
|
277
|
+
const l = o.server.root || e.root, S = await re(
|
|
278
|
+
j(e.production ? i : l, a),
|
|
265
279
|
"utf8"
|
|
266
280
|
);
|
|
267
281
|
if (e.production || !e.vite) return S;
|
|
268
|
-
const F = `/${
|
|
269
|
-
return e.vite.transformIndexHtml(F, S,
|
|
270
|
-
},
|
|
271
|
-
const
|
|
272
|
-
(
|
|
282
|
+
const F = `/${a.replaceAll("\\", "/").replace(/^\/+/, "")}`;
|
|
283
|
+
return e.vite.transformIndexHtml(F, S, h);
|
|
284
|
+
}, w = async (o) => {
|
|
285
|
+
const a = o.server.root || e.root, h = o.entries.filter(
|
|
286
|
+
(l) => !l.roles?.length || !o.server.role || l.roles.includes(o.server.role)
|
|
273
287
|
);
|
|
274
288
|
await Promise.all(
|
|
275
|
-
|
|
289
|
+
h.map(async (l) => {
|
|
276
290
|
if (!(await _(
|
|
277
|
-
j(e.production ?
|
|
291
|
+
j(e.production ? i : a, l.template)
|
|
278
292
|
)).isFile())
|
|
279
|
-
throw new Error(`SSR client entry is missing: ${
|
|
293
|
+
throw new Error(`SSR client entry is missing: ${l.template}`);
|
|
280
294
|
})
|
|
281
|
-
), await Promise.all((o.readiness ?? []).map((
|
|
282
|
-
},
|
|
295
|
+
), await Promise.all((o.readiness ?? []).map((l) => l.run()));
|
|
296
|
+
}, f = s.entries.filter(
|
|
283
297
|
(o) => !o.roles?.length || !s.server.role || o.roles.includes(s.server.role)
|
|
284
298
|
);
|
|
285
299
|
await Promise.all(
|
|
286
|
-
|
|
287
|
-
const
|
|
300
|
+
f.map(async (o) => {
|
|
301
|
+
const a = s.server.root || e.root;
|
|
288
302
|
if (!(await _(
|
|
289
|
-
j(e.production ?
|
|
303
|
+
j(e.production ? i : a, o.template)
|
|
290
304
|
)).isFile()) throw new Error(`Missing client entry: ${o.template}`);
|
|
291
305
|
})
|
|
292
306
|
);
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
let
|
|
307
|
+
const y = ie(async (o, a) => {
|
|
308
|
+
const h = Date.now();
|
|
309
|
+
let l = "/", S = "unknown", F;
|
|
296
310
|
const I = new AbortController(), V = [];
|
|
297
|
-
o.once("aborted", () => I.abort()),
|
|
298
|
-
|
|
311
|
+
o.once("aborted", () => I.abort()), a.once("close", () => {
|
|
312
|
+
a.writableEnded || I.abort();
|
|
299
313
|
});
|
|
300
314
|
try {
|
|
301
|
-
const
|
|
302
|
-
|
|
315
|
+
const m = await p(), u = m.server, A = new URL(o.url || "/", "http://internal");
|
|
316
|
+
l = A.pathname;
|
|
303
317
|
const H = u.healthPath || "/healthz", R = u.readinessPath || "/readyz";
|
|
304
|
-
if (
|
|
305
|
-
return
|
|
318
|
+
if (l === H)
|
|
319
|
+
return $(o, a, 200, {
|
|
306
320
|
status: "ok",
|
|
307
|
-
service:
|
|
321
|
+
service: m.name,
|
|
308
322
|
role: u.role || "default",
|
|
309
|
-
timestamp: new Date(
|
|
323
|
+
timestamp: new Date(h).toISOString()
|
|
310
324
|
});
|
|
311
|
-
if (
|
|
325
|
+
if (l === R) {
|
|
312
326
|
if (t)
|
|
313
|
-
return
|
|
327
|
+
return $(o, a, 503, {
|
|
314
328
|
status: "error",
|
|
315
|
-
service:
|
|
329
|
+
service: m.name,
|
|
316
330
|
message: "Server is shutting down."
|
|
317
331
|
});
|
|
318
332
|
try {
|
|
319
|
-
return await
|
|
333
|
+
return await w(m), $(o, a, 200, {
|
|
320
334
|
status: "ok",
|
|
321
|
-
service:
|
|
335
|
+
service: m.name,
|
|
322
336
|
role: u.role || "default"
|
|
323
337
|
});
|
|
324
338
|
} catch {
|
|
325
|
-
return
|
|
339
|
+
return $(o, a, 503, {
|
|
326
340
|
status: "error",
|
|
327
|
-
service:
|
|
341
|
+
service: m.name,
|
|
328
342
|
message: "A required dependency is unavailable."
|
|
329
343
|
});
|
|
330
344
|
}
|
|
331
345
|
}
|
|
332
|
-
const L =
|
|
346
|
+
const L = ve(
|
|
333
347
|
o.headers["x-forwarded-host"],
|
|
334
348
|
o.headers.host,
|
|
335
349
|
u.trustProxy
|
|
336
350
|
);
|
|
337
351
|
if (!L)
|
|
338
|
-
return E(o,
|
|
352
|
+
return E(o, a, {
|
|
339
353
|
statusCode: 400,
|
|
340
|
-
body:
|
|
354
|
+
body: T(o, l) ? B("Invalid request", "The Host header is invalid.") : JSON.stringify({ status: "error", message: "Invalid Host header." }),
|
|
341
355
|
headers: {
|
|
342
|
-
"content-type":
|
|
356
|
+
"content-type": T(o, l) ? "text/html; charset=utf-8" : "application/json; charset=utf-8",
|
|
343
357
|
"cache-control": "no-store",
|
|
344
|
-
...
|
|
358
|
+
...P
|
|
345
359
|
}
|
|
346
360
|
});
|
|
347
|
-
const
|
|
348
|
-
|
|
361
|
+
const g = xe(
|
|
362
|
+
m.entries,
|
|
349
363
|
L,
|
|
350
|
-
|
|
364
|
+
m.defaultEntryId
|
|
351
365
|
);
|
|
352
|
-
if (!
|
|
353
|
-
return
|
|
366
|
+
if (!g)
|
|
367
|
+
return $(o, a, 421, {
|
|
354
368
|
status: "error",
|
|
355
|
-
service:
|
|
369
|
+
service: m.name,
|
|
356
370
|
message: "No application entry serves this host."
|
|
357
371
|
});
|
|
358
|
-
if (S =
|
|
359
|
-
const d = `Runtime role does not serve entry "${
|
|
360
|
-
return E(o,
|
|
372
|
+
if (S = g.id, g.roles?.length && u.role && !g.roles.includes(u.role)) {
|
|
373
|
+
const d = `Runtime role does not serve entry "${g.id}".`;
|
|
374
|
+
return E(o, a, {
|
|
361
375
|
statusCode: 421,
|
|
362
|
-
body:
|
|
376
|
+
body: T(o, l) ? B("Misdirected request", d) : JSON.stringify({ status: "error", message: d }),
|
|
363
377
|
headers: {
|
|
364
|
-
"content-type":
|
|
378
|
+
"content-type": T(o, l) ? "text/html; charset=utf-8" : "application/json; charset=utf-8",
|
|
365
379
|
"cache-control": "no-store",
|
|
366
|
-
...
|
|
380
|
+
...P
|
|
367
381
|
}
|
|
368
382
|
});
|
|
369
383
|
}
|
|
370
|
-
const K =
|
|
384
|
+
const K = Se(
|
|
371
385
|
o.headers["x-forwarded-proto"],
|
|
372
386
|
o.socket.encrypted ? "https" : "http",
|
|
373
387
|
u.trustProxy
|
|
374
|
-
), z =
|
|
388
|
+
), z = be(
|
|
375
389
|
o.headers.cookie,
|
|
376
390
|
u.cookieAllowlist,
|
|
377
391
|
u.cookieDenylist
|
|
378
|
-
),
|
|
379
|
-
requestId: String(o.headers["x-request-id"] || "").trim() || `${
|
|
392
|
+
), v = {
|
|
393
|
+
requestId: String(o.headers["x-request-id"] || "").trim() || `${h.toString(36)}-${Math.random().toString(36).slice(2, 10)}`,
|
|
380
394
|
url: new URL(
|
|
381
|
-
`${
|
|
395
|
+
`${A.pathname}${A.search}`,
|
|
382
396
|
`${K}://${L}`
|
|
383
397
|
).href,
|
|
384
398
|
host: L,
|
|
@@ -390,67 +404,68 @@ const Ce = (e) => {
|
|
|
390
404
|
apolloRequestTimeoutMs: u.apolloRequestTimeoutMs,
|
|
391
405
|
publicConfig: u.publicConfig,
|
|
392
406
|
signal: I.signal,
|
|
393
|
-
pathname:
|
|
394
|
-
search:
|
|
395
|
-
entryId:
|
|
407
|
+
pathname: l,
|
|
408
|
+
search: A.search,
|
|
409
|
+
entryId: g.id
|
|
396
410
|
};
|
|
397
|
-
F =
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
411
|
+
F = v;
|
|
412
|
+
const X = (d) => {
|
|
413
|
+
const b = ce(d, {
|
|
414
|
+
server: !0,
|
|
415
|
+
registerGlobal: !1,
|
|
416
|
+
headers: v.apolloHeaders,
|
|
417
|
+
signal: v.signal,
|
|
418
|
+
requestTimeoutMs: v.apolloRequestTimeoutMs
|
|
419
|
+
});
|
|
420
|
+
return V.push(b), b;
|
|
421
|
+
}, ne = {
|
|
422
|
+
createApolloRuntime: X,
|
|
423
|
+
createApolloClients: (d) => X(d).clients
|
|
409
424
|
};
|
|
410
|
-
for (const d of
|
|
411
|
-
if (!d.match(
|
|
412
|
-
const b = await
|
|
413
|
-
Promise.resolve(d.handle(
|
|
425
|
+
for (const d of m.endpoints ?? []) {
|
|
426
|
+
if (!d.match(v)) continue;
|
|
427
|
+
const b = await te(
|
|
428
|
+
Promise.resolve(d.handle(v, ne)),
|
|
414
429
|
u.requestTimeoutMs ?? 15e3,
|
|
415
430
|
I
|
|
416
431
|
);
|
|
417
|
-
if (b) return E(o,
|
|
432
|
+
if (b) return E(o, a, b);
|
|
418
433
|
}
|
|
419
434
|
if (e.production) {
|
|
420
|
-
const d = await
|
|
435
|
+
const d = await we(
|
|
436
|
+
i,
|
|
421
437
|
l,
|
|
422
|
-
|
|
423
|
-
h.entries.map(({ template: b }) => b)
|
|
438
|
+
m.entries.map(({ template: b }) => b)
|
|
424
439
|
);
|
|
425
|
-
if (d) return E(o,
|
|
426
|
-
} else if (e.vite && (
|
|
440
|
+
if (d) return E(o, a, d);
|
|
441
|
+
} else if (e.vite && (l.startsWith("/src/") || l.startsWith("/@") || l.includes(".") || l === "/__vite_ping") && (await Pe(e.vite, o, a), a.writableEnded))
|
|
427
442
|
return;
|
|
428
|
-
if (!
|
|
429
|
-
return
|
|
443
|
+
if (!T(o, l))
|
|
444
|
+
return $(o, a, 404, {
|
|
430
445
|
status: "error",
|
|
431
|
-
service:
|
|
446
|
+
service: m.name,
|
|
432
447
|
message: "Resource not found."
|
|
433
448
|
});
|
|
434
|
-
const
|
|
449
|
+
const M = g.kind === "ssr" ? g.responseCache : void 0;
|
|
435
450
|
let k = null;
|
|
436
451
|
try {
|
|
437
|
-
k = await
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
452
|
+
k = await Re(
|
|
453
|
+
g.id,
|
|
454
|
+
v,
|
|
455
|
+
M
|
|
441
456
|
);
|
|
442
457
|
} catch (d) {
|
|
443
458
|
u.logger?.warn?.("ssr.cache.key.failed", {
|
|
444
|
-
entryId:
|
|
445
|
-
requestId:
|
|
459
|
+
entryId: g.id,
|
|
460
|
+
requestId: v.requestId,
|
|
446
461
|
error: d instanceof Error ? d.message : "Unknown cache error"
|
|
447
462
|
});
|
|
448
463
|
}
|
|
449
|
-
if (
|
|
464
|
+
if (M && k)
|
|
450
465
|
try {
|
|
451
|
-
const d = await
|
|
466
|
+
const d = await M.store.get(k);
|
|
452
467
|
if (d)
|
|
453
|
-
return E(o,
|
|
468
|
+
return E(o, a, {
|
|
454
469
|
...d,
|
|
455
470
|
headers: {
|
|
456
471
|
...d.headers,
|
|
@@ -459,40 +474,40 @@ const Ce = (e) => {
|
|
|
459
474
|
});
|
|
460
475
|
} catch (d) {
|
|
461
476
|
u.logger?.warn?.("ssr.cache.read.failed", {
|
|
462
|
-
entryId:
|
|
463
|
-
requestId:
|
|
477
|
+
entryId: g.id,
|
|
478
|
+
requestId: v.requestId,
|
|
464
479
|
error: d instanceof Error ? d.message : "Unknown cache error"
|
|
465
480
|
});
|
|
466
481
|
}
|
|
467
|
-
let N = await C(
|
|
468
|
-
if (
|
|
469
|
-
return E(o,
|
|
482
|
+
let N = await C(m, g.template, o.url || "/");
|
|
483
|
+
if (g.kind === "spa")
|
|
484
|
+
return E(o, a, {
|
|
470
485
|
statusCode: 200,
|
|
471
486
|
body: N,
|
|
472
487
|
headers: {
|
|
473
488
|
"content-type": "text/html; charset=utf-8",
|
|
474
|
-
"cache-control":
|
|
489
|
+
"cache-control": g.cacheControl || "private, no-store",
|
|
475
490
|
vary: "Host, X-Forwarded-Host",
|
|
476
|
-
...
|
|
491
|
+
...P
|
|
477
492
|
}
|
|
478
493
|
});
|
|
479
|
-
const O =
|
|
480
|
-
N =
|
|
494
|
+
const O = g.application;
|
|
495
|
+
N = he(
|
|
481
496
|
N,
|
|
482
|
-
|
|
497
|
+
g.mountSelector || O.mountSelector || "#app"
|
|
483
498
|
);
|
|
484
|
-
const x = await
|
|
485
|
-
|
|
499
|
+
const x = await te(
|
|
500
|
+
fe(O, v),
|
|
486
501
|
u.requestTimeoutMs ?? 15e3,
|
|
487
502
|
I
|
|
488
503
|
);
|
|
489
504
|
if (x.response.redirect) {
|
|
490
|
-
const d = x.response.redirect, b = new URL(d.location,
|
|
505
|
+
const d = x.response.redirect, b = new URL(d.location, v.url);
|
|
491
506
|
if (b.protocol !== "http:" && b.protocol !== "https:")
|
|
492
507
|
throw new Error("SSR redirects must use HTTP or HTTPS.");
|
|
493
|
-
if (!d.allowExternal && b.origin !== new URL(
|
|
508
|
+
if (!d.allowExternal && b.origin !== new URL(v.url).origin)
|
|
494
509
|
throw new Error("Cross-origin redirect requires allowExternal: true.");
|
|
495
|
-
return E(o,
|
|
510
|
+
return E(o, a, {
|
|
496
511
|
statusCode: d.statusCode ?? 302,
|
|
497
512
|
headers: {
|
|
498
513
|
location: b.href,
|
|
@@ -500,7 +515,7 @@ const Ce = (e) => {
|
|
|
500
515
|
}
|
|
501
516
|
});
|
|
502
517
|
}
|
|
503
|
-
const
|
|
518
|
+
const ae = me(N, {
|
|
504
519
|
applicationId: O.id,
|
|
505
520
|
html: x.html,
|
|
506
521
|
teleports: x.teleports,
|
|
@@ -510,10 +525,10 @@ const Ce = (e) => {
|
|
|
510
525
|
u.onMetrics?.(x.metrics), u.logger?.info?.("ssr.render.complete", x.metrics);
|
|
511
526
|
const W = {
|
|
512
527
|
statusCode: x.response.statusCode,
|
|
513
|
-
body:
|
|
528
|
+
body: ae,
|
|
514
529
|
headers: {
|
|
515
530
|
"content-type": "text/html; charset=utf-8",
|
|
516
|
-
"cache-control":
|
|
531
|
+
"cache-control": g.cacheControl || "private, no-store",
|
|
517
532
|
vary: "Host, X-Forwarded-Host",
|
|
518
533
|
"server-timing": [
|
|
519
534
|
`context;dur=${x.metrics.contextDurationMs.toFixed(1)}`,
|
|
@@ -521,50 +536,50 @@ const Ce = (e) => {
|
|
|
521
536
|
`render;dur=${x.metrics.renderDurationMs.toFixed(1)}`
|
|
522
537
|
].join(", "),
|
|
523
538
|
...x.response.headers,
|
|
524
|
-
...
|
|
539
|
+
...P
|
|
525
540
|
}
|
|
526
541
|
};
|
|
527
|
-
if (
|
|
542
|
+
if (M && k && Ce(W, v, M))
|
|
528
543
|
try {
|
|
529
|
-
await
|
|
530
|
-
ttlMs:
|
|
531
|
-
tags: await
|
|
544
|
+
await M.store.set(k, W, {
|
|
545
|
+
ttlMs: M.ttlMs,
|
|
546
|
+
tags: await M.tags?.(v)
|
|
532
547
|
});
|
|
533
548
|
} catch (d) {
|
|
534
549
|
u.logger?.warn?.("ssr.cache.write.failed", {
|
|
535
|
-
entryId:
|
|
536
|
-
requestId:
|
|
550
|
+
entryId: g.id,
|
|
551
|
+
requestId: v.requestId,
|
|
537
552
|
error: d instanceof Error ? d.message : "Unknown cache error"
|
|
538
553
|
});
|
|
539
554
|
}
|
|
540
|
-
return E(o,
|
|
541
|
-
} catch (
|
|
542
|
-
e.vite?.ssrFixStacktrace(
|
|
543
|
-
const u = await
|
|
555
|
+
return E(o, a, W);
|
|
556
|
+
} catch (m) {
|
|
557
|
+
e.vite?.ssrFixStacktrace(m);
|
|
558
|
+
const u = await p().catch(() => s);
|
|
544
559
|
if (u.server.logger?.error?.("ssr.request.failed", {
|
|
545
560
|
entryId: S,
|
|
546
|
-
pathname:
|
|
547
|
-
error:
|
|
548
|
-
}),
|
|
549
|
-
if (
|
|
550
|
-
const
|
|
561
|
+
pathname: l,
|
|
562
|
+
error: m instanceof Error ? m.message : "Unknown error"
|
|
563
|
+
}), a.writableEnded) return;
|
|
564
|
+
if (a.headersSent) return a.destroy();
|
|
565
|
+
const A = m instanceof se, H = A ? 504 : 500;
|
|
551
566
|
if (u.server.renderError)
|
|
552
567
|
try {
|
|
553
568
|
const R = await u.server.renderError({
|
|
554
|
-
error:
|
|
555
|
-
kind:
|
|
569
|
+
error: m,
|
|
570
|
+
kind: A ? "timeout" : "internal",
|
|
556
571
|
production: e.production,
|
|
557
572
|
request: F,
|
|
558
573
|
entryId: S === "unknown" ? void 0 : S
|
|
559
574
|
});
|
|
560
575
|
if (R)
|
|
561
|
-
return E(o,
|
|
576
|
+
return E(o, a, {
|
|
562
577
|
...R,
|
|
563
578
|
statusCode: R.statusCode >= 400 ? R.statusCode : H,
|
|
564
579
|
headers: {
|
|
565
580
|
...R.headers,
|
|
566
581
|
"cache-control": "no-store",
|
|
567
|
-
...
|
|
582
|
+
...P
|
|
568
583
|
}
|
|
569
584
|
});
|
|
570
585
|
} catch (R) {
|
|
@@ -573,40 +588,40 @@ const Ce = (e) => {
|
|
|
573
588
|
error: R instanceof Error ? R.message : "Unknown error renderer failure"
|
|
574
589
|
});
|
|
575
590
|
}
|
|
576
|
-
return
|
|
591
|
+
return T(o, l) ? E(o, a, {
|
|
577
592
|
statusCode: H,
|
|
578
593
|
body: B(
|
|
579
|
-
|
|
580
|
-
e.production ? "The application could not render this page. Please try again." :
|
|
594
|
+
A ? "Request timed out" : "Application unavailable",
|
|
595
|
+
e.production ? "The application could not render this page. Please try again." : m instanceof Error ? m.message : "Unknown rendering failure."
|
|
581
596
|
),
|
|
582
597
|
headers: {
|
|
583
598
|
"content-type": "text/html; charset=utf-8",
|
|
584
599
|
"cache-control": "no-store",
|
|
585
|
-
...
|
|
600
|
+
...P
|
|
586
601
|
}
|
|
587
|
-
}) :
|
|
602
|
+
}) : $(o, a, H, {
|
|
588
603
|
status: "error",
|
|
589
604
|
service: u.name
|
|
590
605
|
});
|
|
591
606
|
} finally {
|
|
592
|
-
for (const
|
|
607
|
+
for (const m of V) m.stop();
|
|
593
608
|
}
|
|
594
609
|
});
|
|
595
610
|
return {
|
|
596
|
-
nodeServer:
|
|
611
|
+
nodeServer: y,
|
|
597
612
|
address: () => {
|
|
598
|
-
const o =
|
|
613
|
+
const o = y.address();
|
|
599
614
|
return {
|
|
600
|
-
host: typeof o == "object" && o ? o.address :
|
|
601
|
-
port: typeof o == "object" && o ? o.port :
|
|
615
|
+
host: typeof o == "object" && o ? o.address : c,
|
|
616
|
+
port: typeof o == "object" && o ? o.port : n
|
|
602
617
|
};
|
|
603
618
|
},
|
|
604
|
-
listen: () => new Promise((o,
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
host:
|
|
609
|
-
port:
|
|
619
|
+
listen: () => new Promise((o, a) => {
|
|
620
|
+
const h = (l) => a(l);
|
|
621
|
+
y.once("error", h), y.listen(n, c, () => {
|
|
622
|
+
y.off("error", h), r.logger?.info?.("ssr.server.listening", {
|
|
623
|
+
host: c,
|
|
624
|
+
port: n,
|
|
610
625
|
role: r.role || "default"
|
|
611
626
|
}), o();
|
|
612
627
|
});
|
|
@@ -615,42 +630,42 @@ const Ce = (e) => {
|
|
|
615
630
|
if (t) return;
|
|
616
631
|
t = !0;
|
|
617
632
|
const o = r.shutdownTimeoutMs ?? 1e4;
|
|
618
|
-
let
|
|
633
|
+
let a;
|
|
619
634
|
try {
|
|
620
635
|
await Promise.race([
|
|
621
636
|
Promise.all([
|
|
622
|
-
new Promise((
|
|
623
|
-
|
|
624
|
-
(S) => S ?
|
|
637
|
+
new Promise((h, l) => {
|
|
638
|
+
y.close(
|
|
639
|
+
(S) => S ? l(S) : h()
|
|
625
640
|
);
|
|
626
641
|
}),
|
|
627
642
|
e.vite?.close()
|
|
628
643
|
]),
|
|
629
|
-
new Promise((
|
|
630
|
-
|
|
631
|
-
|
|
644
|
+
new Promise((h, l) => {
|
|
645
|
+
a = setTimeout(() => {
|
|
646
|
+
y.closeAllConnections?.(), l(new Error("SSR server graceful shutdown timed out."));
|
|
632
647
|
}, o);
|
|
633
648
|
})
|
|
634
649
|
]);
|
|
635
650
|
} finally {
|
|
636
|
-
|
|
651
|
+
a && clearTimeout(a);
|
|
637
652
|
}
|
|
638
653
|
}
|
|
639
654
|
};
|
|
640
655
|
};
|
|
641
656
|
export {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
657
|
+
Ne as a,
|
|
658
|
+
ye as b,
|
|
659
|
+
Ue as c,
|
|
660
|
+
xe as d,
|
|
661
|
+
ve as e,
|
|
662
|
+
be as f,
|
|
663
|
+
Se as g,
|
|
664
|
+
we as h,
|
|
665
|
+
Ce as i,
|
|
666
|
+
Re as j,
|
|
652
667
|
ge as m,
|
|
653
668
|
U as n,
|
|
654
|
-
|
|
669
|
+
fe as r,
|
|
655
670
|
G as s
|
|
656
671
|
};
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { resolve as o, relative as p } from "node:path";
|
|
3
3
|
import { pathToFileURL as f } from "node:url";
|
|
4
|
-
import { c as w } from "./chunks/SsrServerRuntime-
|
|
4
|
+
import { c as w } from "./chunks/SsrServerRuntime-3f0yAnNL.mjs";
|
|
5
5
|
const i = (e, r) => {
|
|
6
6
|
const t = e.indexOf(r);
|
|
7
7
|
return t >= 0 ? e[t + 1] : void 0;
|
package/dist/client.mjs
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import { c } from "./chunks/SsrApplicationRuntime-
|
|
2
|
-
import { g as
|
|
1
|
+
import { c as d } from "./chunks/SsrApplicationRuntime-lj5EmDGU.mjs";
|
|
2
|
+
import { g as h } from "./chunks/SsrSerialization-k-3aCFYt.mjs";
|
|
3
3
|
const m = async (e, o = {}) => {
|
|
4
|
-
const
|
|
4
|
+
const s = o.stateElementId ?? h(e.id), r = document.getElementById(s);
|
|
5
5
|
if (!r?.textContent)
|
|
6
|
-
throw new Error(`SSR hydration state element "${
|
|
7
|
-
const
|
|
6
|
+
throw new Error(`SSR hydration state element "${s}" is missing.`);
|
|
7
|
+
const a = JSON.parse(
|
|
8
8
|
r.textContent
|
|
9
9
|
);
|
|
10
|
-
if (
|
|
10
|
+
if (a.version !== 1)
|
|
11
11
|
throw new Error("Unsupported SSR hydration state version.");
|
|
12
|
-
const
|
|
12
|
+
const l = new AbortController(), c = {
|
|
13
13
|
requestId: `browser-${Date.now().toString(36)}`,
|
|
14
14
|
url: window.location.href,
|
|
15
15
|
host: window.location.host,
|
|
16
16
|
protocol: window.location.protocol === "https:" ? "https" : "http",
|
|
17
17
|
method: "GET",
|
|
18
18
|
headers: {},
|
|
19
|
-
publicConfig:
|
|
20
|
-
signal:
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
publicConfig: a.publicConfig,
|
|
20
|
+
signal: l.signal
|
|
21
|
+
};
|
|
22
|
+
let t;
|
|
23
|
+
try {
|
|
24
|
+
t = await d(e, {
|
|
25
|
+
server: !1,
|
|
26
|
+
request: c,
|
|
27
|
+
hydrationState: a
|
|
28
|
+
}), t.router && (await t.router.push(
|
|
29
|
+
`${window.location.pathname}${window.location.search}${window.location.hash}`
|
|
30
|
+
), await t.router.isReady()), t.app.mount(o.mountSelector ?? e.mountSelector ?? "#app"), document.head.querySelectorAll(
|
|
31
|
+
o.removeHeadSelector ?? "[data-vue-ssr-lite-head]"
|
|
32
|
+
).forEach((n) => n.remove()), r.remove();
|
|
33
|
+
} catch (n) {
|
|
34
|
+
l.abort();
|
|
35
|
+
try {
|
|
36
|
+
t?.apollo?.stop();
|
|
37
|
+
} catch (i) {
|
|
38
|
+
console.error("[vue-ssr-lite] hydration cleanup failed", i);
|
|
39
|
+
}
|
|
40
|
+
throw n;
|
|
41
|
+
}
|
|
31
42
|
};
|
|
32
43
|
export {
|
|
33
44
|
m as hydrateSsrApplication
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S, c as i, u as n } from "./chunks/SsrApplicationRuntime-
|
|
1
|
+
import { S, c as i, u as n } from "./chunks/SsrApplicationRuntime-lj5EmDGU.mjs";
|
|
2
2
|
import { e as p, g as c, r as d, s as f, a as l } from "./chunks/SsrSerialization-k-3aCFYt.mjs";
|
|
3
3
|
const s = (e) => e, t = (e) => e;
|
|
4
4
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrServerRuntime.d.ts","sourceRoot":"","sources":["../../src/server/SsrServerRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAA;AAGnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AA4BzC,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;IAC3C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,EAAE,MAAM;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C;AAgID,eAAO,MAAM,sBAAsB,GACjC,SAAS,uBAAuB,KAC/B,OAAO,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SsrServerRuntime.d.ts","sourceRoot":"","sources":["../../src/server/SsrServerRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAA;AAGnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AA4BzC,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;IAC3C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,EAAE,MAAM;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C;AAgID,eAAO,MAAM,sBAAsB,GACjC,SAAS,uBAAuB,KAC/B,OAAO,CAAC,gBAAgB,CA4f1B,CAAA"}
|
package/dist/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, a, f as o, i as S, m as t, n, b as R, r as l, d as c, e as i, g as p, h as m, j as d, s as E } from "./chunks/SsrServerRuntime-
|
|
1
|
+
import { c as e, a, f as o, i as S, m as t, n, b as R, r as l, d as c, e as i, g as p, h as m, j as d, s as E } from "./chunks/SsrServerRuntime-3f0yAnNL.mjs";
|
|
2
2
|
import { S as A, a as _, b as M, c as v, i as P, p as T, r as h } from "./chunks/SsrHtmlRuntime-cTFsMSAZ.mjs";
|
|
3
3
|
export {
|
|
4
4
|
A as SSR_HEAD_MARKER,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-ssr-lite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Fully managed Vue 3 SSR runtime with routing, Apollo hydration, Vite, and Node server lifecycle.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -61,12 +61,13 @@
|
|
|
61
61
|
"@vue/server-renderer": "^3.5.40",
|
|
62
62
|
"graphql": "^16.12.0",
|
|
63
63
|
"graphql-tag": "^2.12.6",
|
|
64
|
+
"jsdom": "^29.0.2",
|
|
64
65
|
"typescript": "~5.9.3",
|
|
65
66
|
"vite": "^7.3.6",
|
|
66
67
|
"vite-plugin-dts": "^4.5.4",
|
|
67
68
|
"vitest": "^4.1.5",
|
|
68
69
|
"vue": "^3.5.40",
|
|
69
|
-
"vue-apollo-client": "^1.2.
|
|
70
|
+
"vue-apollo-client": "^1.2.4",
|
|
70
71
|
"vue-router": "^4.6.4"
|
|
71
72
|
},
|
|
72
73
|
"resolutions": {
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { inject as R, ref as i, createSSRApp as v } from "vue";
|
|
2
|
-
import { createRouter as f, createMemoryHistory as b, createWebHistory as w } from "vue-router";
|
|
3
|
-
import { createApollo as x } from "vue-apollo-client";
|
|
4
|
-
const q = /* @__PURE__ */ Symbol("vue-ssr-lite-request-context"), M = () => {
|
|
5
|
-
const e = R(q);
|
|
6
|
-
if (!e) throw new Error("vue-ssr-lite request context is not installed.");
|
|
7
|
-
return e;
|
|
8
|
-
}, A = async (e, t) => {
|
|
9
|
-
if (!e?.id || !e.rootComponent)
|
|
10
|
-
throw new Error("An SSR application requires an id and rootComponent.");
|
|
11
|
-
if (t.hydrationState && t.hydrationState.applicationId !== e.id)
|
|
12
|
-
throw new Error("Hydration state belongs to a different SSR application.");
|
|
13
|
-
const u = typeof e.routes == "function" ? e.routes() : e.routes, s = u ? f({
|
|
14
|
-
history: t.server ? b() : w(),
|
|
15
|
-
routes: u,
|
|
16
|
-
scrollBehavior(a, y, p) {
|
|
17
|
-
if (p) return p;
|
|
18
|
-
if (a.hash) return { el: a.hash, top: 24 };
|
|
19
|
-
if (a.fullPath !== y.fullPath)
|
|
20
|
-
return { left: 0, top: 0 };
|
|
21
|
-
}
|
|
22
|
-
}) : null, h = t.hydrationState?.application ?? e.createInitialState?.() ?? {}, S = {
|
|
23
|
-
statusCode: 200,
|
|
24
|
-
headers: {},
|
|
25
|
-
redirect: null
|
|
26
|
-
}, c = {
|
|
27
|
-
request: t.request,
|
|
28
|
-
url: new URL(t.request.url),
|
|
29
|
-
host: t.request.host,
|
|
30
|
-
publicConfig: t.request.publicConfig,
|
|
31
|
-
state: h,
|
|
32
|
-
head: i(null),
|
|
33
|
-
response: S,
|
|
34
|
-
apolloClients: null
|
|
35
|
-
}, m = e.createExtension ? await e.createExtension(c) : void 0, o = { ...c, extension: m }, n = e.apollo ? typeof e.apollo == "function" ? await e.apollo({
|
|
36
|
-
request: t.request,
|
|
37
|
-
publicConfig: t.request.publicConfig,
|
|
38
|
-
server: t.server
|
|
39
|
-
}) : e.apollo : null, C = typeof e.apolloRequestTimeoutMs == "function" ? e.apolloRequestTimeoutMs(t.request.publicConfig) : e.apolloRequestTimeoutMs, r = n ? x(n, {
|
|
40
|
-
server: t.server,
|
|
41
|
-
registerGlobal: !t.server,
|
|
42
|
-
headers: t.request.apolloHeaders,
|
|
43
|
-
initialState: t.hydrationState?.apollo,
|
|
44
|
-
signal: t.request.signal,
|
|
45
|
-
requestTimeoutMs: C ?? t.request.apolloRequestTimeoutMs
|
|
46
|
-
}) : null;
|
|
47
|
-
o.apolloClients = r?.clients ?? null;
|
|
48
|
-
const l = v(e.rootComponent);
|
|
49
|
-
return s && l.use(s), r && l.use(r), l.provide(q, o), await e.install?.({
|
|
50
|
-
app: l,
|
|
51
|
-
router: s,
|
|
52
|
-
context: o,
|
|
53
|
-
apolloClients: r?.clients ?? null,
|
|
54
|
-
server: t.server
|
|
55
|
-
}), { app: l, router: s, context: o, apollo: r };
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
q as S,
|
|
59
|
-
A as c,
|
|
60
|
-
M as u
|
|
61
|
-
};
|