正在加载视频...

视频加载失败

Client/Server composition with server components feels illegal 😅

69,174 次观看 • 2 年前 •via X (Twitter)

10 条评论

Savva Mikhalevski 的头像
Savva Mikhalevski2 年前

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 ⚡️ 的头像
jarindr.eth | zentry ⚡️2 年前

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 的头像
Alex Sidorenko2 年前

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 的头像
Eric Afes2 年前

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

Alex Sidorenko 的头像
Alex Sidorenko2 年前

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 的头像
Abdulrahman2 年前

It’s legal though 😂

Fredkisss is on 🦋 blue sky 🦋 的头像
Fredkisss is on 🦋 blue sky 🦋2 年前

This is actually incredible 🤯

Kofi Bamfo Quaicoe 的头像
Kofi Bamfo Quaicoe2 年前

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

Alex Sidorenko 的头像
Alex Sidorenko2 年前

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

Salik Jamal 的头像
Salik Jamal2 年前

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

相关视频