vue-ssr-lite 0.1.5 → 0.1.7
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 +92 -137
- package/dist/SsrApplicationRuntime.d.ts.map +1 -1
- package/dist/SsrRequestContext.d.ts +7 -0
- package/dist/SsrRequestContext.d.ts.map +1 -1
- package/dist/SsrRuntimeTypes.d.ts +5 -1
- package/dist/SsrRuntimeTypes.d.ts.map +1 -1
- package/dist/chunks/SsrApplicationRuntime-BFebmWyk.mjs +95 -0
- package/dist/chunks/{SsrServerRuntime-lb_db1ZB.mjs → SsrServerRuntime-DvSz8oSq.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/client.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/vite/SsrVitePlugin.d.ts +2 -1
- package/dist/vite/SsrVitePlugin.d.ts.map +1 -1
- package/dist/vite.mjs +8 -8
- package/package.json +1 -1
- package/dist/chunks/SsrApplicationRuntime-CWxsVE4p.mjs +0 -90
package/README.md
CHANGED
|
@@ -1,175 +1,130 @@
|
|
|
1
1
|
# vue-ssr-lite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An API-client-neutral managed Vue 3 SSR runtime. It owns server creation, host
|
|
4
|
+
classification, isolated Vue applications and routers, rendering, generic
|
|
5
|
+
plugin hydration state, browser hydration, assets, errors, timeouts, metrics,
|
|
6
|
+
and request cleanup.
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
It does not import or understand Apollo, GraphQL, REST clients, authentication,
|
|
9
|
+
or application queries.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## Minimal application
|
|
8
12
|
|
|
9
13
|
```ts
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
],
|
|
20
|
-
apollo: ({ publicConfig }) => ({
|
|
21
|
-
endPoints: { default: publicConfig.graphqlEndpoint },
|
|
22
|
-
}),
|
|
14
|
+
import { defineSsrApplication } from 'vue-ssr-lite'
|
|
15
|
+
import apolloConfiguration from './config/ApolloConfiguration'
|
|
16
|
+
import StorefrontApp from './StorefrontApp.vue'
|
|
17
|
+
import { storefrontRoutes } from './routes'
|
|
18
|
+
|
|
19
|
+
export const storefrontApplication = defineSsrApplication({
|
|
20
|
+
id: 'storefront',
|
|
21
|
+
rootComponent: StorefrontApp,
|
|
22
|
+
routes: storefrontRoutes,
|
|
23
|
+
plugins: [apolloConfiguration],
|
|
23
24
|
})
|
|
25
|
+
```
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
`plugins` contains ordinary Vue plugins. `vue-ssr-lite` provides the generic
|
|
28
|
+
request and hydration contexts before installing them, so each plugin can
|
|
29
|
+
derive request scope and contribute serializable state without a framework
|
|
30
|
+
adapter or application `install` callback.
|
|
31
|
+
|
|
32
|
+
Declare SPA/SSR host routing and minimal public configuration:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { defineSsrRuntime } from 'vue-ssr-lite'
|
|
36
|
+
import { storefrontApplication } from './StorefrontApplication'
|
|
37
|
+
|
|
38
|
+
export default defineSsrRuntime({
|
|
39
|
+
name: 'unified-app',
|
|
40
|
+
entries: [
|
|
41
|
+
{
|
|
42
|
+
id: 'admin',
|
|
43
|
+
kind: 'spa',
|
|
44
|
+
template: 'index.html',
|
|
45
|
+
hosts: ['admin.example.com'],
|
|
40
46
|
},
|
|
47
|
+
{
|
|
48
|
+
id: 'storefront',
|
|
49
|
+
kind: 'ssr',
|
|
50
|
+
template: 'site.html',
|
|
51
|
+
hosts: ['*'],
|
|
52
|
+
application: storefrontApplication,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
server: {
|
|
56
|
+
publicConfig: { shopBaseDomain: 'shop.example.com' },
|
|
41
57
|
},
|
|
42
58
|
})
|
|
43
59
|
```
|
|
44
60
|
|
|
45
|
-
Register
|
|
61
|
+
Register the SSR browser entry in Vite:
|
|
46
62
|
|
|
47
63
|
```ts
|
|
48
|
-
import { defineConfig } from 'vite'
|
|
49
|
-
import vue from '@vitejs/plugin-vue'
|
|
50
64
|
import { vueSsrLite } from 'vue-ssr-lite/vite'
|
|
51
65
|
|
|
52
|
-
export default
|
|
66
|
+
export default {
|
|
53
67
|
plugins: [
|
|
54
|
-
vue(),
|
|
55
68
|
vueSsrLite({
|
|
56
69
|
applications: [{
|
|
57
|
-
id: '
|
|
58
|
-
definition: 'src/
|
|
59
|
-
exportName: '
|
|
70
|
+
id: 'storefront',
|
|
71
|
+
definition: 'src/StorefrontApplication.ts',
|
|
72
|
+
exportName: 'storefrontApplication',
|
|
60
73
|
template: 'site.html',
|
|
61
74
|
}],
|
|
75
|
+
spaEntries: { admin: 'index.html' },
|
|
62
76
|
}),
|
|
63
77
|
],
|
|
64
|
-
})
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
The source `site.html` only needs a mount element:
|
|
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>
|
|
75
|
-
```
|
|
76
|
-
|
|
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
78
|
}
|
|
87
79
|
```
|
|
88
80
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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.
|
|
81
|
+
The package Vite plugin owns Vue/Router deduplication and keeps
|
|
82
|
+
`vue-ssr-lite` external so the managed server and consumer bundle share the
|
|
83
|
+
same runtime. API-client Vite plugins own their own dependency identity.
|
|
97
84
|
|
|
98
|
-
##
|
|
85
|
+
## Request lifecycle
|
|
99
86
|
|
|
100
|
-
|
|
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`.
|
|
87
|
+
For every SSR request the package:
|
|
105
88
|
|
|
106
|
-
|
|
89
|
+
1. classifies the normalized host and deployment role;
|
|
90
|
+
2. creates a new Vue app, memory router, state, head, response, abort signal,
|
|
91
|
+
request context, and hydration controller;
|
|
92
|
+
3. provides globally stable request/hydration injection keys;
|
|
93
|
+
4. installs generic application plugins;
|
|
94
|
+
5. resolves the route and waits for native Vue server-prefetch work;
|
|
95
|
+
6. renders HTML and collects plugin hydration state;
|
|
96
|
+
7. serializes escaped state into the application document; and
|
|
97
|
+
8. disposes all request-owned plugin resources.
|
|
107
98
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
dist/server/SsrRuntime.js consumer runtime/application server bundle
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
The package build itself produces separate `index.mjs`, `client.mjs`, `server.mjs`, `vite.mjs`, and `cli.mjs` entry points.
|
|
114
|
-
|
|
115
|
-
## Extension points
|
|
99
|
+
Browser hydration restores the serialized application/plugin state before
|
|
100
|
+
component setup and mounts through the same application definition.
|
|
116
101
|
|
|
117
|
-
|
|
102
|
+
## Public package boundaries
|
|
118
103
|
|
|
119
|
-
- `
|
|
120
|
-
|
|
121
|
-
- `
|
|
122
|
-
- `
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
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.
|
|
104
|
+
- `vue-ssr-lite`: isomorphic definitions, request context, hydration contract,
|
|
105
|
+
serialization, and public types.
|
|
106
|
+
- `vue-ssr-lite/client`: browser hydration only.
|
|
107
|
+
- `vue-ssr-lite/server`: renderer, Node lifecycle, host/proxy/cookie handling,
|
|
108
|
+
assets, readiness, response caching, and shutdown.
|
|
109
|
+
- `vue-ssr-lite/vite`: HTML transformation, virtual browser entries, framework
|
|
110
|
+
identity, and build inputs.
|
|
129
111
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
Application code may define routes, generic plugins, typed state/extensions,
|
|
113
|
+
head/status/redirect behavior, host entries, response caches, endpoints, and
|
|
114
|
+
service readiness. It never calls `renderToString`, manages API-client caches,
|
|
115
|
+
injects hydration HTML, starts the server, or performs request cleanup.
|
|
133
116
|
|
|
134
|
-
|
|
135
|
-
import { createSsrMemoryResponseCache } from 'vue-ssr-lite/server'
|
|
136
|
-
|
|
137
|
-
const publicPages = createSsrMemoryResponseCache({
|
|
138
|
-
maxEntries: 500,
|
|
139
|
-
maxBytes: 32 * 1024 * 1024,
|
|
140
|
-
})
|
|
117
|
+
## Commands
|
|
141
118
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// On publication: publicPages.invalidate({ tags: [`host:${hostname}`] })
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"scripts": {
|
|
122
|
+
"dev": "vue-ssr-lite dev --runtime src/SsrRuntime.ts",
|
|
123
|
+
"build": "vue-ssr-lite build --runtime src/SsrRuntime.ts",
|
|
124
|
+
"start": "vue-ssr-lite start"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
152
127
|
```
|
|
153
128
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
layer so precompressed hashed assets and dynamic HTML use one deployment-wide
|
|
157
|
-
policy without buffering a second copy inside the Node process.
|
|
158
|
-
|
|
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.
|
|
160
|
-
|
|
161
|
-
## Dependency and bundling contract
|
|
162
|
-
|
|
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.
|
|
164
|
-
|
|
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.
|
|
166
|
-
|
|
167
|
-
## Error and redirect contract
|
|
168
|
-
|
|
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.
|
|
170
|
-
|
|
171
|
-
## Validation
|
|
172
|
-
|
|
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.
|
|
174
|
-
|
|
175
|
-
See [SsrPerformanceBaseline.md](./docs/SsrPerformanceBaseline.md) and [SsrBuiltoCompatibility.md](./docs/SsrBuiltoCompatibility.md).
|
|
129
|
+
Production emits the consumer server runtime at
|
|
130
|
+
`dist/server/SsrRuntime.js` and browser assets under `dist/client`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrApplicationRuntime.d.ts","sourceRoot":"","sources":["../src/SsrApplicationRuntime.ts"],"names":[],"mappings":"AAWA,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":"AAWA,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,CAwF7E,CAAA"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
2
|
import { SsrRequestContext } from './SsrRuntimeTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Cross-package-stable request-context injection key.
|
|
5
|
+
*
|
|
6
|
+
* The managed server and a Vite-loaded consumer application can evaluate
|
|
7
|
+
* `vue-ssr-lite` through different module graphs. The global symbol registry
|
|
8
|
+
* keeps the provider and consumer identities equal across those evaluations.
|
|
9
|
+
*/
|
|
3
10
|
export declare const SSR_REQUEST_CONTEXT: InjectionKey<SsrRequestContext<any, any, any>>;
|
|
4
11
|
export declare const useSsrRequestContext: <TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown>() => SsrRequestContext<TApplicationState, TPublicConfig, TExtension>;
|
|
5
12
|
//# sourceMappingURL=SsrRequestContext.d.ts.map
|
|
@@ -1 +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,
|
|
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;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAE3B,YAAY,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAEnD,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { App, Component } from 'vue';
|
|
1
|
+
import { App, Component, Plugin } from 'vue';
|
|
2
2
|
import { Router, RouteRecordRaw } from 'vue-router';
|
|
3
3
|
import { SsrHydrationContext, SsrHydrationController } from './SsrHydrationRuntime';
|
|
4
4
|
export type SsrHeaderValue = string | string[] | undefined;
|
|
@@ -70,6 +70,8 @@ export interface SsrHydrationState<TApplicationState = unknown, TPublicConfig =
|
|
|
70
70
|
plugins?: Record<string, unknown>;
|
|
71
71
|
}
|
|
72
72
|
export interface SsrRequestContext<TApplicationState = Record<string, unknown>, TPublicConfig = unknown, TExtension = unknown> {
|
|
73
|
+
/** Stable identity of the application selected for this request. */
|
|
74
|
+
applicationId: string;
|
|
73
75
|
request: SsrRenderRequest<TPublicConfig>;
|
|
74
76
|
url: URL;
|
|
75
77
|
host: string;
|
|
@@ -96,6 +98,8 @@ export interface SsrApplicationDefinition<TApplicationState = Record<string, unk
|
|
|
96
98
|
rootComponent: Component;
|
|
97
99
|
mountSelector?: string;
|
|
98
100
|
routes?: RouteRecordRaw[] | (() => RouteRecordRaw[]);
|
|
101
|
+
/** Generic Vue plugins installed for every isolated server/browser app. */
|
|
102
|
+
plugins?: readonly Plugin[];
|
|
99
103
|
createInitialState?: () => TApplicationState;
|
|
100
104
|
createExtension?: (context: Omit<SsrRequestContext<TApplicationState, TPublicConfig, TExtension>, 'extension'>) => TExtension | Promise<TExtension>;
|
|
101
105
|
install?: (setup: SsrApplicationSetup<TApplicationState, TPublicConfig, TExtension>) => void | Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrRuntimeTypes.d.ts","sourceRoot":"","sources":["../src/SsrRuntimeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"SsrRuntimeTypes.d.ts","sourceRoot":"","sources":["../src/SsrRuntimeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GA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BAAoB,CAAC,aAAa,CAAC,GACnC,CAAC,MAAM,oBAAoB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { inject as S, ref as y, createSSRApp as f } from "vue";
|
|
2
|
+
import { createRouter as w, createMemoryHistory as v, createWebHistory as x } from "vue-router";
|
|
3
|
+
const h = /* @__PURE__ */ Symbol.for(
|
|
4
|
+
"vue-ssr:request-context"
|
|
5
|
+
), q = () => {
|
|
6
|
+
const t = S(h);
|
|
7
|
+
if (!t) throw new Error("vue-ssr-lite request context is not installed.");
|
|
8
|
+
return t;
|
|
9
|
+
}, C = /* @__PURE__ */ Symbol.for(
|
|
10
|
+
"vue-ssr:hydration-context"
|
|
11
|
+
), b = (t) => {
|
|
12
|
+
console.error("[vue-ssr-lite] hydration dispose failed", t);
|
|
13
|
+
}, m = (t, e = typeof window > "u") => {
|
|
14
|
+
const n = /* @__PURE__ */ new Map(), a = [], c = t ?? null;
|
|
15
|
+
return {
|
|
16
|
+
server: e,
|
|
17
|
+
read: (r) => c ? c[r] : void 0,
|
|
18
|
+
contribute: (r, s) => {
|
|
19
|
+
e && n.set(r, s);
|
|
20
|
+
},
|
|
21
|
+
onDispose: (r) => {
|
|
22
|
+
a.push(r);
|
|
23
|
+
},
|
|
24
|
+
collect: () => {
|
|
25
|
+
if (n.size === 0) return;
|
|
26
|
+
const r = {};
|
|
27
|
+
for (const [s, u] of n)
|
|
28
|
+
r[s] = u();
|
|
29
|
+
return r;
|
|
30
|
+
},
|
|
31
|
+
dispose: () => {
|
|
32
|
+
for (; a.length > 0; ) {
|
|
33
|
+
const r = a.pop();
|
|
34
|
+
try {
|
|
35
|
+
r?.();
|
|
36
|
+
} catch (s) {
|
|
37
|
+
b(s);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, g = async (t, e) => {
|
|
43
|
+
if (!t?.id || !t.rootComponent)
|
|
44
|
+
throw new Error("An SSR application requires an id and rootComponent.");
|
|
45
|
+
if (e.hydrationState && e.hydrationState.applicationId !== t.id)
|
|
46
|
+
throw new Error("Hydration state belongs to a different SSR application.");
|
|
47
|
+
const n = typeof t.routes == "function" ? t.routes() : t.routes, a = n ? w({
|
|
48
|
+
history: e.server ? v() : x(),
|
|
49
|
+
routes: n,
|
|
50
|
+
scrollBehavior(o, p, i) {
|
|
51
|
+
if (i) return i;
|
|
52
|
+
if (o.hash) return { el: o.hash, top: 24 };
|
|
53
|
+
if (o.fullPath !== p.fullPath)
|
|
54
|
+
return { left: 0, top: 0 };
|
|
55
|
+
}
|
|
56
|
+
}) : null, c = e.hydrationState?.application ?? t.createInitialState?.() ?? {}, r = {
|
|
57
|
+
statusCode: 200,
|
|
58
|
+
headers: {},
|
|
59
|
+
redirect: null
|
|
60
|
+
}, s = m(
|
|
61
|
+
e.hydrationState?.plugins,
|
|
62
|
+
e.server
|
|
63
|
+
), u = {
|
|
64
|
+
applicationId: t.id,
|
|
65
|
+
request: e.request,
|
|
66
|
+
url: new URL(e.request.url),
|
|
67
|
+
host: e.request.host,
|
|
68
|
+
publicConfig: e.request.publicConfig,
|
|
69
|
+
state: c,
|
|
70
|
+
head: y(null),
|
|
71
|
+
response: r,
|
|
72
|
+
hydration: s
|
|
73
|
+
}, d = t.createExtension ? await t.createExtension(u) : void 0, l = { ...u, extension: d };
|
|
74
|
+
try {
|
|
75
|
+
const o = f(t.rootComponent);
|
|
76
|
+
a && o.use(a), o.provide(C, s), o.provide(h, l);
|
|
77
|
+
for (const p of t.plugins ?? []) o.use(p);
|
|
78
|
+
return await t.install?.({
|
|
79
|
+
app: o,
|
|
80
|
+
router: a,
|
|
81
|
+
context: l,
|
|
82
|
+
hydration: s,
|
|
83
|
+
server: e.server
|
|
84
|
+
}), { app: o, router: a, context: l, hydration: s };
|
|
85
|
+
} catch (o) {
|
|
86
|
+
throw s.dispose(), o;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
C as S,
|
|
91
|
+
h as a,
|
|
92
|
+
m as b,
|
|
93
|
+
g as c,
|
|
94
|
+
q as u
|
|
95
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createServer as se } from "node:http";
|
|
|
2
2
|
import { stat as B, readFile as q } from "node:fs/promises";
|
|
3
3
|
import { resolve as j, sep as V, extname as ee } from "node:path";
|
|
4
4
|
import { renderToString as ae } from "@vue/server-renderer";
|
|
5
|
-
import { c as ie } from "./SsrApplicationRuntime-
|
|
5
|
+
import { c as ie } from "./SsrApplicationRuntime-BFebmWyk.mjs";
|
|
6
6
|
import { a as ce } from "./SsrSerialization-k-3aCFYt.mjs";
|
|
7
7
|
import { r as W, p as le, i as de } from "./SsrHtmlRuntime-cTFsMSAZ.mjs";
|
|
8
8
|
const D = () => globalThis.performance?.now?.() ?? Date.now(), K = (e) => new TextEncoder().encode(e).byteLength, ue = async (e, t) => {
|
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-DvSz8oSq.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,4 +1,4 @@
|
|
|
1
|
-
import { c as d } from "./chunks/SsrApplicationRuntime-
|
|
1
|
+
import { c as d } from "./chunks/SsrApplicationRuntime-BFebmWyk.mjs";
|
|
2
2
|
import { g as h } from "./chunks/SsrSerialization-k-3aCFYt.mjs";
|
|
3
3
|
const m = async (e, o = {}) => {
|
|
4
4
|
const s = o.stateElementId ?? h(e.id), r = document.getElementById(s);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S, a as i, c as n, b as o, u as c } from "./chunks/SsrApplicationRuntime-
|
|
1
|
+
import { S, a as i, c as n, b as o, u as c } from "./chunks/SsrApplicationRuntime-BFebmWyk.mjs";
|
|
2
2
|
import { e as d, g as l, r as R, s as T, a as f } from "./chunks/SsrSerialization-k-3aCFYt.mjs";
|
|
3
3
|
const s = (e) => e, r = (e) => e;
|
|
4
4
|
export {
|
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-DvSz8oSq.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,
|
|
@@ -19,7 +19,8 @@ export interface SsrVitePluginOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* Additional dependencies to keep in the SSR bundle (`ssr.noExternal`). The
|
|
21
21
|
* package is API-client neutral, so callers list their own client packages
|
|
22
|
-
* (for example an Apollo/GraphQL stack) here.
|
|
22
|
+
* (for example an Apollo/GraphQL stack) here. `vue-ssr-lite` itself remains
|
|
23
|
+
* external so the managed server and consumer use the same Node module.
|
|
23
24
|
*/
|
|
24
25
|
ssrNoExternal?: (string | RegExp)[];
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsrVitePlugin.d.ts","sourceRoot":"","sources":["../../src/vite/SsrVitePlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,uBAAuB,EAAE,CAAA;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB
|
|
1
|
+
{"version":3,"file":"SsrVitePlugin.d.ts","sourceRoot":"","sources":["../../src/vite/SsrVitePlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,uBAAuB,EAAE,CAAA;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CACpC;AAcD,eAAO,MAAM,UAAU,GAAI,SAAS,oBAAoB,KAAG,MAwG1D,CAAA"}
|
package/dist/vite.mjs
CHANGED
|
@@ -39,14 +39,14 @@ const v = [
|
|
|
39
39
|
dedupe: [.../* @__PURE__ */ new Set([...v, ...t.dedupe ?? []])]
|
|
40
40
|
},
|
|
41
41
|
ssr: {
|
|
42
|
-
// The managed server imports vue-ssr-lite through Node.
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]
|
|
42
|
+
// The managed server imports vue-ssr-lite through Node. Explicitly
|
|
43
|
+
// externalize the package so Vite's development module runner and
|
|
44
|
+
// production SSR bundle reuse that same native module evaluation.
|
|
45
|
+
// Vite gives `external` precedence if a broader consumer
|
|
46
|
+
// `noExternal` filter also happens to match this package.
|
|
47
|
+
external: ["vue-ssr-lite"],
|
|
48
|
+
// API-client and browser-oriented packages remain consumer-owned.
|
|
49
|
+
noExternal: [...new Set(t.ssrNoExternal ?? [])]
|
|
50
50
|
},
|
|
51
51
|
build: o.isSsrBuild ? void 0 : { manifest: !0, rollupOptions: { input: i } }
|
|
52
52
|
};
|
package/package.json
CHANGED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { inject as S, ref as y, createSSRApp as f } from "vue";
|
|
2
|
-
import { createRouter as w, createMemoryHistory as v, createWebHistory as x } from "vue-router";
|
|
3
|
-
const p = /* @__PURE__ */ Symbol("vue-ssr-lite-request-context"), q = () => {
|
|
4
|
-
const e = S(p);
|
|
5
|
-
if (!e) throw new Error("vue-ssr-lite request context is not installed.");
|
|
6
|
-
return e;
|
|
7
|
-
}, C = /* @__PURE__ */ Symbol.for(
|
|
8
|
-
"vue-ssr:hydration-context"
|
|
9
|
-
), b = (e) => {
|
|
10
|
-
console.error("[vue-ssr-lite] hydration dispose failed", e);
|
|
11
|
-
}, m = (e, t = typeof window > "u") => {
|
|
12
|
-
const n = /* @__PURE__ */ new Map(), a = [], c = e ?? null;
|
|
13
|
-
return {
|
|
14
|
-
server: t,
|
|
15
|
-
read: (r) => c ? c[r] : void 0,
|
|
16
|
-
contribute: (r, o) => {
|
|
17
|
-
t && n.set(r, o);
|
|
18
|
-
},
|
|
19
|
-
onDispose: (r) => {
|
|
20
|
-
a.push(r);
|
|
21
|
-
},
|
|
22
|
-
collect: () => {
|
|
23
|
-
if (n.size === 0) return;
|
|
24
|
-
const r = {};
|
|
25
|
-
for (const [o, u] of n)
|
|
26
|
-
r[o] = u();
|
|
27
|
-
return r;
|
|
28
|
-
},
|
|
29
|
-
dispose: () => {
|
|
30
|
-
for (; a.length > 0; ) {
|
|
31
|
-
const r = a.pop();
|
|
32
|
-
try {
|
|
33
|
-
r?.();
|
|
34
|
-
} catch (o) {
|
|
35
|
-
b(o);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}, T = async (e, t) => {
|
|
41
|
-
if (!e?.id || !e.rootComponent)
|
|
42
|
-
throw new Error("An SSR application requires an id and rootComponent.");
|
|
43
|
-
if (t.hydrationState && t.hydrationState.applicationId !== e.id)
|
|
44
|
-
throw new Error("Hydration state belongs to a different SSR application.");
|
|
45
|
-
const n = typeof e.routes == "function" ? e.routes() : e.routes, a = n ? w({
|
|
46
|
-
history: t.server ? v() : x(),
|
|
47
|
-
routes: n,
|
|
48
|
-
scrollBehavior(s, d, i) {
|
|
49
|
-
if (i) return i;
|
|
50
|
-
if (s.hash) return { el: s.hash, top: 24 };
|
|
51
|
-
if (s.fullPath !== d.fullPath)
|
|
52
|
-
return { left: 0, top: 0 };
|
|
53
|
-
}
|
|
54
|
-
}) : null, c = t.hydrationState?.application ?? e.createInitialState?.() ?? {}, r = {
|
|
55
|
-
statusCode: 200,
|
|
56
|
-
headers: {},
|
|
57
|
-
redirect: null
|
|
58
|
-
}, o = m(
|
|
59
|
-
t.hydrationState?.plugins,
|
|
60
|
-
t.server
|
|
61
|
-
), u = {
|
|
62
|
-
request: t.request,
|
|
63
|
-
url: new URL(t.request.url),
|
|
64
|
-
host: t.request.host,
|
|
65
|
-
publicConfig: t.request.publicConfig,
|
|
66
|
-
state: c,
|
|
67
|
-
head: y(null),
|
|
68
|
-
response: r,
|
|
69
|
-
hydration: o
|
|
70
|
-
}, h = e.createExtension ? await e.createExtension(u) : void 0, l = { ...u, extension: h };
|
|
71
|
-
try {
|
|
72
|
-
const s = f(e.rootComponent);
|
|
73
|
-
return a && s.use(a), s.provide(C, o), s.provide(p, l), await e.install?.({
|
|
74
|
-
app: s,
|
|
75
|
-
router: a,
|
|
76
|
-
context: l,
|
|
77
|
-
hydration: o,
|
|
78
|
-
server: t.server
|
|
79
|
-
}), { app: s, router: a, context: l, hydration: o };
|
|
80
|
-
} catch (s) {
|
|
81
|
-
throw o.dispose(), s;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
export {
|
|
85
|
-
C as S,
|
|
86
|
-
p as a,
|
|
87
|
-
m as b,
|
|
88
|
-
T as c,
|
|
89
|
-
q as u
|
|
90
|
-
};
|