Loading video...

Video Failed to Load

Go Home

Client/Server composition with server components feels illegal 😅

69,174 views • 2 years ago •via X (Twitter)

10 Comments

Savva Mikhalevski's profile picture
Savva Mikhalevski2 years ago

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

jarindr.eth | zentry ⚡️'s profile picture
jarindr.eth | zentry ⚡️2 years ago

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"

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

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

Eric Afes's profile picture
Eric Afes2 years ago

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

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

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.

Abdulrahman's profile picture
Abdulrahman2 years ago

It’s legal though 😂

Fredkisss is on 🦋 blue sky 🦋's profile picture
Fredkisss is on 🦋 blue sky 🦋2 years ago

This is actually incredible 🤯

Kofi Bamfo Quaicoe's profile picture
Kofi Bamfo Quaicoe2 years ago

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

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

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

Salik Jamal's profile picture
Salik Jamal2 years ago

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

Related Videos