@vercel/next 4.11.3 → 4.12.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 +129 -70
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11144,7 +11144,9 @@ async function getDynamicRoutes({
|
|
|
11144
11144
|
isServerMode,
|
|
11145
11145
|
dynamicMiddlewareRouteMap,
|
|
11146
11146
|
isAppPPREnabled,
|
|
11147
|
-
isAppClientSegmentCacheEnabled
|
|
11147
|
+
isAppClientSegmentCacheEnabled,
|
|
11148
|
+
isAppClientParamParsingEnabled,
|
|
11149
|
+
prerenderManifest
|
|
11148
11150
|
}) {
|
|
11149
11151
|
if (routesManifest) {
|
|
11150
11152
|
switch (routesManifest.version) {
|
|
@@ -11197,6 +11199,8 @@ async function getDynamicRoutes({
|
|
|
11197
11199
|
src: namedRegex || regex,
|
|
11198
11200
|
dest: `${!isDev ? import_path2.default.posix.join("/", entryDirectory, page) : page}${routeKeys ? `?${Object.keys(routeKeys).map((key) => `${routeKeys[key]}=$${key}`).join("&")}` : ""}`
|
|
11199
11201
|
};
|
|
11202
|
+
const { renderingMode, prefetchDataRoute } = prerenderManifest.fallbackRoutes[page] ?? prerenderManifest.blockingFallbackRoutes[page] ?? prerenderManifest.omittedRoutes[page] ?? {};
|
|
11203
|
+
const isRoutePPREnabled = renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */;
|
|
11200
11204
|
if (!isServerMode) {
|
|
11201
11205
|
route.check = true;
|
|
11202
11206
|
}
|
|
@@ -11233,14 +11237,15 @@ async function getDynamicRoutes({
|
|
|
11233
11237
|
}
|
|
11234
11238
|
}
|
|
11235
11239
|
if (isAppPPREnabled || isAppClientSegmentCacheEnabled) {
|
|
11240
|
+
const shouldSkipSuffixes = hasFallbackRootParams || isRoutePPREnabled && isAppClientParamParsingEnabled && !prefetchDataRoute;
|
|
11236
11241
|
routes2.push({
|
|
11237
11242
|
src: route.src.replace(
|
|
11238
11243
|
new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
|
|
11239
|
-
|
|
11244
|
+
shouldSkipSuffixes ? "\\.rsc(?:/)?$" : "(?<rscSuffix>\\.rsc|\\.prefetch\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$"
|
|
11240
11245
|
),
|
|
11241
11246
|
dest: route.dest?.replace(
|
|
11242
11247
|
/($|\?)/,
|
|
11243
|
-
|
|
11248
|
+
shouldSkipSuffixes ? ".rsc$1" : "$rscSuffix$1"
|
|
11244
11249
|
),
|
|
11245
11250
|
check: true,
|
|
11246
11251
|
override: true
|
|
@@ -11883,6 +11888,9 @@ async function getSourceFilePathFromPage({
|
|
|
11883
11888
|
if (page === "/_not-found/page") {
|
|
11884
11889
|
return "";
|
|
11885
11890
|
}
|
|
11891
|
+
if (page === "/_global-error/page") {
|
|
11892
|
+
return "";
|
|
11893
|
+
}
|
|
11886
11894
|
if (!INTERNAL_PAGES.includes(page)) {
|
|
11887
11895
|
console.log(
|
|
11888
11896
|
`WARNING: Unable to find source file for page ${page} with extensions: ${extensionsToTry.join(
|
|
@@ -12222,7 +12230,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12222
12230
|
isCorrectNotFoundRoutes,
|
|
12223
12231
|
isEmptyAllowQueryForPrendered,
|
|
12224
12232
|
isAppPPREnabled,
|
|
12225
|
-
isAppClientSegmentCacheEnabled
|
|
12233
|
+
isAppClientSegmentCacheEnabled,
|
|
12234
|
+
isAppClientParamParsingEnabled
|
|
12226
12235
|
} = prerenderRouteArgs;
|
|
12227
12236
|
if (isBlocking && isFallback) {
|
|
12228
12237
|
throw new import_build_utils.NowBuildError({
|
|
@@ -12335,7 +12344,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12335
12344
|
isAppPathRoute = true;
|
|
12336
12345
|
}
|
|
12337
12346
|
const isOmittedOrNotFound = isOmitted || isNotFound;
|
|
12338
|
-
let
|
|
12347
|
+
let htmlFallbackFsRef = null;
|
|
12339
12348
|
let postponedPrerender;
|
|
12340
12349
|
let postponedState = null;
|
|
12341
12350
|
let didPostpone = false;
|
|
@@ -12355,34 +12364,27 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12355
12364
|
didPostpone = false;
|
|
12356
12365
|
}
|
|
12357
12366
|
}
|
|
12358
|
-
if (!dataRoute?.endsWith(".rsc")) {
|
|
12359
|
-
throw new Error(
|
|
12360
|
-
`Invariant: unexpected output path for ${dataRoute} and PPR`
|
|
12361
|
-
);
|
|
12362
|
-
}
|
|
12363
|
-
if (!prefetchDataRoute?.endsWith(".prefetch.rsc")) {
|
|
12364
|
-
throw new Error(
|
|
12365
|
-
`Invariant: unexpected output path for ${prefetchDataRoute} and PPR`
|
|
12366
|
-
);
|
|
12367
|
-
}
|
|
12368
12367
|
}
|
|
12369
12368
|
if (postponedPrerender) {
|
|
12370
12369
|
const contentType = initialHeaders?.["content-type"];
|
|
12371
12370
|
if (!contentType) {
|
|
12372
12371
|
throw new Error("Invariant: contentType can't be undefined");
|
|
12373
12372
|
}
|
|
12374
|
-
|
|
12373
|
+
htmlFallbackFsRef = new import_build_utils.FileBlob({
|
|
12374
|
+
contentType,
|
|
12375
|
+
data: postponedPrerender
|
|
12376
|
+
});
|
|
12375
12377
|
} else if (appDir && !dataRoute && !prefetchDataRoute && isAppPathRoute && !(isBlocking || isFallback)) {
|
|
12376
12378
|
const contentType = initialHeaders?.["content-type"];
|
|
12377
12379
|
const fsPath = import_path2.default.join(appDir, `${routeFileNoExt}.body`);
|
|
12378
12380
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
12379
|
-
|
|
12381
|
+
htmlFallbackFsRef = new import_build_utils.FileFsRef({
|
|
12380
12382
|
fsPath,
|
|
12381
12383
|
contentType: contentType || "text/html;charset=utf-8"
|
|
12382
12384
|
});
|
|
12383
12385
|
}
|
|
12384
12386
|
} else {
|
|
12385
|
-
|
|
12387
|
+
htmlFallbackFsRef = isBlocking || isNotFound && !static404Page ? (
|
|
12386
12388
|
// Blocking pages do not have an HTML fallback
|
|
12387
12389
|
null
|
|
12388
12390
|
) : new import_build_utils.FileFsRef({
|
|
@@ -12403,11 +12405,12 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12403
12405
|
)
|
|
12404
12406
|
});
|
|
12405
12407
|
}
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12408
|
+
let dataFallbackFsRef = null;
|
|
12409
|
+
if (!isFallback && !isBlocking && (!isNotFound || static404Page) && dataRoute && (!isAppClientParamParsingEnabled || prefetchDataRoute)) {
|
|
12410
|
+
const basePath = isAppPathRoute && !isOmittedOrNotFound && appDir ? appDir : pagesDir;
|
|
12411
|
+
dataFallbackFsRef = new import_build_utils.FileFsRef({
|
|
12409
12412
|
fsPath: import_path2.default.join(
|
|
12410
|
-
|
|
12413
|
+
basePath,
|
|
12411
12414
|
`${isOmittedOrNotFound ? localePrefixed404 ? addLocaleOrDefault("/404.html", routesManifest, locale) : "/404.html" : isAppPathRoute ? (
|
|
12412
12415
|
// When experimental PPR is enabled, we expect that the data
|
|
12413
12416
|
// that should be served as a part of the prerender should
|
|
@@ -12417,8 +12420,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12417
12420
|
renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ ? prefetchDataRoute : dataRoute
|
|
12418
12421
|
) : routeFileNoExt + ".json"}`
|
|
12419
12422
|
)
|
|
12420
|
-
})
|
|
12421
|
-
|
|
12423
|
+
});
|
|
12424
|
+
}
|
|
12422
12425
|
if (isOmittedOrNotFound) {
|
|
12423
12426
|
initialStatus = 404;
|
|
12424
12427
|
}
|
|
@@ -12456,7 +12459,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12456
12459
|
);
|
|
12457
12460
|
}
|
|
12458
12461
|
outputPathPrefetchData = normalizeDataRoute(prefetchDataRoute);
|
|
12459
|
-
} else if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */) {
|
|
12462
|
+
} else if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && !isAppClientParamParsingEnabled) {
|
|
12460
12463
|
throw new Error("Invariant: expected to find prefetch data route PPR");
|
|
12461
12464
|
}
|
|
12462
12465
|
if (isSharedLambdas) {
|
|
@@ -12486,20 +12489,20 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12486
12489
|
lambda = lambdas[outputSrcPathPage];
|
|
12487
12490
|
}
|
|
12488
12491
|
if (!isAppPathRoute && !isNotFound && initialRevalidate === false) {
|
|
12489
|
-
if (
|
|
12492
|
+
if (htmlFallbackFsRef == null || dataFallbackFsRef == null) {
|
|
12490
12493
|
throw new import_build_utils.NowBuildError({
|
|
12491
12494
|
code: "NEXT_HTMLFSREF_JSONFSREF",
|
|
12492
12495
|
message: `invariant: htmlFsRef != null && jsonFsRef != null ${routeFileNoExt}`
|
|
12493
12496
|
});
|
|
12494
12497
|
}
|
|
12495
12498
|
if (!canUsePreviewMode || routeKey === "/404" && !lambdas[outputPathPage]) {
|
|
12496
|
-
|
|
12497
|
-
prerenders[outputPathPage] =
|
|
12499
|
+
htmlFallbackFsRef.contentType = htmlContentType;
|
|
12500
|
+
prerenders[outputPathPage] = htmlFallbackFsRef;
|
|
12498
12501
|
if (outputPathPrefetchData) {
|
|
12499
|
-
prerenders[outputPathPrefetchData] =
|
|
12502
|
+
prerenders[outputPathPrefetchData] = dataFallbackFsRef;
|
|
12500
12503
|
}
|
|
12501
12504
|
if (outputPathData && renderingMode !== "PARTIALLY_STATIC" /* PARTIALLY_STATIC */) {
|
|
12502
|
-
prerenders[outputPathData] =
|
|
12505
|
+
prerenders[outputPathData] = dataFallbackFsRef;
|
|
12503
12506
|
}
|
|
12504
12507
|
}
|
|
12505
12508
|
}
|
|
@@ -12570,7 +12573,11 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12570
12573
|
let htmlAllowQuery = allowQuery;
|
|
12571
12574
|
if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && (isFallback || isBlocking)) {
|
|
12572
12575
|
const { fallbackRootParams, fallback } = isFallback ? prerenderManifest.fallbackRoutes[routeKey] : prerenderManifest.blockingFallbackRoutes[routeKey];
|
|
12573
|
-
if (
|
|
12576
|
+
if (
|
|
12577
|
+
// We only want to vary on the shell contents if there is a fallback
|
|
12578
|
+
// present and able to be served.
|
|
12579
|
+
fallback && typeof fallback === "string" && fallbackRootParams && fallbackRootParams.length > 0
|
|
12580
|
+
) {
|
|
12574
12581
|
htmlAllowQuery = fallbackRootParams;
|
|
12575
12582
|
} else if (postponedPrerender) {
|
|
12576
12583
|
htmlAllowQuery = [];
|
|
@@ -12581,7 +12588,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12581
12588
|
staleExpiration: initialExpire,
|
|
12582
12589
|
lambda,
|
|
12583
12590
|
allowQuery: htmlAllowQuery,
|
|
12584
|
-
fallback:
|
|
12591
|
+
fallback: htmlFallbackFsRef,
|
|
12585
12592
|
group: prerenderGroup,
|
|
12586
12593
|
bypassToken: prerenderManifest.bypassToken,
|
|
12587
12594
|
experimentalBypassFor,
|
|
@@ -12617,7 +12624,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12617
12624
|
staleExpiration: initialExpire,
|
|
12618
12625
|
lambda,
|
|
12619
12626
|
allowQuery,
|
|
12620
|
-
fallback:
|
|
12627
|
+
fallback: dataFallbackFsRef,
|
|
12621
12628
|
group: prerenderGroup,
|
|
12622
12629
|
bypassToken: prerenderManifest.bypassToken,
|
|
12623
12630
|
experimentalBypassFor,
|
|
@@ -12690,13 +12697,17 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12690
12697
|
appDir,
|
|
12691
12698
|
routeFileNoExt + prefetchSegmentDirSuffix
|
|
12692
12699
|
);
|
|
12700
|
+
let segmentAllowQuery = allowQuery;
|
|
12701
|
+
if (isAppClientParamParsingEnabled && (isFallback || isBlocking)) {
|
|
12702
|
+
segmentAllowQuery = [];
|
|
12703
|
+
}
|
|
12693
12704
|
for (const segmentPath of meta.segmentPaths) {
|
|
12694
12705
|
const outputSegmentPath = import_path2.default.join(
|
|
12695
12706
|
outputPathPage + prefetchSegmentDirSuffix,
|
|
12696
12707
|
segmentPath
|
|
12697
12708
|
) + prefetchSegmentSuffix;
|
|
12698
12709
|
let fallback = null;
|
|
12699
|
-
if (
|
|
12710
|
+
if (segmentAllowQuery && segmentAllowQuery.length === 0) {
|
|
12700
12711
|
const fsPath = import_path2.default.join(
|
|
12701
12712
|
segmentsDir,
|
|
12702
12713
|
segmentPath + prefetchSegmentSuffix
|
|
@@ -12707,7 +12718,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12707
12718
|
expiration: initialRevalidate,
|
|
12708
12719
|
staleExpiration: initialExpire,
|
|
12709
12720
|
lambda,
|
|
12710
|
-
allowQuery,
|
|
12721
|
+
allowQuery: segmentAllowQuery,
|
|
12711
12722
|
fallback,
|
|
12712
12723
|
// Use the same prerender group as the JSON/data prerender.
|
|
12713
12724
|
group: prerenderGroup,
|
|
@@ -14015,7 +14026,10 @@ async function serverBuild({
|
|
|
14015
14026
|
variantsManifest,
|
|
14016
14027
|
experimentalPPRRoutes,
|
|
14017
14028
|
isAppPPREnabled,
|
|
14018
|
-
|
|
14029
|
+
isAppFullPPREnabled,
|
|
14030
|
+
isAppClientSegmentCacheEnabled,
|
|
14031
|
+
isAppClientParamParsingEnabled,
|
|
14032
|
+
clientParamParsingOrigins
|
|
14019
14033
|
}) {
|
|
14020
14034
|
if (isAppPPREnabled) {
|
|
14021
14035
|
(0, import_build_utils2.debug)(
|
|
@@ -14024,6 +14038,7 @@ async function serverBuild({
|
|
|
14024
14038
|
);
|
|
14025
14039
|
}
|
|
14026
14040
|
lambdaPages = Object.assign({}, lambdaPages, lambdaAppPaths);
|
|
14041
|
+
const shouldSkipPrefetchRSCHandling = isAppFullPPREnabled && isAppClientParamParsingEnabled && isAppClientSegmentCacheEnabled;
|
|
14027
14042
|
const experimentalAllowBundling = Boolean(
|
|
14028
14043
|
process.env.NEXT_EXPERIMENTAL_FUNCTION_BUNDLING
|
|
14029
14044
|
);
|
|
@@ -14071,6 +14086,23 @@ async function serverBuild({
|
|
|
14071
14086
|
} else if (rewrite.dest.startsWith("https://")) {
|
|
14072
14087
|
protocol = "https://";
|
|
14073
14088
|
}
|
|
14089
|
+
let origin = null;
|
|
14090
|
+
if (protocol) {
|
|
14091
|
+
const urlWithoutProtocol = rewrite.dest.substring(protocol.length);
|
|
14092
|
+
const delimiters = ["/", "?", "#"];
|
|
14093
|
+
let endIndex = -1;
|
|
14094
|
+
for (const delimiter of delimiters) {
|
|
14095
|
+
const index = urlWithoutProtocol.indexOf(delimiter);
|
|
14096
|
+
if (index !== -1) {
|
|
14097
|
+
endIndex = endIndex === -1 ? index : Math.min(endIndex, index);
|
|
14098
|
+
}
|
|
14099
|
+
}
|
|
14100
|
+
if (endIndex === -1) {
|
|
14101
|
+
origin = rewrite.dest;
|
|
14102
|
+
} else {
|
|
14103
|
+
origin = protocol + urlWithoutProtocol.substring(0, endIndex);
|
|
14104
|
+
}
|
|
14105
|
+
}
|
|
14074
14106
|
let pathname = null;
|
|
14075
14107
|
let query = null;
|
|
14076
14108
|
if (!protocol) {
|
|
@@ -14113,7 +14145,10 @@ async function serverBuild({
|
|
|
14113
14145
|
const { rewriteHeaders } = routesManifest;
|
|
14114
14146
|
if (!rewriteHeaders)
|
|
14115
14147
|
continue;
|
|
14116
|
-
|
|
14148
|
+
const isAllowedOrigin = origin && clientParamParsingOrigins ? clientParamParsingOrigins.some(
|
|
14149
|
+
(allowedOrigin) => new RegExp(allowedOrigin).test(origin)
|
|
14150
|
+
) : false;
|
|
14151
|
+
if (origin && !isAllowedOrigin)
|
|
14117
14152
|
continue;
|
|
14118
14153
|
rewrite.headers = {
|
|
14119
14154
|
...rewrite.headers,
|
|
@@ -15031,7 +15066,8 @@ ${JSON.stringify(
|
|
|
15031
15066
|
isCorrectNotFoundRoutes,
|
|
15032
15067
|
isEmptyAllowQueryForPrendered,
|
|
15033
15068
|
isAppPPREnabled,
|
|
15034
|
-
isAppClientSegmentCacheEnabled
|
|
15069
|
+
isAppClientSegmentCacheEnabled,
|
|
15070
|
+
isAppClientParamParsingEnabled
|
|
15035
15071
|
});
|
|
15036
15072
|
await Promise.all(
|
|
15037
15073
|
Object.keys(prerenderManifest.staticRoutes).map(
|
|
@@ -15087,7 +15123,9 @@ ${JSON.stringify(
|
|
|
15087
15123
|
isServerMode: true,
|
|
15088
15124
|
dynamicMiddlewareRouteMap: middleware.dynamicRouteMap,
|
|
15089
15125
|
isAppPPREnabled,
|
|
15090
|
-
isAppClientSegmentCacheEnabled
|
|
15126
|
+
isAppClientSegmentCacheEnabled,
|
|
15127
|
+
isAppClientParamParsingEnabled,
|
|
15128
|
+
prerenderManifest
|
|
15091
15129
|
}).then(
|
|
15092
15130
|
(arr) => localizeDynamicRoutes(
|
|
15093
15131
|
arr,
|
|
@@ -15261,7 +15299,10 @@ ${JSON.stringify(
|
|
|
15261
15299
|
}
|
|
15262
15300
|
}
|
|
15263
15301
|
const shouldHandleSegmentToRsc = Boolean(
|
|
15264
|
-
isAppClientSegmentCacheEnabled && rscPrefetchHeader && prefetchSegmentHeader && prefetchSegmentDirSuffix && prefetchSegmentSuffix
|
|
15302
|
+
isAppClientSegmentCacheEnabled && rscPrefetchHeader && prefetchSegmentHeader && prefetchSegmentDirSuffix && prefetchSegmentSuffix && // When the entire application has PPR enabled (all the routes) and both
|
|
15303
|
+
// client param parsing and client segment cache are enabled we do not
|
|
15304
|
+
// need the .prefetch.rsc rewrite.
|
|
15305
|
+
!shouldSkipPrefetchRSCHandling
|
|
15265
15306
|
);
|
|
15266
15307
|
const serverActionMetaRoutes = await getServerActionMetaRoutes(
|
|
15267
15308
|
import_path4.default.join(entryPath, outputDirectory)
|
|
@@ -15540,9 +15581,7 @@ ${JSON.stringify(
|
|
|
15540
15581
|
override: true
|
|
15541
15582
|
}
|
|
15542
15583
|
] : [],
|
|
15543
|
-
...rscPrefetchHeader && isAppPPREnabled &&
|
|
15544
|
-
// the .prefetch.rsc routing
|
|
15545
|
-
!isAppClientSegmentCacheEnabled ? [
|
|
15584
|
+
...rscPrefetchHeader && isAppPPREnabled && !shouldSkipPrefetchRSCHandling ? [
|
|
15546
15585
|
{
|
|
15547
15586
|
src: `^${import_path4.default.posix.join("/", entryDirectory, "/")}$`,
|
|
15548
15587
|
has: [
|
|
@@ -15658,28 +15697,34 @@ ${JSON.stringify(
|
|
|
15658
15697
|
...afterFilesRewrites,
|
|
15659
15698
|
// ensure non-normalized /.rsc from rewrites is handled
|
|
15660
15699
|
...appPathRoutesManifest ? [
|
|
15661
|
-
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15700
|
+
...shouldSkipPrefetchRSCHandling ? [] : [
|
|
15701
|
+
{
|
|
15702
|
+
src: import_path4.default.posix.join(
|
|
15703
|
+
"/",
|
|
15704
|
+
entryDirectory,
|
|
15705
|
+
"/\\.prefetch\\.rsc$"
|
|
15706
|
+
),
|
|
15707
|
+
dest: import_path4.default.posix.join(
|
|
15708
|
+
"/",
|
|
15709
|
+
entryDirectory,
|
|
15710
|
+
`/__index${RSC_PREFETCH_SUFFIX}`
|
|
15711
|
+
),
|
|
15712
|
+
check: true
|
|
15713
|
+
},
|
|
15714
|
+
{
|
|
15715
|
+
src: import_path4.default.posix.join(
|
|
15716
|
+
"/",
|
|
15717
|
+
entryDirectory,
|
|
15718
|
+
"(.+)/\\.prefetch\\.rsc$"
|
|
15719
|
+
),
|
|
15720
|
+
dest: import_path4.default.posix.join(
|
|
15721
|
+
"/",
|
|
15722
|
+
entryDirectory,
|
|
15723
|
+
`$1${RSC_PREFETCH_SUFFIX}`
|
|
15724
|
+
),
|
|
15725
|
+
check: true
|
|
15726
|
+
}
|
|
15727
|
+
],
|
|
15683
15728
|
{
|
|
15684
15729
|
src: import_path4.default.posix.join("/", entryDirectory, "/\\.rsc$"),
|
|
15685
15730
|
dest: import_path4.default.posix.join("/", entryDirectory, `/index.rsc`),
|
|
@@ -15763,7 +15808,7 @@ ${JSON.stringify(
|
|
|
15763
15808
|
] : [],
|
|
15764
15809
|
// If it didn't match any of the static routes or dynamic ones, then we
|
|
15765
15810
|
// should fallback to either prefetch or normal RSC request
|
|
15766
|
-
...shouldHandleSegmentToRsc
|
|
15811
|
+
...shouldHandleSegmentToRsc ? [
|
|
15767
15812
|
{
|
|
15768
15813
|
src: "^/(?<path>.+)(?<rscSuffix>\\.segments/.+\\.segment\\.rsc)(?:/)?$",
|
|
15769
15814
|
dest: `/$path${isAppPPREnabled ? ".prefetch.rsc" : ".rsc"}`,
|
|
@@ -16977,7 +17022,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16977
17022
|
experimentalPPRRoutes.add(route);
|
|
16978
17023
|
}
|
|
16979
17024
|
const isAppPPREnabled = requiredServerFilesManifest ? requiredServerFilesManifest.config.experimental?.ppr === true || requiredServerFilesManifest.config.experimental?.ppr === "incremental" || requiredServerFilesManifest.config.experimental?.cacheComponents === true : false;
|
|
17025
|
+
const isAppFullPPREnabled = requiredServerFilesManifest ? requiredServerFilesManifest?.config.experimental?.ppr === true || requiredServerFilesManifest.config.experimental?.cacheComponents === true : false;
|
|
16980
17026
|
const isAppClientSegmentCacheEnabled = requiredServerFilesManifest ? requiredServerFilesManifest.config.experimental?.clientSegmentCache === true : false;
|
|
17027
|
+
const isAppClientParamParsingEnabled = routesManifest?.rsc?.clientParamParsing ?? false;
|
|
17028
|
+
const clientParamParsingOrigins = requiredServerFilesManifest ? requiredServerFilesManifest.config.experimental?.clientParamParsingOrigins : void 0;
|
|
16981
17029
|
if (requiredServerFilesManifest) {
|
|
16982
17030
|
if (!routesManifest) {
|
|
16983
17031
|
throw new Error(
|
|
@@ -17027,7 +17075,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17027
17075
|
variantsManifest,
|
|
17028
17076
|
experimentalPPRRoutes,
|
|
17029
17077
|
isAppPPREnabled,
|
|
17030
|
-
|
|
17078
|
+
isAppFullPPREnabled,
|
|
17079
|
+
isAppClientSegmentCacheEnabled,
|
|
17080
|
+
isAppClientParamParsingEnabled,
|
|
17081
|
+
clientParamParsingOrigins
|
|
17031
17082
|
});
|
|
17032
17083
|
}
|
|
17033
17084
|
const pageKeys = Object.keys(pages);
|
|
@@ -17418,7 +17469,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17418
17469
|
canUsePreviewMode,
|
|
17419
17470
|
bypassToken: prerenderManifest.bypassToken || "",
|
|
17420
17471
|
isServerMode,
|
|
17421
|
-
isAppPPREnabled: false
|
|
17472
|
+
isAppPPREnabled: false,
|
|
17473
|
+
isAppClientParamParsingEnabled,
|
|
17474
|
+
isAppClientSegmentCacheEnabled,
|
|
17475
|
+
prerenderManifest
|
|
17422
17476
|
}).then(
|
|
17423
17477
|
(arr) => localizeDynamicRoutes(
|
|
17424
17478
|
arr,
|
|
@@ -17444,7 +17498,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17444
17498
|
canUsePreviewMode,
|
|
17445
17499
|
bypassToken: prerenderManifest.bypassToken || "",
|
|
17446
17500
|
isServerMode,
|
|
17447
|
-
isAppPPREnabled: false
|
|
17501
|
+
isAppPPREnabled: false,
|
|
17502
|
+
isAppClientParamParsingEnabled: false,
|
|
17503
|
+
isAppClientSegmentCacheEnabled: false,
|
|
17504
|
+
prerenderManifest
|
|
17448
17505
|
}).then(
|
|
17449
17506
|
(arr) => arr.map((route) => {
|
|
17450
17507
|
route.src = route.src.replace("^", `^${dynamicPrefix}`);
|
|
@@ -17623,8 +17680,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17623
17680
|
appPathRoutesManifest,
|
|
17624
17681
|
isSharedLambdas,
|
|
17625
17682
|
canUsePreviewMode,
|
|
17683
|
+
// The following flags are not supported in this version of the builder.
|
|
17626
17684
|
isAppPPREnabled: false,
|
|
17627
|
-
isAppClientSegmentCacheEnabled: false
|
|
17685
|
+
isAppClientSegmentCacheEnabled: false,
|
|
17686
|
+
isAppClientParamParsingEnabled: false
|
|
17628
17687
|
});
|
|
17629
17688
|
await Promise.all(
|
|
17630
17689
|
Object.keys(prerenderManifest.staticRoutes).map(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/next",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/semver": "6.0.0",
|
|
31
31
|
"@types/text-table": "0.2.1",
|
|
32
32
|
"@types/webpack-sources": "3.2.0",
|
|
33
|
-
"@vercel/build-utils": "11.0.
|
|
33
|
+
"@vercel/build-utils": "11.0.2",
|
|
34
34
|
"@vercel/routing-utils": "5.1.1",
|
|
35
35
|
"async-sema": "3.0.1",
|
|
36
36
|
"buffer-crc32": "0.2.13",
|