This Data Fetching Combo is OP

preview_player
Показать описание
With this approach, we can get both benefits from server and client-side rendering. It's pretty neat, works well for me and I hope it does for you too!!

-- my links
Рекомендации по теме
Комментарии
Автор

Hope you had a great start into the new year

OR ELSE

joshtriedcoding
Автор

Had to do a double take when I saw the thumbnail 😂 awesome stuff Josh ❤

developedbyed
Автор

For polling you can also do Server-Sent Events (SSE). The server sends the data with the 'content-type' header set to 'text/event-stream' and the client listen to that with the EventSource API.

alex_rpascual
Автор

thank you so much. your visualization of the fetching data is really helpful

mjylove
Автор

I appreciate that you're concerned about promoting good practices in every video, keep it up!

josephnaru
Автор

For me one of the most important reason for splitting Backend calls between server and client side is the fact that server side calls are Blocking calls, therefore if we are dealing with large volume of data on server side then it will cause delay in page load by delaying the first content paint

SubzEye
Автор

It's an interesting approach. But what about caching and revalidating data? I assume that on the server side, we can perform revalidation based solely on time. Then, on the client side, we can easily revalidate data using the 'useQuery' capability when executing a mutation.

Is this the correct approach? I'm getting tired of dealing with Next.js revalidation...

MrGuysmo
Автор

Hey Josh,
I've been a huge fan of your videos, and your programming skills always leave me in awe. Your projects are truly inspiring, and I've learned so much from watching your content. I aspire to become as proficient as you in programming.
I have a request for a video idea that I think would benefit many, including myself. Could you consider creating a tutorial using Next.js 14, Appwrite, Shadcn with Zod for authentication? I find it challenging as a beginner, especially when incorporating Zod, Toast Messages, and storing user account details in the database.

cqyzszs
Автор

Is it possible to recreate a similar experience but without next.js, with like tanstack-router and hono or elysia, or something else? Hate the direction next.js is taking with way too much magic at so many levels..

xtromp
Автор

I was thinking about this yesterday while following one of your tutorials that if the data fetching can be done on the sever (irrespective of server componennts) then why we need react query at all. I guess, 60% of the time, fetching data on the server should do

amansagar
Автор

What if you need to update the UI immediately after a user action, what is the best approach? (while updating also the DB)

samfights
Автор

Josh, you are my favorite react/nextjs teacher on youtube! Keep it up for our sake

footyflair
Автор

Josh, can you please make a video on how you make your YouTube videos and the Softwares that you use in your videos, I really like the way you animate the code and the way you explain the ideas on a board

abderehmen
Автор

I randomly done this method in my app with react-query - but here someone is teaching it ;)

Alireza-kwfj
Автор

In your project for the first site visit time the page is served directly by the server with the data from database (first time is slow because server has to get data from database usually situated far ), then because you need a realtime data fetch every 10 seconds you write a logic that runs client side to keep fetching the data and updating the graph component (well websocket is fine but we still can use the simple https for cases where the rate of data updates is relatively low, maybe it updates 10 times a minute or so).In client side you also write the logic for graph changes everytime so in one . But do you think its really effective in terms of compute power requirement. Does it really save considerable amount of money for the website owners. because the fetching of data every 10 seconds is not really that big of a compute. Excluding case where the software is an admin side e commerce dashboard with high sales.

vaibhavn.k
Автор

Edge runtime doesnt automatically mean you put the server close to the user, you can (which is the default when deploying on vercel) use the edge runtime in a single region. I think global is an enterprise feature, no?

juliusmarminge
Автор

You need to finsih the saga how does this tie in with react querry, suspense streaming and optimistic updates? Can't wrap my head around it..

edhahaz
Автор

i just dont want to use server component anymore. The complexity it adds is insane. I spent 3 hours trying to go through supabase and understand how to fetch data in server components.

satyak
Автор

I was thinking about the same thing before I saw your video notification

samislam
Автор

Hi josh, May I know what is the you are using for demonstration? It looks fantastic.

manitahriri