Add opt-in next routing resolver delegation#94102
Draft
timneutkens wants to merge 1 commit into
Draft
Conversation
Contributor
Failing test suitesCommit: 19ecc5b | About building and testing Next.js
Expand output● next-server-nft › with output:standalone › should not trace too many files in next-server.js.nft.json Other failing CI jobs |
6b71457 to
19ecc5b
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.
What?
Adds an opt-in live server delegation path from
resolve-routes.tsto@next/routingbehind__NEXT_EXPERIMENTAL_USE_NEXT_ROUTING_RESOLVER=1. The guard intentionally limits delegation to compatible production requests and falls back to the legacy resolver for dev, minimal mode, upgrade requests, i18n, basePath, trailingSlash, middleware, exportPathMap, RSC requests, and dynamic filesystem route apps.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 default behavior unchanged while making it possible to exercise selected production route-resolution paths through the shared package. Existing routing e2e coverage showed dynamic Pages Router behavior is not equivalent enough yet, so this PR keeps those apps on the legacy resolver until dedicated dynamic-route equivalence work lands.
How?
@next/routingstate from the existingfsCheckeradapter.resolveRoutesresult shape.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/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-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-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"git diff --check