Skip to content

Commit

Permalink
[cli] allow prerender to stream (#11745)
Browse files Browse the repository at this point in the history
Allow all app router lambdas to use streaming, including prerender and
experimental PPR.

Practically speaking this is a no-op at the moment; `api-builds` has a
feature-flagged check to ensure any prerender function will not stream.
It is effectively a duplicate of the check that this PR removes.

This is the check in `api-builds`:
https://github.com/vercel/api/blob/987de85d6a38a34f717cd1372826cbaf6113dd7d/services/api-builds/src/endpoints/post-lambda.ts#L273
  • Loading branch information
craigandrews committed Jun 18, 2024
1 parent 88e9800 commit f0d6aca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-spoons-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vercel': patch
---

Allow app router prerender functions to use streaming.
5 changes: 1 addition & 4 deletions packages/next/src/server-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,7 @@ export async function serverBuild({
const appRouterStreamingActionLambdaGroups: LambdaGroup[] = [];

for (const group of appRouterLambdaGroups) {
if (!group.isPrerenders || group.isExperimentalPPR) {
group.isStreaming = true;
}

group.isStreaming = true;
group.isAppRouter = true;

// We create a streaming variant of the Prerender lambda group
Expand Down

0 comments on commit f0d6aca

Please sign in to comment.