@nuxt/nitro-server-nightly 4.5.1-29744085.ef319e7f → 4.5.1-29746779.3590eee2
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/index.mjs +9 -3
- package/dist/runtime/handlers/renderer.mjs +14 -5
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import { ImpoundPlugin } from "impound";
|
|
|
22
22
|
import { resolveModulePath } from "exsolve";
|
|
23
23
|
import { runtimeDependencies } from "nitropack/runtime/meta";
|
|
24
24
|
//#region package.json
|
|
25
|
-
var version = "4.5.1-
|
|
25
|
+
var version = "4.5.1-29746779.3590eee2";
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/utils.ts
|
|
28
28
|
function toArray(value) {
|
|
@@ -58,7 +58,7 @@ let _distDir = dirname(fileURLToPath(import.meta.url));
|
|
|
58
58
|
if (/(?:chunks|shared)$/.test(_distDir)) _distDir = dirname(_distDir);
|
|
59
59
|
const distDir = _distDir;
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region
|
|
61
|
+
//#region src/templates/spa-loading-icon.ts
|
|
62
62
|
const template = () => {
|
|
63
63
|
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"80\" fill=\"none\" class=\"nuxt-spa-loading\" viewBox=\"0 0 37 25\"><path d=\"M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567\"/></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.nuxt-spa-loading>path{fill:none;stroke:#00dc82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{to{stroke-dashoffset:-128}}</style>";
|
|
64
64
|
};
|
|
@@ -273,6 +273,8 @@ async function bundle(nuxt) {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
const mockProxy = resolveModulePath("mocked-exports/proxy", { from: import.meta.url });
|
|
276
|
+
const h3Entry = resolveModulePath("h3", { from: import.meta.url });
|
|
277
|
+
const h3PackageJson = resolveModulePath("h3/package.json", { from: import.meta.url });
|
|
276
278
|
const nitroConfig = defu(nuxt.options.nitro, {
|
|
277
279
|
debug: nuxt.options.debug ? nuxt.options.debug.nitro : false,
|
|
278
280
|
rootDir: nuxt.options.rootDir,
|
|
@@ -434,6 +436,8 @@ async function bundle(nuxt) {
|
|
|
434
436
|
"@vue/compiler-ssr": mockProxy
|
|
435
437
|
},
|
|
436
438
|
"@vue/devtools-api": "vue-devtools-stub",
|
|
439
|
+
"h3": h3Entry,
|
|
440
|
+
"h3/package.json": h3PackageJson,
|
|
437
441
|
...nuxt.options.alias,
|
|
438
442
|
"#internal/nuxt/paths": resolve(distDir, "runtime/utils/paths")
|
|
439
443
|
},
|
|
@@ -720,7 +724,9 @@ async function bundle(nuxt) {
|
|
|
720
724
|
"~",
|
|
721
725
|
"@",
|
|
722
726
|
"~~",
|
|
723
|
-
"@@"
|
|
727
|
+
"@@",
|
|
728
|
+
"h3",
|
|
729
|
+
"h3/package.json"
|
|
724
730
|
];
|
|
725
731
|
const basePath = nitroConfig.typescript.tsConfig.compilerOptions?.baseUrl ? resolve(nuxt.options.buildDir, nitroConfig.typescript.tsConfig.compilerOptions?.baseUrl) : nuxt.options.buildDir;
|
|
726
732
|
const aliases = nitroConfig.alias;
|
|
@@ -33,6 +33,7 @@ const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToSt
|
|
|
33
33
|
const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
|
|
34
34
|
const PAYLOAD_URL_RE = NUXT_JSON_PAYLOADS ? /^[^?]*\/_payload.json(?:\?.*)?$/ : /^[^?]*\/_payload.js(?:\?.*)?$/;
|
|
35
35
|
const PAYLOAD_FILENAME = NUXT_JSON_PAYLOADS ? "_payload.json" : "_payload.js";
|
|
36
|
+
const PAYLOAD_BUILD_ID_PARAM = "_b";
|
|
36
37
|
let entryPath;
|
|
37
38
|
const SSR_BOT_RE = NUXT_SSR_STREAMING_BOT_RE;
|
|
38
39
|
const handler = defineRenderHandler((event) => {
|
|
@@ -71,12 +72,14 @@ async function renderRoute(event, ssrError) {
|
|
|
71
72
|
const _PAYLOAD_INLINE = !_PAYLOAD_EXTRACTION || NUXT_PAYLOAD_INLINE;
|
|
72
73
|
const isRenderingPayload = (_PAYLOAD_EXTRACTION || import.meta.dev && routeOptions.prerender) && PAYLOAD_URL_RE.test(ssrContext.url);
|
|
73
74
|
if (isRenderingPayload) {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const payloadURL = new URL(ssrContext.url, "http://localhost");
|
|
76
|
+
const url = payloadURL.pathname.slice(0, -`/${PAYLOAD_FILENAME}`.length) || "/";
|
|
77
|
+
payloadURL.searchParams.delete(PAYLOAD_BUILD_ID_PARAM);
|
|
78
|
+
ssrContext.url = url + payloadURL.search;
|
|
79
|
+
event._path = event.node.req.url = ssrContext.url;
|
|
80
|
+
if (payloadCache && await payloadCache.hasItem(ssrContext.url + ".json")) return payloadCache.getItem(ssrContext.url + ".json");
|
|
78
81
|
}
|
|
79
|
-
const payloadURL = _PAYLOAD_EXTRACTION ?
|
|
82
|
+
const payloadURL = _PAYLOAD_EXTRACTION ? buildPayloadURL(ssrContext) : void 0;
|
|
80
83
|
const renderer = await getRenderer(ssrContext);
|
|
81
84
|
if (NUXT_EARLY_HINTS && !isRenderingPayload && !import.meta.prerender) {
|
|
82
85
|
const { link } = renderResourceHeaders({}, renderer.rendererContext);
|
|
@@ -508,6 +511,12 @@ function snapshotResponseHeaders(event) {
|
|
|
508
511
|
const headers = event.node.res.getHeaders();
|
|
509
512
|
return Object.entries(headers).map(([k, v]) => `${k}: ${Array.isArray(v) ? v.join(", ") : v}`).sort().join("\n");
|
|
510
513
|
}
|
|
514
|
+
function buildPayloadURL(ssrContext) {
|
|
515
|
+
const url = new URL(ssrContext.url, "http://localhost");
|
|
516
|
+
const payloadURL = joinURL(ssrContext.runtimeConfig.app.cdnURL || ssrContext.runtimeConfig.app.baseURL, url.pathname, PAYLOAD_FILENAME);
|
|
517
|
+
url.searchParams.set(PAYLOAD_BUILD_ID_PARAM, ssrContext.runtimeConfig.app.buildId);
|
|
518
|
+
return payloadURL + url.search;
|
|
519
|
+
}
|
|
511
520
|
function normalizeChunks(chunks) {
|
|
512
521
|
const result = [];
|
|
513
522
|
for (const _chunk of chunks) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/nitro-server-nightly",
|
|
3
|
-
"version": "4.5.1-
|
|
3
|
+
"version": "4.5.1-29746779.3590eee2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@nuxt/devalue": "^2.0.2",
|
|
35
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.5.1-
|
|
35
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.5.1-29746779.3590eee2",
|
|
36
36
|
"@unhead/vue": "^3.2.1",
|
|
37
37
|
"@vue/shared": "^3.5.40",
|
|
38
38
|
"consola": "^3.4.2",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@babel/plugin-proposal-decorators": "^7.25.0 || ^8.0.0",
|
|
65
65
|
"@babel/plugin-syntax-typescript": "^7.25.0 || ^8.0.0",
|
|
66
66
|
"@rollup/plugin-babel": "^6.0.0 || ^7.0.0",
|
|
67
|
-
"nuxt": "npm:nuxt-nightly@4.5.1-
|
|
67
|
+
"nuxt": "npm:nuxt-nightly@4.5.1-29746779.3590eee2"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"@babel/plugin-proposal-decorators": {
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@babel/plugin-proposal-decorators": "8.0.2",
|
|
82
82
|
"@babel/plugin-syntax-typescript": "8.0.3",
|
|
83
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.5.1-
|
|
83
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.5.1-29746779.3590eee2",
|
|
84
84
|
"@rollup/plugin-babel": "7.1.0",
|
|
85
|
-
"nuxt": "npm:nuxt-nightly@4.5.1-
|
|
85
|
+
"nuxt": "npm:nuxt-nightly@4.5.1-29746779.3590eee2",
|
|
86
86
|
"tsdown": "0.22.0",
|
|
87
87
|
"vitest": "4.1.10"
|
|
88
88
|
},
|