3 ms·
I’ve been a backend and data engineer who got my start in full stack. I’m working on a project and selected Svelte for the front end after trying to learn Reac
by snapetom 2y ago
I’ve been a backend and data engineer who got my start in full stack. I’m working on a project and selected Svelte for the front end after trying to learn React. I agree 100%. Svelte is great. Even 5 with its warts isn’t as bad as react.
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.
- benmccann 2y agoFiles with `.server` in the name run only on the server. The remaining files run on the client and server. This is mentioned in the introduction on https://svelte.dev/docs/kit/routing https://svelte.dev/docs/kit/routing What's confusing about this and what could we do to help?
- vergessenmir 2y agoIt's all kinda hidden. The documentation steers you towards SSR or assumes it. It appears as though you can't have client side routing without a roundtrip to the server. Take a looked at the "page" documentation immediately under Routing. 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.
- snapetom 2y ago> or assumes it. I think this succinctly summarizes my gripes. The docs do generally make these assumptions, and are not clear when it's otherwise.
- benmccann 2y agoThe docs for single page apps live at https://svelte.dev/docs/kit/single-page-apps https://svelte.dev/docs/kit/single-page-apps 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.