client-side-routing-patterns
Installation
SKILL.md
Client-Side Routing Patterns
Skill Resources
- Activation and cross-agent notes: references/activation.md
Modern client-side routing is built on two browser primitives: history.pushState / history.replaceState and the popstate event. Understanding these directly makes every router less magical and easier to debug.
History API Fundamentals
// pushState: add a new history entry (browser Back button goes back)
history.pushState(
{ key: 'some-state' }, // State object (serializable; retrieve via history.state)
'', // Title — browsers ignore this; pass empty string
'/new-path?q=foo', // URL to display
);