Hacker News new | ask | show | jobs
by synergy20 1099 days ago
hope it adds a client side router, and provides a true SPA mode(not the sveltekit stuff), before then, no plan to use svelte again as my use cases is 100% SPA with 0% SSR, absolutely nothing with SSR.
3 comments

It sounds like you have a misunderstanding about SvelteKit. It does have a client side router and you can use SvelteKit as a pure SPA today very easily, all you need is to set `export const ssr = false;` and `export const prerender = false;` in `src/routes/+layout.ts`. Then export with `adapter-static` and you're done.

Swing by the official Svelte Discord, we're happy to discuss your questions! https://discord.com/invite/svelte

I'm aware of that in fact, it's still far from the "pure" SPA as what React or Vue provides. SSR-first sveltekit is not the same as "pure" CSR SPA, and I do not need read all the SSR oriented doc to figure out how to do a CSR SPA. I spent a few months with Svelte(kit) and eventually returned to React.

If ever Svelte does CSR-first SPA with client side builtin router, I will definitely give a second try, until then, React will be my choice.

You would be hard pressed to find a functional difference between a SvelteKit project compiled with adapter-static and a "Create React App" app. If you have any concrete differences, do share them. They're functionally equivalent (except a SvelteKit project is a lot lighter in JS due to the compiler architecture).

There are unfortunately a lot of misunderstandings around SvelteKit because it is SSR-centric. SvelteKit has probably the best interactive docs of any framework at https://learn.svelte.dev/ and I do encourage everyone to go through them to get the full picture!

You can use SvelteKit without SSR; it can be compiled for many backends, including static files.
There are pure SPA svelte routers: https://github.com/ItalyPaleAle/svelte-spa-router