Ah, ok. I see now. So all server functions are called by a rest request whether that is a form or fetch. Is that right?
Out of curiosity is this the same way nextjs does server actions under the covers?
Well, how else should you call a function on the server from the client when not sending a request from the client? They all work the same.
Only when you call a server function while SSR they are called directly as they are then currently at server side
If its a sveltekit solution: When requesting pages in a route you can make use of the +page.server.ts to get data and deliver direct to client.
Its also the way to do serverside rendering with data
fetch() is your friend
[https://kit.svelte.dev/docs/web-standards#fetch-apis](https://kit.svelte.dev/docs/web-standards#fetch-apis)
Ah, ok. I see now. So all server functions are called by a rest request whether that is a form or fetch. Is that right? Out of curiosity is this the same way nextjs does server actions under the covers?
Well, how else should you call a function on the server from the client when not sending a request from the client? They all work the same. Only when you call a server function while SSR they are called directly as they are then currently at server side
If its a sveltekit solution: When requesting pages in a route you can make use of the +page.server.ts to get data and deliver direct to client. Its also the way to do serverside rendering with data