Skip to content

Handle RSC reload document responses#15032

Draft
agcty wants to merge 2 commits into
remix-run:mainfrom
agcty:codex/rsc-reload-document-recovery
Draft

Handle RSC reload document responses#15032
agcty wants to merge 2 commits into
remix-run:mainfrom
agcty:codex/rsc-reload-document-recovery

Conversation

@agcty
Copy link
Copy Markdown

@agcty agcty commented May 11, 2026

Summary

  • teach the RSC browser fetch paths to honor 204 + X-Remix-Reload-Document responses instead of decoding an empty RSC payload
  • reload GET RSC recoveries at the original document target and mutation/action recoveries at the current document
  • add a bounded sessionStorage guard and focused RSC recovery tests

Validation

  • pnpm test -- packages/react-router/tests/rsc/browser-test.ts --runInBand
  • pnpm --filter react-router typecheck
  • pnpm --filter react-router build
  • pnpm changes:validate
  • pnpm eslint packages/react-router/lib/rsc/browser.tsx packages/react-router/tests/rsc/browser-test.ts

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented May 11, 2026

Hi @agcty,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@agcty agcty force-pushed the codex/rsc-reload-document-recovery branch from 21c92b0 to c3a52d7 Compare May 11, 2026 08:45
@agcty
Copy link
Copy Markdown
Author

agcty commented May 11, 2026

Leaving a note on direction: the version source for this draft should likely come from the lower-level plugin-rsc primitive in vitejs/vite-plugin-react#1223.

This React Router PR is still useful as the framework recovery layer: it wires version propagation through RSC navigations, route discovery, and server actions, and teaches the browser to recover from a 204 + X-Remix-Reload-Document response without trying to decode an empty RSC payload.

The part I would expect to change before this is ready is the provisional random React Router RSC version. Once plugin-rsc exposes virtual:vite-rsc/compatibility-manifest, React Router can consume compatibilityManifest.compatibilityVersion and compose it with any React Router-specific deployment/routing state. That keeps plugin-owned build/RSC compatibility in plugin-rsc, while React Router owns the request protocol and recovery behavior.

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented May 11, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants