@vercel/next 4.2.3 → 4.2.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.
- package/dist/index.js +12 -114
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -12017,8 +12017,7 @@ async function getDynamicRoutes({
|
|
12017
12017
|
bypassToken,
|
12018
12018
|
isServerMode,
|
12019
12019
|
dynamicMiddlewareRouteMap,
|
12020
|
-
experimentalPPRRoutes
|
12021
|
-
hasActionOutputSupport
|
12020
|
+
experimentalPPRRoutes
|
12022
12021
|
}) {
|
12023
12022
|
if (routesManifest) {
|
12024
12023
|
switch (routesManifest.version) {
|
@@ -12086,25 +12085,14 @@ async function getDynamicRoutes({
|
|
12086
12085
|
dest
|
12087
12086
|
});
|
12088
12087
|
}
|
12089
|
-
|
12090
|
-
|
12091
|
-
|
12092
|
-
|
12093
|
-
|
12094
|
-
|
12095
|
-
|
12096
|
-
|
12097
|
-
});
|
12098
|
-
} else {
|
12099
|
-
routes2.push({
|
12100
|
-
...route,
|
12101
|
-
src: route.src.replace(
|
12102
|
-
new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
|
12103
|
-
"(?:\\.rsc)(?:/)?$"
|
12104
|
-
),
|
12105
|
-
dest: route.dest?.replace(/($|\?)/, ".rsc$1")
|
12106
|
-
});
|
12107
|
-
}
|
12088
|
+
routes2.push({
|
12089
|
+
...route,
|
12090
|
+
src: route.src.replace(
|
12091
|
+
new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
|
12092
|
+
"(?:\\.rsc)(?:/)?$"
|
12093
|
+
),
|
12094
|
+
dest: route.dest?.replace(/($|\?)/, ".rsc$1")
|
12095
|
+
});
|
12108
12096
|
routes2.push(route);
|
12109
12097
|
}
|
12110
12098
|
return routes2;
|
@@ -14321,7 +14309,6 @@ var CORRECT_NOT_FOUND_ROUTES_VERSION = "v12.0.1";
|
|
14321
14309
|
var CORRECT_MIDDLEWARE_ORDER_VERSION = "v12.1.7-canary.29";
|
14322
14310
|
var NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = "v12.1.7-canary.33";
|
14323
14311
|
var EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = "v12.2.0";
|
14324
|
-
var ACTION_OUTPUT_SUPPORT_VERSION = "v14.2.2";
|
14325
14312
|
var CORRECTED_MANIFESTS_VERSION = "v12.2.0";
|
14326
14313
|
var PRELOAD_CHUNKS = {
|
14327
14314
|
APP_ROUTER_PAGES: [
|
@@ -14401,10 +14388,6 @@ async function serverBuild({
|
|
14401
14388
|
nextVersion,
|
14402
14389
|
EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION
|
14403
14390
|
);
|
14404
|
-
const hasActionOutputSupport = import_semver3.default.gte(
|
14405
|
-
nextVersion,
|
14406
|
-
ACTION_OUTPUT_SUPPORT_VERSION
|
14407
|
-
);
|
14408
14391
|
const projectDir = requiredServerFilesManifest.relativeAppDir ? import_path4.default.join(baseDir, requiredServerFilesManifest.relativeAppDir) : requiredServerFilesManifest.appDir || entryPath;
|
14409
14392
|
const inversedAppPathManifest = {};
|
14410
14393
|
if (appPathRoutesManifest) {
|
@@ -14945,19 +14928,11 @@ async function serverBuild({
|
|
14945
14928
|
pageExtensions,
|
14946
14929
|
inversedAppPathManifest
|
14947
14930
|
});
|
14948
|
-
const appRouterStreamingActionLambdaGroups = [];
|
14949
14931
|
for (const group of appRouterLambdaGroups) {
|
14950
14932
|
if (!group.isPrerenders || group.isExperimentalPPR) {
|
14951
14933
|
group.isStreaming = true;
|
14952
14934
|
}
|
14953
14935
|
group.isAppRouter = true;
|
14954
|
-
if (hasActionOutputSupport) {
|
14955
|
-
appRouterStreamingActionLambdaGroups.push({
|
14956
|
-
...group,
|
14957
|
-
isActionLambda: true,
|
14958
|
-
isStreaming: true
|
14959
|
-
});
|
14960
|
-
}
|
14961
14936
|
}
|
14962
14937
|
for (const group of appRouteHandlersLambdaGroups) {
|
14963
14938
|
if (!group.isPrerenders) {
|
@@ -15005,12 +14980,6 @@ async function serverBuild({
|
|
15005
14980
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
15006
14981
|
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes
|
15007
14982
|
})),
|
15008
|
-
appRouterStreamingPrerenderLambdaGroups: appRouterStreamingActionLambdaGroups.map((group) => ({
|
15009
|
-
pages: group.pages,
|
15010
|
-
isPrerender: group.isPrerenders,
|
15011
|
-
pseudoLayerBytes: group.pseudoLayerBytes,
|
15012
|
-
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes
|
15013
|
-
})),
|
15014
14983
|
appRouteHandlersLambdaGroups: appRouteHandlersLambdaGroups.map(
|
15015
14984
|
(group) => ({
|
15016
14985
|
pages: group.pages,
|
@@ -15028,7 +14997,6 @@ async function serverBuild({
|
|
15028
14997
|
const combinedGroups = [
|
15029
14998
|
...pageLambdaGroups,
|
15030
14999
|
...appRouterLambdaGroups,
|
15031
|
-
...appRouterStreamingActionLambdaGroups,
|
15032
15000
|
...apiLambdaGroups,
|
15033
15001
|
...appRouteHandlersLambdaGroups
|
15034
15002
|
];
|
@@ -15175,9 +15143,6 @@ async function serverBuild({
|
|
15175
15143
|
});
|
15176
15144
|
}
|
15177
15145
|
let outputName = import_path4.default.posix.join(entryDirectory, pageName);
|
15178
|
-
if (group.isActionLambda) {
|
15179
|
-
outputName = `${outputName}.action`;
|
15180
|
-
}
|
15181
15146
|
if (isPPR) {
|
15182
15147
|
if (!revalidate) {
|
15183
15148
|
throw new Error("Invariant: PPR lambda isn't set");
|
@@ -15302,8 +15267,7 @@ async function serverBuild({
|
|
15302
15267
|
bypassToken: prerenderManifest.bypassToken || "",
|
15303
15268
|
isServerMode: true,
|
15304
15269
|
dynamicMiddlewareRouteMap: middleware.dynamicRouteMap,
|
15305
|
-
experimentalPPRRoutes
|
15306
|
-
hasActionOutputSupport
|
15270
|
+
experimentalPPRRoutes
|
15307
15271
|
}).then(
|
15308
15272
|
(arr) => localizeDynamicRoutes(
|
15309
15273
|
arr,
|
@@ -15718,70 +15682,6 @@ async function serverBuild({
|
|
15718
15682
|
override: true
|
15719
15683
|
}
|
15720
15684
|
] : [],
|
15721
|
-
...hasActionOutputSupport ? [
|
15722
|
-
// Create rewrites for streaming prerenders (.action routes)
|
15723
|
-
// This contains separate rewrites for each possible "has" (action header, or content-type)
|
15724
|
-
// Also includes separate handling for index routes which should match to /index.action.
|
15725
|
-
// This follows the same pattern as the rewrites for .rsc files.
|
15726
|
-
{
|
15727
|
-
src: `^${import_path4.default.posix.join("/", entryDirectory, "/")}`,
|
15728
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/index.action"),
|
15729
|
-
has: [
|
15730
|
-
{
|
15731
|
-
type: "header",
|
15732
|
-
key: "next-action"
|
15733
|
-
}
|
15734
|
-
],
|
15735
|
-
continue: true,
|
15736
|
-
override: true
|
15737
|
-
},
|
15738
|
-
{
|
15739
|
-
src: `^${import_path4.default.posix.join("/", entryDirectory, "/")}`,
|
15740
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/index.action"),
|
15741
|
-
has: [
|
15742
|
-
{
|
15743
|
-
type: "header",
|
15744
|
-
key: "content-type",
|
15745
|
-
value: "multipart/form-data;.*"
|
15746
|
-
}
|
15747
|
-
],
|
15748
|
-
continue: true,
|
15749
|
-
override: true
|
15750
|
-
},
|
15751
|
-
{
|
15752
|
-
src: `^${import_path4.default.posix.join(
|
15753
|
-
"/",
|
15754
|
-
entryDirectory,
|
15755
|
-
"/((?!.+\\.action).+?)(?:/)?$"
|
15756
|
-
)}`,
|
15757
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/$1.action"),
|
15758
|
-
has: [
|
15759
|
-
{
|
15760
|
-
type: "header",
|
15761
|
-
key: "next-action"
|
15762
|
-
}
|
15763
|
-
],
|
15764
|
-
continue: true,
|
15765
|
-
override: true
|
15766
|
-
},
|
15767
|
-
{
|
15768
|
-
src: `^${import_path4.default.posix.join(
|
15769
|
-
"/",
|
15770
|
-
entryDirectory,
|
15771
|
-
"/((?!.+\\.action).+?)(?:/)?$"
|
15772
|
-
)}`,
|
15773
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/$1.action"),
|
15774
|
-
has: [
|
15775
|
-
{
|
15776
|
-
type: "header",
|
15777
|
-
key: "content-type",
|
15778
|
-
value: "multipart/form-data;.*"
|
15779
|
-
}
|
15780
|
-
],
|
15781
|
-
continue: true,
|
15782
|
-
override: true
|
15783
|
-
}
|
15784
|
-
] : [],
|
15785
15685
|
{
|
15786
15686
|
src: `^${import_path4.default.posix.join("/", entryDirectory, "/")}`,
|
15787
15687
|
has: [
|
@@ -17487,8 +17387,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17487
17387
|
canUsePreviewMode,
|
17488
17388
|
bypassToken: prerenderManifest.bypassToken || "",
|
17489
17389
|
isServerMode,
|
17490
|
-
experimentalPPRRoutes
|
17491
|
-
hasActionOutputSupport: false
|
17390
|
+
experimentalPPRRoutes
|
17492
17391
|
}).then(
|
17493
17392
|
(arr) => localizeDynamicRoutes(
|
17494
17393
|
arr,
|
@@ -17514,8 +17413,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17514
17413
|
canUsePreviewMode,
|
17515
17414
|
bypassToken: prerenderManifest.bypassToken || "",
|
17516
17415
|
isServerMode,
|
17517
|
-
experimentalPPRRoutes
|
17518
|
-
hasActionOutputSupport: false
|
17416
|
+
experimentalPPRRoutes
|
17519
17417
|
}).then(
|
17520
17418
|
(arr) => arr.map((route) => {
|
17521
17419
|
route.src = route.src.replace("^", `^${dynamicPrefix}`);
|