Skip to content

next-routing: remove unanchored has.value fallback#94110

Open
fallintoplace wants to merge 1 commit into
vercel:canaryfrom
fallintoplace:fix/next-routing-anchor-has-value
Open

next-routing: remove unanchored has.value fallback#94110
fallintoplace wants to merge 1 commit into
vercel:canaryfrom
fallintoplace:fix/next-routing-anchor-has-value

Conversation

@fallintoplace
Copy link
Copy Markdown

Summary

This keeps @next/routing aligned with existing Next.js has.value matching semantics.

packages/next-routing/src/matchers.ts currently tries an anchored regex first and then falls back to an unanchored regex. That allows a rule like value: 'admin' to match not-admin, which is broader than the existing resolver.

This change removes the unanchored fallback and adds a regression test covering the not-admin case.

Related: #94109 was auto-closed by the issue template bot because it did not include a reproduction repository link.

Testing

  • runtime verification of exact match vs substring non-match in packages/next-routing
  • runtime verification that named capture regexes still resolve correctly
  • added a regression test in packages/next-routing/src/__tests__/conditions.test.ts

Why

The goal here is compatibility. @next/routing is reimplementing subtle resolver behavior, so matcher semantics should stay as close as possible to the existing Next.js resolver.

@fallintoplace fallintoplace marked this pull request as ready for review May 25, 2026 18:04
@fallintoplace fallintoplace marked this pull request as draft May 26, 2026 23:27
@fallintoplace fallintoplace marked this pull request as ready for review May 26, 2026 23:29
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