Pass through prerender classification metadata to prerender-config.json#80
Open
agadzik wants to merge 1 commit into
Open
Pass through prerender classification metadata to prerender-config.json#80agadzik wants to merge 1 commit into
agadzik wants to merge 1 commit into
Conversation
Forward hasPostponed, hasFallback, htmlSize, and isDynamicRoute from AdapterOutput['PRERENDER'] (added in vercel/next.js#95534) so deployment summaries can classify PPR and Cache Components routes, matching the @vercel/next builder. The values are tri-state, so they are written raw: false/0 are preserved and only undefined keys are dropped. Adds the repo's first vitest setup with a pass-through test, wired into the Lint workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e86b9d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@agadzik is attempting to deploy a commit to the vtest314-next-adapter-e2e-tests Team on Vercel. A member of the Team first needs to authorize it. |
mischnic
reviewed
Jul 7, 2026
Comment on lines
+618
to
+651
| /** | ||
| * Prerender classification metadata added to `AdapterOutput['PRERENDER']` | ||
| * by https://github.com/vercel/next.js/pull/95534. Remove this type (and | ||
| * the cast below) once the `next` devDependency includes those fields. | ||
| */ | ||
| type PrerenderClassificationFields = { | ||
| /** | ||
| * hasPostponed signals whether the build-time prerender of a PPR app | ||
| * page postponed (React suspended on dynamic data). `false` means it | ||
| * prerendered without postponing; `undefined` means the signal does | ||
| * not apply (pages router, route handlers, blocking templates). | ||
| */ | ||
| hasPostponed?: boolean; | ||
| /** | ||
| * hasFallback signals whether a dynamic route template has a static | ||
| * fallback shell generated during build. `false` means the template | ||
| * is blocking or omitted; `undefined` means the concept does not | ||
| * apply (concrete prerenders). | ||
| */ | ||
| hasFallback?: boolean; | ||
| /** | ||
| * htmlSize is the byte size of the prerendered HTML shell for app | ||
| * pages. `0` means an empty shell (everything postponed). It is only | ||
| * set on the HTML prerender output; RSC/data/segment outputs leave it | ||
| * `undefined`, as do pages router and route handler outputs. | ||
| */ | ||
| htmlSize?: number; | ||
| /** | ||
| * isDynamicRoute signals whether this prerender originates from a | ||
| * dynamic route template (`dynamicRoutes` in the prerender manifest) | ||
| * rather than a concrete prerendered path (`routes`). | ||
| */ | ||
| isDynamicRoute?: boolean; | ||
| }; |
Collaborator
There was a problem hiding this comment.
We should be able to remove this once the Nextjs side is merged. then bumping the next canary version dependency here will give you the true types.
Author
There was a problem hiding this comment.
yeah, wont merge this until the next changes are merged and I make this change!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Forwards four per-route classification fields from
AdapterOutput['PRERENDER']into the Build Output APIprerender-config.json:hasPostponed— whether the build-time PPR prerender postponedhasFallback— whether a dynamic route template has a static fallback shellhtmlSize— byte size of the prerendered HTML shell (0= fully postponed empty shell)isDynamicRoute— dynamic route template vs. concrete prerendered pathWhy
Vercel's deployment summary classifies PPR and Cache Components routes from these signals. The legacy
@vercel/nextbuilder emits them (vercel/vercel#16554, vercel/vercel#16584); this adapter did not, so newer Next versions regressed the summary.How
Pure pass-through — all four values are computed in Next core by vercel/next.js#95534 and written raw: they are tri-state, so
false/0must be preserved and onlyundefinedkeys dropped byJSON.stringify. Deliberately not using the|| undefinedidiom used elsewhere in this file, which would collapsefalsetoundefined.Since no published
nextcanary includes vercel/next.js#95534 yet, the fields are typed via a localPrerenderClassificationFieldstype intersected at the read site. Remove it once thenextdevDependency is bumped past that PR's merge. Until then (and on older Next versions at runtime) the fields simply readundefinedand are omitted — this PR is safe to merge independently.Tests
Adds the repo's first vitest setup (
vitest run, wired into the Lint workflow) with a pass-through test forhandlePrerenderOutputs: assertshasFallback: falseandhtmlSize: 0survive un-mangled, and that absent fields produce no keys.Rollout
A release of this package does nothing in production until
@vercel/nextbumps its pinned version and re-bundles. After merge, cut a new beta from the version-packages PR so that follow-up can pin it.Known fast-follow (separate PR, different mechanism, tracked in #79):
.vc-config.jsonreportsoperationType: PAGEwhere the legacy builder emitsISR(e.g.pages/index.jswithgetStaticProps+revalidate), which corrupts the same deployment-summary classification these fields feed.Supersedes #78 (same commit, branch renamed).
🤖 Generated with Claude Code