mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #454] Track stable Next.js API surface with a checked-in manifest and CI coverage gate #102
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#102
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?
Originally created by @Divkix on GitHub (Mar 11, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/454
Summary
vinext already has strong compatibility infrastructure:
tests/nextjs-compat/TRACKING.mdpackages/vinext/src/check.ts.github/workflows/ci.yml.github/workflows/ecosystem.yml.github/workflows/tip.ymlWhat we do not have yet is a machine-readable compatibility model for stable Next.js releases.
Today, compatibility knowledge is spread across:
packages/vinext/src/index.tspackages/vinext/src/shims/packages/vinext/src/check.tstests/nextjs-compat/That works, but it means we do not have a single CI-enforced answer to:
next/*API surface for versionx.y.z?This issue proposes a stable-only compatibility tracking system built around a checked-in manifest extracted from the published
nextnpm package.Goals
api-manifest.jsonfor the currently supported stable version.Non-Goals
check.tsas the canonical compatibility model.Decisions
"16.1".check.tsremains a user-facing migration tool, not the internal engineering source of truth.Current vs Proposed
index.ts+ hand-maintained support maps incheck.tsapi-manifest.json+ exported shim registry +known-gaps.jsonArchitecture
Current:
Proposed:
Registry refactor:
Proposed Work
1. Extract a stable public API manifest
Add:
scripts/extract-nextjs-api.mjsapi-manifest.jsonBehavior:
npm packthe published stablenext@x.y.znext/*entrypoints from the published packageExample shape:
Notes:
next/navigationmay require a one-hop resolution into compiled output.2. Move the shim registry into a shared module
Add:
packages/vinext/src/shims/registry.tsUpdate:
packages/vinext/src/index.tsBehavior:
nextShimMapinto a reusable exported registrynext/*entries separate from internalnext/dist/*aliasesThis avoids parsing
index.tsas source text in CI.3. Add a required shim coverage check
Add:
scripts/check-shim-coverage.mjsknown-gaps.jsonUpdate:
.github/workflows/ci.ymlBehavior:
api-manifest.jsonknown-gaps.jsonSuggested
known-gaps.jsonshape:Suggested statuses:
plannedstubwont-fixThis lets reviewers distinguish intentional non-goals from temporary gaps.
4. Add stable-only tracking workflow
Add:
.github/workflows/nextjs-api-track.ymlscripts/diff-nextjs-api.mjsBehavior:
npm view next versionapi-manifest.jsonThis should target stable releases only.
5. Add a small dual-target contract suite
Add:
tests/contracts/tests/fixtures/contract-app/Initial contracts:
redirect()status behaviorcookies()mutability gatingheaders()read-only behaviorgenerateMetadata()merge chainBehavior:
6. Keep canary advisory-only
Update:
.github/workflows/tip.ymlBehavior:
next@canaryas non-blocking early warningTesting / Validation
This work needs tests at three layers: script correctness, shim coverage enforcement, and behavioral parity.
1. Script-level tests
Add Vitest coverage for the new scripts and helpers.
Suggested files:
tests/api-manifest.test.tstests/shim-coverage.test.tsThese should cover:
module.exports = require(...)style wrappersnext/navigationstyle caseknown-gaps.jsonPrefer fixture-based tests over hitting the network.
Suggested fixtures:
tests/fixtures/next-api-manifest/2. Registry refactor safety
The registry extraction from
index.tsmust not change runtime behavior.Validation:
resolve.aliasandresolveIdstill handle:next/*next/*.jsnext/dist/*aliasesMinimum targeted test runs:
pnpm test tests/shims.test.tspnpm test tests/nextjs-compat/3. Contract tests
Add a small dual-target suite for behavioral parity.
Suggested files:
tests/contracts/redirect.contract.test.tstests/contracts/request-apis.contract.test.tstests/contracts/middleware.contract.test.tstests/contracts/metadata.contract.test.tsInitial cases:
redirect()status behaviorcookies()mutability gatingheaders()read-only behaviorgenerateMetadata()merge chainThese should run against the same fixture app under:
4. CI / workflow validation
Required on PRs:
api-manifest.jsonNon-blocking / scheduled:
tip.yml5. Definition of done
This issue is complete when:
api-manifest.jsonis checked in and versionedknown-gaps.jsonis checked in and required for intentional omissionsindex.tsnext/*export is missing without a documented gaptip.ymlremains advisory onlyFollow-ups
Out of scope for v1, but natural follow-ups:
next/dist/*Why this is worth doing
This does not replace the current test suite or ecosystem jobs. It fills a different gap: machine-enforced API drift detection for stable releases.
That gives us:
@Divkix commented on GitHub (Mar 11, 2026):
Implemented on
feat/api-surface-tracking. #461What landed:
nextpackage instead of using a hard-coded module list.api-manifest.jsonnow tracks 26 runtime modules fornext@16.1.6..github/workflows/nextjs-api-track.ymlnow works from the published artifact and de-dupes issues by version marker.known-gaps.json.tests/contracts/http.contract.test.tsand pass against both vinext and realnext dev.Important scope clarifications:
wont-fixinknown-gaps.json(next/babel,next/client,next/jest, and the experimental test helpers).303check is covered intests/app-router.test.ts, not in the shared contract suite, because that flow depends on vinext-specific action transport.Verification:
pnpm test tests/api-manifest.test.ts tests/manifest-diff.test.ts tests/shim-coverage.test.tspnpm test tests/app-router.test.ts -t "uses 303 for server action redirects"pnpm test tests/contracts/http.contract.test.tsCONTRACT_TARGET=nextjs pnpm test tests/contracts/http.contract.test.tspnpm test tests/shims.test.tsnext@16.1.6packagepnpm run typecheckpnpm run lintpnpm run fmt:check@Divkix commented on GitHub (Mar 11, 2026):
Related to #204. This issue tracks the API surface (what exports exist), while #204 does a behavioral audit (whether implementations match Next.js behavior). They complement each other - the manifest tells us what to implement, the audit verifies we implement it correctly. Not blocking.
@Divkix commented on GitHub (Apr 14, 2026):
Looks like it has already been solved with a github workflow.