Skip to content

[next] changed condition for when to set rscDidPostponeHeader and added tests#10808

Merged
wyattjoh merged 4 commits intomainfrom
wyattjoh/ppr-tests
Nov 8, 2023
Merged

[next] changed condition for when to set rscDidPostponeHeader and added tests#10808
wyattjoh merged 4 commits intomainfrom
wyattjoh/ppr-tests

Conversation

@wyattjoh
Copy link
Contributor

@wyattjoh wyattjoh commented Nov 7, 2023

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.

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2023

🦋 Changeset detected

Latest commit: 8cd5407

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/next Patch
vercel Patch

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

@wyattjoh
Copy link
Contributor Author

wyattjoh commented Nov 7, 2023

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but useful, this just ensures that if the probe specified both responseHeaders AND notResponseHeaders it checks both of them.

Comment on lines +18 to +19
// TODO: uncomment when we've fixed the 404 case for force-dynamic pages
// { pathname: '/dynamic/force-dynamic', dynamic: 'force-dynamic' },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be addressed in a follow up PR as it requires changes to Next.js.

Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests look good to me. Would appreciate some review from Next.js team too.

Comment on lines +6 to +10
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove eslint from the fixture? or is it baked into Next.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's baked in to Next.js's build process.

@wyattjoh wyattjoh merged commit fd29b96 into main Nov 8, 2023
@wyattjoh wyattjoh deleted the wyattjoh/ppr-tests branch November 8, 2023 16:21
Ethan-Arrowood pushed a commit that referenced this pull request Nov 8, 2023
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>
@EndangeredMassa EndangeredMassa changed the title tests: added tests for PPR [next] changed condition for when to set rscDidPostponeHeader and added tests Nov 8, 2023
ztanner added a commit to vercel/next.js that referenced this pull request Nov 29, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants