@vercel/next 4.3.15 → 4.3.17
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 +29 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -11192,6 +11192,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11192
11192
|
let fallbackStatus;
|
11193
11193
|
let fallbackHeaders;
|
11194
11194
|
let renderingMode = "STATIC" /* STATIC */;
|
11195
|
+
let fallbackRevalidate;
|
11195
11196
|
if (manifest.version === 4) {
|
11196
11197
|
experimentalBypassFor = manifest.dynamicRoutes[lazyRoute].experimentalBypassFor;
|
11197
11198
|
prefetchDataRoute = manifest.dynamicRoutes[lazyRoute].prefetchDataRoute;
|
@@ -11201,6 +11202,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11201
11202
|
renderingMode = manifest.dynamicRoutes[lazyRoute].renderingMode ?? // By default, when the rendering mode isn't specified, fallback to
|
11202
11203
|
// using the `experimentalPPR` flag.
|
11203
11204
|
(manifest.dynamicRoutes[lazyRoute].experimentalPPR ? "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ : "STATIC" /* STATIC */);
|
11205
|
+
fallbackRevalidate = manifest.dynamicRoutes[lazyRoute].fallbackRevalidate;
|
11204
11206
|
}
|
11205
11207
|
if (typeof fallback === "string") {
|
11206
11208
|
ret.fallbackRoutes[lazyRoute] = {
|
@@ -11213,6 +11215,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11213
11215
|
dataRouteRegex,
|
11214
11216
|
prefetchDataRoute,
|
11215
11217
|
prefetchDataRouteRegex,
|
11218
|
+
fallbackRevalidate,
|
11216
11219
|
renderingMode
|
11217
11220
|
};
|
11218
11221
|
} else if (fallback === null) {
|
@@ -11718,13 +11721,16 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11718
11721
|
if (appDir && renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */) {
|
11719
11722
|
isAppPathRoute = true;
|
11720
11723
|
if (isFallback) {
|
11721
|
-
const { fallbackStatus, fallbackHeaders } = prerenderManifest.fallbackRoutes[routeKey];
|
11724
|
+
const { fallbackStatus, fallbackHeaders, fallbackRevalidate } = prerenderManifest.fallbackRoutes[routeKey];
|
11722
11725
|
if (fallbackStatus) {
|
11723
11726
|
initialStatus = fallbackStatus;
|
11724
11727
|
}
|
11725
11728
|
if (fallbackHeaders) {
|
11726
11729
|
initialHeaders = fallbackHeaders;
|
11727
11730
|
}
|
11731
|
+
if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && typeof fallbackRevalidate !== "undefined") {
|
11732
|
+
initialRevalidate = fallbackRevalidate;
|
11733
|
+
}
|
11728
11734
|
}
|
11729
11735
|
}
|
11730
11736
|
if (appDir && srcRoute && (!dataRoute || dataRoute?.endsWith(".rsc"))) {
|
@@ -11906,20 +11912,20 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11906
11912
|
const route = routesManifest?.dynamicRoutes.find(
|
11907
11913
|
(r) => r.page === pageKey && !("isMiddleware" in r)
|
11908
11914
|
);
|
11915
|
+
const isDynamic = isDynamicRoute(routeKey);
|
11909
11916
|
const routeKeys = route?.routeKeys;
|
11910
11917
|
let allowQuery;
|
11911
11918
|
if (isEmptyAllowQueryForPrendered) {
|
11912
|
-
const isDynamic = isDynamicRoute(routeKey);
|
11913
11919
|
if (!isDynamic) {
|
11914
11920
|
allowQuery = [];
|
11915
11921
|
} else if (routeKeys) {
|
11916
11922
|
allowQuery = Object.values(routeKeys);
|
11917
11923
|
}
|
11918
11924
|
} else {
|
11919
|
-
const
|
11925
|
+
const isDynamic2 = isDynamicRoute(pageKey);
|
11920
11926
|
if (routeKeys) {
|
11921
11927
|
allowQuery = Object.values(routeKeys);
|
11922
|
-
} else if (!
|
11928
|
+
} else if (!isDynamic2) {
|
11923
11929
|
allowQuery = [];
|
11924
11930
|
}
|
11925
11931
|
}
|
@@ -11960,10 +11966,14 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11960
11966
|
};
|
11961
11967
|
}
|
11962
11968
|
}
|
11969
|
+
let htmlAllowQuery = allowQuery;
|
11970
|
+
if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && isFallback) {
|
11971
|
+
htmlAllowQuery = [];
|
11972
|
+
}
|
11963
11973
|
prerenders[outputPathPage] = new import_build_utils.Prerender({
|
11964
11974
|
expiration: initialRevalidate,
|
11965
11975
|
lambda,
|
11966
|
-
allowQuery,
|
11976
|
+
allowQuery: htmlAllowQuery,
|
11967
11977
|
fallback: htmlFsRef,
|
11968
11978
|
group: prerenderGroup,
|
11969
11979
|
bypassToken: prerenderManifest.bypassToken,
|
@@ -11991,6 +12001,9 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11991
12001
|
return pathData;
|
11992
12002
|
};
|
11993
12003
|
if (outputPathData || outputPathPrefetchData) {
|
12004
|
+
if (htmlAllowQuery !== allowQuery) {
|
12005
|
+
prerenderGroup++;
|
12006
|
+
}
|
11994
12007
|
const prerender = new import_build_utils.Prerender({
|
11995
12008
|
expiration: initialRevalidate,
|
11996
12009
|
lambda,
|
@@ -13801,7 +13814,8 @@ ${JSON.stringify(
|
|
13801
13814
|
if (isCorrectManifests) {
|
13802
13815
|
for (const manifest of [
|
13803
13816
|
"routes-manifest.json",
|
13804
|
-
"server/pages-manifest.json"
|
13817
|
+
"server/pages-manifest.json",
|
13818
|
+
...appPathRoutesManifest ? ["server/app-paths-manifest.json"] : []
|
13805
13819
|
]) {
|
13806
13820
|
const fsPath = import_path4.default.join(entryPath, outputDirectory, manifest);
|
13807
13821
|
const relativePath = import_path4.default.relative(baseDir, fsPath);
|
@@ -13830,6 +13844,15 @@ ${JSON.stringify(
|
|
13830
13844
|
}
|
13831
13845
|
break;
|
13832
13846
|
}
|
13847
|
+
case "server/app-paths-manifest.json": {
|
13848
|
+
for (const key of Object.keys(manifestData)) {
|
13849
|
+
const normalizedKey = appPathRoutesManifest?.[key] || key.replace(/(^|\/)(page|route)$/, "");
|
13850
|
+
if (isDynamicRoute(normalizedKey) && !normalizedPages.has(normalizedKey)) {
|
13851
|
+
delete manifestData[key];
|
13852
|
+
}
|
13853
|
+
}
|
13854
|
+
break;
|
13855
|
+
}
|
13833
13856
|
default: {
|
13834
13857
|
throw new import_build_utils2.NowBuildError({
|
13835
13858
|
message: `Unexpected manifest value ${manifest}, please contact support if this continues`,
|