@vercel/next 3.4.5 → 3.4.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 -18
- package/dist/server-build.js +2 -1
- package/dist/utils.js +11 -17
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -40874,6 +40874,10 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
40874
40874
|
shouldAddHelpers: false,
|
40875
40875
|
shouldAddSourcemapSupport: false,
|
40876
40876
|
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
40877
|
+
framework: {
|
40878
|
+
slug: 'nextjs',
|
40879
|
+
version: nextVersion,
|
40880
|
+
},
|
40877
40881
|
});
|
40878
40882
|
(0, build_utils_1.debug)(`Created serverless function for page: "${page}"`);
|
40879
40883
|
}));
|
@@ -41363,6 +41367,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
41363
41367
|
],
|
41364
41368
|
handler: path_1.default.join(path_1.default.relative(baseDir, entryPath), '___next_launcher.cjs'),
|
41365
41369
|
runtime: nodeVersion.runtime,
|
41370
|
+
nextVersion,
|
41366
41371
|
...lambdaOptions,
|
41367
41372
|
});
|
41368
41373
|
}
|
@@ -41379,6 +41384,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
41379
41384
|
],
|
41380
41385
|
handler: path_1.default.join(path_1.default.relative(baseDir, entryPath), '___next_launcher.cjs'),
|
41381
41386
|
runtime: nodeVersion.runtime,
|
41387
|
+
nextVersion,
|
41382
41388
|
...lambdaOptions,
|
41383
41389
|
});
|
41384
41390
|
}
|
@@ -41524,6 +41530,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
41524
41530
|
layers: [group.pseudoLayer],
|
41525
41531
|
handler: path_1.default.join(path_1.default.relative(baseDir, entryPath), '___next_launcher.cjs'),
|
41526
41532
|
runtime: nodeVersion.runtime,
|
41533
|
+
nextVersion,
|
41527
41534
|
});
|
41528
41535
|
}));
|
41529
41536
|
}
|
@@ -42875,7 +42882,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
42875
42882
|
runtime: nodeVersion.runtime,
|
42876
42883
|
maxDuration: group.maxDuration,
|
42877
42884
|
isStreaming: group.isStreaming,
|
42878
|
-
|
42885
|
+
nextVersion,
|
42879
42886
|
});
|
42880
42887
|
for (const page of group.pages) {
|
42881
42888
|
const pageNoExt = page.replace(/\.js$/, '');
|
@@ -42942,6 +42949,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
42942
42949
|
routesManifest,
|
42943
42950
|
isCorrectMiddlewareOrder,
|
42944
42951
|
prerenderBypassToken: prerenderManifest.bypassToken || '',
|
42952
|
+
nextVersion,
|
42945
42953
|
});
|
42946
42954
|
const isNextDataServerResolving = middleware.staticRoutes.length > 0 &&
|
42947
42955
|
semver_1.default.gte(nextVersion, NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION);
|
@@ -44080,7 +44088,7 @@ exports.createPseudoLayer = createPseudoLayer;
|
|
44080
44088
|
// measured with 1, 2, 5, 10, and `os.cpus().length || 5`
|
44081
44089
|
// and sema(1) produced the best results
|
44082
44090
|
const createLambdaSema = new async_sema_1.Sema(1);
|
44083
|
-
async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStreaming, ...lambdaOptions }) {
|
44091
|
+
async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStreaming, nextVersion, ...lambdaOptions }) {
|
44084
44092
|
await createLambdaSema.acquire();
|
44085
44093
|
const files = {};
|
44086
44094
|
const addedFiles = new Set();
|
@@ -44117,6 +44125,10 @@ async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStream
|
|
44117
44125
|
shouldAddHelpers: false,
|
44118
44126
|
shouldAddSourcemapSupport: false,
|
44119
44127
|
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
44128
|
+
framework: {
|
44129
|
+
slug: 'nextjs',
|
44130
|
+
version: nextVersion,
|
44131
|
+
},
|
44120
44132
|
});
|
44121
44133
|
}
|
44122
44134
|
exports.createLambdaFromPseudoLayers = createLambdaFromPseudoLayers;
|
@@ -44429,8 +44441,7 @@ async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes,
|
|
44429
44441
|
let matchingGroup = groups.find(group => {
|
44430
44442
|
const matches = group.maxDuration === opts.maxDuration &&
|
44431
44443
|
group.memory === opts.memory &&
|
44432
|
-
group.isPrerenders === isPrerenderRoute
|
44433
|
-
!opts.cron; // Functions with a cronjob must be on their own
|
44444
|
+
group.isPrerenders === isPrerenderRoute;
|
44434
44445
|
if (matches) {
|
44435
44446
|
let newTracedFilesSize = group.pseudoLayerBytes;
|
44436
44447
|
let newTracedFilesUncompressedSize = group.pseudoLayerUncompressedBytes;
|
@@ -45038,7 +45049,7 @@ async function getPrivateOutputs(dir, entries) {
|
|
45038
45049
|
return { files, routes };
|
45039
45050
|
}
|
45040
45051
|
exports.getPrivateOutputs = getPrivateOutputs;
|
45041
|
-
async function getMiddlewareBundle({
|
45052
|
+
async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, nextVersion, }) {
|
45042
45053
|
const middlewareManifest = await getMiddlewareManifest(entryPath, outputDirectory);
|
45043
45054
|
const sortedFunctions = [
|
45044
45055
|
...(!middlewareManifest
|
@@ -45068,18 +45079,6 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
45068
45079
|
i18n: routesManifest.i18n,
|
45069
45080
|
},
|
45070
45081
|
}, path_1.default.resolve(entryPath, outputDirectory), edgeFunction.wasm);
|
45071
|
-
const edgeFunctionOptions = {};
|
45072
|
-
if (config.functions) {
|
45073
|
-
const sourceFile = await getSourceFilePathFromPage({
|
45074
|
-
workPath: entryPath,
|
45075
|
-
page: `${edgeFunction.page}.js`,
|
45076
|
-
});
|
45077
|
-
const opts = await (0, build_utils_1.getLambdaOptionsFromFunction)({
|
45078
|
-
sourceFile,
|
45079
|
-
config,
|
45080
|
-
});
|
45081
|
-
edgeFunctionOptions.cron = opts.cron;
|
45082
|
-
}
|
45083
45082
|
return {
|
45084
45083
|
type,
|
45085
45084
|
page: edgeFunction.page,
|
@@ -45105,7 +45104,6 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
45105
45104
|
return acc;
|
45106
45105
|
}, {});
|
45107
45106
|
return new build_utils_1.EdgeFunction({
|
45108
|
-
...edgeFunctionOptions,
|
45109
45107
|
deploymentTarget: 'v8-worker',
|
45110
45108
|
name: edgeFunction.name,
|
45111
45109
|
files: {
|
@@ -45133,6 +45131,10 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
45133
45131
|
path: `assets/${name}`,
|
45134
45132
|
};
|
45135
45133
|
}),
|
45134
|
+
framework: {
|
45135
|
+
slug: 'nextjs',
|
45136
|
+
version: nextVersion,
|
45137
|
+
},
|
45136
45138
|
});
|
45137
45139
|
})(),
|
45138
45140
|
routeMatchers: getRouteMatchers(edgeFunction, routesManifest),
|
package/dist/server-build.js
CHANGED
@@ -506,7 +506,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
506
506
|
runtime: nodeVersion.runtime,
|
507
507
|
maxDuration: group.maxDuration,
|
508
508
|
isStreaming: group.isStreaming,
|
509
|
-
|
509
|
+
nextVersion,
|
510
510
|
});
|
511
511
|
for (const page of group.pages) {
|
512
512
|
const pageNoExt = page.replace(/\.js$/, '');
|
@@ -573,6 +573,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
573
573
|
routesManifest,
|
574
574
|
isCorrectMiddlewareOrder,
|
575
575
|
prerenderBypassToken: prerenderManifest.bypassToken || '',
|
576
|
+
nextVersion,
|
576
577
|
});
|
577
578
|
const isNextDataServerResolving = middleware.staticRoutes.length > 0 &&
|
578
579
|
semver_1.default.gte(nextVersion, NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION);
|
package/dist/utils.js
CHANGED
@@ -475,7 +475,7 @@ exports.createPseudoLayer = createPseudoLayer;
|
|
475
475
|
// measured with 1, 2, 5, 10, and `os.cpus().length || 5`
|
476
476
|
// and sema(1) produced the best results
|
477
477
|
const createLambdaSema = new async_sema_1.Sema(1);
|
478
|
-
async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStreaming, ...lambdaOptions }) {
|
478
|
+
async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStreaming, nextVersion, ...lambdaOptions }) {
|
479
479
|
await createLambdaSema.acquire();
|
480
480
|
const files = {};
|
481
481
|
const addedFiles = new Set();
|
@@ -512,6 +512,10 @@ async function createLambdaFromPseudoLayers({ files: baseFiles, layers, isStream
|
|
512
512
|
shouldAddHelpers: false,
|
513
513
|
shouldAddSourcemapSupport: false,
|
514
514
|
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
515
|
+
framework: {
|
516
|
+
slug: 'nextjs',
|
517
|
+
version: nextVersion,
|
518
|
+
},
|
515
519
|
});
|
516
520
|
}
|
517
521
|
exports.createLambdaFromPseudoLayers = createLambdaFromPseudoLayers;
|
@@ -824,8 +828,7 @@ async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes,
|
|
824
828
|
let matchingGroup = groups.find(group => {
|
825
829
|
const matches = group.maxDuration === opts.maxDuration &&
|
826
830
|
group.memory === opts.memory &&
|
827
|
-
group.isPrerenders === isPrerenderRoute
|
828
|
-
!opts.cron; // Functions with a cronjob must be on their own
|
831
|
+
group.isPrerenders === isPrerenderRoute;
|
829
832
|
if (matches) {
|
830
833
|
let newTracedFilesSize = group.pseudoLayerBytes;
|
831
834
|
let newTracedFilesUncompressedSize = group.pseudoLayerUncompressedBytes;
|
@@ -1433,7 +1436,7 @@ async function getPrivateOutputs(dir, entries) {
|
|
1433
1436
|
return { files, routes };
|
1434
1437
|
}
|
1435
1438
|
exports.getPrivateOutputs = getPrivateOutputs;
|
1436
|
-
async function getMiddlewareBundle({
|
1439
|
+
async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, nextVersion, }) {
|
1437
1440
|
const middlewareManifest = await getMiddlewareManifest(entryPath, outputDirectory);
|
1438
1441
|
const sortedFunctions = [
|
1439
1442
|
...(!middlewareManifest
|
@@ -1463,18 +1466,6 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
1463
1466
|
i18n: routesManifest.i18n,
|
1464
1467
|
},
|
1465
1468
|
}, path_1.default.resolve(entryPath, outputDirectory), edgeFunction.wasm);
|
1466
|
-
const edgeFunctionOptions = {};
|
1467
|
-
if (config.functions) {
|
1468
|
-
const sourceFile = await getSourceFilePathFromPage({
|
1469
|
-
workPath: entryPath,
|
1470
|
-
page: `${edgeFunction.page}.js`,
|
1471
|
-
});
|
1472
|
-
const opts = await (0, build_utils_1.getLambdaOptionsFromFunction)({
|
1473
|
-
sourceFile,
|
1474
|
-
config,
|
1475
|
-
});
|
1476
|
-
edgeFunctionOptions.cron = opts.cron;
|
1477
|
-
}
|
1478
1469
|
return {
|
1479
1470
|
type,
|
1480
1471
|
page: edgeFunction.page,
|
@@ -1500,7 +1491,6 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
1500
1491
|
return acc;
|
1501
1492
|
}, {});
|
1502
1493
|
return new build_utils_1.EdgeFunction({
|
1503
|
-
...edgeFunctionOptions,
|
1504
1494
|
deploymentTarget: 'v8-worker',
|
1505
1495
|
name: edgeFunction.name,
|
1506
1496
|
files: {
|
@@ -1528,6 +1518,10 @@ async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, ro
|
|
1528
1518
|
path: `assets/${name}`,
|
1529
1519
|
};
|
1530
1520
|
}),
|
1521
|
+
framework: {
|
1522
|
+
slug: 'nextjs',
|
1523
|
+
version: nextVersion,
|
1524
|
+
},
|
1531
1525
|
});
|
1532
1526
|
})(),
|
1533
1527
|
routeMatchers: getRouteMatchers(edgeFunction, routesManifest),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "3.4.
|
3
|
+
"version": "3.4.7",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@types/semver": "6.0.0",
|
46
46
|
"@types/text-table": "0.2.1",
|
47
47
|
"@types/webpack-sources": "3.2.0",
|
48
|
-
"@vercel/build-utils": "6.
|
48
|
+
"@vercel/build-utils": "6.3.0",
|
49
49
|
"@vercel/nft": "0.22.5",
|
50
50
|
"@vercel/routing-utils": "2.1.9",
|
51
51
|
"async-sema": "3.0.1",
|
@@ -71,5 +71,5 @@
|
|
71
71
|
"typescript": "4.5.2",
|
72
72
|
"webpack-sources": "3.2.3"
|
73
73
|
},
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "3d98d1cdea151b7125deb082c2c8469c865027d0"
|
75
75
|
}
|