Repository navigation
chore: merge upstream facebook/react main - #2
Conversation
Implements `captureLedgers` on the server. This wraps around part of the Flight rendering graph and captures its Ledger effects. Like with previous steps, decoding on the client is still not implemented; will be added in later PRs. The previous PR already implemented most of the changes to the wire protocol, including the `Y` row type that represents a `captureLedgers` instance. In addition to writing Ledger declarations to the response stream, we also introduce two internal, renderable types recognized by Flight: - A LedgerDataObject is the `data` field returned by `captureLedgers`. It is the wrapped version of the model object passed as the first argument to `captureLedgers`, and renders to the same data as the original object; the only difference is that it also tracks any Ledger writes that occur during rendering. - A LedgerTotal is an entry in the `ledgers` array returned by `captureLedgers`. It renders to a thenable that resolves to the final Ledger total, resolving only once the client stream has closed. It cannot be read on the server.
Brings in react#37591 (captureLedgers on the server). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e353f31f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| ): ReactJSONValue { | ||
| const ledgers = ensureRequestLedgers(request); | ||
| const id = ensureLedgerTotalDeclared(request, ledgers, total); | ||
| return '$y' + id.toString(16); |
There was a problem hiding this comment.
Add client decoding for serialized ledger totals
When a captured ledger total is passed to a Client Component, this emits a $y<id> reference, but ReactFlightClient.parseModelString has no corresponding decoder. Searching packages/react-client and packages/react-server-dom-* found no alternative ledger decoder. The reference consequently falls through to ordinary outlined-model handling, where parsing y<id> as hexadecimal produces NaN; the prop remains unresolved and rejects when the response closes instead of providing the promised ledger total. Add the matching client protocol support before exposing these handles for transport.
Useful? React with 👍 / 👎.
chore: merge upstream facebook/react main DiffTrain build for [741e331](react@741e331)
The fork
mainis one upstream commit behindfacebook/reactmain. This PR merges that commit into the fork.33e52451f2from upstream:[Ledgers] Implement captureLedgers on the server (#37591).Local validation was not performed. CI on this PR will run the checks.