feat: inline every rsc and remove is_root#356
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the RSC/HTML streaming format to inline payloads (removing root special-casing), improves debug/context handling across async boundaries, and adds streaming controls (timeout + progressive chunk sizing).
Changes:
- Inline RSC payloads into chunk
0where possible and update model serialization shape (incl. debug/owner metadata). - Add
render_htmlstreaming controls:~timeoutand~progressive_chunk_size; add stack-frame filtering hooks for model rendering. - Extend tests/benchmarks to cover the new inlining, context propagation across async Suspense, debug payloads, and streaming behavior.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/server-reason-react-ppx/server_reason_react_ppx.ml | Fix option prop JSON encoding to serialize Some via inner [%to_json]. |
| packages/server-reason-react-ppx/cram/server-client-props.t/input.re | Adds a PPX regression case for option(...) annotated props. |
| packages/server-reason-react-ppx/cram/server-client-props.t/run.t | Updates expected expanded output for option prop serialization. |
| packages/reactDom/src/ReactServerDOM.mli | Extends public API with timeout/chunk sizing and stack filtering hooks. |
| packages/reactDom/src/ReactServerDOM.ml | Implements inlined model output, debug info, context across async, and buffered streaming + timeout. |
| packages/reactDom/src/dune | Adds lwt.unix dependency for timeout support. |
| packages/reactDom/src/ReactDOM.mli | Exposes attribute_to_html in the public interface. |
| packages/reactDom/src/ReactDOM.ml | Updates Provider pattern matches for new Provider record fields. |
| packages/react/src/React.mli | Extends Provider and Context.t to support async context propagation. |
| packages/react/src/React.ml | Implements async context propagation via Lwt.with_value/Lwt.get in useContext. |
| packages/reactDom/test/test_RSC_model.ml | Updates expected RSC chunks and adds extensive coverage for new behaviors. |
| packages/reactDom/test/test_RSC_html_shell.ml | Updates shell streaming expectations and forces small progressive chunks in tests. |
| packages/reactDom/test/test_RSC_html.ml | Adds timeout tests, chunk-size tests, and new escaping/context/Suspense expectations. |
| packages/html/Html.ml | Escapes & in single-quote attribute escaping for safer HTML attributes. |
| demo/universal/native/DB.re | Refactors editNote to update/write notes with explicit Result handling. |
| demo/server/pages/SinglePageRSC.re | Switches to layout-based HTML wrapper and updates content markup. |
| demo/server/pages/ServerOnlyRSC.re | Switches to layout callback API. |
| demo/server/DreamRSC.re | Changes env debug comparison operator. |
| demo/client/SinglePageRSC.re | Switches client boot to createFromFetch + createRoot render. |
| benchmark/dune | Adds Lwt deps and lwt_ppx for async benchmarks. |
| benchmark/bench.ml | Adds async RSC benchmarks via render_html and Lwt_main.run. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Uh oh!
There was an error while loading. Please reload this page.