Data Flow in Svelte 5 | How to fetch & pass data from the backend to the frontend in SvelteKit

  Рет қаралды 2,678

Niklas Fischer

Niklas Fischer

Күн бұрын

Пікірлер: 33
@o0OeftichisO0o
@o0OeftichisO0o 8 күн бұрын
WHAT A AMAZING VIDEO!!! THIS IS WHAT I NEEDED. THANK YOU!!
@Niklas-Fischer
@Niklas-Fischer Ай бұрын
Completely forgot to plug my udemy course on Svelte 5 in the video. If you like my teaching style, you'll find it in the description though :)
@KevinMacKenzie61
@KevinMacKenzie61 Ай бұрын
It's an excellent course. I highly recommend.
@Crypt0xAC
@Crypt0xAC 19 күн бұрын
This is a great video. Your explanation of the load function is fantastic, and the prefetch aroused my interest.
@CarlosLeon-ii2fs
@CarlosLeon-ii2fs Ай бұрын
Extra rich content +12:00. Thanks to share it!
@Niklas-Fischer
@Niklas-Fischer Ай бұрын
really appreciate that! :)
@BRODZELi
@BRODZELi 27 күн бұрын
Thank you! Your explanation was awesome. Please create more SvelteKit tutorials!
@Niklas-Fischer
@Niklas-Fischer 27 күн бұрын
Thank you so much! Really appreciate that and I want to in the near future. Just a bit difficult as these take time to make and I'm already juggling a lot of client work + a side project at the moment. But I already have a few additional topics I'd like to make tutorials about. Do you have anything specific on mind that you'd be interested in?
@BRODZELi
@BRODZELi 27 күн бұрын
@@Niklas-Fischer Thank you for asking! I’d love to see a tutorial on implementing animations in a Svelte app using tools like Rive or Lottie. Specifically, how to control animations with Svelte (e.g., using HTML buttons or sliders to adjust stages or change the animation's color). It would also be amazing if you could include functionality to save the played animations as a video file (e.g., .mp4), similar to capturing gameplay footage.
@Niklas-Fischer
@Niklas-Fischer 26 күн бұрын
@@BRODZELi okay! I haven't done much with animations in Svelte yet, so I might not be the best person to ask, but I'll see what I can do :)
@gageracer
@gageracer 20 күн бұрын
Great video. I would argue that in your case making it server side makes more sense as if the user has no internet, the client won't be able to fetch the thing anyway. Server side is always more secure and works good as much as client side fetch would.
@Niklas-Fischer
@Niklas-Fischer 20 күн бұрын
Thank you! :) In your example though, making it always server-side would also not work for people who don't have an internet connection in that moment, since the page will be generated upon request and the user could not trigger that request without an internet connection.
18 күн бұрын
Nice to example. 🎉
@good-dev-student
@good-dev-student Ай бұрын
Thank you 🎉
@D_bugit
@D_bugit 27 күн бұрын
In your point of view... Would you opt for using load function always unless otherwise serverload Function is needed?
@Niklas-Fischer
@Niklas-Fischer 27 күн бұрын
yes!! Exactly. And the main reason for a server load function being needed is usually to hide away credentials.
@D_bugit
@D_bugit 27 күн бұрын
@@Niklas-Fischer That is really interesting. Thanks 👍
@EliSpizzichino
@EliSpizzichino Ай бұрын
I think you forgot to mention that if you structure your application's frontend with API endpoint that does the "secret"/backend stuff, you can then use page.ts's Load function to load data in. Am I correct?
@Niklas-Fischer
@Niklas-Fischer 27 күн бұрын
you're completely right. When the secret stuff is handled by another API, you can use the client-side load function. Would say though that I didn't forget about that because to me that's an "external" API in the sense, that it's outside the SvelteKit application.
@good-dev-student
@good-dev-student Ай бұрын
pNPM save time + cpu
@pookiepats
@pookiepats 19 сағат бұрын
no it is insecure and out of date
@good-dev-student
@good-dev-student 18 сағат бұрын
@pookiepats how what the heck?
@EliSpizzichino
@EliSpizzichino Ай бұрын
I think it's useful to make a video about set/getContext, state, cookies/sessions in connection with the Load function.
@Niklas-Fischer
@Niklas-Fischer 27 күн бұрын
yup! Have a whole video planned on Auth in Svelte, where we'd talk about taht as well.
@imalkesara4466
@imalkesara4466 27 күн бұрын
Sir can u explain those things like what are hooks,session,layout.ts etc in a video , thank you
@Niklas-Fischer
@Niklas-Fischer 26 күн бұрын
Put this on my list! At the moment super busy with other stuff but trying to get back to it very soon :)
@chidimbamalu3490
@chidimbamalu3490 15 күн бұрын
Good one. Kindly apply enough ZOOM for Mobile viewers. Thank you
@Niklas-Fischer
@Niklas-Fischer 14 күн бұрын
thanks for the feedback!! Will try to do a better job of that for next time :)
@good-dev-student
@good-dev-student Ай бұрын
Please use dark mode or simple bg css you hurt my eyes 👀
@Niklas-Fischer
@Niklas-Fischer 27 күн бұрын
haha sorry about that 😃 will use darker colours next time.
@accountwizardindia8171
@accountwizardindia8171 20 күн бұрын
In this case, it's an API to fetch data, but what if I have my own database and fetch using SQL? Which is better, +page.server.ts or +page.ts? Do you recommend always using an API to keep things more systematic?
@Niklas-Fischer
@Niklas-Fischer 19 күн бұрын
hey! So with a database, you definitely need a layer in between, but you can freely choose how that looks like. Either you have an external api, an api endpoint within your sveltekit app or you use a +page.server.ts file to connect to your database. But that layer has to be server-side, because if you build it client side anybody will have the access keys to your database. So it's not about being more systematic, it's really just about keeping your database safe :)
@accountwizardindia8171
@accountwizardindia8171 17 күн бұрын
@@Niklas-Fischer This is great!! I always get confused. Just one more Q, I see Tauri or Capacitor* to disable SSR I think*. So then how data really would flow if data base not static (updates daily)? How will you make a Mob App with Sveltkit in this case? Thanks in Advance!!
Sveltekit Data Fetching in 2024 Explained
19:59
Ben Davis
Рет қаралды 10 М.
Avoid Leaking User Data In Your SvelteKit App
24:31
Joy of Code
Рет қаралды 6 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Svelte 5 Ruined Svelte (and that's why I love it)
12:37
Ben Davis
Рет қаралды 13 М.
Svelte 5 Is Like React, But Better
19:33
Theo - t3․gg
Рет қаралды 82 М.
Svelte 5 Snippets: Revolutionizing UI Composition | Snippets Vs Slots
12:09
Fullstack Ninja Academy
Рет қаралды 2,1 М.
10X Your SvelteKit Developer Experience in VSCode
10:00
Huntabyte
Рет қаралды 39 М.
How to deeply understand Angular signals (...or anything)
10:51
Joshua Morony
Рет қаралды 10 М.
Reduce your SvelteKit & Svelte 5 bundle sizes with server load functions
12:51
Svelte 5: In Action | Build A Tasks App
21:40
Syntax
Рет қаралды 8 М.
Svelte 5's Secret Weapon: Classes + Context
18:14
Huntabyte
Рет қаралды 30 М.
How to FETCH data from an API using JavaScript ↩️
14:17
Bro Code
Рет қаралды 168 М.