Repository navigation
refactor(tanstack-start)!: use React Flight for RSC responses - #18787
Open
jacobsfletch wants to merge 5 commits into
Open
jacobsfletch wants to merge 5 commits into
jacobsfletch wants to merge 5 commits into
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
jacobsfletch
commented
Oct 16, 2026
|
|
||
| // Flight accepts complete models; TanStack's non-RSC declaration only accepts ReactNode. | ||
| return new Response(renderToReadableStream(result as ReactNode), { | ||
| headers: { 'Content-Type': 'text/x-component' }, |
Member
Author
There was a problem hiding this comment.
Uses text/x-component because the response now contains a React Flight stream, matching Next.js.
…ack-flight-responses # Conflicts: # test/form-state/e2e.spec.ts
jacobsfletch
added this pull request to stack #18794
October 16, 2026 20:16
jacobsfletch
marked this pull request as ready for review
October 16, 2026 20:28
jacobsfletch
commented
Oct 16, 2026
| const result = await runServerFunction(args) | ||
|
|
||
| // Flight accepts complete models; TanStack's non-RSC declaration only accepts ReactNode. | ||
| return new Response(renderToReadableStream(result as ReactNode), { |
Member
Author
There was a problem hiding this comment.
This is the React Flight protocol that TanStack exposes
This branch has not been deployed
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.
Removes
serializeForRSCfor TanStack server-function responses in favor of native React Flight.Previously, we recursively walked each response and wrapped React components individually. Now, the entire response goes through Flight once, keeping components and data together.
Breaking Changes
Update the dispatcher in
app-tanstack/app/_payload/server.functions.tsto return the native Flight response directly: