[ResizeObserver 2/3] Layout event emitter - #57722
Open
paradowstack wants to merge 4 commits into
Open
Conversation
paradowstack
force-pushed
the
feat/LayoutEventEmitter
branch
from
July 28, 2026 15:58
91b6fcb to
a2ea9b2
Compare
paradowstack
marked this pull request as ready for review
July 28, 2026 16:00
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.
Summary:
onLayoutevents are emitted inline fromShadowTree::emitLayoutEvents, which forcesShadowTreeto depend onViewPropsandBaseViewEventEmitter.This moves that logic into a standalone
LayoutEventEmitterthat consumes theshadowTreeDidCommithook (added in the parent PR) and is registered as a commit hook byScheduler. Same filter (nodes with anonLayoutprop), same timing (during commit), sameBaseViewEventEmitter::onLayoutcall — behavior is unchanged.After this,
ShadowTreeno longer references view props or event emitters, and the per-commit layout-change signal is shared withResizeObserverinstead of being duplicated.Changelog:
[INTERNAL] [CHANGED] - Emit
onLayoutfrom aLayoutEventEmittercommit hook instead of inline inShadowTreeTest Plan:
Behavior-preserving refactor. Existing
onLayouttests pass andShadowTreeno longer includesViewShadowNode/ViewProps. Verified in rn-tester thatonLayoutstill fires on mount and on size changes.