feat: streaming Flight (NDJSON out-of-order payload)#8
Merged
Conversation
f296f75 to
13b6600
Compare
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>
13b6600 to
c9fed59
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the streaming counterpart to Flight navigation.
Flight::stream()emits NDJSON: the shell row (Suspense boundaries asF:<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 clientstreamNavigate()reads it row-by-row and patches boundaries in place (reusingtoNode/mountIslands). Includes tests and a docs page. Verified: 34 tests pass, phpstan clean, docs build.