Build your own SPA router with URLPattern

Jschof.dev. Build Your Own Router.

Jim Schofield shows how to use the Baseline newly available URLPattern API, web components, and the History API to match routes, handle SPA navigation, and avoid XSS by keeping a static list of renderable components.

jschof.dev/posts/2025/11/build-your-own-router