@nuxt/nitro-server-nightly 4.4.7-29652887.e4d5cc70 → 4.5.0-29657113.e77d3dbf

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 CHANGED
@@ -21,7 +21,7 @@ import { hasTTY, isCI, isWindows } from "std-env";
21
21
  import { ImpoundPlugin } from "impound";
22
22
  import { resolveModulePath } from "exsolve";
23
23
  import { runtimeDependencies } from "nitropack/runtime/meta";
24
- var version = "4.4.7-29652887.e4d5cc70";
24
+ var version = "4.5.0-29657113.e77d3dbf";
25
25
  function toArray(value) {
26
26
  return Array.isArray(value) ? value : [value];
27
27
  }
@@ -79,7 +79,7 @@ const handler = defineEventHandler(async (event) => {
79
79
  }
80
80
  }
81
81
  if (link.length) {
82
- ssrContext.head.push({ link }, { mode: "server" });
82
+ ssrContext.head.push({ link });
83
83
  }
84
84
  }
85
85
  const islandHead = {};
@@ -21,8 +21,7 @@ import { appHead, appTeleportAttrs, appTeleportTag, componentIslands } from "#in
21
21
  import entryIds from "#internal/nuxt/entry-ids.mjs";
22
22
  // @ts-expect-error virtual file
23
23
  import { entryFileName } from "#internal/entry-chunk.mjs";
24
- // @ts-expect-error virtual file
25
- import { buildAssetsURL, publicAssetsURL } from "#internal/nuxt/paths";
24
+ import { buildAssetsURL, publicAssetsURL } from "../utils/paths.mjs";
26
25
  import { relative } from "pathe";
27
26
  // @ts-expect-error private property consumed by vite-generated url helpers
28
27
  globalThis.__buildAssetsURL = buildAssetsURL;
@@ -70,9 +69,7 @@ async function renderRoute(event, ssrError) {
70
69
  const nitroApp = useNitroApp();
71
70
 
72
71
  const ssrContext = createSSRContext(event);
73
-
74
- const headEntryOptions = { mode: "server" };
75
- ssrContext.head.push(appHead, headEntryOptions);
72
+ ssrContext.head.push(appHead);
76
73
  if (ssrError) {
77
74
 
78
75
  const status = ssrError.status || ssrError.statusCode;
@@ -188,11 +185,10 @@ async function renderRoute(event, ssrError) {
188
185
  }
189
186
  }
190
187
  ssrContext.head.push({ script: [{
191
- tagPosition: "head",
192
- tagPriority: -2,
193
188
  type: "importmap",
194
- innerHTML: JSON.stringify({ imports: { "#entry": path } })
195
- }] }, headEntryOptions);
189
+
190
+ innerHTML: { imports: { "#entry": path } }
191
+ }] });
196
192
  }
197
193
 
198
194
 
@@ -206,7 +202,7 @@ async function renderRoute(event, ssrError) {
206
202
  rel: "modulepreload",
207
203
  crossorigin: "",
208
204
  href: payloadURL
209
- }] }, headEntryOptions);
205
+ }] });
210
206
  }
211
207
 
212
208
  if (inlinedStyles.length) {
@@ -228,7 +224,7 @@ async function renderRoute(event, ssrError) {
228
224
  });
229
225
  }
230
226
  if (link.length) {
231
- ssrContext.head.push({ link }, headEntryOptions);
227
+ ssrContext.head.push({ link });
232
228
  }
233
229
  if (!NO_SCRIPTS) {
234
230
 
@@ -239,15 +235,15 @@ async function renderRoute(event, ssrError) {
239
235
  ssrContext.modules?.delete(id);
240
236
  }
241
237
  }
242
- ssrContext.head.push({ link: getPreloadLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
243
- ssrContext.head.push({ link: getPrefetchLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
238
+ ssrContext.head.push({ link: getPreloadLinks(ssrContext, renderer.rendererContext) });
239
+ ssrContext.head.push({ link: getPrefetchLinks(ssrContext, renderer.rendererContext) });
244
240
 
245
241
  ssrContext.head.push({ script: _PAYLOAD_INLINE ? NUXT_JSON_PAYLOADS ? renderPayloadJsonScript({
246
242
  ssrContext,
247
- data: ssrContext.payload
243
+ data: stripInlineOnlyPayloadFields(ssrContext.payload)
248
244
  }) : renderPayloadScript({
249
245
  ssrContext,
250
- data: ssrContext.payload,
246
+ data: stripInlineOnlyPayloadFields(ssrContext.payload),
251
247
  routeOptions
252
248
  }) : NUXT_JSON_PAYLOADS ? renderPayloadJsonScript({
253
249
  ssrContext,
@@ -259,7 +255,6 @@ async function renderRoute(event, ssrError) {
259
255
  routeOptions,
260
256
  src: payloadURL
261
257
  }) }, {
262
- ...headEntryOptions,
263
258
 
264
259
  tagPosition: "bodyClose",
265
260
  tagPriority: "high"
@@ -276,9 +271,11 @@ async function renderRoute(event, ssrError) {
276
271
 
277
272
  tagPosition,
278
273
  crossorigin: ""
279
- })) }, headEntryOptions);
274
+ })) });
280
275
  }
