Hacker News new | ask | show | jobs
by himujjal 1156 days ago
I agree with this comment. SvelteKit is unnecessarily complicated. The `+page.svelte` etc are just the start of it.

Plus I can't use it with Go, PHP, Ruby, Rust etc when it comes to SSR (without running multiple servers and handling deployment nightmares).

Something about this whole Node + SSR Front-end is smelly. (next, nuxt, solidstart) I love Svelte as a framework and a way of writing UI, but SvelteKit. Eh! Not so much.

SvelteKit is too much complexity for no reason. Goes opposite of what Svelte was meant to be: Simple and intuitive.

2 comments

Curious to hear more, what specifically is complicated about it?

SvelteKit is a JavaScript framework, it makes sense that you can't use it with other languages. You can pair it with a backend of your choice of course, but to get the SSR benefits you do need to work within the framework.

There are other ways of using Svelte with other languages, I would take a look at something like Inertia.js [0].

[0] https://inertiajs.com

Hey Kevin! First of all. I am a regular listener to your podcast! Love it!

Now, I am not specifically targeting SvelteKit to be fair. But the whole host of meta-frameworks like NextJS, NuxtJS etc which Vercel is pushing.

These frameworks in general are too much complexity added. SSR is hard and the best way to handle all of these is to not have a server layer at all. That is just abstract the rendering/routing part and leave the rest of the server stuffs to the user.

I want to simply write my Fastify/Express/Go-gin/Django app. Then add SvelteKit as my front-end with SSR support.

Right now, I first write SvelteKit and then think how am I going to integrate Express and Fastify to it (for a moment let's leave non-node solutions).

Trust me. If you simply leave the server out of SK and generate a simple API abstraction like `res.send(renderSKPath('/users/:id', { serverData }))`. It would have done the job.

I think its difficult to express what I want to say, but in short, remove the server and keep SK as a rendering layer only.

P.S. I know that there is an express adapter for SK. But that is not the point of this comment at all.

You're asking for two things that seem largely incompatible. How do you expect to do SSR in a Go-gin or Django app? Svelte components get compiled to JavaScript and SvelteKit is written in JavaScript. Doing SSR in those frameworks would necessitate calling JavaScript from Go or Python and introduce far more complexity if you could get it to work at all. The simplest options are either to run a Node server or turn off SSR, which you can do with 1-line in SvelteKit.
“SvelteKit is too complicated, it doesn’t even have this thing that would certainly make it more complicated!”