@jay-framework/production-server 0.19.5 → 0.19.7
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.js
CHANGED
|
@@ -6,8 +6,8 @@ import path from "node:path";
|
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { DevSlowlyChangingPhase, slowRenderInstances, scanPlugins, runLoadParams, parseCookies } from "@jay-framework/stack-server-runtime";
|
|
9
|
-
import { l as loadProductionPageParts, g as buildPagePartsConfig, d as initializeServices, r as registerActionsFromManifest, i as isActionRequest, a as fetchActionRequest, c as fetchStaticFile, m as matchRequest, f as fetchPageRequest, F as FilesystemArtifactStore } from "./init-services-
|
|
10
|
-
import { e, b } from "./init-services-
|
|
9
|
+
import { l as loadProductionPageParts, g as buildPagePartsConfig, d as initializeServices, r as registerActionsFromManifest, i as isActionRequest, a as fetchActionRequest, c as fetchStaticFile, m as matchRequest, f as fetchPageRequest, F as FilesystemArtifactStore } from "./init-services-mT6H6d4z.js";
|
|
10
|
+
import { e, b } from "./init-services-mT6H6d4z.js";
|
|
11
11
|
import crypto from "node:crypto";
|
|
12
12
|
import fs$1 from "node:fs";
|
|
13
13
|
import { jayRuntime } from "@jay-framework/vite-plugin";
|
|
@@ -412,24 +412,27 @@ async function fetchPageRequest(match, manifest, requestUrl, artifacts, staticBa
|
|
|
412
412
|
}
|
|
413
413
|
const fastViewState = fastResult.rendered || {};
|
|
414
414
|
const fastCarryForward = fastResult.carryForward || {};
|
|
415
|
+
const instanceSlowVS = cached.carryForward?.__instances?.slowViewStates;
|
|
416
|
+
const fullSlowViewState = instanceSlowVS && Object.keys(instanceSlowVS).length > 0 ? { ...cached.slowViewState, __headlessInstances: instanceSlowVS } : cached.slowViewState;
|
|
417
|
+
const fullViewState = deepMergeViewStates(
|
|
418
|
+
fullSlowViewState,
|
|
419
|
+
fastViewState,
|
|
420
|
+
route.trackByMap || {}
|
|
421
|
+
);
|
|
415
422
|
const headTagSources = [];
|
|
416
|
-
if (route.headMeta)
|
|
417
|
-
headTagSources.push(headMetaToHeadTags(route.headMeta));
|
|
418
423
|
const slowHeadTags = cached.carryForward.__slowHeadTags;
|
|
419
424
|
if (slowHeadTags)
|
|
420
425
|
headTagSources.push(...slowHeadTags);
|
|
421
426
|
const fastHeadTags = fastResult.headTags;
|
|
422
427
|
if (fastHeadTags)
|
|
423
428
|
headTagSources.push(fastHeadTags);
|
|
429
|
+
const templateHeadTags = headMetaToHeadTags(route.headMeta, fullViewState);
|
|
430
|
+
if (templateHeadTags.length > 0)
|
|
431
|
+
headTagSources.push(templateHeadTags);
|
|
424
432
|
const headTags = headTagSources.length > 0 ? mergeHeadTags(headTagSources) : [];
|
|
425
433
|
const hasCustomTitle = headTags.some((t) => t.tag?.toLowerCase() === "title");
|
|
426
434
|
const titleTag = hasCustomTitle ? "" : " <title>Vite + TS</title>\n";
|
|
427
435
|
const headTagsHtml = headTags.length > 0 ? serializeHeadTags(headTags) + "\n" : "";
|
|
428
|
-
const fullViewState = deepMergeViewStates(
|
|
429
|
-
cached.slowViewState,
|
|
430
|
-
fastViewState,
|
|
431
|
-
route.trackByMap || {}
|
|
432
|
-
);
|
|
433
436
|
const serverElementPath = route.serverElementPath || instance.serverElementPath;
|
|
434
437
|
const tLoadStart = Date.now();
|
|
435
438
|
const serverElement = await artifacts.loadServerElement(serverElementPath);
|
|
@@ -445,21 +448,7 @@ async function fetchPageRequest(match, manifest, requestUrl, artifacts, staticBa
|
|
|
445
448
|
const cssUrl = instance.clientCssPath ? `${staticBaseUrl}${instance.clientCssPath}` : "";
|
|
446
449
|
const cssPreload = cssUrl ? ` <link rel="preload" href="${cssUrl}" as="style" />` : "";
|
|
447
450
|
const cssLink = cssUrl ? ` <link rel="stylesheet" href="${cssUrl}" />` : "";
|
|
448
|
-
const
|
|
449
|
-
for (const url of route.cssImports ?? []) {
|
|
450
|
-
if (url.includes("fonts.googleapis.com")) {
|
|
451
|
-
cssImportHints.push(
|
|
452
|
-
' <link rel="preconnect" href="https://fonts.googleapis.com" />'
|
|
453
|
-
);
|
|
454
|
-
cssImportHints.push(
|
|
455
|
-
' <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />'
|
|
456
|
-
);
|
|
457
|
-
cssImportHints.push(` <link rel="stylesheet" href="${url}" />`);
|
|
458
|
-
} else {
|
|
459
|
-
cssImportHints.push(` <link rel="preload" href="${url}" as="style" />`);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
const cssImportPreloads = cssImportHints.join("\n");
|
|
451
|
+
const cssImportPreloads = (route.cssImports ?? []).map((url) => ` <link rel="preload" href="${url}" as="style" />`).join("\n");
|
|
463
452
|
const encoder = new TextEncoder();
|
|
464
453
|
const stream = new ReadableStream({
|
|
465
454
|
async start(controller) {
|
package/dist/serve-index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/production-server",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"test:watch": "vitest"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@jay-framework/compiler-jay-html": "^0.19.
|
|
34
|
-
"@jay-framework/compiler-jay-stack": "^0.19.
|
|
35
|
-
"@jay-framework/compiler-shared": "^0.19.
|
|
36
|
-
"@jay-framework/fullstack-component": "^0.19.
|
|
37
|
-
"@jay-framework/logger": "^0.19.
|
|
38
|
-
"@jay-framework/ssr-runtime": "^0.19.
|
|
39
|
-
"@jay-framework/stack-route-scanner": "^0.19.
|
|
40
|
-
"@jay-framework/stack-server-runtime": "^0.19.
|
|
41
|
-
"@jay-framework/view-state-merge": "^0.19.
|
|
42
|
-
"@jay-framework/vite-plugin": "^0.19.
|
|
33
|
+
"@jay-framework/compiler-jay-html": "^0.19.7",
|
|
34
|
+
"@jay-framework/compiler-jay-stack": "^0.19.7",
|
|
35
|
+
"@jay-framework/compiler-shared": "^0.19.7",
|
|
36
|
+
"@jay-framework/fullstack-component": "^0.19.7",
|
|
37
|
+
"@jay-framework/logger": "^0.19.7",
|
|
38
|
+
"@jay-framework/ssr-runtime": "^0.19.7",
|
|
39
|
+
"@jay-framework/stack-route-scanner": "^0.19.7",
|
|
40
|
+
"@jay-framework/stack-server-runtime": "^0.19.7",
|
|
41
|
+
"@jay-framework/view-state-merge": "^0.19.7",
|
|
42
|
+
"@jay-framework/vite-plugin": "^0.19.7",
|
|
43
43
|
"vite": "^5.0.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@jay-framework/dev-environment": "^0.19.
|
|
46
|
+
"@jay-framework/dev-environment": "^0.19.7",
|
|
47
47
|
"@types/node": "^22.15.21",
|
|
48
48
|
"rimraf": "^5.0.5",
|
|
49
49
|
"tsup": "^8.0.1",
|