2 ms·
The downsides of a SPA is that using React client-side is more heavy than plan static html files with vanilla JS. It has a cost on the amount of JS to initially
by slorber 4y ago
The downsides of a SPA is that using React client-side is more heavy than plan static html files with vanilla JS. It has a cost on the amount of JS to initially download, and executing that JS.
We believe React enables a better UX, and this weight is worth it for multiple reasons (SPA navigation, prefetching, and upcoming things).
You can compare for yourself and see what's best: docusaurus.io (SPA/React) vs v1.docusaurus.io (MPA/vanillaJS)
Note we didn't upgrade to React 18 yet, which will reduce the cost of using React client side, and provide new interesting concurrent features like progressive hydratation. We also want to leverage React Server Components later. We could also explore using Preact.
The web APIs are also constantly evolving, with new page transition APIs and things like that. It's not impossible we move back to a MPA in the (long term) future if it makes sense.