-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Modern Event System: add plugin handling and forked paths #18195
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4cd1e11:
|
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.
only nits, feel free to disregard if annoying
// which also nicely allows us to support more without needing | ||
// to add more individual code paths to support various | ||
// events that do not bubble. | ||
expect(handleImgLoadStart).toHaveBeenCalledTimes(1); |
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.
dope
packages/react-dom/src/events/__tests__/DOMModernPluginEventSystem-test.internal.js
Outdated
Show resolved
Hide resolved
d63d2f6
to
54be398
Compare
Fix Fix Fix
54be398
to
4cd1e11
Compare
Modern Event System: add plugin handling and forked paths (facebook#18195)
This PR adds more of the modern event system logic, enough that based single root/non-portal logic now works and removing the flag should result in most tests passing. Note: this PR does not affect the existing legacy event system, and the only real changes are to the new modern event system (which is behind a flag anyway). This PR consists of:
DOMModernPluginEventSystem.js
adds event plugin handling, which is basically the exact same code from the legacy event system (except refactored to use basic for loops)DOMModernPluginEventSystem-test.internal.js
that showes basic capture/bubble events working correctly with the new system (on a single root/non-portal example)ReactBrowserEventEmitter-test.internal.js
uses the correct existing depending on the modern event system flagReactDOMEventListener-test.js
disables or alters the expected outcome when using the new systemReactTreeTraversal-test.js
disables or alters the expected outcome when using the new systemEnterLeaveEventPlugin.js
alters the logic to account for the new event system having roots rather than a single document listener, plus disables the first ancestor logic for the modern event system.