@vercel/next 3.8.3 → 3.8.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 +21 -14
- package/dist/server-build.js +21 -14
- package/dist/server-launcher.js +1 -0
- package/package.json +1 -1
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,17 @@ 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
43260
|
if (pageMatchesApi(page)) {
|
43260
43261
|
apiPages.push(page);
|
43261
43262
|
}
|
43262
|
-
else if (
|
43263
|
-
|
43263
|
+
else if ((appPathRoutesManifest?.[`${normalizedPathname}/page`] ||
|
43264
|
+
appPathRoutesManifest?.[`${normalizedPathname}/route`]) &&
|
43265
|
+
lambdaAppPaths[page]) {
|
43266
|
+
appRouterPages.push(page);
|
43264
43267
|
}
|
43265
43268
|
else {
|
43266
43269
|
nonApiPages.push(page);
|
@@ -43358,6 +43361,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43358
43361
|
compress: false,
|
43359
43362
|
})}`)
|
43360
43363
|
.replace('__NEXT_SERVER_PATH__', `${(0, utils_1.getNextServerPath)(nextVersion)}/next-server.js`);
|
43364
|
+
const appLauncher = launcher.replace('// pre-next-server-target', `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${requiredServerFilesManifest.config?.experimental?.serverActions
|
43365
|
+
? 'experimental'
|
43366
|
+
: 'next'}"`);
|
43361
43367
|
if (entryDirectory !== '.' &&
|
43362
43368
|
path_1.default.posix.join('/', entryDirectory) !== routesManifest.basePath) {
|
43363
43369
|
// we normalize the entryDirectory in the request URL since
|
@@ -43367,14 +43373,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43367
43373
|
.join('/', entryDirectory)
|
43368
43374
|
.replace(/\//g, '\\/')}/, '')`);
|
43369
43375
|
}
|
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
43376
|
const pageTraces = {};
|
43374
43377
|
const compressedPages = {};
|
43375
43378
|
const mergedPageKeys = [
|
43376
43379
|
...nonApiPages,
|
43377
|
-
...
|
43380
|
+
...appRouterPages,
|
43378
43381
|
...apiPages,
|
43379
43382
|
...internalPages,
|
43380
43383
|
];
|
@@ -43479,10 +43482,10 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43479
43482
|
internalPages,
|
43480
43483
|
pageExtensions,
|
43481
43484
|
});
|
43482
|
-
const
|
43485
|
+
const appRouterLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
43483
43486
|
entryPath: projectDir,
|
43484
43487
|
config,
|
43485
|
-
pages:
|
43488
|
+
pages: appRouterPages,
|
43486
43489
|
prerenderRoutes,
|
43487
43490
|
pageTraces,
|
43488
43491
|
compressedPages,
|
@@ -43493,10 +43496,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43493
43496
|
internalPages,
|
43494
43497
|
pageExtensions,
|
43495
43498
|
});
|
43496
|
-
for (const group of
|
43499
|
+
for (const group of appRouterLambdaGroups) {
|
43497
43500
|
if (!group.isPrerenders) {
|
43498
43501
|
group.isStreaming = true;
|
43499
43502
|
}
|
43503
|
+
group.isAppRouter = true;
|
43500
43504
|
}
|
43501
43505
|
const apiLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
43502
43506
|
entryPath: projectDir,
|
@@ -43527,7 +43531,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43527
43531
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
43528
43532
|
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
|
43529
43533
|
})),
|
43530
|
-
|
43534
|
+
appRouterLambdaGroups: appRouterLambdaGroups.map(group => ({
|
43531
43535
|
pages: group.pages,
|
43532
43536
|
isPrerender: group.isPrerenders,
|
43533
43537
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
@@ -43537,7 +43541,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43537
43541
|
}, null, 2));
|
43538
43542
|
const combinedGroups = [
|
43539
43543
|
...pageLambdaGroups,
|
43540
|
-
...
|
43544
|
+
...appRouterLambdaGroups,
|
43541
43545
|
...apiLambdaGroups,
|
43542
43546
|
];
|
43543
43547
|
await (0, utils_1.detectLambdaLimitExceeding)(combinedGroups, lambdaCompressedByteLimit, compressedPages);
|
@@ -43597,6 +43601,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
43597
43601
|
});
|
43598
43602
|
}
|
43599
43603
|
}
|
43604
|
+
const launcherFiles = {
|
43605
|
+
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
|
43606
|
+
};
|
43600
43607
|
const operationType = (0, utils_1.getOperationType)({ group, prerenderManifest });
|
43601
43608
|
const lambda = await (0, utils_1.createLambdaFromPseudoLayers)({
|
43602
43609
|
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,17 @@ 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
186
|
if (pageMatchesApi(page)) {
|
186
187
|
apiPages.push(page);
|
187
188
|
}
|
188
|
-
else if (
|
189
|
-
|
189
|
+
else if ((appPathRoutesManifest?.[`${normalizedPathname}/page`] ||
|
190
|
+
appPathRoutesManifest?.[`${normalizedPathname}/route`]) &&
|
191
|
+
lambdaAppPaths[page]) {
|
192
|
+
appRouterPages.push(page);
|
190
193
|
}
|
191
194
|
else {
|
192
195
|
nonApiPages.push(page);
|
@@ -284,6 +287,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
284
287
|
compress: false,
|
285
288
|
})}`)
|
286
289
|
.replace('__NEXT_SERVER_PATH__', `${(0, utils_1.getNextServerPath)(nextVersion)}/next-server.js`);
|
290
|
+
const appLauncher = launcher.replace('// pre-next-server-target', `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${requiredServerFilesManifest.config?.experimental?.serverActions
|
291
|
+
? 'experimental'
|
292
|
+
: 'next'}"`);
|
287
293
|
if (entryDirectory !== '.' &&
|
288
294
|
path_1.default.posix.join('/', entryDirectory) !== routesManifest.basePath) {
|
289
295
|
// we normalize the entryDirectory in the request URL since
|
@@ -293,14 +299,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
293
299
|
.join('/', entryDirectory)
|
294
300
|
.replace(/\//g, '\\/')}/, '')`);
|
295
301
|
}
|
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
302
|
const pageTraces = {};
|
300
303
|
const compressedPages = {};
|
301
304
|
const mergedPageKeys = [
|
302
305
|
...nonApiPages,
|
303
|
-
...
|
306
|
+
...appRouterPages,
|
304
307
|
...apiPages,
|
305
308
|
...internalPages,
|
306
309
|
];
|
@@ -405,10 +408,10 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
405
408
|
internalPages,
|
406
409
|
pageExtensions,
|
407
410
|
});
|
408
|
-
const
|
411
|
+
const appRouterLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
409
412
|
entryPath: projectDir,
|
410
413
|
config,
|
411
|
-
pages:
|
414
|
+
pages: appRouterPages,
|
412
415
|
prerenderRoutes,
|
413
416
|
pageTraces,
|
414
417
|
compressedPages,
|
@@ -419,10 +422,11 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
419
422
|
internalPages,
|
420
423
|
pageExtensions,
|
421
424
|
});
|
422
|
-
for (const group of
|
425
|
+
for (const group of appRouterLambdaGroups) {
|
423
426
|
if (!group.isPrerenders) {
|
424
427
|
group.isStreaming = true;
|
425
428
|
}
|
429
|
+
group.isAppRouter = true;
|
426
430
|
}
|
427
431
|
const apiLambdaGroups = await (0, utils_1.getPageLambdaGroups)({
|
428
432
|
entryPath: projectDir,
|
@@ -453,7 +457,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
453
457
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
454
458
|
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
|
455
459
|
})),
|
456
|
-
|
460
|
+
appRouterLambdaGroups: appRouterLambdaGroups.map(group => ({
|
457
461
|
pages: group.pages,
|
458
462
|
isPrerender: group.isPrerenders,
|
459
463
|
pseudoLayerBytes: group.pseudoLayerBytes,
|
@@ -463,7 +467,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
463
467
|
}, null, 2));
|
464
468
|
const combinedGroups = [
|
465
469
|
...pageLambdaGroups,
|
466
|
-
...
|
470
|
+
...appRouterLambdaGroups,
|
467
471
|
...apiLambdaGroups,
|
468
472
|
];
|
469
473
|
await (0, utils_1.detectLambdaLimitExceeding)(combinedGroups, lambdaCompressedByteLimit, compressedPages);
|
@@ -523,6 +527,9 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
523
527
|
});
|
524
528
|
}
|
525
529
|
}
|
530
|
+
const launcherFiles = {
|
531
|
+
[path_1.default.join(path_1.default.relative(baseDir, projectDir), '___next_launcher.cjs')]: new build_utils_1.FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
|
532
|
+
};
|
526
533
|
const operationType = (0, utils_1.getOperationType)({ group, prerenderManifest });
|
527
534
|
const lambda = await (0, utils_1.createLambdaFromPseudoLayers)({
|
528
535
|
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({
|