Yeah, I personally think routing is a superior user experience, but I can understand traditional request/response pages as a default. A couple use-cases for pushstate routing off the top of my head:
-
Transitions. Once you get into FLIP (first/last/invert/play), things really start to feel app-like. Example using Vue: https://css-tricks.com/wp-content/uploads/2018/04/page-transitions-final.mp4
-
The now-ubiquitous top border loading bar (a la YouTube). You could stream download/upload progress (eg. image uploads), and page loads (eg. pages that require external API calls).
-
Forced page changes. For instance, if the server session times out, you could push a route change to
/login. -
Deep linking. For instance, instead of a page dedicated to editing a user, we often have the edit form as a modal on top of the user list. What you really want there is the modal to be injected without changing the user’s scroll position. The url changes to
./edit, the user makes the change, closes the modal, which backs out of the route change, removes the modal element, and the user is still at the same scroll position. Combined with transitions (handling the lightbox fades and dialog bounce via CSS), you get a rich UI experience with little (or no) JS. In Nuxt, these situations are called<nuxt-child />. It’s a “page in a page”, but with a unique URL. In-short, not everything that is a URL is a “page”.


















