On the other hand, I've been trying out astro with svelte and it's been super nice, especially with the ability to have runes in other typescript files.
On the other hand, I've been trying out astro with svelte and it's been super nice, especially with the ability to have runes in other typescript files.
Astro is also built in top of Vite and the same thing happens there. If you reference `import.meta.env.SSR` it is statically replaced during build and unused code is tree-shaken out: https://vite.dev/guide/env-and-mode#env-variables
I do still believe that it may be good to point this out in the docs more thoroughly. In general though, couldn't there be some situations where using a universal load function like this may increase the chance for some security critical logic bugs?
Kit on the other hand has been a major pain. You won’t need a webserver oh wait you do! You have to make drastic tradeoffs when choosing between full SPA and SSR render only. Server side pre-rendering seems like middle ground nightmare that I just I don’t think I can tackle sufficiently right now. I need to get an MVP.
The (browser) issue is a symptom of this greater problem - it’s just not clear what runs on the server side and what doesn’t. The documentation is very poor on this and blogs are flat out wrong.
What's confusing about this and what could we do to help?
How do I serve svelte files using a python or golang backend and still have client side routing? These should have a fairly straightforward answer but I don't think they do.
By default, SvelteKit does SSR for the first page and client-side routing thereafter. This is fully configurable. Perhaps it's worth an additional mention on the routing page. I'll take a look later. Thanks for the suggestion.
I think this succinctly summarizes my gripes. The docs do generally make these assumptions, and are not clear when it's otherwise.