-
Notifications
You must be signed in to change notification settings - Fork 49.2k
[React Native] Fabric get current event priority #21553
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
Merged
rickhanlonii
merged 8 commits into
facebook:master
from
sammy-SC:rn-fabric-getCurrentEventPriority
Jun 8, 2021
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3037cb3
Call into Fabric to get current event priority
sammy-SC 61d10f9
Prettier
sammy-SC f90ccfb
Merge branch 'master' of https://github.com/facebook/react into rn-fa…
sammy-SC 4723c6b
Better handle null and undefined cases
sammy-SC c63531c
Remove optional chaining and use ?? operator
sammy-SC 9b8d716
prettier-all
sammy-SC 1acb6de
Use conditional ternary operator
sammy-SC f170db8
prettier
sammy-SC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we discussed is that instead of native proving priority, they could send provide the name of the event here, and in this switch we would select the priority based on event name (like DOM does).
The advantage of this approach is that we can update this map in JavaScript without needing a native app change, and the source of truth for "event name to event priority" lives inside React (leaving us free to change the model cheaply). The disadvantage is that we'd need to maintain the map here for all React Native platforms, but as soon as we change the model we would need to maintain an event priority to new model priority map anyway.
@sebmarkbage @acdlite what do you think about those two approaches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: sending event name of event
This doesn't work well with event priority deduction that we have implemented in Fabric.
I do have a somewhat hybrid system in mind that would combine event priority deduction with event priority map in JavaScript. I didn't want to overcomplicate the initial implementation and learn from this before making the next step.
The APIs are still marked as "unstable" to make it clear we are still experimenting with it.