4 ms·
if you ever feel the need to send progressive JSON - just zip it and don't bother solving fake problem at the wrong abstraction layer
by slt2021 1y ago
if you ever feel the need to send progressive JSON - just zip it and don't bother solving fake problem at the wrong abstraction layer
- aloha2436 1y agoThe article doesn't advocate sending it progressively to make it smaller on the wire. The motivating example is one where some of the data (e.g. posts) is available before the rest of the data in the response (e.g. comments). Rather than: - Sending a request for posts, then a request for comments, resulting in multiple round trips (a.k.a. a "waterfall"), or, - Sending a request for posts and comments, but having to wait until the commends have loaded to get the posts, ...you can instead get posts and comments available as soon as they're ready, by progressively loading information. The message, though, is that this is something a full-stack web framework should handle for you, hence the revelation at the end of the article about it being a lesson in the motivation behind React's Server Components.