[next] changed condition for when to set rscDidPostponeHeader and added tests#10808
[next] changed condition for when to set rscDidPostponeHeader and added tests#10808
Conversation
🦋 Changeset detectedLatest commit: 8cd5407 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
| vary: rscVaryHeader, | ||
| ...(experimentalPPR && rscDidPostponeHeader | ||
| // If it contains a pre-render, then it was postponed. | ||
| ...(prerender && rscDidPostponeHeader |
There was a problem hiding this comment.
This ensures that the prerender is only generated with the "didPostponeHeader" being set if indeed that specific prerender did actually postpone. This is indicated by the truthyness of the prerender variable here.
| } else if (probe.notResponseHeaders) { | ||
| } | ||
|
|
||
| if (probe.notResponseHeaders) { |
There was a problem hiding this comment.
Unrelated but useful, this just ensures that if the probe specified both responseHeaders AND notResponseHeaders it checks both of them.
| // TODO: uncomment when we've fixed the 404 case for force-dynamic pages | ||
| // { pathname: '/dynamic/force-dynamic', dynamic: 'force-dynamic' }, |
There was a problem hiding this comment.
This will be addressed in a follow up PR as it requires changes to Next.js.
Ethan-Arrowood
left a comment
There was a problem hiding this comment.
tests look good to me. Would appreciate some review from Next.js team too.
| eslint: { | ||
| // Warning: This allows production builds to successfully complete even if | ||
| // your project has ESLint errors. | ||
| ignoreDuringBuilds: true, | ||
| }, |
There was a problem hiding this comment.
Can we remove eslint from the fixture? or is it baked into Next.js?
There was a problem hiding this comment.
It's baked in to Next.js's build process.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@32.5.3 ### Patch Changes - Handle `TooManyProjects` error in places where projects are created ([#10807](#10807)) - Updated dependencies \[[`89c1e0323`](89c1e03), [`fd29b966d`](fd29b96)]: - @vercel/node@3.0.9 - @vercel/next@4.0.14 ## @vercel/next@4.0.14 ### Patch Changes - Fixed headers for static routes when PPR is enabled ([#10808](#10808)) ## @vercel/node@3.0.9 ### Patch Changes - Replace usage of `fetch` with `undici.request` ([#10767](#10767)) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This copies over the E2E tests that were added to `vercel/vercel` in vercel/vercel#10808 and vercel/vercel#10823, with some minor adjustments to reflect the differences in cache behavior between start & deploy.

This adds some tests to the PPR implementation for Next.js. This also fixes a bug where the static pages were incorrectly generating a header that falsly indicated that it postponed.