feat: track stable Next.js API surface and contract coverage#461
Draft
Divkix wants to merge 7 commits intocloudflare:mainfrom
Draft
feat: track stable Next.js API surface and contract coverage#461Divkix wants to merge 7 commits intocloudflare:mainfrom
Divkix wants to merge 7 commits intocloudflare:mainfrom
Conversation
Add machine-readable API tracking infrastructure to enforce compatibility between vinext's shims and the published Next.js API surface. - Extract API manifest from next@16.1.6 (18 modules, scripts/extract-nextjs-api.ts) - Add manifest diff script for detecting API changes (scripts/diff-nextjs-api.ts) - Extract inline shim map into shared registry module (shims/registry.ts) - Add shim coverage checker with known-gaps support (shims/coverage.ts) - Add CI gate for shim coverage (ci.yml shim-coverage job) - Add 5 behavioral contract tests (redirect 303, cookies, headers, middleware, metadata) - Fix server action redirect status: 307 → 303 to match Next.js behavior - Add weekly Next.js stable release tracking workflow (nextjs-api-track.yml) - Enhance tip.yml with optional compat test job Closes cloudflare#454
- Fix workflow tsx invocations: pnpm tsx → pnpm dlx tsx - Add label creation step before issue search in tracking workflow - Fix HEREDOC indentation in issue body template - Stop skipping default exports in shim coverage check - Add subdirectory module discovery (compat/router, legacy/image, font/google, font/local, web-vitals) to manifest extractor - Regenerate api-manifest.json: 18 → 21 modules covered - Add test fixtures for subdirectory module extraction
commit: |
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.
Closes #454
Summary
This PR finishes the stable API-tracking work for vinext's Next.js compatibility layer.
It adds three things that now work together:
nextpackageknown-gaps.jsonnext devIt also moves the server-action redirect
303assertion out of the shared contract layer and into the regular App Router regression suite, because that flow depends on vinext's action transport details.What Changed
api-manifest.jsonfornext@16.1.6known-gaps.jsonfor intentional gaps surfaced by discovery (next/babeland experimental test helpers).github/workflows/nextjs-api-track.ymlto work fromnpm packoutput and de-dupe issues by version marker303server-action redirect assertion intotests/app-router.test.ts127.0.0.1for reliable local server boot in testsScope Notes
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