mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #400] [MERGED] fix: middleware object matcher semantics and i18n parity #541
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#541
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/400
Author: @JaredStowell
Created: 3/10/2026
Status: ✅ Merged
Merged: 3/10/2026
Merged by: @james-elicx
Base:
main← Head:jstowell/fix-middleware-matcher-options📝 Commits (9)
f7c0d7cFix middleware matcher request usage11dd9f1Handle object middleware matchers15e137eFix middleware object matcher3cbf1bdmake ci happyda8f1a7Fix default locale middleware matchdae71d7Fix default-locale matcher logic6c83c05Restore regexp matcher support5777ea8Fix middleware regexp matcher0186220Merge remote-tracking branch 'upstream/main' into jstowell/fix-middleware-matcher-options📊 Changes
14 files changed (+1019 additions, -98 deletions)
View changed files
📝
packages/vinext/src/config/config-matchers.ts(+6 -1)📝
packages/vinext/src/entries/app-rsc-entry.ts(+13 -4)📝
packages/vinext/src/entries/pages-server-entry.ts(+1 -1)📝
packages/vinext/src/index.ts(+2 -0)📝
packages/vinext/src/server/middleware-codegen.ts(+165 -13)📝
packages/vinext/src/server/middleware.ts(+114 -16)📝
tests/__snapshots__/entry-templates.test.ts.snap(+383 -62)📝
tests/app-router.test.ts(+22 -0)➕
tests/fixtures/app-basic/app/mw-object-gated/page.tsx(+8 -0)📝
tests/fixtures/app-basic/middleware.ts(+5 -0)📝
tests/fixtures/pages-basic/middleware.ts(+8 -1)➕
tests/fixtures/pages-basic/pages/mw-object-gated.tsx(+8 -0)📝
tests/pages-router.test.ts(+42 -0)📝
tests/shims.test.ts(+242 -0)📄 Description
This fixes several middleware matcher correctness issues so vinext stays aligned with Next.js behavior in both shared runtime code and generated App Router code.
What changed:
hasandmissingare actually enforced instead of matching onsourcealone.regexpand preservelocale: falsebehavior.Why this matters:
Tests:
has/missing, single-object configs,regexp, host handling, and i18n behavior.Validation:
pnpm test tests/shims.test.ts tests/entry-templates.test.tspnpm test tests/pages-router.test.tspnpm test tests/app-router.test.tspnpm run typecheck🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.