vite-plugin-ssr has first-class support for both Server-side Routing and Client-side Routing.
Server Routing is the "old school way" of doing routing: when the user navigates to a new page, the old page is completely discarded and the the HTML of the new page loaded.
Server Routing leads to a simpler app architecture and, consequently, to a faster app development.
vite-plugin-ssr does Server Routing.
With Client Routing, when the user navigates to a new page, the DOM is mutated instead of doing a full HTML reload.
Client Routing enables:
We can opt-in with
By default, we recommend Server Routing because it leads to a simpler app architecture. We should keep in mind that simpler app architecture => faster app development => more features for our users. Do our users care more about features or about slightly faster page transitions?
We should use Client Routing only if we have a rationale.
While frameworks such as Next.js and Nuxt make Client Routing seem easy at first, it always comes with inherent complexity that makes scaling the architecture of Next.js/Nuxt apps more complex and thus slower.
Examples for using Client Routing:
On the other hand, as a Startup who wants to deliver an MVP as quickly as possible, Server Routing should be the default choice.