@vercel/next 4.18.0 → 4.19.0
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 +37 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -940,14 +940,23 @@ var require_superstatic = __commonJS({
|
|
|
940
940
|
normalizeHasKeys(r.has);
|
|
941
941
|
normalizeHasKeys(r.missing);
|
|
942
942
|
try {
|
|
943
|
-
const
|
|
943
|
+
const interpolate = (value) => replaceSegments(
|
|
944
944
|
segments,
|
|
945
945
|
hasSegments,
|
|
946
|
-
|
|
946
|
+
value,
|
|
947
947
|
false,
|
|
948
948
|
internalParamNames
|
|
949
949
|
);
|
|
950
|
-
|
|
950
|
+
let route;
|
|
951
|
+
if (typeof r.destination === "string") {
|
|
952
|
+
route = { src, dest: interpolate(r.destination), check: true };
|
|
953
|
+
} else {
|
|
954
|
+
const destination = { ...r.destination };
|
|
955
|
+
if (typeof destination.path === "string") {
|
|
956
|
+
destination.path = interpolate(destination.path);
|
|
957
|
+
}
|
|
958
|
+
route = { src, destination };
|
|
959
|
+
}
|
|
951
960
|
if (typeof r.env !== "undefined") {
|
|
952
961
|
route.env = r.env;
|
|
953
962
|
}
|
|
@@ -12512,6 +12521,13 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12512
12521
|
message: "invariant: isOmitted and isFallback cannot both be true"
|
|
12513
12522
|
});
|
|
12514
12523
|
}
|
|
12524
|
+
const routeIsDynamic = Boolean(isFallback || isBlocking || isOmitted);
|
|
12525
|
+
let hasFallback;
|
|
12526
|
+
if (isFallback) {
|
|
12527
|
+
hasFallback = true;
|
|
12528
|
+
} else if (isBlocking || isOmitted) {
|
|
12529
|
+
hasFallback = false;
|
|
12530
|
+
}
|
|
12515
12531
|
let routeFileNoExt = routeKey === "/" ? "/index" : routeKey;
|
|
12516
12532
|
let origRouteFileNoExt = routeFileNoExt;
|
|
12517
12533
|
const { isLocalePrefixed } = prerenderManifest;
|
|
@@ -12612,6 +12628,15 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12612
12628
|
}
|
|
12613
12629
|
const isOmittedOrNotFound = isOmitted || isNotFound;
|
|
12614
12630
|
let htmlFallbackFsRef = null;
|
|
12631
|
+
let htmlSize;
|
|
12632
|
+
if (appDir) {
|
|
12633
|
+
try {
|
|
12634
|
+
htmlSize = import_fs_extra3.default.statSync(
|
|
12635
|
+
import_path3.default.join(appDir, `${routeFileNoExt}.html`)
|
|
12636
|
+
).size;
|
|
12637
|
+
} catch {
|
|
12638
|
+
}
|
|
12639
|
+
}
|
|
12615
12640
|
let postponedPrerender;
|
|
12616
12641
|
let postponedState = null;
|
|
12617
12642
|
let didPostpone = false;
|
|
@@ -12889,6 +12914,9 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12889
12914
|
allowHeader,
|
|
12890
12915
|
partialFallback: partialFallback || void 0,
|
|
12891
12916
|
hasPostponed,
|
|
12917
|
+
hasFallback,
|
|
12918
|
+
htmlSize,
|
|
12919
|
+
isDynamicRoute: routeIsDynamic,
|
|
12892
12920
|
...isNotFound ? {
|
|
12893
12921
|
initialStatus: 404
|
|
12894
12922
|
} : {},
|
|
@@ -12923,6 +12951,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12923
12951
|
allowHeader,
|
|
12924
12952
|
partialFallback: void 0,
|
|
12925
12953
|
hasPostponed,
|
|
12954
|
+
hasFallback,
|
|
12955
|
+
isDynamicRoute: routeIsDynamic,
|
|
12926
12956
|
...isNotFound ? {
|
|
12927
12957
|
initialStatus: 404
|
|
12928
12958
|
} : {},
|
|
@@ -12978,6 +13008,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12978
13008
|
allowHeader,
|
|
12979
13009
|
partialFallback: void 0,
|
|
12980
13010
|
hasPostponed,
|
|
13011
|
+
hasFallback,
|
|
13012
|
+
isDynamicRoute: routeIsDynamic,
|
|
12981
13013
|
chain: {
|
|
12982
13014
|
outputPath: normalizePathData(outputPathData),
|
|
12983
13015
|
headers: routesManifest.ppr.chain.headers
|
|
@@ -13045,6 +13077,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
13045
13077
|
allowHeader,
|
|
13046
13078
|
partialFallback: void 0,
|
|
13047
13079
|
hasPostponed,
|
|
13080
|
+
hasFallback,
|
|
13081
|
+
isDynamicRoute: routeIsDynamic,
|
|
13048
13082
|
// These routes are always only static, so they should not
|
|
13049
13083
|
// permit any bypass unless it's for preview
|
|
13050
13084
|
bypassToken: prerenderManifest.bypassToken,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/next",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"text-table": "0.2.0",
|
|
54
54
|
"vitest": "2.0.3",
|
|
55
55
|
"webpack-sources": "3.2.3",
|
|
56
|
-
"@vercel/build-utils": "13.
|
|
57
|
-
"@vercel/routing-utils": "6.
|
|
56
|
+
"@vercel/build-utils": "13.30.0",
|
|
57
|
+
"@vercel/routing-utils": "6.3.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "node build.mjs",
|