2026.08.05alpinejs-router: HTML-first Client-side Routing for Alpine.js7 min read alpinejs-router path resolution Five stages from an incoming path to route params, with the fallback at each stage noted on the right. Resolving one path each stage falls through to the next; the right column is what happens on a miss /teams/42/projects/9 1 · staticRoutes.has(path) a Set — paths with no “:” never compile hit → {} params 2 · dynamicRoutes[depth] bucket by segment count — here 4 no bucket → notfound 3 · keyed["teams"] + wildcard Map on first segment, then “:param” first both lists may run 4 · RegExp test, score order static 3 · regex param 2 · bare param 1 all miss → notfound 5 · named groups → params $router.params.projectId Declaration order is not consulted — specificity decides. is() and notfound() walk the same index.