←back to thread

Svelte 5 Released

(www.npmjs.com)
390 points begoon | 2 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. keb_ ◴[] No.41890365[source]
Sometimes you don't want to develop a full-stack application.
replies(1): >>41890425 #
2. ffsm8 ◴[] No.41890425[source]
Ah, if that's the goal then you should be fine with the static adapter instead. Is linked in the previous link - and here

You'll only need the fallback page and can omit the +layout prerender configuration. It's documented on that page

https://kit.svelte.dev/docs/adapter-static