←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 #
1. kevinak ◴[] No.41890361[source]
I do have to ask - why don't you want to use SSR just because it's an internal application? For the new Svelte Society website we're SSR:ing everything (even the Admin dashboard). Being able to use form actions is a god send.

With that said, unfortunately when using Kit in "SPA mode" you're not getting the full experience, but it's still the best thing out there. You could try Routify as well.

There's a great talk from last years Svelte Summit that was about Svelte(Kit) in "SPA mode".

https://www.youtube.com/watch?v=uIZOeBS-3cI

TL;DR: Lean into load functions and monkey-patch fetch (if possible)

replies(1): >>41890537 #
2. wg0 ◴[] No.41890537[source]
SvelteKit is great in SPA mode as well. Other reason would be for example embedding it under wails/tauri with no backend required.