281
- const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(ssrContext.head, renderSSRHeadOptions);
276
+
277
+
278
+ const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(ssrContext.head, renderSSRHeadOptions);
282
279
 
283
280
  const htmlContext = {
284
281
  htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
@@ -324,3 +321,10 @@ function joinAttrs(chunks) {
324
321
  function renderHTMLDocument(html) {
325
322
  return "<!DOCTYPE html>" + `<html${joinAttrs(html.htmlAttrs)}>` + `<head>${joinTags(html.head)}</head>` + `<body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body>` + "</html>";
326
323
  }
324
+ function stripInlineOnlyPayloadFields(payload) {
325
+ if (!payload.prefetchLinks) {
326
+ return payload;
327
+ }
328
+ const { prefetchLinks: _, ...rest } = payload;
329
+ return rest;
330
+ }
@@ -6,8 +6,7 @@ import { useRuntimeConfig } from "nitropack/runtime";
6
6
  import { NUXT_NO_SSR } from "#internal/nuxt/nitro-config.mjs";
7
7
  // @ts-expect-error virtual file
8
8
  import { appRootAttrs, appRootTag, appSpaLoaderAttrs, appSpaLoaderTag, spaLoadingTemplateOutside } from "#internal/nuxt.config.mjs";
9
- // @ts-expect-error virtual file
10
- import { buildAssetsURL, publicAssetsURL } from "#internal/nuxt/paths";
9
+ import { buildAssetsURL, publicAssetsURL } from "../paths.mjs";
11
10
  // @ts-expect-error private property consumed by vite-generated url helpers
12
11
  globalThis.__buildAssetsURL = buildAssetsURL;
13
12
  // @ts-expect-error private property consumed by vite-generated url helpers
@@ -14,10 +14,11 @@ export declare function renderPayloadScript(opts: {
14
14
  src?: string;
15
15
  }): Script[];
16
16
  interface SplitPayload {
17
- initial: Omit<NuxtPayload, "data">;
17
+ initial: Omit<NuxtPayload, "data" | "prefetchLinks">;
18
18
  payload: {
19
19
  data?: NuxtPayload["data"];
20
20
  prerenderedAt?: NuxtPayload["prerenderedAt"];
21
+ prefetchLinks?: NuxtPayload["prefetchLinks"];
21
22
  };
22
23
  }
23
24
  export declare function splitPayload(ssrContext: NuxtSSRContext): SplitPayload;
@@ -59,15 +59,19 @@ export function renderPayloadScript(opts) {
59
59
  return [{ innerHTML: multiApp ? multiAppPayload : singleAppPayload }];
60
60
  }
61
61
  export function splitPayload(ssrContext) {
62
- const { data, prerenderedAt, ...initial } = ssrContext.payload;
62
+ const { data, prerenderedAt, prefetchLinks, ...initial } = ssrContext.payload;
63
+ const payload = {
64
+ data,
65
+ prerenderedAt
66
+ };
67
+ if (prefetchLinks?.length) {
68
+ payload.prefetchLinks = prefetchLinks;
69
+ }
63
70
  return {
64
71
  initial: {
65
72
  ...initial,
66
73
  prerenderedAt
67
74
  },
68
- payload: {
69
- data,
70
- prerenderedAt
71
- }
75
+ payload
72
76
  };
73
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "4.4.7-29652887.e4d5cc70",
3
+ "version": "4.5.0-29657113.e77d3dbf",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -27,8 +27,8 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@nuxt/devalue": "^2.0.2",
30
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.7-29652887.e4d5cc70",
31
- "@unhead/vue": "^2.1.15",
30
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.5.0-29657113.e77d3dbf",
31
+ "@unhead/vue": "^3.1.0",
32
32
  "@vue/shared": "^3.5.34",
33
33
  "consola": "^3.4.2",
34
34
  "defu": "^6.1.7",
@@ -58,7 +58,7 @@
58
58
  "@babel/plugin-proposal-decorators": "^7.25.0",
59
59
  "@babel/plugin-syntax-typescript": "^7.25.0",
60
60
  "@rollup/plugin-babel": "^6.0.0 || ^7.0.0",
61
- "nuxt": "npm:nuxt-nightly@4.4.7-29652887.e4d5cc70"
61
+ "nuxt": "npm:nuxt-nightly@4.5.0-29657113.e77d3dbf"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "@babel/plugin-proposal-decorators": {
@@ -74,9 +74,9 @@
74
74
  "devDependencies": {
75
75
  "@babel/plugin-proposal-decorators": "7.29.0",
76
76
  "@babel/plugin-syntax-typescript": "7.28.6",
77
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.7-29652887.e4d5cc70",
77
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.5.0-29657113.e77d3dbf",
78
78
  "@rollup/plugin-babel": "7.0.0",
79
- "nuxt": "npm:nuxt-nightly@4.4.7-29652887.e4d5cc70",
79
+ "nuxt": "npm:nuxt-nightly@4.5.0-29657113.e77d3dbf",
80
80
  "obuild": "0.4.35",
81
81
  "vitest": "4.1.6"
82
82
  },