mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
[next] Ensure only pages enable streaming (#11660)
This fixes a regression introduced by #11625 that enabled streaming for routes on the pages router (these routes do not support streaming).
This commit is contained in:
6
.changeset/selfish-yaks-sparkle.md
Normal file
6
.changeset/selfish-yaks-sparkle.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
'@vercel/next': patch
|
||||||
|
'vercel': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Don't create streaming lambdas for pages router routes
|
||||||
@@ -947,6 +947,10 @@ export async function serverBuild({
|
|||||||
const appRouterStreamingActionLambdaGroups: LambdaGroup[] = [];
|
const appRouterStreamingActionLambdaGroups: LambdaGroup[] = [];
|
||||||
|
|
||||||
for (const group of appRouterLambdaGroups) {
|
for (const group of appRouterLambdaGroups) {
|
||||||
|
if (!group.isPrerenders || group.isExperimentalPPR) {
|
||||||
|
group.isStreaming = true;
|
||||||
|
}
|
||||||
|
|
||||||
group.isAppRouter = true;
|
group.isAppRouter = true;
|
||||||
|
|
||||||
// We create a streaming variant of the Prerender lambda group
|
// We create a streaming variant of the Prerender lambda group
|
||||||
@@ -961,6 +965,9 @@ export async function serverBuild({
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const group of appRouteHandlersLambdaGroups) {
|
for (const group of appRouteHandlersLambdaGroups) {
|
||||||
|
if (!group.isPrerenders) {
|
||||||
|
group.isStreaming = true;
|
||||||
|
}
|
||||||
group.isAppRouter = true;
|
group.isAppRouter = true;
|
||||||
group.isAppRouteHandler = true;
|
group.isAppRouteHandler = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1508,7 +1508,7 @@ export type LambdaGroup = {
|
|||||||
maxDuration?: number;
|
maxDuration?: number;
|
||||||
isAppRouter?: boolean;
|
isAppRouter?: boolean;
|
||||||
isAppRouteHandler?: boolean;
|
isAppRouteHandler?: boolean;
|
||||||
readonly isStreaming: boolean;
|
isStreaming?: boolean;
|
||||||
readonly isPrerenders: boolean;
|
readonly isPrerenders: boolean;
|
||||||
readonly isExperimentalPPR: boolean;
|
readonly isExperimentalPPR: boolean;
|
||||||
isActionLambda?: boolean;
|
isActionLambda?: boolean;
|
||||||
@@ -1565,7 +1565,6 @@ export async function getPageLambdaGroups({
|
|||||||
const routeName = normalizePage(page.replace(/\.js$/, ''));
|
const routeName = normalizePage(page.replace(/\.js$/, ''));
|
||||||
const isPrerenderRoute = prerenderRoutes.has(routeName);
|
const isPrerenderRoute = prerenderRoutes.has(routeName);
|
||||||
const isExperimentalPPR = experimentalPPRRoutes?.has(routeName) ?? false;
|
const isExperimentalPPR = experimentalPPRRoutes?.has(routeName) ?? false;
|
||||||
const isStreaming = !isPrerenderRoute || isExperimentalPPR;
|
|
||||||
|
|
||||||
let opts: { memory?: number; maxDuration?: number } = {};
|
let opts: { memory?: number; maxDuration?: number } = {};
|
||||||
|
|
||||||
@@ -1637,7 +1636,6 @@ export async function getPageLambdaGroups({
|
|||||||
...opts,
|
...opts,
|
||||||
isPrerenders: isPrerenderRoute,
|
isPrerenders: isPrerenderRoute,
|
||||||
isExperimentalPPR,
|
isExperimentalPPR,
|
||||||
isStreaming,
|
|
||||||
isApiLambda: !!isApiPage(page),
|
isApiLambda: !!isApiPage(page),
|
||||||
pseudoLayerBytes: initialPseudoLayer.pseudoLayerBytes,
|
pseudoLayerBytes: initialPseudoLayer.pseudoLayerBytes,
|
||||||
pseudoLayerUncompressedBytes: initialPseudoLayerUncompressed,
|
pseudoLayerUncompressedBytes: initialPseudoLayerUncompressed,
|
||||||
|
|||||||
Reference in New Issue
Block a user