mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
3102d17d5c
* fix: deduplicate inherited intercept target patterns in validation
Child routes inherit parent parallel slots (including their intercepting
routes), so the same target pattern can appear on both parent and child
route. The validateRoutePatterns call for intercept targets was seeing
these duplicates and throwing a false "two routes resolve to same path"
error. Deduplicate via Set before validation.
* fix: extract actual URL params for intercepting route source routes
matchSourceRouteParams was feeding the source route's pattern string
(e.g. "/team/:teamId/members") into matchRoute(), which does a trie
lookup. The trie's dynamic child matched the literal ":teamId" as a
param value, producing {teamId: ":teamId"} instead of extracting the
actual value from the request URL.
Replace with a prefix-match param extractor that walks the source
pattern and the request URL in parallel, extracting dynamic segment
values from corresponding URL positions and stopping when static
segments diverge. This correctly handles (.) same-level, (..) one-
level-up, and (...) root interception conventions.
* fix: handle optional catch-all in source route param extraction
Move the catch-all/rest check before the bounds check so optional
catch-all segments (`:path*`) correctly produce an empty array when
the URL has no remaining segments at that position.
* test: update entry template snapshots for catch-all reorder