Streaming is about to be the standard
One lesson learned from using LLMs, the browser can stream and build out of order results
🧠We’ve been streaming video, audio, and HTML for decades — but never objects. That’s about to change.
âś… The Need for Progressive JSON
LLMs & Generative Systems: LLMs generate output token-by-token. Waiting for a full JSON object delays UX and breaks responsiveness.
Real-Time UIs: Dashboards, assistants, IDEs benefit from structured partial updates (vs. raw text).
Data-at-the-Edge: On edge/serverless APIs, latency compounds. Streaming JSON reduces perceived delay.
You can’t stream standard JSON safely—JSON doesn’t allow trailing commas or partial values.
🚫 Why Hasn’t JSON Been Streamed Until Now?
JSON wasn't made for streaming. It’s a full object format.
In contrast:
HTML is naturally streamable—browsers render partial DOM.
Media (audio, video) uses chunking (codecs, headers).
Images support progressive encoding (e.g. JPEG progressive).
So why not JSON?
-
Parsers: Most require a complete object.
-
Tooling: Only recently have good stream parsers emerged (clarinet, oboe.js, streaming-json-parser).
-
Use case: REST APIs were blocking and small. Even GraphQL wasn’t stream-first until Live Queries and @defer.
âś… What Changed?
Now streamable structured output is a UX necessity:
LLMs emit { "type": "function_call", "name": "search", "args": { ... } } piece by piece
React Server Components stream JSON (RSC Flight format)
SSR/Partial hydration: shell first, hydrate later
Edge/Serverless: streaming hides cold starts and TTFB
âś… Tech Already Adopting Progressive JSON
OpenAI Chat API (stream: true) returns { "delta": ... } lines via NDJSON
React Server Components: custom JSON stream protocol
Next.js App Router: streaming server data
Bun/Deno: runtime-level streaming Fetch
gRPC-Web / tRPC: chunked streaming patterns
WebTransport, HTTP/2, HTTP/3: native stream transport
⚠️ Problems Still Unsolved
JSON isn’t stream-safe: half a number or string breaks parsing
Needs NDJSON, envelopes, or framing
HTTP/1.1 + chunked: hard to cache
Axios/Fetch: buffer by default
TypeScript + partial schemas: hard to type/validate
🔥 So Is This Web 3.5?
It’s not Web3 (blockchain) or Web 2.0 (social) — but:
"Interactive, streamable, structured, AI-powered UI over modern transports"
Progressive JSON is key to that shift.
Impacts:
API design (NDJSON, yield, generators)
UI architecture (suspense, partial components)
Middleware (stream transforms)
Tooling (stream parsers, schema inference)
We’re not building websites anymore. We’re building stream-based UI machines.