Add part of the event responder system for experimental event API#15179
Add part of the event responder system for experimental event API#15179trueadm merged 13 commits intofacebook:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
I've added more test coverage and added comments around some of the logic involved in handling the active event component fibers. |
sebmarkbage
left a comment
There was a problem hiding this comment.
You have CI build errors which cover up the file size changes (if any).
| this._nonDiscreteEvents = []; | ||
| } | ||
|
|
||
| DOMEventResponderContext.prototype.isPassive = function(): boolean { |
There was a problem hiding this comment.
Can we avoid using methods on prototypes and instead call it with an argument - like we do in the newer code? function isPassive(context: DOMEventResponderContext){ ... } Methods are much harder to analyze for GCC and requires a virtual dispatch for every call. With stand alone functions we can feel good about getting automatic inlining and DCE with use of future feature flags and such.
There was a problem hiding this comment.
context is passed to the event responder module so that the user can call isPassive etc without having to know about the React internals. I thought about exposing these functions via a public API on React, but that felt like over-kill, especially as the responder modules are external to React.
There was a problem hiding this comment.
Cool. I don't fully see how everything will fit together. We can come back to this later once more stuff is in place.
|
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: 78f2775...ea86b4b react-dom
Generated by 🚫 dangerJS |
| this._nonDiscreteEvents = []; | ||
| } | ||
|
|
||
| DOMEventResponderContext.prototype.isPassive = function(): boolean { |
There was a problem hiding this comment.
Cool. I don't fully see how everything will fit together. We can come back to this later once more stuff is in place.
|
I spoke to @sebmarkbage and he was happy with getting this PR in so I'm merging. |
Note: this is for an experimental event API that we're testing out internally at Facebook.
This PR adds logic to handle triggering event responders from events that are listened to at a top level. This follows on from previous PRs:
This PR also adds tests that validate the triggering of event responder
handleEventfunction.