Skip to content

Remove server route matcher stack#94157

Open
timneutkens wants to merge 20 commits into
canaryfrom
codex/remove-route-matcher-stack
Open

Remove server route matcher stack#94157
timneutkens wants to merge 20 commits into
canaryfrom
codex/remove-route-matcher-stack

Conversation

@timneutkens

@timneutkens timneutkens commented May 27, 2026

Copy link
Copy Markdown
Contributor

What?

Remove the legacy server route matcher managers, route matcher providers, and server route matcher classes. Move route definition and params metadata into fsChecker output and request metadata instead.

Why?

The filesystem checker already owns the normalized route lookup path in production. Keeping a separate matcher manager stack duplicates route inventory, adds reload plumbing, and makes dev and production behavior harder to keep aligned.

How?

  • Build pages and app route definitions in fsChecker from production manifests and from the dev route inventory.
  • Thread matched route definitions and params through resolve-routes and router-server request metadata into base-server and next-server.
  • Remove reloadMatchers propagation and delete the legacy matcher manager, provider, and matcher implementations and tests.
  • Preserve dev ensurePage behavior, including legacy custom-server render methods, and Pages API loading by using matched route definitions while loading compiled dev modules where needed.

Verification

  • pnpm test-start-webpack test/e2e/custom-routes/custom-routes.test.ts
  • pnpm test-start-turbo test/e2e/custom-routes/custom-routes.test.ts
  • pnpm test-dev-webpack test/e2e/custom-routes/custom-routes.test.ts
  • pnpm test-dev-turbo test/e2e/custom-routes/custom-routes.test.ts
  • pnpm test-dev-webpack test/e2e/on-request-error/dynamic-routes/dynamic-routes.test.ts
  • pnpm test-dev-turbo test/e2e/on-request-error/dynamic-routes/dynamic-routes.test.ts
  • pnpm test-start-webpack test/e2e/app-dir/app-routes/app-custom-routes.test.ts
  • pnpm test-start-webpack test/e2e/app-dir/edge-route-rewrite/edge-route-rewrite.test.ts
  • pnpm test-start-webpack test/e2e/middleware-rewrites/test/index.test.ts
  • pnpm test-start-webpack test/e2e/middleware-matcher/index.test.ts test/e2e/middleware-custom-matchers-basepath/test/index.test.ts test/e2e/app-dir/rewrites-redirects/rewrites-redirects.test.ts
  • pnpm test-start-webpack test/e2e/api-catch-all/api-catch-all.test.ts test/e2e/basepath-root-catch-all/basepath-root-catch-all.test.ts test/production/root-catchall-cache/root-catchall-cache.test.ts
  • pnpm test-start-webpack test/e2e/i18n-beforefiles-rewrite/i18n-beforefiles-rewrite.test.ts
  • pnpm test-start-webpack test/e2e/basepath/redirect-and-rewrite.test.ts
  • pnpm test-dev-webpack test/e2e/custom-server/custom-server.test.ts
  • pnpm test-start-webpack test/e2e/custom-server/custom-server.test.ts
  • pnpm --filter=next types
  • pnpm --filter=next build
  • git diff --check

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Stats skipped

Commit: 28a04cc
View workflow run

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch 7 times, most recently from 46f9eb9 to 76b352a Compare May 28, 2026 16:03
@timneutkens
timneutkens marked this pull request as ready for review May 28, 2026 16:35
@timneutkens
timneutkens marked this pull request as draft May 28, 2026 16:35
@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch 4 times, most recently from f7f93a9 to 2d6ea15 Compare May 29, 2026 09:10
Comment thread packages/next/src/server/base-server.ts Outdated
Comment thread packages/next/src/server/base-server.ts Outdated
Comment thread packages/next/src/server/next-server.ts
Comment thread test/development/app-dir/build-error-logs/build-error-logs.test.ts
Comment thread test/e2e/new-link-behavior/material-ui.test.ts
Comment thread packages/next/src/server/lib/router-server.ts
Comment thread packages/next/src/server/lib/router-server.ts
Comment thread packages/next/src/server/lib/router-server.ts
Comment thread packages/next/src/server/lib/router-server.ts
Comment thread packages/next/src/server/lib/router-server.ts
Comment thread packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
Comment thread packages/next/src/server/lib/router-utils/setup-dev-bundler.ts Outdated
Comment thread packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
Comment thread packages/next/src/server/lib/router-utils/resolve-routes.ts Outdated
Comment thread packages/next/src/server/lib/router-utils/filesystem.ts
@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch 7 times, most recently from 013e4e6 to dc108f6 Compare June 21, 2026 18:25
@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch from 0adce3b to ae5ea25 Compare June 26, 2026 18:51
@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch from ae5ea25 to be7dfc7 Compare July 8, 2026 14:32
@timneutkens
timneutkens force-pushed the codex/remove-route-matcher-stack branch from be7dfc7 to 28a04cc Compare July 14, 2026 10:59
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