Add opt-in next routing resolver delegation#94102
Draft
timneutkens wants to merge 1 commit into
Draft
Conversation
Contributor
Failing test suitesCommit: 59a81ff | About building and testing Next.js
Expand output● hmr-intercept-routes › should update intercept routes via HMR
Expand output● app dir - metadata static routes cache › should generate different content after replace the static metadata file |
timneutkens
force-pushed
the
codex/server-routing/opt-in-delegation
branch
from
May 25, 2026 16:33
6b71457 to
19ecc5b
Compare
timneutkens
force-pushed
the
codex/server-routing/opt-in-delegation
branch
2 times, most recently
from
May 27, 2026 09:51
7656147 to
efb45e1
Compare
timneutkens
force-pushed
the
codex/server-routing/result-mapper
branch
from
May 27, 2026 10:12
6b693f0 to
278165d
Compare
timneutkens
force-pushed
the
codex/server-routing/opt-in-delegation
branch
from
May 27, 2026 10:12
efb45e1 to
147d80e
Compare
Contributor
Stats cancelledCommit: 59a81ff |
timneutkens
force-pushed
the
codex/server-routing/result-mapper
branch
from
May 27, 2026 12:40
eeebd58 to
50aa72b
Compare
timneutkens
force-pushed
the
codex/server-routing/opt-in-delegation
branch
from
May 27, 2026 12:40
f8f18f7 to
9270567
Compare
timneutkens
force-pushed
the
codex/server-routing/result-mapper
branch
from
June 4, 2026 11:19
50aa72b to
8c11b31
Compare
timneutkens
force-pushed
the
codex/server-routing/opt-in-delegation
branch
from
June 4, 2026 11:20
9270567 to
59a81ff
Compare
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.
Stack
Depends on #94101 (
codex/server-routing/result-mapper). This is the top PR in the server-routing stack.What?
Adds an opt-in live server delegation path from
resolve-routes.tsto@next/routingbehind__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1. The hook is in the actualnext startroute resolver used byrouter-server.ts, but default behavior remains unchanged unless the env var is enabled.This also adds
@next/routingas anextpackage dependency, ensures isolated tests pack the local@next/routingpackage, and fixes repeated destination query parameters in@next/routingso rewrites like/?items=1&items=2preserve array values.Why?
This is the first live-server adoption step after the audit, adapter input builder, and result mapper PRs. It keeps compatibility first:
@next/routingis used only for selected production route-resolution paths where the mapped result can be returned safely, otherwise the legacy resolver continues.Expanded e2e coverage showed that broader custom-route manifests still need live-server semantics for
has/missing, first-segment params such as/:path, catch-all params, destination query interpolation, and external redirect query encoding. This PR now detects those unsupported features and keeps those apps on the legacy resolver until the adapter models them exactly.How?
@next/routingstate from the existingfsCheckeradapter.resolveRoutesresult shape._next/datapathnames from the live opt-in@next/routinginput.has/missing, catch-all source params, first-segment source params, query interpolation in destinations, or external destinations with query strings.@next/routing.Verification
pnpm --filter @next/routing testpnpm testonly test/unit/server-routing-equivalence/next-routing-adapter.test.ts test/unit/server-routing-equivalence/resolve-routes.test.tspnpm --filter @next/routing buildpnpm --filter=next build__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/e2e/rewrites-has-condition/rewrites-has-condition.test.ts test/e2e/rewrites-destination-query-array/rewrites-destination-query-array.test.ts test/e2e/dynamic-routing/dynamic-routing.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/e2e/custom-routes/custom-routes.test.ts test/e2e/custom-routes-catchall/custom-routes-catchall.test.ts test/e2e/rewrites-client-resolving/rewrites-client-resolving.test.ts test/e2e/invalid-static-asset-404-pages/invalid-static-asset-404-pages.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/e2e/basepath/redirect-and-rewrite.test.ts test/e2e/trailing-slashes-rewrite/trailing-slashes-rewrite.test.ts test/e2e/i18n-data-route/i18n-data-route.test.ts test/e2e/custom-routes-i18n/custom-routes-i18n.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/e2e/trailingslash-with-rewrite/index.test.ts test/e2e/i18n-support-index-rewrite/i18n-support-index-rewrite.test.ts test/e2e/app-dir/rsc-query-routing/rsc-query-routing.test.ts test/e2e/middleware-rewrites/test/index.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/production/custom-server/custom-server.test.ts test/production/required-server-files-ssr-404/test/index.test.ts test/production/static-404/static-404.test.ts test/production/middleware-prefetch/middleware-prefetch.test.ts test/production/rewrite-request-smuggling/rewrite-request-smuggling.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/production/rewrite-request-smuggling/rewrite-request-smuggling.test.ts test/production/standalone-mode/required-server-files/required-server-files.test.ts -t "does not smuggle|should resolve correctly when a redirect is returned|should handle data routes with optional catch-all params|should de-dupe HTML/data requests"__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-turbo test/development/gssp-redirect-with-rewrites/gssp-redirect-with-rewrites.test.ts test/development/dynamic-route-rename/dynamic-route-rename.test.ts test/development/trailing-slash-dist/trailing-slash-dist.test.ts__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1 NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-turbo test/development/middleware-errors/index.test.tsgit diff --checkNote: a combined dev bucket including
middleware-errors,middleware-dev-update,dynamic-route-rename,gssp-redirect-with-rewrites, andtrailing-slash-disthad onemiddleware-errorsfailure, butmiddleware-errorspassed when isolated. The opt-in resolver is disabled in dev, so this looks like a dev error-suite interaction rather than an opt-in routing regression.