News for hackers. Stuff that matters.
Re:Everything About React Server Components by bcherny on Sunday January 17, 2021 @04:19AM (#25809366)
This is an interesting way to look at it!

I think one missing piece that’s far from mature is data fetching. It’s really hard to get something working well at scale:

- REST is simple, but you end up with serial waterfalls for complex fetches.

- GraphQL avoids these waterfalls and lets you collocate declarative data with your components. This is great if your server layer supports it well.

- You also need a way to fetch all descendants’ data high up the tree (to avoid serial fetches). Relay does this with a compilation step, and requires passing pointers back down the tree for runtime use.

- Updating data (POST, PUT, Mutations) is super tricky to do in a way that keeps data consistent, avoids over-fetching, handles exceptions and idempotence and retries right, etc.

I wish there was a standard here, but I think we’re still pretty far from it.

Re:Everything About React Server Components by trixn on Monday January 18, 2021 @09:25AM (#25822058)
I also feel like this really is one of the biggest pain points when writing single page apps. There is no good standard and everybody is promoting his/her way to do it that works well in a TODO app example but kinda fails in a big production application.