2026.08.05svelte-router: Svelte 3–5 SPA Routing Without SvelteKit8 min read svelte-router candidate merge Four candidate sources each expose their next match with its declaration order; the matcher repeatedly takes the lowest order until one matches. Lowest declaration order wins each source offers its next candidate; the matcher merges them by array index static Map get(path) order 0 keyed dynamic segs 2 · users order 3 fallback dyn. :param first order 5 wildcard * /^.*$/ order 9 take the lowest order that still matches a regex only runs when its route is the current front-runner { component, params } Dashed: early exit — when the static hit already outranks every dynamic route, no bucket is consulted and no regex runs at all.