Skip to content

feat: streaming Flight (NDJSON out-of-order payload)#8

Merged
attitude merged 1 commit into
mainfrom
feat/streaming-flight
Jul 6, 2026
Merged

feat: streaming Flight (NDJSON out-of-order payload)#8
attitude merged 1 commit into
mainfrom
feat/streaming-flight

Conversation

@attitude

@attitude attitude commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Adds the streaming counterpart to Flight navigation. Flight::stream() emits NDJSON: the shell row (Suspense boundaries as F:<n> placeholders) then a {b,tree} row per boundary as it resolves, out of order — driven by the same Fiber scheduler as HTML Suspense streaming. The client streamNavigate() reads it row-by-row and patches boundaries in place (reusing toNode/mountIslands). Includes tests and a docs page. Verified: 34 tests pass, phpstan clean, docs build.

@attitude attitude force-pushed the feat/streaming-flight branch from f296f75 to 13b6600 Compare July 6, 2026 23:33
The streaming counterpart to Flight navigation: instead of resolving the
whole view before sending, stream it as NDJSON — the shell first (with
Suspense fallbacks as F:<n> placeholders), then a row per boundary as it
resolves, out of order. Same Fiber scheduler as HTML Suspense streaming;
the wire carries serialized tuple trees instead of HTML.

- src/FlightStream.php: fiber-based NDJSON serializer.
- src/Flight.php: Flight::stream() + Flight::wantsStream().
- client: streamNavigate() reads the NDJSON stream, builds the shell, and
  patches each boundary as its row arrives (reuses toNode + mountIslands).
- tests: FlightStreamTest (out-of-order rows, placeholders, sync case).
- docs: "Streaming Flight" page; Flight-navigation future-work note updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@attitude attitude force-pushed the feat/streaming-flight branch from 13b6600 to c9fed59 Compare July 6, 2026 23:34
@attitude attitude merged commit 26ceb54 into main Jul 6, 2026
3 checks passed
@attitude attitude deleted the feat/streaming-flight branch July 6, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant