[PR #275] [MERGED] fix: static-prefix routes not outranking dynamic catch-alls in route scoring #434

Closed
opened 2026-05-06 12:39:47 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/275
Author: @james-elicx
Created: 3/5/2026
Status: Merged
Merged: 3/6/2026
Merged by: @james-elicx

Base: mainHead: james/fix-static-route-priority


📝 Commits (4)

  • 5e7612a fix: static-prefix routes not outranking dynamic catch-alls in route scoring
  • 40bc41c share route precedence logic between app and pages router
  • a1f0d32 fix(routing): static-prefix boost collapsed infix-static ordering to a tie
  • 999aedf extra comment

📊 Changes

8 files changed (+247 additions, -68 deletions)

View changed files

📝 packages/vinext/src/routing/app-router.ts (+1 -42)
📝 packages/vinext/src/routing/pages-router.ts (+1 -26)
packages/vinext/src/routing/utils.ts (+71 -0)
tests/e2e/app-router/route-priority-static-suffix.spec.ts (+118 -0)
tests/fixtures/app-basic/app/locale-test/[locale]/[...path]/page.tsx (+15 -0)
tests/fixtures/app-basic/app/locale-test/[locale]/blog/[...path]/page.tsx (+15 -0)
tests/fixtures/app-basic/app/locale-test/[locale]/blog/page.tsx (+13 -0)
tests/fixtures/app-basic/app/locale-test/[locale]/page.tsx (+13 -0)

📄 Description

Bit of an edge case in how routes were being ranked - it was possible for static routes in a certain scenario to be ranked at a lower priority than a catch-all, despite the fact that they should be a higher priority.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/275 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `james/fix-static-route-priority` --- ### 📝 Commits (4) - [`5e7612a`](https://github.com/cloudflare/vinext/commit/5e7612a0e8f539524dda5ab5de5fc1bc726079b4) fix: static-prefix routes not outranking dynamic catch-alls in route scoring - [`40bc41c`](https://github.com/cloudflare/vinext/commit/40bc41c6c0e2c08ccc9004921d7e1fa19398378c) share route precedence logic between app and pages router - [`a1f0d32`](https://github.com/cloudflare/vinext/commit/a1f0d32bbd108951939de5b4a3430e4916c58126) fix(routing): static-prefix boost collapsed infix-static ordering to a tie - [`999aedf`](https://github.com/cloudflare/vinext/commit/999aedf3b3aab6779170977342a03c745a76e5ba) extra comment ### 📊 Changes **8 files changed** (+247 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/routing/app-router.ts` (+1 -42) 📝 `packages/vinext/src/routing/pages-router.ts` (+1 -26) ➕ `packages/vinext/src/routing/utils.ts` (+71 -0) ➕ `tests/e2e/app-router/route-priority-static-suffix.spec.ts` (+118 -0) ➕ `tests/fixtures/app-basic/app/locale-test/[locale]/[...path]/page.tsx` (+15 -0) ➕ `tests/fixtures/app-basic/app/locale-test/[locale]/blog/[...path]/page.tsx` (+15 -0) ➕ `tests/fixtures/app-basic/app/locale-test/[locale]/blog/page.tsx` (+13 -0) ➕ `tests/fixtures/app-basic/app/locale-test/[locale]/page.tsx` (+13 -0) </details> ### 📄 Description Bit of an edge case in how routes were being ranked - it was possible for static routes in a certain scenario to be ranked at a lower priority than a catch-all, despite the fact that they should be a higher priority. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:47 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#434
No description provided.