4 ms·
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
by bcherny 6y ago
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.
- trixn 6y agoI 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.