@vercel/next 4.7.11 → 4.9.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 +57 -58
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -1049,14 +1049,26 @@ var require_superstatic = __commonJS({
|
|
1049
1049
|
}
|
1050
1050
|
return hasItems;
|
1051
1051
|
};
|
1052
|
+
function getStringValueForRegex(value) {
|
1053
|
+
if (typeof value === "string") {
|
1054
|
+
return value;
|
1055
|
+
}
|
1056
|
+
if (value && typeof value === "object" && value !== null) {
|
1057
|
+
if ("re" in value && typeof value.re === "string") {
|
1058
|
+
return value.re;
|
1059
|
+
}
|
1060
|
+
}
|
1061
|
+
return null;
|
1062
|
+
}
|
1052
1063
|
function collectHasSegments(has) {
|
1053
1064
|
const hasSegments = /* @__PURE__ */ new Set();
|
1054
1065
|
for (const hasItem of has || []) {
|
1055
1066
|
if (!hasItem.value && "key" in hasItem) {
|
1056
1067
|
hasSegments.add(hasItem.key);
|
1057
1068
|
}
|
1058
|
-
|
1059
|
-
|
1069
|
+
const stringValue = getStringValueForRegex(hasItem.value);
|
1070
|
+
if (stringValue) {
|
1071
|
+
for (const match of stringValue.matchAll(namedGroupsRegex)) {
|
1060
1072
|
if (match[1]) {
|
1061
1073
|
hasSegments.add(match[1]);
|
1062
1074
|
}
|
@@ -11440,7 +11452,7 @@ function getFilesMapFromReasons(fileList, reasons, ignoreFn) {
|
|
11440
11452
|
}
|
11441
11453
|
return parentFilesMap;
|
11442
11454
|
}
|
11443
|
-
var collectTracedFiles = (baseDir, lstatResults, lstatSema, reasons
|
11455
|
+
var collectTracedFiles = (baseDir, lstatResults, lstatSema, reasons) => async (file) => {
|
11444
11456
|
const reason = reasons.get(file);
|
11445
11457
|
if (reason && reason.type.includes("initial")) {
|
11446
11458
|
return;
|
@@ -11450,10 +11462,13 @@ var collectTracedFiles = (baseDir, lstatResults, lstatSema, reasons, files) => a
|
|
11450
11462
|
lstatResults[filePath] = lstatSema.acquire().then(() => (0, import_fs_extra3.lstat)(filePath)).finally(() => lstatSema.release());
|
11451
11463
|
}
|
11452
11464
|
const { mode } = await lstatResults[filePath];
|
11453
|
-
|
11454
|
-
|
11455
|
-
|
11456
|
-
|
11465
|
+
return [
|
11466
|
+
file,
|
11467
|
+
new import_build_utils.FileFsRef({
|
11468
|
+
fsPath: import_path2.default.join(baseDir, file),
|
11469
|
+
mode
|
11470
|
+
})
|
11471
|
+
];
|
11457
11472
|
};
|
11458
11473
|
var ExperimentalTraceVersion = `9.0.4-canary.1`;
|
11459
11474
|
async function createPseudoLayer(files) {
|
@@ -12193,8 +12208,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12193
12208
|
isCorrectNotFoundRoutes,
|
12194
12209
|
isEmptyAllowQueryForPrendered,
|
12195
12210
|
isAppPPREnabled,
|
12196
|
-
isAppClientSegmentCacheEnabled
|
12197
|
-
shouldSkipVaryHeader
|
12211
|
+
isAppClientSegmentCacheEnabled
|
12198
12212
|
} = prerenderRouteArgs;
|
12199
12213
|
if (isBlocking && isFallback) {
|
12200
12214
|
throw new import_build_utils.NowBuildError({
|
@@ -12571,7 +12585,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12571
12585
|
...rscEnabled ? {
|
12572
12586
|
initialHeaders: {
|
12573
12587
|
...initialHeaders,
|
12574
|
-
|
12588
|
+
vary: rscVaryHeader
|
12575
12589
|
}
|
12576
12590
|
} : {}
|
12577
12591
|
});
|
@@ -12602,7 +12616,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12602
12616
|
...rscEnabled ? {
|
12603
12617
|
initialHeaders: {
|
12604
12618
|
...initialHeaders,
|
12605
|
-
|
12619
|
+
vary: rscVaryHeader,
|
12606
12620
|
...(outputPathData || outputPathPrefetchData)?.endsWith(
|
12607
12621
|
".json"
|
12608
12622
|
) ? {
|
@@ -12949,11 +12963,12 @@ async function getNodeMiddleware({
|
|
12949
12963
|
}
|
12950
12964
|
});
|
12951
12965
|
const reasons = /* @__PURE__ */ new Map();
|
12952
|
-
const tracedFiles =
|
12953
|
-
|
12954
|
-
|
12955
|
-
|
12956
|
-
|
12966
|
+
const tracedFiles = Object.fromEntries(
|
12967
|
+
(await Promise.all(
|
12968
|
+
fileList.map(
|
12969
|
+
collectTracedFiles(baseDir, lstatResults, lstatSema, reasons)
|
12970
|
+
)
|
12971
|
+
)).filter((entry) => !!entry)
|
12957
12972
|
);
|
12958
12973
|
const launcherData = (await import_fs_extra3.default.readFile(import_path2.default.join(__dirname, "middleware-launcher.js"), "utf8")).replace(
|
12959
12974
|
/(?:var|const) conf = __NEXT_CONFIG__/,
|
@@ -13848,7 +13863,6 @@ var PRELOAD_CHUNKS = {
|
|
13848
13863
|
};
|
13849
13864
|
var BUNDLED_SERVER_NEXT_VERSION = "v13.5.4";
|
13850
13865
|
var BUNDLED_SERVER_NEXT_PATH = "next/dist/compiled/next-server/server.runtime.prod.js";
|
13851
|
-
var NEXT_VARY_INERT_VERSION = "v13.4.6";
|
13852
13866
|
async function serverBuild({
|
13853
13867
|
dynamicPages,
|
13854
13868
|
pagesDir,
|
@@ -13915,7 +13929,6 @@ async function serverBuild({
|
|
13915
13929
|
nextVersion,
|
13916
13930
|
EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION
|
13917
13931
|
);
|
13918
|
-
const shouldSkipVaryHeader = import_semver3.default.gte(nextVersion, NEXT_VARY_INERT_VERSION);
|
13919
13932
|
const projectDir = requiredServerFilesManifest.relativeAppDir ? import_path4.default.join(baseDir, requiredServerFilesManifest.relativeAppDir) : requiredServerFilesManifest.appDir || entryPath;
|
13920
13933
|
const inversedAppPathManifest = {};
|
13921
13934
|
if (appPathRoutesManifest) {
|
@@ -14129,7 +14142,6 @@ async function serverBuild({
|
|
14129
14142
|
if (hasLambdas) {
|
14130
14143
|
const initialTracingLabel = "Traced Next.js server files in";
|
14131
14144
|
console.time(initialTracingLabel);
|
14132
|
-
const initialTracedFiles = {};
|
14133
14145
|
let initialFileList;
|
14134
14146
|
let initialFileReasons;
|
14135
14147
|
let nextServerBuildTrace;
|
@@ -14216,16 +14228,17 @@ async function serverBuild({
|
|
14216
14228
|
(0, import_build_utils2.debug)("Using instrumentation.js.nft.json trace from build");
|
14217
14229
|
}
|
14218
14230
|
(0, import_build_utils2.debug)("collecting initial Next.js server files");
|
14219
|
-
|
14220
|
-
|
14221
|
-
|
14222
|
-
|
14223
|
-
|
14224
|
-
|
14225
|
-
|
14226
|
-
|
14231
|
+
const initialTracedFiles = Object.fromEntries(
|
14232
|
+
(await Promise.all(
|
14233
|
+
initialFileList.map(
|
14234
|
+
collectTracedFiles(
|
14235
|
+
baseDir,
|
14236
|
+
lstatResults,
|
14237
|
+
lstatSema,
|
14238
|
+
initialFileReasons
|
14239
|
+
)
|
14227
14240
|
)
|
14228
|
-
)
|
14241
|
+
)).filter((entry) => !!entry)
|
14229
14242
|
);
|
14230
14243
|
(0, import_build_utils2.debug)("creating initial pseudo layer");
|
14231
14244
|
const initialPseudoLayer = await createPseudoLayer(initialTracedFiles);
|
@@ -14445,7 +14458,6 @@ ${JSON.stringify(
|
|
14445
14458
|
console.timeEnd(traceLabel);
|
14446
14459
|
}
|
14447
14460
|
for (const page of mergedPageKeys) {
|
14448
|
-
const tracedFiles = {};
|
14449
14461
|
const originalPagePath = getOriginalPagePath(page);
|
14450
14462
|
const pageBuildTrace = getBuildTraceFile(originalPagePath);
|
14451
14463
|
let fileList;
|
@@ -14498,16 +14510,12 @@ ${JSON.stringify(
|
|
14498
14510
|
}
|
14499
14511
|
reasons = traceResult?.reasons || /* @__PURE__ */ new Map();
|
14500
14512
|
}
|
14501
|
-
|
14502
|
-
|
14503
|
-
|
14504
|
-
baseDir,
|
14505
|
-
lstatResults,
|
14506
|
-
lstatSema,
|
14507
|
-
reasons,
|
14508
|
-
tracedFiles
|
14513
|
+
const tracedFiles = Object.fromEntries(
|
14514
|
+
(await Promise.all(
|
14515
|
+
fileList.map(
|
14516
|
+
collectTracedFiles(baseDir, lstatResults, lstatSema, reasons)
|
14509
14517
|
)
|
14510
|
-
)
|
14518
|
+
)).filter((entry) => !!entry)
|
14511
14519
|
);
|
14512
14520
|
pageTraces[page] = tracedFiles;
|
14513
14521
|
compressedPages[page] = (await createPseudoLayer({
|
@@ -14888,8 +14896,7 @@ ${JSON.stringify(
|
|
14888
14896
|
isCorrectNotFoundRoutes,
|
14889
14897
|
isEmptyAllowQueryForPrendered,
|
14890
14898
|
isAppPPREnabled,
|
14891
|
-
isAppClientSegmentCacheEnabled
|
14892
|
-
shouldSkipVaryHeader
|
14899
|
+
isAppClientSegmentCacheEnabled
|
14893
14900
|
});
|
14894
14901
|
await Promise.all(
|
14895
14902
|
Object.keys(prerenderManifest.staticRoutes).map(
|
@@ -15443,7 +15450,7 @@ ${JSON.stringify(
|
|
15443
15450
|
entryDirectory,
|
15444
15451
|
`/__index${RSC_PREFETCH_SUFFIX}`
|
15445
15452
|
),
|
15446
|
-
headers:
|
15453
|
+
headers: { vary: rscVaryHeader },
|
15447
15454
|
continue: true,
|
15448
15455
|
override: true
|
15449
15456
|
},
|
@@ -15464,7 +15471,7 @@ ${JSON.stringify(
|
|
15464
15471
|
entryDirectory,
|
15465
15472
|
`/$1${RSC_PREFETCH_SUFFIX}`
|
15466
15473
|
),
|
15467
|
-
headers:
|
15474
|
+
headers: { vary: rscVaryHeader },
|
15468
15475
|
continue: true,
|
15469
15476
|
override: true
|
15470
15477
|
}
|
@@ -15478,7 +15485,7 @@ ${JSON.stringify(
|
|
15478
15485
|
}
|
15479
15486
|
],
|
15480
15487
|
dest: import_path4.default.posix.join("/", entryDirectory, "/index.rsc"),
|
15481
|
-
headers:
|
15488
|
+
headers: { vary: rscVaryHeader },
|
15482
15489
|
continue: true,
|
15483
15490
|
override: true
|
15484
15491
|
},
|
@@ -15495,7 +15502,7 @@ ${JSON.stringify(
|
|
15495
15502
|
}
|
15496
15503
|
],
|
15497
15504
|
dest: import_path4.default.posix.join("/", entryDirectory, "/$1.rsc"),
|
15498
|
-
headers:
|
15505
|
+
headers: { vary: rscVaryHeader },
|
15499
15506
|
continue: true,
|
15500
15507
|
override: true
|
15501
15508
|
}
|
@@ -17004,7 +17011,6 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17004
17011
|
result.reasons
|
17005
17012
|
);
|
17006
17013
|
for (const page of mergedPageKeys) {
|
17007
|
-
const tracedFiles = {};
|
17008
17014
|
const fileList = parentFilesMap.get(
|
17009
17015
|
import_path5.default.relative(baseDir, pages[page].fsPath)
|
17010
17016
|
);
|
@@ -17014,16 +17020,12 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17014
17020
|
);
|
17015
17021
|
}
|
17016
17022
|
const reasons = result.reasons;
|
17017
|
-
|
17018
|
-
|
17019
|
-
|
17020
|
-
baseDir,
|
17021
|
-
lstatResults,
|
17022
|
-
lstatSema,
|
17023
|
-
reasons,
|
17024
|
-
tracedFiles
|
17023
|
+
const tracedFiles = Object.fromEntries(
|
17024
|
+
(await Promise.all(
|
17025
|
+
Array.from(fileList).map(
|
17026
|
+
collectTracedFiles(baseDir, lstatResults, lstatSema, reasons)
|
17025
17027
|
)
|
17026
|
-
)
|
17028
|
+
)).filter((entry) => !!entry)
|
17027
17029
|
);
|
17028
17030
|
pageTraces[page] = tracedFiles;
|
17029
17031
|
}
|
@@ -17517,10 +17519,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17517
17519
|
isSharedLambdas,
|
17518
17520
|
canUsePreviewMode,
|
17519
17521
|
isAppPPREnabled: false,
|
17520
|
-
isAppClientSegmentCacheEnabled: false
|
17521
|
-
// Relevant Next.js versions will be handled by server-build.ts, which
|
17522
|
-
// does correctly configure this variable.
|
17523
|
-
shouldSkipVaryHeader: false
|
17522
|
+
isAppClientSegmentCacheEnabled: false
|
17524
17523
|
});
|
17525
17524
|
await Promise.all(
|
17526
17525
|
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.9.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,8 +30,8 @@
|
|
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": "10.
|
34
|
-
"@vercel/routing-utils": "5.0.
|
33
|
+
"@vercel/build-utils": "10.6.1",
|
34
|
+
"@vercel/routing-utils": "5.0.6",
|
35
35
|
"async-sema": "3.0.1",
|
36
36
|
"buffer-crc32": "0.2.13",
|
37
37
|
"bytes": "3.1.2",
|