Skip to content

Add a Fantom control for native root constraints - #60156

Open
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D133247484
Open

rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D133247484

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:

Context

Fantom can create roots with a chosen viewport size, but its existing native TesterAppDelegate::updateSurfaceConstraints method was not exposed to JavaScript tests. Tests of native host resizing need to change root constraints without another React render or flushing pending JS work.

Changes

  • Add a thin root.updateSurfaceConstraints(width, height) binding to the existing tester method, forwarding the root’s device pixel ratio.
  • Add root-view tests for growing and shrinking native constraints, percentage-sized descendants, stable host refs, deferred JS work, and attempts to resize a destroyed root.
  • Document the control. Do not add context tracking or a queue-validation API.

Changelog: [Internal]

Differential Revision: D133247484

Summary:
## Context
Fantom can create roots with a chosen viewport size, but its existing native `TesterAppDelegate::updateSurfaceConstraints` method was not exposed to JavaScript tests. Tests of native host resizing need to change root constraints without another React render or flushing pending JS work.

## Changes
- Add a thin `root.updateSurfaceConstraints(width, height)` binding to the existing tester method, forwarding the root’s device pixel ratio.
- Add root-view tests for growing and shrinking native constraints, percentage-sized descendants, stable host refs, deferred JS work, and attempts to resize a destroyed root.
- Document the control. Do not add context tracking or a queue-validation API.

Changelog: [Internal]

Differential Revision: D133247484
@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 Nov 19, 2026
@meta-codesync

meta-codesync Bot commented Nov 19, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133247484.

@andrewdacenko andrewdacenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

Visual regression

1 visual difference(s) at 7ef603cc0c8e. Visual differences need maintainer approval. Review the report, then apply visual-change-approved.

ios touchable/highlight/default: Changed, 42 px (0.039%)

diff

Expected and Captured
Expected Captured
expected captured

This branch has not been deployed

No deployments
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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants