vike
vike copied to clipboard
[Guide] `SPA vs SSR`
- Similarly, the same is true for SPA applications, the relevant knowledge is scattered on different pages, and you need to view and learn in Guides, APIs, Github examples, etc., in order to complete the development and deployment of SPA, SSR and other applications.
I think a good guide here would be really appreciated! I used https://github.com/vikejs/vike/tree/main/examples/render-modes to get most what I needed.
However, I still have one open question: how to render/SSG a html entry point for the SPA part of the app? In my case, I'm using my own router for the SPA app, and all I want is fully statically built SPA with it's own static entry point, so I can deploy the entire Vike app statically.
Currently, you always have to set prerender: true to deploy to static hosts. In other words, you'll be generating a .html file for each URL. Does that work for you?
We also plan to generate a __spa-fallback.html although you'll have to configure your static host to serve that HTML to each URL.
I agree that a good guide would be nice!
Yes, I would love to have a guide how to achieve basically what RR describes here: https://reactrouter.com/how-to/pre-rendering#pre-rendering-with-a-spa-fallback
But it is still not clear how I would achieve that with Vike, because if I turn prerendering on for the SPA I get tonns of errors, which is obvious because it's trying to render all kinds of SPA libs (e.g. in my case Clerk auth and others).
But it is still not clear how I would achieve that with Vike, because if I turn prerendering on for the SPA I get tonns of errors, which is obvious because it's trying to render all kinds of SPA libs (e.g. in my case Clerk auth and others).
That shouldn't be the case. Can you publish a minimal reproduction?
Let's create a new issue/discussion about this.