←back to thread

Svelte 5 Released

(www.npmjs.com)
390 points begoon | 3 comments | | HN request time: 0s | source
Show context
Squarex ◴[] No.41890210[source]
What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false;

But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

replies(5): >>41890328 #>>41890358 #>>41890361 #>>41891738 #>>41897256 #
ffsm8 ◴[] No.41890328[source]
What's the goal of disabling SSR though?

I get that hydrations value is mainly in SEO and a tiny improvement in initial draw speed, but why would you want it disabled, specifically?

It's pretty much what you already wrote though.

https://kit.svelte.dev/docs/single-page-apps

replies(6): >>41890363 #>>41890365 #>>41890370 #>>41890561 #>>41891661 #>>41893102 #
1. sibeliuss ◴[] No.41890561[source]
SSR always yields surprises! If you don't _need_ it, don't enable it; everything is simpler.
replies(1): >>41891214 #
2. djbusby ◴[] No.41891214[source]
What!? Why would that be?
replies(1): >>41891678 #
3. com2kid ◴[] No.41891678[source]
SSR is one missing pragma away from leaking api keys to clients.

SSR means your web server needs to scale with load on your front page, versus static bundles that can be served almost at infinite scale from a $15/month VPS.