@vercel/next 3.8.3 → 3.8.5
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 +21 -16
- package/dist/server-build.js +21 -16
- package/dist/server-launcher.js +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -43242,7 +43242,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43242
43242
|
console.time(lambdaCreationLabel);
|
43243
43243
|
const apiPages = [];
|
43244
43244
|
const nonApiPages = [];
|
43245
|
-
const
|
43245
|
+
const appRouterPages = [];
|
43246
43246
|
lambdaPageKeys.forEach(page => {
|
43247
43247
|
if (internalPages.includes(page) &&
|
43248
43248
|
page !== '404.js' &&
|
@@ -43253,14 +43253,15 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43253
43253
|
if (nonLambdaSsgPages.has(pathname)) {
|
43254
43254
|
return;
|
43255
43255
|
}
|
43256
|
-
|
43257
|
-
|
43256
|
+
const normalizedPathname = (0, utils_1.normalizePage)(pathname);
|
43257
|
+
if ((0, utils_1.isDynamicRoute)(normalizedPathname)) {
|
43258
|
+
dynamicPages.push(normalizedPathname);
|
43258
43259
|
}
|
43259
|
-
if (
|
43260
|
-
|
43260
|
+
if (lambdaAppPaths[page]) {
|
43261
|
+
appRouterPages.push(page);
|
43261
43262
|
}
|
43262
|
-
else if (
|
43263
|
-
|
43263
|
+
else if (pageMatchesApi(page)) {
|
43264
|
+
apiPages.push(page);
|
43264
43265
|
}
|
43265
43266
|
else {
|
43266
43267
|
nonApiPages.push(page);
|
@@ -43358,6 +43359,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43358
43359
|
compress: false,
|
43359
43360
|
})}`)
|
43360
43361
|
.replace('__NEXT_SERVER_PATH__', `${(0, utils_1.getNextServerPath)(nextVersion)}/next-server.js`);
|
43362
|
+
const appLauncher = launcher.replace('// pre-next-server-target', `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${requiredServerFilesManifest.config?.experimental?.serverActions
|
43363
|
+
? 'experimental'
|
43364
|
+
: 'next'}"`);
|
43361
43365
|
if (entryDirectory !== '.' &&
|
43362
43366
|
path_1.default.posix.join('/', entryDirectory) !== routesManifest.basePath) {
|
43363
43367
|
// we normalize the entryDirectory in the request URL since
|
@@ -43367,14 +43371,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43367
43371
|
.join('/', entryDirectory)
|
43368
43372
|
.replace(/\//g, '\\/')}/, '')`);
|
43369
43373
|
}
|
43370
|
-
const launcherFiles = {
|
43371
|
-
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: launcher }),
|
43372
|
-
};
|
43373
43374
|
const pageTraces = {};
|
43374
43375
|
const compressedPages = {};
|
43375
43376
|
const mergedPageKeys = [
|
43376
43377
|
...nonApiPages,
|
43377
|
-
...
|
43378
|
+
...appRouterPages,
|
43378
43379
|
...apiPages,
|
43379
43380
|
...internalPages,
|
43380
43381
|
];
|
@@ -43479,10 +43480,10 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43479
43480
|
internalPages,
|
43480
43481
|
pageExtensions,
|
43481
43482
|
});
|
43482
|
-
const
|
43483
|
+
const appRouterLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
43483
43484
|
entryPath: projectDir,
|
43484
43485
|
config,
|
43485
|
-
pages:
|
43486
|
+
pages: appRouterPages,
|
43486
43487
|
prerenderRoutes,
|
43487
43488
|
pageTraces,
|
43488
43489
|
compressedPages,
|
@@ -43493,10 +43494,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43493
43494
|
internalPages,
|
43494
43495
|
pageExtensions,
|
43495
43496
|
});
|
43496
|
-
for (const group of
|
43497
|
+
for (const group of appRouterLambdaGroups) {
|
43497
43498
|
if (!group.isPrerenders) {
|
43498
43499
|
group.isStreaming = true;
|
43499
43500
|
}
|
43501
|
+
group.isAppRouter = true;
|
43500
43502
|
}
|
43501
43503
|
const apiLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
43502
43504
|
entryPath: projectDir,
|
@@ -43527,7 +43529,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43527
43529
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
43528
43530
|
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
|
43529
43531
|
})),
|
43530
|
-
|
43532
|
+
appRouterLambdaGroups: appRouterLambdaGroups.map(group => ({
|
43531
43533
|
pages: group.pages,
|
43532
43534
|
isPrerender: group.isPrerenders,
|
43533
43535
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
@@ -43537,7 +43539,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43537
43539
|
}, null, 2));
|
43538
43540
|
const combinedGroups = [
|
43539
43541
|
...pageLambdaGroups,
|
43540
|
-
...
|
43542
|
+
...appRouterLambdaGroups,
|
43541
43543
|
...apiLambdaGroups,
|
43542
43544
|
];
|
43543
43545
|
await (0, utils_1.detectLambdaLimitExceeding)(combinedGroups, lambdaCompressedByteLimit, compressedPages);
|
@@ -43597,6 +43599,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43597
43599
|
});
|
43598
43600
|
}
|
43599
43601
|
}
|
43602
|
+
const launcherFiles = {
|
43603
|
+
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
|
43604
|
+
};
|
43600
43605
|
const operationType = (0, utils_1.getOperationType)({ group, prerenderManifest });
|
43601
43606
|
const lambda = await (0, utils_1.createLambdaFromPseudoLayers)({
|
43602
43607
|
files: {
|
package/dist/server-build.js
CHANGED
@@ -168,7 +168,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
168
168
|
console.time(lambdaCreationLabel);
|
169
169
|
const apiPages = [];
|
170
170
|
const nonApiPages = [];
|
171
|
-
const
|
171
|
+
const appRouterPages = [];
|
172
172
|
lambdaPageKeys.forEach(page => {
|
173
173
|
if (internalPages.includes(page) &&
|
174
174
|
page !== '404.js' &&
|
@@ -179,14 +179,15 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
179
179
|
if (nonLambdaSsgPages.has(pathname)) {
|
180
180
|
return;
|
181
181
|
}
|
182
|
-
|
183
|
-
|
182
|
+
const normalizedPathname = (0, utils_1.normalizePage)(pathname);
|
183
|
+
if ((0, utils_1.isDynamicRoute)(normalizedPathname)) {
|
184
|
+
dynamicPages.push(normalizedPathname);
|
184
185
|
}
|
185
|
-
if (
|
186
|
-
|
186
|
+
if (lambdaAppPaths[page]) {
|
187
|
+
appRouterPages.push(page);
|
187
188
|
}
|
188
|
-
else if (
|
189
|
-
|
189
|
+
else if (pageMatchesApi(page)) {
|
190
|
+
apiPages.push(page);
|
190
191
|
}
|
191
192
|
else {
|
192
193
|
nonApiPages.push(page);
|
@@ -284,6 +285,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
284
285
|
compress: false,
|
285
286
|
})}`)
|
286
287
|
.replace('__NEXT_SERVER_PATH__', `${(0, utils_1.getNextServerPath)(nextVersion)}/next-server.js`);
|
288
|
+
const appLauncher = launcher.replace('// pre-next-server-target', `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${requiredServerFilesManifest.config?.experimental?.serverActions
|
289
|
+
? 'experimental'
|
290
|
+
: 'next'}"`);
|
287
291
|
if (entryDirectory !== '.' &&
|
288
292
|
path_1.default.posix.join('/', entryDirectory) !== routesManifest.basePath) {
|
289
293
|
// we normalize the entryDirectory in the request URL since
|
@@ -293,14 +297,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
293
297
|
.join('/', entryDirectory)
|
294
298
|
.replace(/\//g, '\\/')}/, '')`);
|
295
299
|
}
|
296
|
-
const launcherFiles = {
|
297
|
-
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: launcher }),
|
298
|
-
};
|
299
300
|
const pageTraces = {};
|
300
301
|
const compressedPages = {};
|
301
302
|
const mergedPageKeys = [
|
302
303
|
...nonApiPages,
|
303
|
-
...
|
304
|
+
...appRouterPages,
|
304
305
|
...apiPages,
|
305
306
|
...internalPages,
|
306
307
|
];
|
@@ -405,10 +406,10 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
405
406
|
internalPages,
|
406
407
|
pageExtensions,
|
407
408
|
});
|
408
|
-
const
|
409
|
+
const appRouterLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
409
410
|
entryPath: projectDir,
|
410
411
|
config,
|
411
|
-
pages:
|
412
|
+
pages: appRouterPages,
|
412
413
|
prerenderRoutes,
|
413
414
|
pageTraces,
|
414
415
|
compressedPages,
|
@@ -419,10 +420,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
419
420
|
internalPages,
|
420
421
|
pageExtensions,
|
421
422
|
});
|
422
|
-
for (const group of
|
423
|
+
for (const group of appRouterLambdaGroups) {
|
423
424
|
if (!group.isPrerenders) {
|
424
425
|
group.isStreaming = true;
|
425
426
|
}
|
427
|
+
group.isAppRouter = true;
|
426
428
|
}
|
427
429
|
const apiLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
428
430
|
entryPath: projectDir,
|
@@ -453,7 +455,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
453
455
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
454
456
|
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
|
455
457
|
})),
|
456
|
-
|
458
|
+
appRouterLambdaGroups: appRouterLambdaGroups.map(group => ({
|
457
459
|
pages: group.pages,
|
458
460
|
isPrerender: group.isPrerenders,
|
459
461
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
@@ -463,7 +465,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
463
465
|
}, null, 2));
|
464
466
|
const combinedGroups = [
|
465
467
|
...pageLambdaGroups,
|
466
|
-
...
|
468
|
+
...appRouterLambdaGroups,
|
467
469
|
...apiLambdaGroups,
|
468
470
|
];
|
469
471
|
await (0, utils_1.detectLambdaLimitExceeding)(combinedGroups, lambdaCompressedByteLimit, compressedPages);
|
@@ -523,6 +525,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
523
525
|
});
|
524
526
|
}
|
525
527
|
}
|
528
|
+
const launcherFiles = {
|
529
|
+
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
|
530
|
+
};
|
526
531
|
const operationType = (0, utils_1.getOperationType)({ group, prerenderManifest });
|
527
532
|
const lambda = await (0, utils_1.createLambdaFromPseudoLayers)({
|
528
533
|
files: {
|
package/dist/server-launcher.js
CHANGED
@@ -13,6 +13,7 @@ if (process.env.NODE_ENV !== 'production' && region !== 'dev1') {
|
|
13
13
|
console.warn(`Warning: NODE_ENV was incorrectly set to "${process.env.NODE_ENV}", this value is being overridden to "production"`);
|
14
14
|
process.env.NODE_ENV = 'production';
|
15
15
|
}
|
16
|
+
// pre-next-server-target
|
16
17
|
// eslint-disable-next-line
|
17
18
|
const NextServer = require('__NEXT_SERVER_PATH__').default;
|
18
19
|
const nextServer = new NextServer({
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "3.8.
|
3
|
+
"version": "3.8.5",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"@types/semver": "6.0.0",
|
27
27
|
"@types/text-table": "0.2.1",
|
28
28
|
"@types/webpack-sources": "3.2.0",
|
29
|
-
"@vercel/build-utils": "6.7.
|
29
|
+
"@vercel/build-utils": "6.7.3",
|
30
30
|
"@vercel/nft": "0.22.5",
|
31
31
|
"@vercel/routing-utils": "2.2.1",
|
32
32
|
"async-sema": "3.0.1",
|