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

michael
So I have a table of MediaItems and when that list changes, say new entries, I’d like LiveView to know about that so that the Timeline up...
New
First poster: bot
The Analytics That Matter | CSS-Tricks. I’ve long been skeptical of quoting global browser usage percentages to justify their usage of b...
New
pippo12
Hello, I hope you have some tips for me. I am looking for further education including certificates (or similar) which are also accepted ...
New
First poster: bot
A 3D racing game built with ClojureScript, React and ThreeJS
New
First poster: bot
Type. Type is a directed typing experiment. You choose the direction the letters should flow.
New
mtmattei
A few months ago, Uno Platform unveiled Uno Platform for Figma plugin, a plugin created to turn your high-fidelity Figma design into XAML...
New
SynergyRob
I invented a game of double Chess called Synergy Chess. I am not a coder. I hired someone to write the program. People can play online fo...
New
harwind
Why does the image in my <img> tag appear larger than its specified width within a flex container? Here’s my HTML and CSS code: HT...
New
Reinis
For the last few months I’ve been (re)-learning vanilla CSS. Initially I did not ‘get’ how to structure CSS to take advantage of the ‘cas...
New
riyajohnson
When it comes to selecting a framework for a development project, it’s crucial to make an informed decision. With so many options availab...
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
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1134 25392 752
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New