SPA (Single Page Apps) feel like second class citizen in SvelteKit

Using `export const ssr = off` does give you a SPA but the whole experience of development and how this fits with rest of the framework is weird and not very flexible. SPA page on docs even has a note which basically translates to "SPA bad use SSR" with some reasons that don't match reality. I'm tired to see these parroted everywhere without any context. Like:

Bad For SEO

I don't how many times it needs to be said but when you are an app it's not important since most likely you are behind auth. What matters is that SPA's content is linkable. Post Previews and being on google search is for app's marketing site and other content based websites where organic discovery helps drive traffic.

Disabled JavaScript or slow network

This one I don't understand it's like saying my fan should work without electricity, sure I can spin it by hand but that's not how it supposed to work. 99% of people don't disable JavaScript simply because they don't care nor do they know how to and the rest do accept the consequences of switching of the power breaker and simply don't use your app which is fine, it doesn't need to cater to everyone. You need some amount of JS to create good responsive UX.

The reason above do make sense when you put them in context, like for content websites but not for PWAs and general cloud based SaaS apps. The docs should have a page on when to use each rather than picking one and recommending it. Even if you want good defaults it should be through an interactive wizard that takes your context into account when installing svelte though CLI. This not only educates people but also recognizes that literally everything in software engineering is a tradeoff and correct tool should be chosen based on context and need.

As far as the current SPA dev experience,

  • I can't use Workers outside SvelteKit lifecycle and get "Worker is not defined" and some mentions of `SSRCompatModuleRunner.directRequest` the only way to avoid is to use init code for worker in root +layouts which doesn't make sense, I'm building an SPA that will always load in a browser why do I even see the letters "SSR" after disabling it.
  • All the built in data fetching using load() caters to SSR and is very rigid can't set any runes in the recommended data loading: load() function because in SSR it leaks data, but I'm running in browser it shouldn't limit SPA because of how SSR works. I basically had to rebuild a rune based version of square/svelte-store to make any sense of data loading for my app. The author even reached out to merge this into svelte but it didn't go through, something similar in functionality to that would definitely be a welcome feature for those who don't want to use load()
  • Need for an official router. This a pretty popular request and separating the router part where both sveltekit and svelte can import it and where SSR's router would just be a superset, would be amazing. What I also don't understand is that they have added support for obscure technologies like Amp (google's attempt at controlling even more of web) but don't want to add this popular request.

So a great SPA experience would be: pure Svelte, router that support kit's amazing layouts, routing info rune like $page that works everywhere, resolveRoute, some routing hooks to initialize and export some sdk etc and optionally a dependency based data fetcher. If I'm mistaken and this is how it's supposed to work then do enlighten me.