ClaudiaGiv

ClaudiaGiv

SSR explained in SvelteKit

Hi all,

I recently started working with Svelte and created a small app with SvelteKit in order to understand better the framework. I have a few questions about this framework to witch I haven’t found any direct answers on any source/documentation and maybe you can help me with some answers/explanations. So here it goes:

  1. SvelteKit has SSR and in the documentation it says: “All server-side code, including endpoints, has access to fetch in case you need to request data from external APIs.”
    a. What code is server side rendered besides endpoints and how it decides this? All the code from scripts from svelte pages runs on client side or some of it runs on server side?
    b. In order to make use of SSR locally you need an adapter for it or svelte starts a server on its own?
    c. How the SSR works on a prod environment like Netlify for example. The netlify adapter is used for SSR (running the endpoints in a netlify function) ? If a netlify adapter is not provided, how/where would the endpoints run?
  2. If I want to use custom netlify functions in a sveltekit project what configurations are needed (besides netlify.toml and netlify adapter) in order for netlify to recognize the functions from inside the functions directory?
  3. What is the difference here between SSR and prerendering? SSR is used only for endpoints and other js code and prerendering is used for generarting the html to send it to the client which will then be hydrated, with the compiled js code, also sent to the browser?

Hope is not too much and the questions are not too trivial. Still trying to understand better the JS frameworks to keep up with the progress in the JS world.

Thanks!

Most Liked

AstonJ

AstonJ

Did you manage to find an answer after Claudia?

Not sure if it’s any help but just noticed these tutorials in SvelteKit:

Playlist:

Popular Frontend topics Top

PragmaticStudio
Let’s get real. As in really knowing—clearly and practically—what’s up with Phoenix LiveView. What is it? How does it work? What can I ...
New
CommunityNews
Microsoft’s Introduction to JavaScript video series will equip users with the basic skills to start building apps with the popular progra...
New
First poster: bot
Fable 3.0.0-nagareyama-alpha-010 has been released. Link: Release 3.0.0-nagareyama-alpha-010 · fable-compiler/Fable · GitHub
New
CommunityNews
Tailwind CSS Tools For Developers. A collection of tools designed for developers, to save you and your team time when building websites w...
New
PragmaticBookshelf
Tailwind CSS is an exciting new CSS framework that allows you to design your site by composing simple utility classes to create complex e...
New
First poster: bot
Fable 3.1.3 has been released. Link: Release 3.1.3 · fable-compiler/Fable · GitHub
New
CommunityNews
WebAssembly-Powered FM Synthesizer. An 8-operator, polyphonic FM synthesizer running completely in the web browser via Rust compiled to ...
New
New
First poster: AstonJ
Tailwind v3.0.0 has been released. Tailwind CSS v3.0 has got to be our most exciting release ever, including improvements...
New
AlessandroDsgroup
Hi to everyone, we are experiencing a 401 error related to the connection of the websocket (in reference to our web app); we are unable ...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New