Hacker News new | ask | show | jobs
by impulser_ 867 days ago
Svelte is not SSR first. Svelte has nothing to do with the server. There is no server related code in Svelte. Svelte is a UI library/framework/language w.e you want to call it.

SvelteKit can be bundled with server code, but it's just as easy to bundle it without any server code. SvelteKit is essentially just a Vite plugin.

You can add adapter-static and have to bundled as an SPA and not change anything with you code as long as your not using .server.js files which are files meant to protect server code from not being bundled with the client.

2 comments

You haven’t described anything different from what the OP is saying: the main dev behind svelte now works for a company that wants you to use SSR for all your projects. That absolutely impacts feature development to favor sveltekit. The same thing is happening with react.

The same thing is happening with deno as well: most active dev is with deno deploy.

VC has infiltrated open source development and is driving how features are built. Not saying it’s necessarily bad but it does change the incentive structure.

What feature was added to SvelteKit on the behave of Vercel?
I don't see where the person said that some feature was added to SvelteKit on behalf of Vercel.
Svelte has no routing for client-rendering, and itself recommends everyone to just use SvelteKit as boilerplate, which is SSR-first.

I spent two months with SvelteKit for a SPA project,it did not fly, the SSR-first (e.g. documentation etc) made CSR-SPA a second class citizen plus added unnecessary burden for those who does not need SSR, no it's not as easy as just "setting this flag you will be golden for CSR".

If I need SSR sometime, I might as well just do Django, Rails, Laravel etc which are solid. Please give me a true SPA as it used to be, and make SSR optional instead of the default.

SvelteKit is the "router".

We use SvelteKit for a internal application that we embed into a Go binary. It as simple as adding adapter-static as the adapter and not using .server files.

You can use SvelteKit the exact same way as the API for server and client are nearly the same. Load function on the server work the same as the Load function on the client expect for where they are called.

What problems did you have?