nuxt-nightly 4.2.0-29331210.766a637b → 4.2.0-29331654.df559ad9
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.
|
@@ -10,7 +10,7 @@ import { getQuery as getURLQuery, joinURL } from "ufo";
|
|
|
10
10
|
import { propsToString, renderSSRHead } from "@unhead/vue/server";
|
|
11
11
|
import destr from "destr";
|
|
12
12
|
import { defineRenderHandler, getRouteRules, useNitroApp } from "nitropack/runtime";
|
|
13
|
-
import { getRenderer } from "../utils/renderer/build-files.js";
|
|
13
|
+
import { getEntryIds, getRenderer } from "../utils/renderer/build-files.js";
|
|
14
14
|
import { payloadCache } from "../utils/cache.js";
|
|
15
15
|
import { renderPayloadJsonScript, renderPayloadResponse, renderPayloadScript, splitPayload } from "../utils/renderer/payload.js";
|
|
16
16
|
import { createSSRContext, setSSRError } from "../utils/renderer/app.js";
|
|
@@ -18,7 +18,6 @@ import { renderInlineStyles } from "../utils/renderer/inline-styles.js";
|
|
|
18
18
|
import { replaceIslandTeleports } from "../utils/renderer/islands.js";
|
|
19
19
|
import { renderSSRHeadOptions } from "#internal/unhead.config.mjs";
|
|
20
20
|
import { appHead, appTeleportAttrs, appTeleportTag, componentIslands, appManifest as isAppManifestEnabled } from "#internal/nuxt.config.mjs";
|
|
21
|
-
import entryIds from "#internal/nuxt/entry-ids.mjs";
|
|
22
21
|
import { entryFileName } from "#internal/entry-chunk.mjs";
|
|
23
22
|
import { buildAssetsURL, publicAssetsURL } from "#internal/nuxt/paths";
|
|
24
23
|
import { relative } from "pathe";
|
|
@@ -78,7 +77,7 @@ export default defineRenderHandler(async (event) => {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
if (process.env.NUXT_INLINE_STYLES) {
|
|
81
|
-
for (const id of
|
|
80
|
+
for (const id of await getEntryIds()) {
|
|
82
81
|
ssrContext.modules.add(id);
|
|
83
82
|
}
|
|
84
83
|
}
|
|
@@ -10,19 +10,21 @@ const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
|
|
10
10
|
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
|
11
11
|
const getServerEntry = () => import("#build/dist/server/server.mjs").then((r) => r.default || r);
|
|
12
12
|
const getClientManifest = () => import("#build/dist/server/client.manifest.mjs").then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
|
13
|
-
const getPrecomputedDependencies = () => import("#build/dist/server/client.precomputed.mjs").then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
|
14
13
|
export const getSSRRenderer = lazyCachedFunction(async () => {
|
|
14
|
+
const manifest = await getClientManifest();
|
|
15
|
+
if (!manifest) {
|
|
16
|
+
throw new Error("client.manifest is not available");
|
|
17
|
+
}
|
|
15
18
|
const createSSRApp = await getServerEntry();
|
|
16
19
|
if (!createSSRApp) {
|
|
17
20
|
throw new Error("Server bundle is not available");
|
|
18
21
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
precomputed,
|
|
22
|
-
manifest: import.meta.dev ? await getClientManifest() : void 0,
|
|
22
|
+
const options = {
|
|
23
|
+
manifest,
|
|
23
24
|
renderToString,
|
|
24
25
|
buildAssetsURL
|
|
25
|
-
}
|
|
26
|
+
};
|
|
27
|
+
const renderer = createRenderer(createSSRApp, options);
|
|
26
28
|
async function renderToString(input, context) {
|
|
27
29
|
const html = await _renderToString(input, context);
|
|
28
30
|
if (import.meta.dev && process.env.NUXT_VITE_NODE_OPTIONS) {
|
|
@@ -33,7 +35,7 @@ export const getSSRRenderer = lazyCachedFunction(async () => {
|
|
|
33
35
|
return renderer;
|
|
34
36
|
});
|
|
35
37
|
const getSPARenderer = lazyCachedFunction(async () => {
|
|
36
|
-
const
|
|
38
|
+
const manifest = await getClientManifest();
|
|
37
39
|
const spaTemplate = await import("#spa-template").then((r) => r.template).catch(() => "").then((r) => {
|
|
38
40
|
if (spaLoadingTemplateOutside) {
|
|
39
41
|
const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>`;
|
|
@@ -45,13 +47,13 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
|
|
45
47
|
return APP_ROOT_OPEN_TAG + r + APP_ROOT_CLOSE_TAG;
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
precomputed,
|
|
51
|
-
manifest: import.meta.dev ? await getClientManifest() : void 0,
|
|
50
|
+
const options = {
|
|
51
|
+
manifest,
|
|
52
52
|
renderToString: () => spaTemplate,
|
|
53
53
|
buildAssetsURL
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
|
+
const renderer = createRenderer(() => () => {
|
|
56
|
+
}, options);
|
|
55
57
|
const result = await renderer.renderToString({});
|
|
56
58
|
const renderToString = (ssrContext) => {
|
|
57
59
|
const config = useRuntimeConfig(ssrContext.event);
|
|
@@ -84,3 +86,12 @@ export function getRenderer(ssrContext) {
|
|
|
84
86
|
return process.env.NUXT_NO_SSR || ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
|
|
85
87
|
}
|
|
86
88
|
export const getSSRStyles = lazyCachedFunction(() => import("#build/dist/server/styles.mjs").then((r) => r.default || r));
|
|
89
|
+
export const getEntryIds = () => getClientManifest().then((r) => {
|
|
90
|
+
const entryIds = [];
|
|
91
|
+
for (const entry of Object.values(r)) {
|
|
92
|
+
if (entry._globalCSS) {
|
|
93
|
+
entryIds.push(entry.src);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return entryIds;
|
|
97
|
+
});
|
package/dist/index.mjs
CHANGED
|
@@ -3830,7 +3830,7 @@ function addDeclarationTemplates(ctx, options) {
|
|
|
3830
3830
|
});
|
|
3831
3831
|
}
|
|
3832
3832
|
|
|
3833
|
-
const version = "4.2.0-
|
|
3833
|
+
const version = "4.2.0-29331654.df559ad9";
|
|
3834
3834
|
|
|
3835
3835
|
const createImportProtectionPatterns = (nuxt, options) => {
|
|
3836
3836
|
const patterns = [];
|
|
@@ -4206,8 +4206,7 @@ async function initNitro(nuxt) {
|
|
|
4206
4206
|
"#internal/nuxt/app-config": () => nuxt.vfs["#build/app.config.mjs"]?.replace(/\/\*\* client \*\*\/[\s\S]*\/\*\* client-end \*\*\//, "") || "",
|
|
4207
4207
|
"#spa-template": async () => `export const template = ${JSON.stringify(await spaLoadingTemplate(nuxt))}`,
|
|
4208
4208
|
// this will be overridden in vite plugin
|
|
4209
|
-
"#internal/entry-chunk.mjs": () => `export const entryFileName = undefined
|
|
4210
|
-
"#internal/nuxt/entry-ids.mjs": () => `export default []`
|
|
4209
|
+
"#internal/entry-chunk.mjs": () => `export const entryFileName = undefined`
|
|
4211
4210
|
},
|
|
4212
4211
|
routeRules: {
|
|
4213
4212
|
"/__nuxt_error": { cache: false }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-nightly",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-29331654.df559ad9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
|
|
68
68
|
"@nuxt/devalue": "^2.0.2",
|
|
69
69
|
"@nuxt/devtools": "^2.6.5",
|
|
70
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-
|
|
71
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-
|
|
70
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-29331654.df559ad9",
|
|
71
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-29331654.df559ad9",
|
|
72
72
|
"@nuxt/telemetry": "^2.6.6",
|
|
73
|
-
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.0-
|
|
73
|
+
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.0-29331654.df559ad9",
|
|
74
74
|
"@unhead/vue": "^2.0.14",
|
|
75
75
|
"@vue/shared": "^3.5.22",
|
|
76
76
|
"c12": "^3.3.0",
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
"radix3": "^1.1.2",
|
|
113
113
|
"scule": "^1.3.0",
|
|
114
114
|
"semver": "^7.7.2",
|
|
115
|
-
"seroval": "^1.3.2",
|
|
116
115
|
"std-env": "^3.9.0",
|
|
117
116
|
"tinyglobby": "^0.2.15",
|
|
118
117
|
"ufo": "^1.6.1",
|