Skip to content

chore: merge upstream facebook/react main - #5

Merged
Donny/강동윤 (kdy1) merged 4 commits into
mainfrom
kdy1/merge-upstream-main
Nov 26, 2026
Merged

Donny/강동윤 (kdy1) merged 4 commits into
mainfrom
kdy1/merge-upstream-main

Conversation

@kdy1

Copy link
Copy Markdown
Member

Summary

This PR merges the latest facebook/react main branch into the fork's main branch. It uses a merge commit, so the upstream history is kept. The merge had no conflicts, and the fork's own changes are unchanged.

Upstream head: react/react@edae846

Merged upstream commits

How did you test this change?

Local validation was not performed. CI on this PR will check the merge.

🤖 Generated with Claude Code

Adds the remaining built-in Ledger kinds.

Ledgers are limited to a fixed set of built-in kinds. There is no
generic Ledger constructor, by design. We could consider adding one
later if a compelling use case arises.

All the built-in kinds follow certain algebraic properties:

- Monotonicity. A write in one component must not cancel out a write in
a different component. For example, once a bit is set in a Mask ledger,
it can never be unset.
- Commutativity. The order of writes should not affect the final total.
This allows us to stream parallel parts of the graph independently,
without buffering them to preserve write order.
- Associativity. Grouping writes into partial totals must not affect the
final total. This allows us to accumulate and merge totals
incrementally. If a stream is intentionally closed early during partial
prerendering, its total describes the portion that was received.

The built-in Ledger kinds are:

- `createBitLedger`. Flips a flag from false to true.
- `createMaskLedger`. Adds bits to a bitmask.
- `createMinLedger`. Tracks the smallest number.
- `createMaxLedger`. Tracks the largest number.
- `createSetLedger`. Accumulates a Set of scalar values.

There's a caveat regarding Set Ledgers: Sets in JavaScript have an
iteration order, but React does not guarantee anything about the order
of the entries in the final Set. The order is considered undefined and
consumers must not rely on it.

Sets also only support scalar values for now, not objects. This is
because object identity is not a good basis for set equality. We may add
support for sets of arbitrary values later, though we'll need to
consider the identity question again.

Min and Max Ledgers reject NaN. NaN is neither smaller nor larger than
any number, so the total would depend on the order of the writes.

Set entries are checked against the taint registry, like any other value
sent to the client. A tainted entry throws from addToLedger, so the
component that wrote it errors. Entries are checked again when they're
emitted, which catches a value tainted after it was written. That check
runs outside any task, so it fails the request.
Test suite for Ledgers. I've moved these tests to their own PR at the
end of the stack for the reviewer's convenience, to give a better sense
of how much implementation is involved in each of the previous PRs.
Adds support for consuming a Ledger total from a response and rendering
it inside a new Flight response ("forwarding"), while preserving the
incremental nature of the accumulated total. If the new Flight render is
aborted during partial prerendering before the original response has
finished, the Ledger in the new response will represent only the data
that had been decoded up to that point.

This differs from embedding the total into the new response as a regular
thenable or promise, e.g. `Promise.resolve(ledgerTotal)`. Such a promise
would only resolve when the original response has finished streaming; by
design, you cannot observe a partial total.

To get the partial total, you must pass the special Ledger thenable
directly to the new response without unwrapping it. This makes it harder
to accidentally observe a total that is out of sync with its
corresponding data.

Forwarding is incremental. Each destination resumes a Set total where it
left off, rather than rescanning it on every batch, so a total that
grows by one entry per batch costs linear time. The forwarded total and
its entries go through the same taint checks as any other value sent to
the client.

No new public API is required.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T03:13:47.368924Z 6485c81 PR opened
ℹ️ About Codex in GitHub

Your 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.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The size diff is too large to display in a single comment. This workflow run contains an artifact called sizebot-message.md with the full report.

Generated by sizebot against 6485c81

@kdy1
Donny/강동윤 (kdy1) merged commit fb031f0 into main Nov 26, 2026
251 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 26, 2026
chore: merge upstream facebook/react main

DiffTrain build for [fb031f0](react@fb031f0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants