Emit onMiss on prerender configs - #114
Draft
lubakravche wants to merge 1 commit into
Draft
Conversation
Derive the BOA prerender onMiss mode per prerender group from the Next.js response classification on the group's canonical UI output: 'sync' when the response is complete (the stored shell is the finished page, so a miss keeps blocking revalidation and its request collapsing), 'dynamic' when it is initial or empty (dynamic-hole routes already cost two invocations on a blocking miss, so per-request dynamic serving plus one coalesced async shell backfill is cost-neutral and serves misses immediately). Unclassified groups and Route Handlers omit the key and keep the legacy blocking-miss behavior. The mode is captured per groupId before outputs are processed and applied to both the HTML and RSC configs, since the platform reads each path's config independently. The field is inert until the platform proxy flag is enabled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 6a3668c 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Note
Draft as a merge-order guard, not review status. This PR is ready for review now. It stays draft until the vercel/proxy dispatch PR and the vercel/api carriage PR merge and the proxy flag is enabled — merging the adapter side first would ship a field nothing consumes yet, and the changeset's behavior-change notice must land in the same release window as the platform actually honoring it.
Why
onMiss: "sync" | "dynamic", controlling how the platform serves a prerender cache miss. Absence means the current behavior: block the request on a synchronous revalidation.dynamicmeans serve the miss dynamically per request while a single coalesced async revalidation backfills the shell. RFC (approved): https://app.notion.com/p/3c9e06b059c481e4b84ee7e2abc06488routeType/response/compute, emitted sincenext@16.3.0-canary.96— the pin main already carries from EmitinitialMetadataon prerender configs #107). This is a framework heuristic with no developer override.response: "complete"→onMiss: "sync", emitted explicitly: the stored shell is the finished response, so blocking miss revalidation with its request collapsing (one invocation, one cache write) stays the cheapest way to serve it. Emitting the value rather than relying on absence makes new-Next builds distinguishable from legacy configs that merely lack classification data.response: "initial" | "empty"→onMiss: "dynamic": routes with dynamic holes already cost two invocations on a sync miss (shell render + resume), so per-request dynamic serving plus one coalesced async shell backfill is cost-neutral — and the miss is answered immediately instead of blocking.fallback: falsetemplates) and Route-Handler-only groups (routeType: "route") omit the key entirely — never an empty or undefined value — and keep the legacy blocking-miss behavior.staticHint), which was the direct skeleton for this change: same group-level derivation point, but emitting theonMissenum for classified groups instead of a boolean hint.staticHintis not emitted.What
handlePrerenderOutputsbuilds a group-level map keyed bygroupIdfrom the group's canonical UI output (routeType !== 'route' && response !== undefined) before any outputs are processed, then applies it to every written prerender config in the group. Next.js classifies only the canonical output, but the platform reads each path's config independently, so the group's HTML and RSC configs must both carry the value.initialMetadataemission (EmitinitialMetadataon prerender configs #107) is untouched; this PR only adds theonMisskey.16.3.0-canary.96, the first canary with the classification fields.chore: version packages (beta)flow, written to be conspicuous: once the proxy flag is enabled, upgrading the adapter changes miss behavior for all PPR routes with dynamic holes — intended and cost-neutral, but visible.Validation
outputs.test.tsusing the existingmakePrerenderOutput/ written-config helpers: a complete group emitsonMiss: "sync"on both its HTML and RSC configs; initial and empty groups emit"dynamic"on both; an unclassified output gains noonMissproperty; a Route-Handler-only group (routeType: "route") gains none.biome checkon touched files,vitest run(10/10), andtsc --noEmitall pass.🤖 Generated with Claude Code
Recreated from #112 (same commit), which was opened from a fork by a sandboxed agent that lacked push access to this repo.