@modern-js/server-core 3.10.2 → 3.10.4
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.
|
@@ -48,6 +48,7 @@ var __webpack_exports__ = {};
|
|
|
48
48
|
});
|
|
49
49
|
const universal_namespaceObject = require("@modern-js/utils/universal");
|
|
50
50
|
const trie_router_namespaceObject = require("hono/router/trie-router");
|
|
51
|
+
const url_namespaceObject = require("hono/utils/url");
|
|
51
52
|
const external_constants_js_namespaceObject = require("../../constants.js");
|
|
52
53
|
const index_js_namespaceObject = require("../../utils/index.js");
|
|
53
54
|
const external_csrRscRender_js_namespaceObject = require("./csrRscRender.js");
|
|
@@ -112,7 +113,7 @@ var __webpack_exports__ = {};
|
|
|
112
113
|
const framework = (0, universal_namespaceObject.cutNameByHyphen)(metaName || 'modern-js');
|
|
113
114
|
const fallbackHeader = `x-${framework}-ssr-fallback`;
|
|
114
115
|
return async (req, { monitors, nodeReq, templates, serverManifest, rscClientManifest, rscSSRManifest, rscServerManifest, locals, matchEntryName, matchPathname, loaderContext, contextForceCSR, reporter })=>{
|
|
115
|
-
const forMatchpathname = matchPathname ?? (0,
|
|
116
|
+
const forMatchpathname = matchPathname ?? (0, url_namespaceObject.getPath)(req);
|
|
116
117
|
const [routeInfo, params] = matchRoute(router, forMatchpathname, matchEntryName);
|
|
117
118
|
let fallbackReason = null;
|
|
118
119
|
const fallbackWrapper = (reason)=>{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cutNameByHyphen } from "@modern-js/utils/universal";
|
|
2
2
|
import { TrieRouter } from "hono/router/trie-router";
|
|
3
|
+
import { getPath } from "hono/utils/url";
|
|
3
4
|
import { X_MODERNJS_RENDER } from "../../constants.mjs";
|
|
4
|
-
import { ErrorDigest, createErrorHtml,
|
|
5
|
+
import { ErrorDigest, createErrorHtml, getRuntimeEnv, parseHeaders, parseQuery, sortRoutes, uniqueKeyByRoute } from "../../utils/index.mjs";
|
|
5
6
|
import { csrRscRender } from "./csrRscRender.mjs";
|
|
6
7
|
import { dataHandler } from "./dataHandler.mjs";
|
|
7
8
|
import { renderRscHandler } from "./renderRscHandler.mjs";
|
|
@@ -64,7 +65,7 @@ async function createRender({ routes, pwd, metaName, staticGenerate, cacheConfig
|
|
|
64
65
|
const framework = cutNameByHyphen(metaName || 'modern-js');
|
|
65
66
|
const fallbackHeader = `x-${framework}-ssr-fallback`;
|
|
66
67
|
return async (req, { monitors, nodeReq, templates, serverManifest, rscClientManifest, rscSSRManifest, rscServerManifest, locals, matchEntryName, matchPathname, loaderContext, contextForceCSR, reporter })=>{
|
|
67
|
-
const forMatchpathname = matchPathname ??
|
|
68
|
+
const forMatchpathname = matchPathname ?? getPath(req);
|
|
68
69
|
const [routeInfo, params] = matchRoute(router, forMatchpathname, matchEntryName);
|
|
69
70
|
let fallbackReason = null;
|
|
70
71
|
const fallbackWrapper = (reason)=>{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { cutNameByHyphen } from "@modern-js/utils/universal";
|
|
3
3
|
import { TrieRouter } from "hono/router/trie-router";
|
|
4
|
+
import { getPath } from "hono/utils/url";
|
|
4
5
|
import { X_MODERNJS_RENDER } from "../../constants.mjs";
|
|
5
|
-
import { ErrorDigest, createErrorHtml,
|
|
6
|
+
import { ErrorDigest, createErrorHtml, getRuntimeEnv, parseHeaders, parseQuery, sortRoutes, uniqueKeyByRoute } from "../../utils/index.mjs";
|
|
6
7
|
import { csrRscRender } from "./csrRscRender.mjs";
|
|
7
8
|
import { dataHandler } from "./dataHandler.mjs";
|
|
8
9
|
import { renderRscHandler } from "./renderRscHandler.mjs";
|
|
@@ -67,7 +68,7 @@ async function createRender({ routes, pwd, metaName, staticGenerate, cacheConfig
|
|
|
67
68
|
const framework = cutNameByHyphen(metaName || 'modern-js');
|
|
68
69
|
const fallbackHeader = `x-${framework}-ssr-fallback`;
|
|
69
70
|
return async (req, { monitors, nodeReq, templates, serverManifest, rscClientManifest, rscSSRManifest, rscServerManifest, locals, matchEntryName, matchPathname, loaderContext, contextForceCSR, reporter })=>{
|
|
70
|
-
const forMatchpathname = matchPathname ??
|
|
71
|
+
const forMatchpathname = matchPathname ?? getPath(req);
|
|
71
72
|
const [routeInfo, params] = matchRoute(router, forMatchpathname, matchEntryName);
|
|
72
73
|
let fallbackReason = null;
|
|
73
74
|
const fallbackWrapper = (reason)=>{
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.10.
|
|
18
|
+
"version": "3.10.4",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -71,19 +71,19 @@
|
|
|
71
71
|
"flatted": "^3.4.4",
|
|
72
72
|
"hono": "^4.11.7",
|
|
73
73
|
"ts-deepmerge": "8.0.0",
|
|
74
|
-
"@modern-js/plugin": "3.10.
|
|
75
|
-
"@modern-js/runtime-utils": "3.10.
|
|
76
|
-
"@modern-js/utils": "3.10.
|
|
74
|
+
"@modern-js/plugin": "3.10.4",
|
|
75
|
+
"@modern-js/runtime-utils": "3.10.4",
|
|
76
|
+
"@modern-js/utils": "3.10.4"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/cloneable-readable": "^2.0.3",
|
|
80
80
|
"@types/merge-deep": "^3.0.3",
|
|
81
81
|
"@types/node": "^20",
|
|
82
|
-
"http-proxy-middleware": "^2.0.
|
|
82
|
+
"http-proxy-middleware": "^2.0.11",
|
|
83
83
|
"typescript": "^5",
|
|
84
|
-
"@modern-js/
|
|
85
|
-
"@modern-js/
|
|
86
|
-
"@scripts/rstest-config": "2.66.
|
|
84
|
+
"@modern-js/types": "3.10.4",
|
|
85
|
+
"@modern-js/rslib": "3.10.4",
|
|
86
|
+
"@scripts/rstest-config": "2.66.3"
|
|
87
87
|
},
|
|
88
88
|
"sideEffects": false,
|
|
89
89
|
"publishConfig": {
|