vue-ssr-lite 0.1.5 → 0.1.6
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/SsrRequestContext.d.ts +7 -0
- package/dist/SsrRequestContext.d.ts.map +1 -1
- package/dist/chunks/{SsrApplicationRuntime-CWxsVE4p.mjs → SsrApplicationRuntime-DB_oRq-_.mjs} +3 -1
- package/dist/chunks/{SsrServerRuntime-lb_db1ZB.mjs → SsrServerRuntime-CrpKROBI.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
|
@@ -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"}
|
package/dist/chunks/{SsrApplicationRuntime-CWxsVE4p.mjs → SsrApplicationRuntime-DB_oRq-_.mjs}
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { inject as S, ref as y, createSSRApp as f } from "vue";
|
|
2
2
|
import { createRouter as w, createMemoryHistory as v, createWebHistory as x } from "vue-router";
|
|
3
|
-
const p = /* @__PURE__ */ Symbol(
|
|
3
|
+
const p = /* @__PURE__ */ Symbol.for(
|
|
4
|
+
"vue-ssr:request-context"
|
|
5
|
+
), q = () => {
|
|
4
6
|
const e = S(p);
|
|
5
7
|
if (!e) throw new Error("vue-ssr-lite request context is not installed.");
|
|
6
8
|
return e;
|
|
@@ -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-DB_oRq-_.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-CrpKROBI.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-DB_oRq-_.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-DB_oRq-_.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-CrpKROBI.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