feat(rsc): ability to not load server reference module during createFromReadableStream on rsc environment#1289
Merged
Merged
Conversation
Co-authored-by: OpenCode <noreply@opencode.ai>
createFromReadableStreamcreateFromReadableStream
createFromReadableStreamcreateFromReadableStream on rsc environment
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
createFromReadableStream on rsc environmentcreateFromReadableStream on rsc environment
Add a persisted Flight example covering development and production server restarts. Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
commented
Jul 16, 2026
Keep persisted Flight handling in the application root while reusing the starter framework flow. Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
commented
Jul 16, 2026
createFromReadableStream on rsc environmentcreateFromReadableStream on rsc environment
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
commented
Jul 17, 2026
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
commented
Jul 17, 2026
Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
marked this pull request as ready for review
July 17, 2026 03:51
This was referenced Jul 17, 2026
This was referenced Jul 20, 2026
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.
Description
TODO:
This PR adds
createFromReadableStreamoptions{ preserveServerReferences: true }to allow not loading server reference module. The use case is demonstrated inpackages/plugin-rsc/examples/cache-replayand accompanying e2e. In short, it allows rsc flight payload produced by one runtime to be consumed by other runtime and render it as a form action without importing associated server reference module.The implementation idea is a same as
$$decode-clientproxy trick we already use for preserving client reference "entity" without reviving actual "module" duringcreateFromReadableStream. This PR added$$preservetag for server reference. This idea is illustrated in https://artifacts.hiro18181.workers.dev/vite-plugin-react-rsc-load-id-journey (this was created before this PR, so missing$$preservemention).This is a smaller scope of changes from #1253 where I can understand the motivation and verify the correctness. The other aspect from the original PR such as framework-owned reference format seems to have issues in entire usages of server action lifecycle (from my reading, the e2e there doesn't support progressive enhancement form action since it only intercepts
loadServerAction), so it's deferred and will be investigated separately.For further context that I haven't fully verified in my eye but raised by agents are following: