vue-ssr-lite 0.0.3 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -117
- package/dist/SsrApplicationRuntime.d.ts +8 -0
- package/dist/SsrApplicationRuntime.d.ts.map +1 -0
- package/dist/SsrBrowserRuntime.d.ts +8 -0
- package/dist/SsrBrowserRuntime.d.ts.map +1 -0
- package/dist/SsrRenderRuntime.d.ts +3 -0
- package/dist/SsrRenderRuntime.d.ts.map +1 -0
- package/dist/SsrRequestContext.d.ts +5 -0
- package/dist/SsrRequestContext.d.ts.map +1 -0
- package/dist/SsrRuntimeTypes.d.ts +223 -0
- package/dist/SsrRuntimeTypes.d.ts.map +1 -0
- package/dist/SsrSerialization.d.ts +7 -0
- package/dist/SsrSerialization.d.ts.map +1 -0
- package/dist/chunks/SsrApplicationRuntime-B-6cXN5-.mjs +61 -0
- package/dist/chunks/SsrHtmlRuntime-cTFsMSAZ.mjs +54 -0
- package/dist/chunks/SsrSerialization-k-3aCFYt.mjs +47 -0
- package/dist/chunks/SsrServerRuntime-Cboc9aUP.mjs +654 -0
- package/dist/cli/SsrCli.d.ts +3 -0
- package/dist/cli/SsrCli.d.ts.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +73 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.mjs +34 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +15 -0
- package/dist/server/SsrAssetRuntime.d.ts +3 -0
- package/dist/server/SsrAssetRuntime.d.ts.map +1 -0
- package/dist/server/SsrHostRuntime.d.ts +10 -0
- package/dist/server/SsrHostRuntime.d.ts.map +1 -0
- package/dist/server/SsrHtmlRuntime.d.ts +16 -0
- package/dist/server/SsrHtmlRuntime.d.ts.map +1 -0
- package/dist/server/SsrResponseCacheRuntime.d.ts +9 -0
- package/dist/server/SsrResponseCacheRuntime.d.ts.map +1 -0
- package/dist/server/SsrServerRuntime.d.ts +19 -0
- package/dist/server/SsrServerRuntime.d.ts.map +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.mjs +25 -0
- package/dist/vite/SsrVitePlugin.d.ts +15 -0
- package/dist/vite/SsrVitePlugin.d.ts.map +1 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.mjs +111 -0
- package/docs/SsrBuiltoCompatibility.md +31 -0
- package/docs/SsrPerformanceBaseline.md +36 -0
- package/package.json +53 -69
- package/apollo/SsrApolloAdapter.js +0 -184
- package/apollo/index.d.ts +0 -50
- package/bin/vue-ssr-lite.mjs +0 -83
- package/engine/.fuse_hidden0000002d00000001 +0 -166
- package/engine/SsrEngine.js +0 -139
- package/engine/SsrEngineHostPolicy.js +0 -132
- package/engine/SsrEngineHtml.js +0 -166
- package/engine/index.d.ts +0 -86
- package/engine/index.js +0 -26
- package/index.d.ts +0 -104
- package/index.js +0 -40
- package/runtime/SsrRuntimeApp.js +0 -94
- package/runtime/SsrRuntimeClient.js +0 -72
- package/runtime/SsrRuntimeContext.js +0 -44
- package/runtime/SsrRuntimeServer.js +0 -63
- package/runtime/client.d.ts +0 -20
- package/runtime/server.d.ts +0 -26
- package/server/SsrServer.js +0 -600
- package/server/index.d.ts +0 -91
- package/server/index.js +0 -14
- package/vite/SsrVitePlugin.js +0 -218
- package/vite/index.d.ts +0 -37
package/README.md
CHANGED
|
@@ -1,154 +1,175 @@
|
|
|
1
1
|
# vue-ssr-lite
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
`vue-ssr-lite` is a managed Vue 3 SSR runtime. A consumer supplies one application definition and a small Vite registration; the package owns the HTTP server, Vite middleware, per-request Vue/Router/Apollo lifecycle, server rendering, state transfer, browser hydration, static assets, health checks, errors, timeouts, instrumentation, startup, and graceful shutdown.
|
|
4
|
+
|
|
5
|
+
## Minimal integration
|
|
6
|
+
|
|
7
|
+
Create one application definition:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
// src/PublicSsrRuntime.ts
|
|
11
|
+
import PublicApp from './PublicApp.vue'
|
|
12
|
+
import { defineSsrApplication, defineSsrRuntime } from 'vue-ssr-lite'
|
|
13
|
+
|
|
14
|
+
export const publicApplication = defineSsrApplication({
|
|
15
|
+
id: 'public',
|
|
16
|
+
rootComponent: PublicApp,
|
|
17
|
+
routes: [
|
|
18
|
+
{ path: '/:path(.*)*', component: PublicApp },
|
|
19
|
+
],
|
|
20
|
+
apollo: ({ publicConfig }) => ({
|
|
21
|
+
endPoints: { default: publicConfig.graphqlEndpoint },
|
|
22
|
+
}),
|
|
23
|
+
})
|
|
7
24
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
export default () => defineSsrRuntime({
|
|
26
|
+
name: 'public-site',
|
|
27
|
+
entries: [{
|
|
28
|
+
id: 'public',
|
|
29
|
+
kind: 'ssr',
|
|
30
|
+
template: 'site.html',
|
|
31
|
+
hosts: ['*'],
|
|
32
|
+
application: publicApplication,
|
|
33
|
+
}],
|
|
34
|
+
server: {
|
|
35
|
+
host: process.env.HOST || '0.0.0.0',
|
|
36
|
+
port: Number(process.env.PORT || 4173),
|
|
37
|
+
trustProxy: process.env.TRUST_PROXY === 'true',
|
|
38
|
+
publicConfig: {
|
|
39
|
+
graphqlEndpoint: process.env.GRAPHQL_ENDPOINT || 'http://localhost:4000/graphql',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
```
|
|
13
44
|
|
|
14
|
-
|
|
45
|
+
Register its template and exported application in Vite:
|
|
15
46
|
|
|
16
|
-
|
|
47
|
+
```ts
|
|
48
|
+
import { defineConfig } from 'vite'
|
|
49
|
+
import vue from '@vitejs/plugin-vue'
|
|
50
|
+
import { vueSsrLite } from 'vue-ssr-lite/vite'
|
|
17
51
|
|
|
18
|
-
|
|
19
|
-
|
|
52
|
+
export default defineConfig({
|
|
53
|
+
plugins: [
|
|
54
|
+
vue(),
|
|
55
|
+
vueSsrLite({
|
|
56
|
+
applications: [{
|
|
57
|
+
id: 'public',
|
|
58
|
+
definition: 'src/PublicSsrRuntime.ts',
|
|
59
|
+
exportName: 'publicApplication',
|
|
60
|
+
template: 'site.html',
|
|
61
|
+
}],
|
|
62
|
+
}),
|
|
63
|
+
],
|
|
64
|
+
})
|
|
20
65
|
```
|
|
21
66
|
|
|
22
|
-
|
|
67
|
+
The source `site.html` only needs a mount element:
|
|
23
68
|
|
|
69
|
+
```html
|
|
70
|
+
<!doctype html>
|
|
71
|
+
<html lang="en">
|
|
72
|
+
<head><meta charset="UTF-8"></head>
|
|
73
|
+
<body><div id="app"></div></body>
|
|
74
|
+
</html>
|
|
24
75
|
```
|
|
25
|
-
import { vueSsrLite } from 'vue-ssr-lite/vite'
|
|
26
76
|
|
|
27
|
-
|
|
77
|
+
Use package-owned lifecycle commands:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"scripts": {
|
|
82
|
+
"dev": "vue-ssr-lite dev --runtime src/PublicSsrRuntime.ts",
|
|
83
|
+
"build": "vue-ssr-lite build --runtime src/PublicSsrRuntime.ts",
|
|
84
|
+
"start": "vue-ssr-lite start"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
28
87
|
```
|
|
29
88
|
|
|
30
|
-
|
|
31
|
-
with `vue-ssr-lite init`:
|
|
89
|
+
## Runtime behavior
|
|
32
90
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
91
|
+
- Every render creates a new Vue app, router, Apollo client set/cache, request context, application state, head state, response state, and abort signal.
|
|
92
|
+
- Generated `vue-apollo-client` composables use native Vue server prefetch. After render, named caches are extracted into an inert `application/json` state element. The browser restores them before creating query composables or mounting.
|
|
93
|
+
- Development runs Vite in middleware mode and loads the runtime module through Vite for safe hot updates. Production serves compiled client assets and imports `dist/server/SsrRuntime.js` without loading Vite.
|
|
94
|
+
- Proxy host/protocol headers are ignored unless `trustProxy` is enabled. Cookie forwarding is deny-by-default and requires an allowlist.
|
|
95
|
+
- Head values and JSON-LD are escaped, hydration JSON escapes `<` and Unicode separators, raw HTML templates are never exposed as static assets, and production error responses contain no stack trace or internal path.
|
|
96
|
+
- The default response cache is disabled. An entry may opt into a bounded package memory cache or provide a distributed `SsrResponseCache`; the package owns the application + normalized host + route portion of every key, while `vary` adds publication/data version and locale. Requests with forwarded cookies bypass response caching, and `invalidate` supports key/tag invalidation. Apollo request caches are never reused as response caches.
|
|
36
97
|
|
|
37
|
-
|
|
38
|
-
```
|
|
98
|
+
## Public exports
|
|
39
99
|
|
|
40
|
-
|
|
100
|
+
- `vue-ssr-lite`: isomorphic application/runtime definitions, request context, app creation, serialization, and public types.
|
|
101
|
+
- `vue-ssr-lite/client`: browser hydration only; contains no Node server imports.
|
|
102
|
+
- `vue-ssr-lite/server`: SSR renderer, Node HTTP lifecycle, host/proxy/cookie normalization, HTML/assets, health/readiness, response-cache controls, and graceful shutdown.
|
|
103
|
+
- `vue-ssr-lite/vite`: HTML transformation, virtual hydration entries, framework deduplication, and SSR dependency handling.
|
|
104
|
+
- `vue-ssr-lite` CLI: `dev`, `build`, and `start`.
|
|
41
105
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
106
|
+
The build command produces:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
dist/client/** compiled HTML, manifest, and hashed browser assets
|
|
110
|
+
dist/server/SsrRuntime.js consumer runtime/application server bundle
|
|
46
111
|
```
|
|
47
112
|
|
|
48
|
-
|
|
49
|
-
marker knowledge, no state-global naming, no Apollo extraction wiring. The
|
|
50
|
-
integration injects markers and the generated client entry into your existing
|
|
51
|
-
HTML template, builds a virtual server entry, and emits a runtime manifest so
|
|
52
|
-
`start` needs no build tooling.
|
|
53
|
-
|
|
54
|
-
## The application definition
|
|
55
|
-
|
|
56
|
-
Everything the runtime needs lives in one `defineSsrApp` call:
|
|
57
|
-
|
|
58
|
-
- `root` — the root component (required; the only required field).
|
|
59
|
-
- `routes` / `scrollBehavior` — optional; the package creates the router with
|
|
60
|
-
memory history on the server and web history in the browser. Router-less
|
|
61
|
-
apps are fully supported. `router` accepts an async factory for dynamic
|
|
62
|
-
router construction.
|
|
63
|
-
- `apollo` — optional: `endpoint` (or `endpoints`; values may be functions of
|
|
64
|
-
the public config), `timeoutMs`, `headers`, `links` (your auth/refresh
|
|
65
|
-
links; may be a function of `{ server }`), `cacheConfig` (type policies),
|
|
66
|
-
`ssrForceFetchDelay` (hydration deduplication), and `install(app, clients,
|
|
67
|
-
context)` for library-specific provides. The adapter owns per-request
|
|
68
|
-
clients and caches, server extraction, browser restoration, timeout and
|
|
69
|
-
cancellation. Requires `@apollo/client` to be installed.
|
|
70
|
-
- `config` — optional serializable public configuration (object or factory).
|
|
71
|
-
Only serialized when non-empty. Never put secrets here.
|
|
72
|
-
- `head` — optional default head payload (title, description, Open Graph,
|
|
73
|
-
Twitter, canonical, favicon, JSON-LD). Pages set `useSsrContext().head`.
|
|
74
|
-
- `setup({ app, router, context, apollo, server })` — install plugins,
|
|
75
|
-
provide services.
|
|
76
|
-
|
|
77
|
-
Inside components/composables, `useSsrContext()` exposes the request URL,
|
|
78
|
-
host, public config, hydration state, the head ref, and mutable
|
|
79
|
-
`response.statusCode` / `response.redirect` — statuses are honest: a 404 page
|
|
80
|
-
returns 404.
|
|
81
|
-
|
|
82
|
-
## Multi-app hosting (builder/admin SPA + public SSR)
|
|
113
|
+
The package build itself produces separate `index.mjs`, `client.mjs`, `server.mjs`, `vite.mjs`, and `cli.mjs` entry points.
|
|
83
114
|
|
|
84
|
-
|
|
85
|
-
vueSsrLite({
|
|
86
|
-
app: './src/site/SiteSsrApp.ts',
|
|
87
|
-
template: 'site.html',
|
|
88
|
-
spa: [{ name: 'builder', template: 'index.html', hosts: ['app.example.com'], localhost: true }],
|
|
89
|
-
})
|
|
90
|
-
```
|
|
115
|
+
## Extension points
|
|
91
116
|
|
|
92
|
-
|
|
93
|
-
unmatched is served by SSR — the custom-domain model. The dev server honors
|
|
94
|
-
the same classification, so subdomain testing works with `*.localhost`.
|
|
117
|
+
Application-specific behavior belongs in the consumer:
|
|
95
118
|
|
|
96
|
-
|
|
119
|
+
- `createInitialState` and `createExtension` for typed public/request data;
|
|
120
|
+
- `routes` for static, nested, dynamic, or catch-all routing;
|
|
121
|
+
- `apollo` for endpoints, named clients, cache policies, request-aware context, customer auth callbacks, and uploads;
|
|
122
|
+
- `install` for application plugins and typed provides;
|
|
123
|
+
- `resolveHead` and the request context response state for metadata, status codes, and redirects;
|
|
124
|
+
- runtime `entries` for SPA/SSR host classification and deployment roles;
|
|
125
|
+
- `endpoints` for application-specific robots, sitemaps, or other resources; endpoint tools create isolated Apollo clients and stop them automatically;
|
|
126
|
+
- `readiness` for API/service probes;
|
|
127
|
+
- `logger` and `onMetrics` for structured logging and performance collection.
|
|
128
|
+
- `renderError` for a consumer-owned unavailable/error document while the package enforces an error status, security headers, no-store, and response-lifecycle ownership.
|
|
97
129
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
deployments, error-page overrides, serialized-global and head-attribute
|
|
102
|
-
overrides (migration compatibility), and a per-request CSP `nonce` provider.
|
|
103
|
-
`ssrApolloNoExternal` from `vue-ssr-lite/vite` is the SSR dependency-inlining
|
|
104
|
-
preset for the Apollo cluster.
|
|
130
|
+
Anonymous response caching is explicit and remains off unless an SSR entry adds
|
|
131
|
+
`responseCache`. A safe public entry sets a public `cacheControl`, chooses a
|
|
132
|
+
short TTL, and provides publication/locale variation plus invalidation tags:
|
|
105
133
|
|
|
106
|
-
|
|
134
|
+
```ts
|
|
135
|
+
import { createSsrMemoryResponseCache } from 'vue-ssr-lite/server'
|
|
107
136
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
server is one host of this engine, not the engine itself.
|
|
137
|
+
const publicPages = createSsrMemoryResponseCache({
|
|
138
|
+
maxEntries: 500,
|
|
139
|
+
maxBytes: 32 * 1024 * 1024,
|
|
140
|
+
})
|
|
113
141
|
|
|
114
|
-
|
|
142
|
+
// In the SSR runtime entry:
|
|
143
|
+
responseCache: {
|
|
144
|
+
store: publicPages,
|
|
145
|
+
ttlMs: 30_000,
|
|
146
|
+
vary: (request) => request.publicConfig.publicationVersion,
|
|
147
|
+
tags: (request) => [`host:${request.host}`],
|
|
148
|
+
},
|
|
149
|
+
cacheControl: 'public, max-age=30',
|
|
115
150
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
trusted only with `SSR_TRUST_PROXY`/`trustProxy`; host validation; static
|
|
119
|
-
traversal guard; security headers on HTML; production error pages without
|
|
120
|
-
stack traces; module scripts stripped from error shells.
|
|
151
|
+
// On publication: publicPages.invalidate({ tags: [`host:${hostname}`] })
|
|
152
|
+
```
|
|
121
153
|
|
|
122
|
-
|
|
154
|
+
For multi-process deployments, provide the same interface backed by a shared
|
|
155
|
+
cache. Compression is intentionally integrated at the reverse-proxy/platform
|
|
156
|
+
layer so precompressed hashed assets and dynamic HTML use one deployment-wide
|
|
157
|
+
policy without buffering a second copy inside the Node process.
|
|
123
158
|
|
|
124
|
-
|
|
125
|
-
promises across requests. The runtime and adapter enforce per-request
|
|
126
|
-
creation; if you build custom data layers, follow the same rule. Global
|
|
127
|
-
client libraries (e.g. vue-apollo-client's `createApollo`) are for SPA
|
|
128
|
-
entries only — never call them in code that runs during SSR.
|
|
159
|
+
Endpoint handlers return plain response values; they never receive Node response objects. Application code never calls `renderToString`, extracts/restores Apollo state, injects HTML, serves assets, starts a server, or performs request cleanup.
|
|
129
160
|
|
|
130
|
-
##
|
|
161
|
+
## Dependency and bundling contract
|
|
131
162
|
|
|
132
|
-
|
|
133
|
-
belong to your app: map them into `config`/server options in your definition
|
|
134
|
-
or server file.
|
|
163
|
+
Vue, Vue Router, `@vue/server-renderer`, Apollo Client, GraphQL, Vite, and `vue-apollo-client` are peers so the consumer owns one compatible runtime instance. The Vite plugin deduplicates them. The Apollo/GraphQL ESM/CJS cluster is inlined into the SSR consumer bundle; Vue, Vue Router, and the renderer remain external so Node resolves their official runtime exports. Application-specific browser-oriented UI dependencies remain the consumer's documented `ssr.noExternal` responsibility.
|
|
135
164
|
|
|
136
|
-
|
|
165
|
+
Node-only modules are reachable only from `/server`, `/vite`, and the CLI. Browser hydration imports `/client`, preventing `node:http`, filesystem, and Vite code from entering client output.
|
|
137
166
|
|
|
138
|
-
|
|
139
|
-
build step — the package ships plain ESM with hand-maintained type
|
|
140
|
-
declarations).
|
|
167
|
+
## Error and redirect contract
|
|
141
168
|
|
|
142
|
-
|
|
169
|
+
Consumers set `context.response.statusCode`, headers, or a redirect. Relative and same-origin redirects are allowed by default. A canonical-domain redirect must explicitly set `allowExternal: true`. Invalid configuration, hosts, templates, and application registrations fail predictably. Timeouts return 504; unhandled rendering failures return 500; non-HTML misses return JSON 404; disabled deployment-role entries return 421.
|
|
143
170
|
|
|
144
|
-
|
|
171
|
+
## Validation
|
|
145
172
|
|
|
146
|
-
|
|
147
|
-
npm run release:patch
|
|
148
|
-
npm run release:minor
|
|
149
|
-
npm run release:major
|
|
150
|
-
```
|
|
173
|
+
Focused tests cover host/proxy/cookie behavior, safe state/head injection, concurrent request isolation, router/state/head separation, Apollo cache isolation/restoration, and server lifecycle. Consumer integrations must additionally validate their routes, domains, templates, SEO, GraphQL failures, real-browser hydration warnings and duplicate requests, Docker startup, reverse-proxy headers, and shutdown behavior.
|
|
151
174
|
|
|
152
|
-
|
|
153
|
-
creates the npm version commit and tag, and publishes the package. The tests
|
|
154
|
-
also run automatically before publishing directly.
|
|
175
|
+
See [SsrPerformanceBaseline.md](./docs/SsrPerformanceBaseline.md) and [SsrBuiltoCompatibility.md](./docs/SsrBuiltoCompatibility.md).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SsrApplicationDefinition, SsrCreatedApplication, SsrHydrationState, SsrRenderRequest } from './SsrRuntimeTypes';
|
|
2
|
+
export interface SsrCreateApplicationOptions<TApplicationState, TPublicConfig> {
|
|
3
|
+
server: boolean;
|
|
4
|
+
request: SsrRenderRequest<TPublicConfig>;
|
|
5
|
+
hydrationState?: SsrHydrationState<TApplicationState, TPublicConfig> | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const createSsrApplication: <TApplicationState extends Record<string, any> = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown>(definition: SsrApplicationDefinition<TApplicationState, TPublicConfig, TExtension>, options: SsrCreateApplicationOptions<TApplicationState, TPublicConfig>) => Promise<SsrCreatedApplication<TApplicationState, TPublicConfig, TExtension>>;
|
|
8
|
+
//# sourceMappingURL=SsrApplicationRuntime.d.ts.map
|
|
@@ -0,0 +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,CA+F7E,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SsrApplicationDefinition } from './SsrRuntimeTypes';
|
|
2
|
+
export interface SsrHydrateOptions {
|
|
3
|
+
mountSelector?: string;
|
|
4
|
+
stateElementId?: string;
|
|
5
|
+
removeHeadSelector?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const hydrateSsrApplication: (definition: SsrApplicationDefinition<any, any, any>, options?: SsrHydrateOptions) => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=SsrBrowserRuntime.d.ts.map
|
|
@@ -0,0 +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,CA2Cd,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SsrApplicationDefinition, SsrRenderRequest, SsrRenderResult } from './SsrRuntimeTypes';
|
|
2
|
+
export declare const renderSsrApplication: <TApplicationState extends Record<string, any> = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown>(definition: SsrApplicationDefinition<TApplicationState, TPublicConfig, TExtension>, request: SsrRenderRequest<TPublicConfig>) => Promise<SsrRenderResult<TApplicationState, TPublicConfig>>;
|
|
3
|
+
//# sourceMappingURL=SsrRenderRuntime.d.ts.map
|
|
@@ -0,0 +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,CA0D3D,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { SsrRequestContext } from './SsrRuntimeTypes';
|
|
3
|
+
export declare const SSR_REQUEST_CONTEXT: InjectionKey<SsrRequestContext<any, any, any>>;
|
|
4
|
+
export declare const useSsrRequestContext: <TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown>() => SsrRequestContext<TApplicationState, TPublicConfig, TExtension>;
|
|
5
|
+
//# sourceMappingURL=SsrRequestContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SsrRequestContext.d.ts","sourceRoot":"","sources":["../src/SsrRequestContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CACvC,CAAA;AAExC,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3C,aAAa,GAAG,OAAO,EACvB,UAAU,GAAG,OAAO,OACjB,iBAAiB,CAAC,iBAAiB,EAAE,aAAa,EAAE,UAAU,CAQlE,CAAA"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { App, Component } from 'vue';
|
|
2
|
+
import { Router, RouteRecordRaw } from 'vue-router';
|
|
3
|
+
import { VueApolloClientOptions, VueApolloState, VueApolloClients } from 'vue-apollo-client';
|
|
4
|
+
export type SsrHeaderValue = string | string[] | undefined;
|
|
5
|
+
export type SsrHeaders = Record<string, SsrHeaderValue>;
|
|
6
|
+
export interface SsrHeadPayload {
|
|
7
|
+
title?: string | null;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
keywords?: string | readonly string[] | null;
|
|
10
|
+
robots?: string | null;
|
|
11
|
+
canonicalUrl?: string | null;
|
|
12
|
+
favicon?: string | null;
|
|
13
|
+
ogTitle?: string | null;
|
|
14
|
+
ogDescription?: string | null;
|
|
15
|
+
ogImage?: string | null;
|
|
16
|
+
ogImageAlt?: string | null;
|
|
17
|
+
ogUrl?: string | null;
|
|
18
|
+
ogType?: string | null;
|
|
19
|
+
ogSiteName?: string | null;
|
|
20
|
+
ogLocale?: string | null;
|
|
21
|
+
twitterCard?: string | null;
|
|
22
|
+
twitterTitle?: string | null;
|
|
23
|
+
twitterDescription?: string | null;
|
|
24
|
+
twitterImage?: string | null;
|
|
25
|
+
twitterImageAlt?: string | null;
|
|
26
|
+
twitterSite?: string | null;
|
|
27
|
+
twitterCreator?: string | null;
|
|
28
|
+
jsonLd?: readonly unknown[] | null;
|
|
29
|
+
htmlAttributes?: Record<string, string | null | undefined>;
|
|
30
|
+
}
|
|
31
|
+
export interface SsrResponseState {
|
|
32
|
+
statusCode: number;
|
|
33
|
+
headers: Record<string, string>;
|
|
34
|
+
redirect?: {
|
|
35
|
+
location: string;
|
|
36
|
+
statusCode?: 301 | 302 | 303 | 307 | 308;
|
|
37
|
+
allowExternal?: boolean;
|
|
38
|
+
} | null;
|
|
39
|
+
}
|
|
40
|
+
export interface SsrRenderMetrics {
|
|
41
|
+
requestId: string;
|
|
42
|
+
applicationId: string;
|
|
43
|
+
contextDurationMs: number;
|
|
44
|
+
routeDurationMs: number;
|
|
45
|
+
renderDurationMs: number;
|
|
46
|
+
totalDurationMs: number;
|
|
47
|
+
htmlBytes: number;
|
|
48
|
+
stateBytes: number;
|
|
49
|
+
}
|
|
50
|
+
export interface SsrRenderRequest<TPublicConfig = unknown> {
|
|
51
|
+
requestId: string;
|
|
52
|
+
url: string;
|
|
53
|
+
host: string;
|
|
54
|
+
protocol: 'http' | 'https';
|
|
55
|
+
method: string;
|
|
56
|
+
headers: SsrHeaders;
|
|
57
|
+
cookie?: string;
|
|
58
|
+
apolloHeaders?: Record<string, string>;
|
|
59
|
+
apolloRequestTimeoutMs?: number;
|
|
60
|
+
publicConfig: TPublicConfig;
|
|
61
|
+
signal: AbortSignal;
|
|
62
|
+
}
|
|
63
|
+
export interface SsrHydrationState<TApplicationState = unknown, TPublicConfig = unknown> {
|
|
64
|
+
version: 1;
|
|
65
|
+
applicationId: string;
|
|
66
|
+
publicConfig: TPublicConfig;
|
|
67
|
+
application: TApplicationState;
|
|
68
|
+
apollo?: VueApolloState;
|
|
69
|
+
}
|
|
70
|
+
export interface SsrRequestContext<TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown> {
|
|
71
|
+
request: SsrRenderRequest<TPublicConfig>;
|
|
72
|
+
url: URL;
|
|
73
|
+
host: string;
|
|
74
|
+
publicConfig: TPublicConfig;
|
|
75
|
+
state: TApplicationState;
|
|
76
|
+
head: {
|
|
77
|
+
value: SsrHeadPayload | null;
|
|
78
|
+
};
|
|
79
|
+
response: SsrResponseState;
|
|
80
|
+
apolloClients: VueApolloClients | null;
|
|
81
|
+
extension: TExtension;
|
|
82
|
+
}
|
|
83
|
+
export interface SsrApplicationSetup<TApplicationState, TPublicConfig, TExtension> {
|
|
84
|
+
app: App;
|
|
85
|
+
router: Router | null;
|
|
86
|
+
context: SsrRequestContext<TApplicationState, TPublicConfig, TExtension>;
|
|
87
|
+
apolloClients: VueApolloClients | null;
|
|
88
|
+
server: boolean;
|
|
89
|
+
}
|
|
90
|
+
export type SsrApolloOptionsFactory<TPublicConfig> = (input: {
|
|
91
|
+
request: SsrRenderRequest<TPublicConfig>;
|
|
92
|
+
publicConfig: TPublicConfig;
|
|
93
|
+
server: boolean;
|
|
94
|
+
}) => VueApolloClientOptions | Promise<VueApolloClientOptions>;
|
|
95
|
+
export interface SsrApplicationDefinition<TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown> {
|
|
96
|
+
id: string;
|
|
97
|
+
rootComponent: Component;
|
|
98
|
+
mountSelector?: string;
|
|
99
|
+
routes?: RouteRecordRaw[] | (() => RouteRecordRaw[]);
|
|
100
|
+
createInitialState?: () => TApplicationState;
|
|
101
|
+
createExtension?: (context: Omit<SsrRequestContext<TApplicationState, TPublicConfig, TExtension>, 'extension'>) => TExtension | Promise<TExtension>;
|
|
102
|
+
apollo?: VueApolloClientOptions | SsrApolloOptionsFactory<TPublicConfig>;
|
|
103
|
+
apolloRequestTimeoutMs?: number | ((publicConfig: TPublicConfig) => number | undefined);
|
|
104
|
+
install?: (setup: SsrApplicationSetup<TApplicationState, TPublicConfig, TExtension>) => void | Promise<void>;
|
|
105
|
+
resolveHead?: (context: SsrRequestContext<TApplicationState, TPublicConfig, TExtension>) => SsrHeadPayload | null | Promise<SsrHeadPayload | null>;
|
|
106
|
+
cleanup?: (context: SsrRequestContext<TApplicationState, TPublicConfig, TExtension>) => void | Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
export interface SsrCreatedApplication<TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown> {
|
|
109
|
+
app: App;
|
|
110
|
+
router: Router | null;
|
|
111
|
+
context: SsrRequestContext<TApplicationState, TPublicConfig, TExtension>;
|
|
112
|
+
apollo: ReturnType<(typeof import('vue-apollo-client'))['createApollo']> | null;
|
|
113
|
+
}
|
|
114
|
+
export interface SsrRenderResult<TApplicationState = unknown, TPublicConfig = unknown> {
|
|
115
|
+
html: string;
|
|
116
|
+
teleports: string;
|
|
117
|
+
head: SsrHeadPayload | null;
|
|
118
|
+
response: SsrResponseState;
|
|
119
|
+
hydrationState: SsrHydrationState<TApplicationState, TPublicConfig>;
|
|
120
|
+
metrics: SsrRenderMetrics;
|
|
121
|
+
}
|
|
122
|
+
export type SsrEntryKind = 'ssr' | 'spa';
|
|
123
|
+
export interface SsrRuntimeEntry {
|
|
124
|
+
id: string;
|
|
125
|
+
kind: SsrEntryKind;
|
|
126
|
+
template: string;
|
|
127
|
+
hosts: string[];
|
|
128
|
+
roles?: string[];
|
|
129
|
+
application?: SsrApplicationDefinition<any, any, any>;
|
|
130
|
+
mountSelector?: string;
|
|
131
|
+
cacheControl?: string;
|
|
132
|
+
responseCache?: SsrResponseCacheStrategy<any>;
|
|
133
|
+
}
|
|
134
|
+
export interface SsrHttpRequest<TPublicConfig = unknown> extends SsrRenderRequest<TPublicConfig> {
|
|
135
|
+
pathname: string;
|
|
136
|
+
search: string;
|
|
137
|
+
entryId: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SsrHttpResponse {
|
|
140
|
+
statusCode: number;
|
|
141
|
+
body?: string | Uint8Array;
|
|
142
|
+
headers?: Record<string, string>;
|
|
143
|
+
}
|
|
144
|
+
export interface SsrResponseCacheWriteOptions {
|
|
145
|
+
ttlMs: number;
|
|
146
|
+
tags?: readonly string[];
|
|
147
|
+
}
|
|
148
|
+
export interface SsrResponseCacheInvalidation {
|
|
149
|
+
keys?: readonly string[];
|
|
150
|
+
tags?: readonly string[];
|
|
151
|
+
}
|
|
152
|
+
export interface SsrResponseCache {
|
|
153
|
+
get: (key: string) => SsrHttpResponse | null | Promise<SsrHttpResponse | null>;
|
|
154
|
+
set: (key: string, response: SsrHttpResponse, options: SsrResponseCacheWriteOptions) => void | Promise<void>;
|
|
155
|
+
invalidate: (selector?: SsrResponseCacheInvalidation) => number | Promise<number>;
|
|
156
|
+
}
|
|
157
|
+
export interface SsrResponseCacheStrategy<TPublicConfig = unknown> {
|
|
158
|
+
store: SsrResponseCache;
|
|
159
|
+
ttlMs: number;
|
|
160
|
+
/**
|
|
161
|
+
* Adds publication/data version, locale, or another public discriminator to
|
|
162
|
+
* the package-owned application + host + route key. Returning null bypasses
|
|
163
|
+
* the cache. Requests with forwarded cookies are always bypassed.
|
|
164
|
+
*/
|
|
165
|
+
vary?: (request: SsrHttpRequest<TPublicConfig>) => string | null | Promise<string | null>;
|
|
166
|
+
tags?: (request: SsrHttpRequest<TPublicConfig>) => readonly string[] | Promise<readonly string[]>;
|
|
167
|
+
shouldCache?: (response: SsrHttpResponse, request: SsrHttpRequest<TPublicConfig>) => boolean;
|
|
168
|
+
}
|
|
169
|
+
export interface SsrEndpointDefinition<TPublicConfig = unknown> {
|
|
170
|
+
id: string;
|
|
171
|
+
match: (request: SsrHttpRequest<TPublicConfig>) => boolean;
|
|
172
|
+
handle: (request: SsrHttpRequest<TPublicConfig>, tools: SsrEndpointTools) => SsrHttpResponse | null | Promise<SsrHttpResponse | null>;
|
|
173
|
+
}
|
|
174
|
+
export interface SsrEndpointTools {
|
|
175
|
+
/** Creates isolated server clients that the runtime stops after the request. */
|
|
176
|
+
createApolloClients: (options: VueApolloClientOptions) => VueApolloClients;
|
|
177
|
+
}
|
|
178
|
+
export interface SsrReadinessProbe {
|
|
179
|
+
id: string;
|
|
180
|
+
run: () => void | Promise<void>;
|
|
181
|
+
}
|
|
182
|
+
export interface SsrLogger {
|
|
183
|
+
debug?: (event: string, details?: Record<string, unknown>) => void;
|
|
184
|
+
info?: (event: string, details?: Record<string, unknown>) => void;
|
|
185
|
+
warn?: (event: string, details?: Record<string, unknown>) => void;
|
|
186
|
+
error?: (event: string, details?: Record<string, unknown>) => void;
|
|
187
|
+
}
|
|
188
|
+
export interface SsrErrorRenderContext<TPublicConfig = unknown> {
|
|
189
|
+
error: unknown;
|
|
190
|
+
kind: 'timeout' | 'internal';
|
|
191
|
+
production: boolean;
|
|
192
|
+
request?: SsrHttpRequest<TPublicConfig>;
|
|
193
|
+
entryId?: string;
|
|
194
|
+
}
|
|
195
|
+
export interface SsrServerOptions<TPublicConfig = unknown> {
|
|
196
|
+
root?: string;
|
|
197
|
+
host?: string;
|
|
198
|
+
port?: number;
|
|
199
|
+
role?: string;
|
|
200
|
+
trustProxy?: boolean;
|
|
201
|
+
clientOutDir?: string;
|
|
202
|
+
requestTimeoutMs?: number;
|
|
203
|
+
apolloRequestTimeoutMs?: number;
|
|
204
|
+
shutdownTimeoutMs?: number;
|
|
205
|
+
cookieAllowlist?: string[];
|
|
206
|
+
cookieDenylist?: string[];
|
|
207
|
+
publicConfig: TPublicConfig;
|
|
208
|
+
healthPath?: string;
|
|
209
|
+
readinessPath?: string;
|
|
210
|
+
logger?: SsrLogger;
|
|
211
|
+
onMetrics?: (metrics: SsrRenderMetrics) => void;
|
|
212
|
+
renderError?: (context: SsrErrorRenderContext<TPublicConfig>) => SsrHttpResponse | null | Promise<SsrHttpResponse | null>;
|
|
213
|
+
}
|
|
214
|
+
export interface SsrRuntimeDefinition<TPublicConfig = unknown> {
|
|
215
|
+
name: string;
|
|
216
|
+
entries: SsrRuntimeEntry[];
|
|
217
|
+
defaultEntryId?: string;
|
|
218
|
+
server: SsrServerOptions<TPublicConfig>;
|
|
219
|
+
endpoints?: SsrEndpointDefinition<TPublicConfig>[];
|
|
220
|
+
readiness?: SsrReadinessProbe[];
|
|
221
|
+
}
|
|
222
|
+
export type SsrRuntimeDefinitionExport<TPublicConfig = unknown> = SsrRuntimeDefinition<TPublicConfig> | (() => SsrRuntimeDefinition<TPublicConfig> | Promise<SsrRuntimeDefinition<TPublicConfig>>);
|
|
223
|
+
//# sourceMappingURL=SsrRuntimeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ssr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,KAAK,IAAI,CAAA;IAC/C,WAAW,CAAC,EAAE,CACZ,OAAO,EAAE,qBAAqB,CAAC,aAAa,CAAC,KAC1C,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;CAC9D;AAED,MAAM,WAAW,oBAAoB,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,7 @@
|
|
|
1
|
+
import { SsrHeadPayload } from './SsrRuntimeTypes';
|
|
2
|
+
export declare const escapeSsrHtml: (value: unknown) => string;
|
|
3
|
+
export declare const serializeSsrState: (value: unknown) => string;
|
|
4
|
+
export declare const renderSsrHead: (payload: SsrHeadPayload | null) => string;
|
|
5
|
+
export declare const sanitizeSsrIdentifier: (value: string) => string;
|
|
6
|
+
export declare const getSsrStateElementId: (applicationId: string) => string;
|
|
7
|
+
//# sourceMappingURL=SsrSerialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SsrSerialization.d.ts","sourceRoot":"","sources":["../src/SsrSerialization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAMlB,CAAA;AAE7B,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,MAIf,CAAA;AAcpC,eAAO,MAAM,aAAa,GAAI,SAAS,cAAc,GAAG,IAAI,KAAG,MAgD9D,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MAC8B,CAAA;AAEpF,eAAO,MAAM,oBAAoB,GAAI,eAAe,MAAM,KAAG,MACC,CAAA"}
|