@vercel/next 4.3.5 → 4.3.7
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 +20 -116
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -10682,7 +10682,6 @@ async function getDynamicRoutes({
|
|
10682
10682
|
bypassToken,
|
10683
10683
|
isServerMode,
|
10684
10684
|
dynamicMiddlewareRouteMap,
|
10685
|
-
hasActionOutputSupport,
|
10686
10685
|
isAppPPREnabled
|
10687
10686
|
}) {
|
10688
10687
|
if (routesManifest) {
|
@@ -10751,25 +10750,14 @@ async function getDynamicRoutes({
|
|
10751
10750
|
dest
|
10752
10751
|
});
|
10753
10752
|
}
|
10754
|
-
|
10755
|
-
|
10756
|
-
|
10757
|
-
|
10758
|
-
|
10759
|
-
|
10760
|
-
|
10761
|
-
|
10762
|
-
});
|
10763
|
-
} else {
|
10764
|
-
routes2.push({
|
10765
|
-
...route,
|
10766
|
-
src: route.src.replace(
|
10767
|
-
new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
|
10768
|
-
"(?:\\.rsc)(?:/)?$"
|
10769
|
-
),
|
10770
|
-
dest: route.dest?.replace(/($|\?)/, ".rsc$1")
|
10771
|
-
});
|
10772
|
-
}
|
10753
|
+
routes2.push({
|
10754
|
+
...route,
|
10755
|
+
src: route.src.replace(
|
10756
|
+
new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
|
10757
|
+
"(?:\\.rsc)(?:/)?$"
|
10758
|
+
),
|
10759
|
+
dest: route.dest?.replace(/($|\?)/, ".rsc$1")
|
10760
|
+
});
|
10773
10761
|
routes2.push(route);
|
10774
10762
|
}
|
10775
10763
|
return routes2;
|
@@ -11635,8 +11623,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11635
11623
|
routesManifest,
|
11636
11624
|
isCorrectNotFoundRoutes,
|
11637
11625
|
isEmptyAllowQueryForPrendered,
|
11638
|
-
isAppPPREnabled
|
11639
|
-
hasActionOutputSupport
|
11626
|
+
isAppPPREnabled
|
11640
11627
|
} = prerenderRouteArgs;
|
11641
11628
|
if (isBlocking && isFallback) {
|
11642
11629
|
throw new import_build_utils.NowBuildError({
|
@@ -11964,12 +11951,6 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
11964
11951
|
}
|
11965
11952
|
} : {}
|
11966
11953
|
});
|
11967
|
-
if (hasActionOutputSupport) {
|
11968
|
-
const actionOutputKey = `${import_path2.default.join("./", srcRoute || "")}.action`;
|
11969
|
-
if (srcRoute !== routeKey && lambdas[actionOutputKey]) {
|
11970
|
-
lambdas[`${routeKey}.action`] = lambdas[actionOutputKey];
|
11971
|
-
}
|
11972
|
-
}
|
11973
11954
|
const normalizePathData = (pathData) => {
|
11974
11955
|
if ((srcRoute === "/" || srcRoute == "/index") && pathData.endsWith(RSC_PREFETCH_SUFFIX)) {
|
11975
11956
|
delete lambdas[pathData];
|
@@ -12557,9 +12538,7 @@ async function getVariantsManifest(entryPath, outputDirectory) {
|
|
12557
12538
|
const hasVariantsManifest = await import_fs_extra3.default.access(pathVariantsManifest).then(() => true).catch(() => false);
|
12558
12539
|
if (!hasVariantsManifest)
|
12559
12540
|
return null;
|
12560
|
-
const variantsManifest = await import_fs_extra3.default.readJSON(
|
12561
|
-
pathVariantsManifest
|
12562
|
-
);
|
12541
|
+
const variantsManifest = await import_fs_extra3.default.readJSON(pathVariantsManifest);
|
12563
12542
|
return variantsManifest;
|
12564
12543
|
}
|
12565
12544
|
async function getServerlessPages(params) {
|
@@ -13042,7 +13021,6 @@ var CORRECT_NOT_FOUND_ROUTES_VERSION = "v12.0.1";
|
|
13042
13021
|
var CORRECT_MIDDLEWARE_ORDER_VERSION = "v12.1.7-canary.29";
|
13043
13022
|
var NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = "v12.1.7-canary.33";
|
13044
13023
|
var EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = "v12.2.0";
|
13045
|
-
var ACTION_OUTPUT_SUPPORT_VERSION = "v14.2.2";
|
13046
13024
|
var CORRECTED_MANIFESTS_VERSION = "v12.2.0";
|
13047
13025
|
var PRELOAD_CHUNKS = {
|
13048
13026
|
APP_ROUTER_PAGES: [
|
@@ -13129,7 +13107,6 @@ async function serverBuild({
|
|
13129
13107
|
nextVersion,
|
13130
13108
|
EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION
|
13131
13109
|
);
|
13132
|
-
const hasActionOutputSupport = import_semver3.default.gte(nextVersion, ACTION_OUTPUT_SUPPORT_VERSION) && Boolean(process.env.NEXT_EXPERIMENTAL_STREAMING_ACTIONS) && !routesManifest.i18n;
|
13133
13110
|
const projectDir = requiredServerFilesManifest.relativeAppDir ? import_path4.default.join(baseDir, requiredServerFilesManifest.relativeAppDir) : requiredServerFilesManifest.appDir || entryPath;
|
13134
13111
|
const inversedAppPathManifest = {};
|
13135
13112
|
if (appPathRoutesManifest) {
|
@@ -13153,7 +13130,7 @@ async function serverBuild({
|
|
13153
13130
|
}
|
13154
13131
|
for (const rewrite of afterFilesRewrites) {
|
13155
13132
|
if (rewrite.src && rewrite.dest) {
|
13156
|
-
const rscSuffix = isAppPPREnabled ? `(\\.prefetch)?\\.rsc
|
13133
|
+
const rscSuffix = isAppPPREnabled ? `(\\.prefetch)?\\.rsc` : "\\.rsc";
|
13157
13134
|
rewrite.src = rewrite.src.replace(
|
13158
13135
|
/\/?\(\?:\/\)\?/,
|
13159
13136
|
`(?<rscsuff>${rscSuffix})?(?:/)?`
|
@@ -13684,13 +13661,6 @@ ${JSON.stringify(
|
|
13684
13661
|
for (const group of appRouterLambdaGroups) {
|
13685
13662
|
group.isStreaming = true;
|
13686
13663
|
group.isAppRouter = true;
|
13687
|
-
if (hasActionOutputSupport) {
|
13688
|
-
appRouterStreamingActionLambdaGroups.push({
|
13689
|
-
...group,
|
13690
|
-
isActionLambda: true,
|
13691
|
-
isStreaming: true
|
13692
|
-
});
|
13693
|
-
}
|
13694
13664
|
}
|
13695
13665
|
for (const group of appRouteHandlersLambdaGroups) {
|
13696
13666
|
if (!group.isPrerenders) {
|
@@ -13994,8 +13964,7 @@ ${JSON.stringify(
|
|
13994
13964
|
hasPages404: routesManifest.pages404,
|
13995
13965
|
isCorrectNotFoundRoutes,
|
13996
13966
|
isEmptyAllowQueryForPrendered,
|
13997
|
-
isAppPPREnabled
|
13998
|
-
hasActionOutputSupport
|
13967
|
+
isAppPPREnabled
|
13999
13968
|
});
|
14000
13969
|
await Promise.all(
|
14001
13970
|
Object.keys(prerenderManifest.staticRoutes).map(
|
@@ -14060,8 +14029,7 @@ ${JSON.stringify(
|
|
14060
14029
|
bypassToken: prerenderManifest.bypassToken || "",
|
14061
14030
|
isServerMode: true,
|
14062
14031
|
dynamicMiddlewareRouteMap: middleware.dynamicRouteMap,
|
14063
|
-
isAppPPREnabled
|
14064
|
-
hasActionOutputSupport
|
14032
|
+
isAppPPREnabled
|
14065
14033
|
}).then(
|
14066
14034
|
(arr) => localizeDynamicRoutes(
|
14067
14035
|
arr,
|
@@ -14218,9 +14186,6 @@ ${JSON.stringify(
|
|
14218
14186
|
if (isAppPPREnabled) {
|
14219
14187
|
edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] = edgeFunctions[pathname];
|
14220
14188
|
}
|
14221
|
-
if (hasActionOutputSupport) {
|
14222
|
-
edgeFunctions[`${pathname}.action`] = edgeFunctions[pathname];
|
14223
|
-
}
|
14224
14189
|
}
|
14225
14190
|
}
|
14226
14191
|
}
|
@@ -14481,52 +14446,6 @@ ${JSON.stringify(
|
|
14481
14446
|
override: true
|
14482
14447
|
}
|
14483
14448
|
] : [],
|
14484
|
-
...hasActionOutputSupport ? [
|
14485
|
-
// Create rewrites for streaming prerenders (.action routes)
|
14486
|
-
// This contains separate rewrites for each possible "has" (action header, or content-type)
|
14487
|
-
// Also includes separate handling for index routes which should match to /index.action.
|
14488
|
-
// This follows the same pattern as the rewrites for .rsc files.
|
14489
|
-
{
|
14490
|
-
src: `^${import_path4.default.posix.join("/", entryDirectory, "/?")}`,
|
14491
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/index.action"),
|
14492
|
-
has: [
|
14493
|
-
{
|
14494
|
-
type: "header",
|
14495
|
-
key: "next-action"
|
14496
|
-
}
|
14497
|
-
],
|
14498
|
-
missing: [
|
14499
|
-
{
|
14500
|
-
type: "header",
|
14501
|
-
key: rscHeader
|
14502
|
-
}
|
14503
|
-
],
|
14504
|
-
continue: true,
|
14505
|
-
override: true
|
14506
|
-
},
|
14507
|
-
{
|
14508
|
-
src: `^${import_path4.default.posix.join(
|
14509
|
-
"/",
|
14510
|
-
entryDirectory,
|
14511
|
-
"/((?!.+\\.action).+?)(?:/)?$"
|
14512
|
-
)}`,
|
14513
|
-
dest: import_path4.default.posix.join("/", entryDirectory, "/$1.action"),
|
14514
|
-
has: [
|
14515
|
-
{
|
14516
|
-
type: "header",
|
14517
|
-
key: "next-action"
|
14518
|
-
}
|
14519
|
-
],
|
14520
|
-
missing: [
|
14521
|
-
{
|
14522
|
-
type: "header",
|
14523
|
-
key: rscHeader
|
14524
|
-
}
|
14525
|
-
],
|
14526
|
-
continue: true,
|
14527
|
-
override: true
|
14528
|
-
}
|
14529
|
-
] : [],
|
14530
14449
|
{
|
14531
14450
|
src: `^${import_path4.default.posix.join("/", entryDirectory, "/?")}`,
|
14532
14451
|
has: [
|
@@ -14597,22 +14516,6 @@ ${JSON.stringify(
|
|
14597
14516
|
// These need to come before handle: miss or else they are grouped
|
14598
14517
|
// with that routing section
|
14599
14518
|
...afterFilesRewrites,
|
14600
|
-
// Ensure that after we normalize `afterFilesRewrites`, unmatched actions are routed to the correct handler
|
14601
|
-
// e.g. /foo/.action -> /foo.action. This should only ever match in cases where we're routing to an action handler
|
14602
|
-
// and the rewrite normalization led to something like /foo/$1$rscsuff, and $1 had no match.
|
14603
|
-
// This is meant to have parity with the .rsc handling below.
|
14604
|
-
...hasActionOutputSupport ? [
|
14605
|
-
{
|
14606
|
-
src: `${import_path4.default.posix.join("/", entryDirectory, "/\\.action$")}`,
|
14607
|
-
dest: `${import_path4.default.posix.join("/", entryDirectory, "/index.action")}`,
|
14608
|
-
check: true
|
14609
|
-
},
|
14610
|
-
{
|
14611
|
-
src: `${import_path4.default.posix.join("/", entryDirectory, "(.+)/\\.action$")}`,
|
14612
|
-
dest: `${import_path4.default.posix.join("/", entryDirectory, "$1.action")}`,
|
14613
|
-
check: true
|
14614
|
-
}
|
14615
|
-
] : [],
|
14616
14519
|
// ensure non-normalized /.rsc from rewrites is handled
|
14617
14520
|
...appPathRoutesManifest ? [
|
14618
14521
|
{
|
@@ -15007,11 +14910,14 @@ var build = async (buildOptions) => {
|
|
15007
14910
|
const nextVersionRange = await getNextVersionRange(entryPath);
|
15008
14911
|
const nodeVersion = await (0, import_build_utils3.getNodeVersion)(entryPath, void 0, config, meta);
|
15009
14912
|
const spawnOpts = (0, import_build_utils3.getSpawnOptions)(meta, nodeVersion);
|
15010
|
-
const { cliType, lockfileVersion,
|
14913
|
+
const { cliType, lockfileVersion, packageJson } = await (0, import_build_utils3.scanParentDirs)(
|
14914
|
+
entryPath,
|
14915
|
+
true
|
14916
|
+
);
|
15011
14917
|
spawnOpts.env = (0, import_build_utils3.getEnvForPackageManager)({
|
15012
14918
|
cliType,
|
15013
14919
|
lockfileVersion,
|
15014
|
-
packageJsonPackageManager,
|
14920
|
+
packageJsonPackageManager: packageJson?.packageManager,
|
15015
14921
|
nodeVersion,
|
15016
14922
|
env: spawnOpts.env || {}
|
15017
14923
|
});
|
@@ -16248,8 +16154,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
16248
16154
|
canUsePreviewMode,
|
16249
16155
|
bypassToken: prerenderManifest.bypassToken || "",
|
16250
16156
|
isServerMode,
|
16251
|
-
isAppPPREnabled: false
|
16252
|
-
hasActionOutputSupport: false
|
16157
|
+
isAppPPREnabled: false
|
16253
16158
|
}).then(
|
16254
16159
|
(arr) => localizeDynamicRoutes(
|
16255
16160
|
arr,
|
@@ -16275,8 +16180,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
16275
16180
|
canUsePreviewMode,
|
16276
16181
|
bypassToken: prerenderManifest.bypassToken || "",
|
16277
16182
|
isServerMode,
|
16278
|
-
isAppPPREnabled: false
|
16279
|
-
hasActionOutputSupport: false
|
16183
|
+
isAppPPREnabled: false
|
16280
16184
|
}).then(
|
16281
16185
|
(arr) => arr.map((route) => {
|
16282
16186
|
route.src = route.src.replace("^", `^${dynamicPrefix}`);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "4.3.
|
3
|
+
"version": "4.3.7",
|
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": "8.3.
|
33
|
+
"@vercel/build-utils": "8.3.7",
|
34
34
|
"@vercel/routing-utils": "3.1.0",
|
35
35
|
"async-sema": "3.0.1",
|
36
36
|
"buffer-crc32": "0.2.13",
|