Skip to content

Improve Pages API route parity#1205

Draft
southpolesteve wants to merge 1 commit into
mainfrom
codex/pages-api-route-parity
Draft

Improve Pages API route parity#1205
southpolesteve wants to merge 1 commit into
mainfrom
codex/pages-api-route-parity

Conversation

@southpolesteve
Copy link
Copy Markdown
Collaborator

Extracts a focused slice from #922 into a reviewable PR.

This PR improves Pages API route compatibility for the Next.js deploy-suite work without pulling in the broader Pages Router rendering/client-navigation changes.

Includes:

  • route-level config.api.bodyParser.sizeLimit support
  • config.api.bodyParser = false raw request stream support
  • piping raw request streams into responses without forcing res.end()
  • res.revalidate() callback plumbing
  • best-effort Pages API runtime = "edge" / experimental-edge handling via NextRequest, with a warning that vinext does not implement true Edge Runtime isolation
  • an AsyncLocalStorage edge-runtime global helper for parity with edge API fixtures

Verification run locally:

  • vp test run tests/pages-api-route.test.ts
  • vp check packages/vinext/src/server/pages-api-route.ts packages/vinext/src/server/pages-node-compat.ts packages/vinext/src/server/edge-runtime-globals.ts tests/pages-api-route.test.ts
  • vp run vinext#build

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@1205

commit: a6881d5

@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant