Skip to content

Handle versioned i18n Pages API routing - #103

Draft
timneutkens wants to merge 1 commit into
mainfrom
codex/versioned-i18n-pages-api-routing
Draft

timneutkens wants to merge 1 commit into
mainfrom
codex/versioned-i18n-pages-api-routing

Conversation

@timneutkens

@timneutkens timneutkens commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Restore the i18n Pages API routing fix from #81 behind a versioned routing-manifest contract instead of a Next.js package-version check.

  • Treat unversioned manifests and routing.version: 1 as the legacy contract, preserving existing locale-prefixed API routing.
  • For routing.version: 2, keep /api and nested Pages API paths canonical across wildcard-domain prefixing, default-locale prefixing, localeDetection: false fallback routing, and locale-prefix removal. Similar prefixes such as /apiary remain ordinary localized pages.
  • Reject unsupported routing-manifest versions before creating deployment output.
  • Add focused adapter tests and a patch changeset.

This adapter change must be released and synced into the Vercel builder before Next.js starts emitting routing manifest v2. That rollout order decouples the two repositories' release schedules while preserving older Next.js behavior.

Paired Next.js change: vercel/next.js #97366.

Verification

  • pnpm --filter @next-community/adapter-vercel test --run (10 tests passed)
  • pnpm --filter @next-community/adapter-vercel build
  • pnpm exec biome check packages/adapter/src/index.ts packages/adapter/src/routing.ts packages/adapter/src/routing.test.ts packages/adapter/package.json .changeset/fix-i18n-api-routes.md

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 878d37d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@next-community/adapter-vercel Patch

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

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
adapter-vercel-adapter Ready Ready Preview Aug 14, 2026 12:29pm

This branch was successfully deployed

1 active deployment
Preview — 878d37de Deployed Aug 14, 2026 by vercel[bot]
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