Documentation menu

Fabric Mounting and Retained Transactions

Translate Fabric mutations into a confirmed Hera scene while bounding queued and in-flight work.

Fabric's mounting transactions describe how its shadow tree has changed after an update. The Hera adapter translates those mutations into data owned by the host, which the transaction sink can compare with its confirmed retained scene. From that comparison, the sink produces the protocol operations needed to bring Hera toward the new desired state.

Mount Observation and Mutation Translation

The mount observer receives each Fabric transaction and passes it through the adapter. By reading layout metrics, view properties, text state, and scroll information at that boundary, the adapter produces the host's mutation representation before the original Fabric data goes out of scope.

The translation preserves the lifecycle represented by each mutation. An insertion establishes a node's parent and index, while removal can detach it without destroying its descendants. Deletion ends that retained lifetime. Keeping removal and deletion distinct allows moves to preserve an existing subtree.

Data Ownership Across the Boundary

Fabric mutation lists and C ABI pointer fields can have shorter lifetimes than a queued transaction. The host's mutation storage must own text, glyph arrays, and other payloads until submission no longer needs them.

The sink converts its owned representation into HeraOp values and node/property structures. Static layout assertions check important glyph ABI sizes, alignment, and field offsets.

Desired and Confirmed Scenes

The sink keeps desired state separate from both the pending candidate and the confirmed scene. This lets later Fabric updates arrive while an earlier candidate waits for its outcome, without accidentally using unconfirmed future work as the baseline for another incremental diff.

Accepted outcomes promote the matching pending scene. Rejection discards that candidate and marks the sink for a rebuild from confirmed state. It retries only when newer desired work or a resize can supply a correction, so an unchanged invalid scene does not create a retry loop. Transport failures and missing-outcome deadlines are terminal because their retained baseline is ambiguous.

Backpressure and Deadlines

Queues bound the amount of mounting work held by dispatch, while outcome deadlines bound how long a submitted candidate can remain unresolved. Both incremental updates and rebuilds must start from the correct confirmed state, especially when desired state has already accumulated later mutations.

A frame-schedule hint is not permission to skip retained outcome handling. CommitAck is useful for submission tracing but does not replace CommitAccepted when advancing the sink's baseline.

Adapter Extension

An additional property or component crosses several parts of this pipeline. Follow it from adapter extraction into owned mutation storage, retained-scene diffing, C conversion, Rust conversion, and protocol validation, then run native and integration tests to check that the complete boundary behaves consistently.

See component support and commit outcomes.

Source Reference

The following files in the Hera checkout define the behavior described on this page.

  • react-native/rn_host/src/fabric/mounting/mount_observer.cpp
  • react-native/rn_host/src/fabric/adapter/adapter.cpp
  • react-native/rn_host/src/fabric/mounting/mount_sink.cpp
  • react-native/rn_host/src/fabric/mounting/retained_scene.cpp
  • react-native/rn_host/src/platform/mount/bounded_queue.h