@nuxt/nitro-server-nightly 4.3.0-29442002.5d974989 → 4.3.0-29442098.a3a19e40
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
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
|
|
11
11
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
12
12
|
<a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
13
|
-
<a href="https://deepwiki.com/nuxt/nuxt"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
14
13
|
</p>
|
|
15
14
|
|
|
16
15
|
Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { isWindows } from 'std-env';
|
|
|
19
19
|
import { ImpoundPlugin } from 'impound';
|
|
20
20
|
import { resolveModulePath } from 'exsolve';
|
|
21
21
|
|
|
22
|
-
const version = "4.3.0-
|
|
22
|
+
const version = "4.3.0-29442098.a3a19e40";
|
|
23
23
|
const nitroBuilder = {
|
|
24
24
|
version: version};
|
|
25
25
|
|
|
@@ -316,21 +316,17 @@ async function bundle(nuxt) {
|
|
|
316
316
|
// this will be overridden in vite plugin
|
|
317
317
|
"#internal/entry-chunk.mjs": () => `export const entryFileName = undefined`,
|
|
318
318
|
"#internal/nuxt/entry-ids.mjs": () => `export default []`,
|
|
319
|
-
"#internal/nuxt/nitro-config.mjs": () =>
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
`export const NUXT_PAYLOAD_EXTRACTION = ${!!nuxt.options.experimental.payloadExtraction}`,
|
|
331
|
-
`export const NUXT_RUNTIME_PAYLOAD_EXTRACTION = ${hasCachedRoutes}`
|
|
332
|
-
].join("\n");
|
|
333
|
-
}
|
|
319
|
+
"#internal/nuxt/nitro-config.mjs": () => [
|
|
320
|
+
`export const NUXT_NO_SSR = ${nuxt.options.ssr === false}`,
|
|
321
|
+
`export const NUXT_EARLY_HINTS = ${nuxt.options.experimental.writeEarlyHints !== false}`,
|
|
322
|
+
`export const NUXT_NO_SCRIPTS = ${nuxt.options.features.noScripts === "all" || !!nuxt.options.features.noScripts && !nuxt.options.dev}`,
|
|
323
|
+
`export const NUXT_INLINE_STYLES = ${!!nuxt.options.features.inlineStyles}`,
|
|
324
|
+
`export const PARSE_ERROR_DATA = ${!!nuxt.options.experimental.parseErrorData}`,
|
|
325
|
+
`export const NUXT_JSON_PAYLOADS = ${!!nuxt.options.experimental.renderJsonPayloads}`,
|
|
326
|
+
`export const NUXT_ASYNC_CONTEXT = ${!!nuxt.options.experimental.asyncContext}`,
|
|
327
|
+
`export const NUXT_SHARED_DATA = ${!!nuxt.options.experimental.sharedPrerenderData}`,
|
|
328
|
+
`export const NUXT_PAYLOAD_EXTRACTION = ${!!nuxt.options.experimental.payloadExtraction}`
|
|
329
|
+
].join("\n")
|
|
334
330
|
},
|
|
335
331
|
routeRules: {
|
|
336
332
|
"/__nuxt_error": { cache: false }
|
|
@@ -497,10 +493,6 @@ async function bundle(nuxt) {
|
|
|
497
493
|
value = normalizedRules;
|
|
498
494
|
}
|
|
499
495
|
}
|
|
500
|
-
if (name === "cache" || name === "isr") {
|
|
501
|
-
name = "payload";
|
|
502
|
-
value = Boolean(value);
|
|
503
|
-
}
|
|
504
496
|
return `${name}: ${JSON.stringify(value)}`;
|
|
505
497
|
}).join(",")}}`;
|
|
506
498
|
}
|
|
@@ -512,24 +504,6 @@ async function bundle(nuxt) {
|
|
|
512
504
|
`;
|
|
513
505
|
}
|
|
514
506
|
});
|
|
515
|
-
if (nuxt.options.experimental.payloadExtraction) {
|
|
516
|
-
nuxt.hook("nitro:init", (nitro2) => {
|
|
517
|
-
nitro2.hooks.hook("build:before", (nitro3) => {
|
|
518
|
-
for (const [route, value] of Object.entries(nitro3.options.routeRules)) {
|
|
519
|
-
if ((value.isr || value.cache) && !route.endsWith("*") && !route.endsWith("/_payload.json")) {
|
|
520
|
-
const payloadKey = route + "/_payload.json";
|
|
521
|
-
const defaults = {};
|
|
522
|
-
for (const key of ["isr", "cache"]) {
|
|
523
|
-
if (key in value) {
|
|
524
|
-
defaults[key] = value[key];
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
nitro3.options.routeRules[payloadKey] = defu(nitro3.options.routeRules[payloadKey], defaults);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
507
|
if (nuxt.options.experimental.appManifest) {
|
|
534
508
|
const buildId = nuxt.options.runtimeConfig.app.buildId ||= nuxt.options.buildId;
|
|
535
509
|
const buildTimestamp = Date.now();
|
|
@@ -12,7 +12,7 @@ import { createSSRContext, setSSRError } from "../utils/renderer/app.js";
|
|
|
12
12
|
import { renderInlineStyles } from "../utils/renderer/inline-styles.js";
|
|
13
13
|
import { replaceIslandTeleports } from "../utils/renderer/islands.js";
|
|
14
14
|
import { renderSSRHeadOptions } from "#internal/unhead.config.mjs";
|
|
15
|
-
import { NUXT_ASYNC_CONTEXT, NUXT_EARLY_HINTS, NUXT_INLINE_STYLES, NUXT_JSON_PAYLOADS, NUXT_NO_SCRIPTS, NUXT_PAYLOAD_EXTRACTION,
|
|
15
|
+
import { NUXT_ASYNC_CONTEXT, NUXT_EARLY_HINTS, NUXT_INLINE_STYLES, NUXT_JSON_PAYLOADS, NUXT_NO_SCRIPTS, NUXT_PAYLOAD_EXTRACTION, PARSE_ERROR_DATA } from "#internal/nuxt/nitro-config.mjs";
|
|
16
16
|
import { appHead, appTeleportAttrs, appTeleportTag, componentIslands, appManifest as isAppManifestEnabled } from "#internal/nuxt.config.mjs";
|
|
17
17
|
import entryIds from "#internal/nuxt/entry-ids.mjs";
|
|
18
18
|
import { entryFileName } from "#internal/entry-chunk.mjs";
|
|
@@ -55,9 +55,7 @@ export default defineRenderHandler(async (event) => {
|
|
|
55
55
|
}
|
|
56
56
|
setSSRError(ssrContext, ssrError);
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
const _PAYLOAD_EXTRACTION = !ssrContext.noSSR && (import.meta.prerender && NUXT_PAYLOAD_EXTRACTION || NUXT_RUNTIME_PAYLOAD_EXTRACTION && (routeOptions.isr || routeOptions.cache));
|
|
60
|
-
const isRenderingPayload = _PAYLOAD_EXTRACTION && PAYLOAD_URL_RE.test(ssrContext.url);
|
|
58
|
+
const isRenderingPayload = NUXT_PAYLOAD_EXTRACTION && PAYLOAD_URL_RE.test(ssrContext.url);
|
|
61
59
|
if (isRenderingPayload) {
|
|
62
60
|
const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
|
|
63
61
|
ssrContext.url = url;
|
|
@@ -66,9 +64,11 @@ export default defineRenderHandler(async (event) => {
|
|
|
66
64
|
return payloadCache.getItem(url);
|
|
67
65
|
}
|
|
68
66
|
}
|
|
67
|
+
const routeOptions = getRouteRules(event);
|
|
69
68
|
if (routeOptions.ssr === false) {
|
|
70
69
|
ssrContext.noSSR = true;
|
|
71
70
|
}
|
|
71
|
+
const _PAYLOAD_EXTRACTION = import.meta.prerender && NUXT_PAYLOAD_EXTRACTION && !ssrContext.noSSR;
|
|
72
72
|
const payloadURL = _PAYLOAD_EXTRACTION ? joinURL(ssrContext.runtimeConfig.app.cdnURL || ssrContext.runtimeConfig.app.baseURL, ssrContext.url.replace(/\?.*$/, ""), PAYLOAD_FILENAME) + "?" + ssrContext.runtimeConfig.app.buildId : void 0;
|
|
73
73
|
const renderer = await getRenderer(ssrContext);
|
|
74
74
|
if (NUXT_EARLY_HINTS && !isRenderingPayload && !import.meta.prerender) {
|
|
@@ -105,7 +105,7 @@ export default defineRenderHandler(async (event) => {
|
|
|
105
105
|
}
|
|
106
106
|
return response;
|
|
107
107
|
}
|
|
108
|
-
if (_PAYLOAD_EXTRACTION
|
|
108
|
+
if (_PAYLOAD_EXTRACTION) {
|
|
109
109
|
appendResponseHeader(event, "x-nitro-prerender", joinURL(ssrContext.url.replace(/\?.*$/, ""), PAYLOAD_FILENAME));
|
|
110
110
|
await payloadCache.setItem(ssrContext.url === "/" ? "/" : ssrContext.url.replace(/\/$/, ""), renderPayloadResponse(ssrContext));
|
|
111
111
|
}
|
|
@@ -168,7 +168,7 @@ export default defineRenderHandler(async (event) => {
|
|
|
168
168
|
link: getPrefetchLinks(ssrContext, renderer.rendererContext)
|
|
169
169
|
}, headEntryOptions);
|
|
170
170
|
ssrContext.head.push({
|
|
171
|
-
script: _PAYLOAD_EXTRACTION ? NUXT_JSON_PAYLOADS ? renderPayloadJsonScript({ ssrContext, data: splitPayload(ssrContext).initial, src: payloadURL }) : renderPayloadScript({ ssrContext, data: splitPayload(ssrContext).initial,
|
|
171
|
+
script: _PAYLOAD_EXTRACTION ? NUXT_JSON_PAYLOADS ? renderPayloadJsonScript({ ssrContext, data: splitPayload(ssrContext).initial, src: payloadURL }) : renderPayloadScript({ ssrContext, data: splitPayload(ssrContext).initial, src: payloadURL }) : NUXT_JSON_PAYLOADS ? renderPayloadJsonScript({ ssrContext, data: ssrContext.payload }) : renderPayloadScript({ ssrContext, data: ssrContext.payload })
|
|
172
172
|
}, {
|
|
173
173
|
...headEntryOptions,
|
|
174
174
|
// this should come before another end of body scripts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RenderResponse } from 'nitropack/types';
|
|
2
2
|
import type { Script } from '@unhead/vue';
|
|
3
3
|
import type { NuxtPayload, NuxtSSRContext } from 'nuxt/app';
|
|
4
4
|
export declare function renderPayloadResponse(ssrContext: NuxtSSRContext): RenderResponse;
|
|
@@ -9,7 +9,6 @@ export declare function renderPayloadJsonScript(opts: {
|
|
|
9
9
|
}): Script[];
|
|
10
10
|
export declare function renderPayloadScript(opts: {
|
|
11
11
|
ssrContext: NuxtSSRContext;
|
|
12
|
-
routeOptions: NitroRouteRules;
|
|
13
12
|
data?: any;
|
|
14
13
|
src?: string;
|
|
15
14
|
}): Script[];
|
|
@@ -2,7 +2,7 @@ import { getResponseStatus, getResponseStatusText } from "h3";
|
|
|
2
2
|
import devalue from "@nuxt/devalue";
|
|
3
3
|
import { stringify, uneval } from "devalue";
|
|
4
4
|
import { appId, multiApp } from "#internal/nuxt.config.mjs";
|
|
5
|
-
import { NUXT_JSON_PAYLOADS, NUXT_NO_SSR, NUXT_PAYLOAD_EXTRACTION
|
|
5
|
+
import { NUXT_JSON_PAYLOADS, NUXT_NO_SSR, NUXT_PAYLOAD_EXTRACTION } from "#internal/nuxt/nitro-config.mjs";
|
|
6
6
|
export function renderPayloadResponse(ssrContext) {
|
|
7
7
|
return {
|
|
8
8
|
body: NUXT_JSON_PAYLOADS ? stringify(splitPayload(ssrContext).payload, ssrContext["~payloadReducers"]) : `export default ${devalue(splitPayload(ssrContext).payload)}`,
|
|
@@ -38,7 +38,7 @@ export function renderPayloadJsonScript(opts) {
|
|
|
38
38
|
}
|
|
39
39
|
export function renderPayloadScript(opts) {
|
|
40
40
|
opts.data.config = opts.ssrContext.config;
|
|
41
|
-
const _PAYLOAD_EXTRACTION =
|
|
41
|
+
const _PAYLOAD_EXTRACTION = import.meta.prerender && NUXT_PAYLOAD_EXTRACTION && !opts.ssrContext.noSSR;
|
|
42
42
|
const nuxtData = devalue(opts.data);
|
|
43
43
|
if (_PAYLOAD_EXTRACTION) {
|
|
44
44
|
const singleAppPayload2 = `import p from "${opts.src}";window.__NUXT__={...p,...(${nuxtData})}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/nitro-server-nightly",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-29442098.a3a19e40",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@nuxt/devalue": "^2.0.2",
|
|
22
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-
|
|
22
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-29442098.a3a19e40",
|
|
23
23
|
"@unhead/vue": "^2.0.19",
|
|
24
24
|
"@vue/shared": "^3.5.26",
|
|
25
25
|
"consola": "^3.4.2",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"vue-devtools-stub": "^0.1.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"nuxt": "npm:nuxt-nightly@4.3.0-
|
|
50
|
+
"nuxt": "npm:nuxt-nightly@4.3.0-29442098.a3a19e40"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-
|
|
54
|
-
"nuxt": "npm:nuxt-nightly@4.3.0-
|
|
53
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29442098.a3a19e40",
|
|
54
|
+
"nuxt": "npm:nuxt-nightly@4.3.0-29442098.a3a19e40",
|
|
55
55
|
"unbuild": "3.6.1",
|
|
56
56
|
"vitest": "3.2.4"
|
|
57
57
|
},
|