Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Client/Server composition with server components feels illegal 😅

69,174 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Savva Mikhalevski
Savva Mikhalevskivor 2 Jahren

This can be done with the same number of lines using regular REST. But with rate limiting, caching, proper security, and separation of concerns.

Profilbild von jarindr.eth | zentry ⚡️
jarindr.eth | zentry ⚡️vor 2 Jahren

Can someone tell me what's the benefit vs calling API and update result on the client again? Not talking about you don't need "backend"

Profilbild von Alex Sidorenko
Alex Sidorenkovor 2 Jahren

I think it's mainly this 1. Eliminate the problem of duplicating and synchronizing the data state on the client 2. Great potential for shared full-stack components in the future

Profilbild von Eric Afes
Eric Afesvor 2 Jahren

So having a key on the Suspense forces the server component to rerun? 🤔

Profilbild von Alex Sidorenko
Alex Sidorenkovor 2 Jahren

The server component reruns because of the query params updates (regardless of the key on the Suspense). The key on the Suspense re-triggers the suspense fallback on every re-run. Here is how it would work without it.

Profilbild von Abdulrahman
Abdulrahmanvor 2 Jahren

It’s legal though 😂

Profilbild von Fredkisss is on 🦋 blue sky 🦋
Fredkisss is on 🦋 blue sky 🦋vor 2 Jahren

This is actually incredible 🤯

Profilbild von Kofi Bamfo Quaicoe
Kofi Bamfo Quaicoevor 2 Jahren

Can you please make a @YouTube tutorial for all these...

Profilbild von Alex Sidorenko
Alex Sidorenkovor 2 Jahren

@YouTube What would you like to see in a tutorial?

Profilbild von Salik Jamal
Salik Jamalvor 2 Jahren

These tutorials are always great man, Next.js is awesome!

Ähnliche Videos