[Ledgers] Add the row ID to the dedupe map #37589

Open
acdlite opened 11:07am on September 11, 2026 wants to merge 122 ฮ” into facebook/react ledgers/1-flag from
ledgers/2-dedupe-map
Diff Delta:
122
About 7325 Diff Delta/hour
Classified as:  Feature Add

acdlite's Description of Work

Small refactor to prepare for Ledgers.

Changes the type of the value in object deduping map (writtenObjects) from string (a reference to an object already written to the response) to {id: number, reference: string} instead. reference is the same string as before, and id is the row ID of the object.

The motivation is so a consumer of the dedupe map can access the row ID of the deduped object. For Ledgers, this allows us to also reuse the corresponding Ledger entries.

The original reference is kept in the map, too, since it encodes additional information about the reference besides just the row id.

An alternative considered was changing the type to string | {id: string, reference: number} but this results in additional type checks whenever the map is accessed, and also means the map is no longer monomorphic.

1 total changed file
Loading changes...
Youโ€™ve reached the end of the pull request
Thus concludes todayโ€™s episode of โ€œJust One Small Changeโ€