References — fw-08 A Client-Side Router

Primary sources first. Read the real implementation after you have written yours, never before.

Platform primitives — the whole module rests on these

  • HTML Standard — History interfacepushState, replaceState, and the popstate semantics that catch everyone
  • Navigation API — the modern replacement: intercepting navigations, transitions, and a real event for all navigations rather than only back/forward. Explainer.
  • URL StandardURL and URLSearchParams; do not parse URLs by hand
  • URLPattern — native route-pattern matching, which removes most of a router's parsing code
  • Scroll restorationhistory.scrollRestoration, the detail every hand-rolled router forgets

Routers to read

The hard parts

  • Nested routes and layout preservation · scroll restoration on back · in-flight navigation cancellation · focus management after navigation (an accessibility requirement, not a nicety) · code-split route loading without waterfalls
  • Accessible client-side routing — the user-testing study behind focus-on-navigation guidance

When a claim here proves stale, record it in PROGRESS.md section 7.