Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event emits during initial rendering in Fabric #42777

Closed
wants to merge 1 commit into from

Conversation

mdvacca
Copy link
Contributor

@mdvacca mdvacca commented Feb 1, 2024

Summary:
During view preallocation eventEmitter information is not being passed to the platform. This causes bugs with emision of events during initial rendering when using the new Fabric Event dispatching system.

e.g. Rendering a TextInput that has 'onFocus' event and also has autoFocus enabled.

The new Fabric Event dispatching system dispatch events earlier (this is expected)

In this diff I'm fixing this issue by ensuring that all preallocated views have an eventEmitter (when its shadowNode has an eventEmitter)

This was actually implemented in the past, but in order to optimize, we run an experiment (D29117957) and it was later deleted.
(D40356386). I didn't find details of the results of the experiment.
We could run another experiment to understand potential negative perf impact of this change, although I believe it's the right thing to do here.

Changelog: [Android][Fixed] Fix delivery of events during initial rendering in new architecture

Reviewed By: sammy-SC

Differential Revision: D53108114

@facebook-github-bot facebook-github-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 Feb 1, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53108114

mdvacca added a commit to mdvacca/react-native that referenced this pull request Feb 1, 2024
Summary:

During view preallocation eventEmitter information is not being passed to the platform. This causes bugs with emision of events during initial rendering when using the new Fabric Event dispatching system.

e.g. Rendering a TextInput that has 'onFocus' event and also has autoFocus enabled.

The new Fabric Event dispatching system dispatch events earlier (this is expected)

In this diff I'm fixing this issue by ensuring that all preallocated views have an eventEmitter (when its shadowNode has an eventEmitter)

This was actually implemented in the past, but in order to optimize, we run an experiment (D29117957) and it was later deleted.
(D40356386). I didn't find details of the results of the experiment.
We could run another experiment to understand potential negative perf impact of this change, although I believe it's the right thing to do here.


Changelog: [Android][Fixed] Fix delivery of events during initial rendering in new architecture

Reviewed By: sammy-SC

Differential Revision: D53108114
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53108114

mdvacca added a commit to mdvacca/react-native that referenced this pull request Feb 1, 2024
Summary:

During view preallocation eventEmitter information is not being passed to the platform. This causes bugs with emision of events during initial rendering when using the new Fabric Event dispatching system.

e.g. Rendering a TextInput that has 'onFocus' event and also has autoFocus enabled.

The new Fabric Event dispatching system dispatch events earlier (this is expected)

In this diff I'm fixing this issue by ensuring that all preallocated views have an eventEmitter (when its shadowNode has an eventEmitter)

This was actually implemented in the past, but in order to optimize, we run an experiment (D29117957) and it was later deleted.
(D40356386). I didn't find details of the results of the experiment.
We could run another experiment to understand potential negative perf impact of this change, although I believe it's the right thing to do here.


Changelog: [Android][Fixed] Fix delivery of events during initial rendering in new architecture

Reviewed By: sammy-SC

Differential Revision: D53108114
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53108114

@analysis-bot
Copy link

analysis-bot commented Feb 1, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,181,136 +8
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 20,559,907 -9
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: ebc2831
Branch: main

Summary:

During view preallocation eventEmitter information is not being passed to the platform. This causes bugs with emision of events during initial rendering when using the new Fabric Event dispatching system.

e.g. Rendering a TextInput that has 'onFocus' event and also has autoFocus enabled.

The new Fabric Event dispatching system dispatch events earlier (this is expected)

In this diff I'm fixing this issue by ensuring that all preallocated views have an eventEmitter (when its shadowNode has an eventEmitter)

This was actually implemented in the past, but in order to optimize, we run an experiment (D29117957) and it was later deleted.
(D40356386). I didn't find details of the results of the experiment.
We could run another experiment to understand potential negative perf impact of this change, although I believe it's the right thing to do here.


Changelog: [Android][Fixed] Fix delivery of events during initial rendering in new architecture

Reviewed By: sammy-SC

Differential Revision: D53108114
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53108114

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 1, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 7b36233.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by cc2a73a.

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants