2 days ago
- Progressive JSON extends the idea of Progressive JPEGs to JSON data transfer by sending data breadth-first with placeholders that get filled later.
- Streaming JSON parsers allow partial object trees but result in malformed data (e.g., missing fields), making them hard to use in applications.
- Progressive JSON uses placeholders (like $1, $2, $3) that resolve as data arrives, enabling the client to handle incomplete parts as Promises.
- Inlining combines related data into fewer chunks when possible for efficiency, while outlining allows deduplication and handling cyclic objects.
- React Server Components (RSC) implement progressive JSON streaming, where <Suspense> boundaries control UI reveal despite out-of-order data arrival.
- Progressive streaming decouples data delivery from UI display, preventing arbitrary page jumps and improving perceived performance.
- Streaming data is beneficial when a server delay blocks client processing, but it requires a programming model like React Suspense to handle incomplete info gracefully.