Comparison
Client-side routingvsHistory API
Client-side routing
you intercepted the link click, pushed a new URL and rendered a different component in place.
Mapping URLs to components in the browser, updating history without a document request. It is what makes an application feel instant between screens, and it is the source of the whole category of bugs where the browser and the application disagree about where you are. The server still needs to serve the application for every routable URL, or a direct visit or refresh returns a 404.
Full entry →History API
you changed the URL with `pushState` and nothing was fetched, because that is all it does.
The interface for adding and replacing entries in the session history without a navigation, plus the `popstate` event fired when the user moves through them. `pushState` adds an entry, `replaceState` overwrites the current one — the difference decides what the back button does, which is why filter changes should replace and screen changes should push. It gives no notification when your own code pushes, so a router has to track that itself.
Full entry →