mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1062] [MERGED] feat(app-router): add artifact compatibility metadata #1062
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1062
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1062
Author: @NathanDrake2406
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/6/2026
Merged by: @james-elicx
Base:
main← Head:nathan/726-compat-01-envelope📝 Commits (5)
b56b041feat(app-router): add artifact compatibility envelope7d9ac6dtest(app-router): cover future artifact schema rejection01751affeat(app-router): attach artifact compatibility metadata6284368Merge remote-tracking branch 'upstream/main' into nathan/726-compat-01-enveloped2ec7c2fix(app-router): tolerate unused compatibility metadata parse failures📊 Changes
6 files changed (+556 additions, -3 deletions)
View changed files
📝
packages/vinext/src/server/app-elements-wire.ts(+35 -2)📝
packages/vinext/src/server/app-elements.ts(+1 -0)📝
packages/vinext/src/server/app-page-render.ts(+35 -1)➕
packages/vinext/src/server/artifact-compatibility.ts(+202 -0)📝
tests/app-elements.test.ts(+240 -0)📝
tests/app-page-render.test.ts(+43 -0)📄 Description
What this changes
Implements
#726-COMPAT-01plus#726-COMPAT-02/03from #726.This PR adds the App Router artifact compatibility envelope, attaches concrete render-boundary metadata to outgoing record payloads, and defines a conservative compatibility evaluator for future cache/skip callers.
Why
Issue #726 requires every reusable or skippable artifact to carry compatibility proof before cache reuse or skip transport can depend on it. The rule for this slice is deliberately strict: no proof, no reuse. Unknown compatibility is represented as a render-fresh fallback, never as positive compatibility proof.
Approach
packages/vinext/src/server/artifact-compatibility.tswith schema constants,ArtifactCompatibilityEnvelope, constructor/parser helpers, a route/root graph fingerprint helper, andevaluateArtifactCompatibility().renderAppPageLifecyclewhen the outgoing App Router payload is a record:process.env.__VINEXT_BUILD_IDrootBoundaryIdfrom__rootLayoutwhen availablerenderEpoch: nulluntil a real epoch owner existsCorrectness oracle
Vinext internal invariant from #726: no reusable or skippable artifact should gain implicit compatibility proof from cache presence, artifact presence, or wire shape. Unknown graph/deployment/root/epoch compatibility must return a render-fresh fallback, and only fully known matching metadata can produce
compatible.A focused Next.js source/test search for
artifact compatibility,compatibility envelope,renderEpoch,deploymentVersion, andgraphVersionfound no public Next.js behavior to port for this internal Vinext protocol. This PR does not claim public Next.js behavior parity for rolling deploys.Validation
vp test run tests/app-elements.test.ts tests/app-page-render.test.tsvp check packages/vinext/src/server/artifact-compatibility.ts packages/vinext/src/server/app-elements.ts packages/vinext/src/server/app-page-render.ts tests/app-elements.test.ts tests/app-page-render.test.tsvp run vinext#buildRisks / follow-ups
graphVersionhelper is a narrow route/root fingerprint until the RouteManifest graphVersion from GRAPH-02/03 exists.renderEpochis carried but remainsnull, so current artifacts cannot become positive reuse proof solely from matching graph/deployment/root metadata.#726-COMPAT-04/05should add old-client/new-server coverage and hard-navigation loop prevention before any broader deployment fallback behavior depends on this envelope.Refs #726
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.