Skip to content

[ResizeObserver 1/3] Add new hook shadowTreeDidCommit - #57721

Open
paradowstack wants to merge 2 commits into
react:mainfrom
paradowstack:feat/shadowTreeDidCommit
Open

[ResizeObserver 1/3] Add new hook shadowTreeDidCommit#57721
paradowstack wants to merge 2 commits into
react:mainfrom
paradowstack:feat/shadowTreeDidCommit

Conversation

@paradowstack

Copy link
Copy Markdown
Contributor

Stack 1/3 — parent: main. Followed by LayoutEventEmitterResizeObserver.

Summary:

ShadowTree already computes the set of nodes whose layout changed on every commit (affectedLayoutableNodes), but today it's only consumed internally by ShadowTree::emitLayoutEvents.

This adds a shadowTreeDidCommit(shadowTree, rootShadowNode, affectedLayoutableNodes) method to ShadowTreeDelegate and UIManagerCommitHook so other systems can react to layout changes after a commit. ShadowTree calls it once the new revision is installed, and UIManager forwards it to the registered commit hooks.

Both declarations have no-op defaults, so nothing observes the hook yet — this is inert on its own. It's the shared signal the next two PRs build on (extracting onLayout emission, and ResizeObserver), so neither has to re-derive which nodes changed layout.

Changelog:

[INTERNAL] [ADDED] - Add shadowTreeDidCommit commit hook exposing the nodes with layout changes after each commit

Test Plan:

No behavior change: the hook has no-op defaults and no consumer in this PR. Existing Fabric commit/mounting tests pass.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 28, 2026
@paradowstack
paradowstack marked this pull request as ready for review July 28, 2026 16:00
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant