-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Further optimizations for event dispatching #48426
base: main
Are you sure you want to change the base?
Conversation
This pull request was exported from Phabricator. Differential Revision: D67751821 |
f4d024a
to
07d8776
Compare
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
This pull request was exported from Phabricator. Differential Revision: D67751821 |
07d8776
to
8bde8c3
Compare
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
This pull request was exported from Phabricator. Differential Revision: D67751821 |
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
8bde8c3
to
db06b82
Compare
This pull request was exported from Phabricator. Differential Revision: D67751821 |
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
db06b82
to
587cc1e
Compare
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
This pull request was exported from Phabricator. Differential Revision: D67751821 |
587cc1e
to
a683051
Compare
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
This pull request was exported from Phabricator. Differential Revision: D67751821 |
Summary: Changelog: [internal] This implements a (mostly) spec-compliant version of the [`Event`](https://dom.spec.whatwg.org/#interface-event) and [`EventTarget`](https://dom.spec.whatwg.org/#interface-eventtarget) Web interfaces. It does not implement legacy methods in either of the interfaces, and ignores the parts of the spec that are related to Web-specific quirks (shadow roots, re-mapping of animation events with webkit prefixes, etc.). IMPORTANT: This only creates the interfaces and does not expose them externally yet (no `Event` or `EventTarget` in the global scope). Differential Revision: D67738145
Summary: Changelog: [internal] Adds a regression test to make sure we implement the correct spec-compliant behavior for a possible bug in the Web spec: whatwg/dom#1346 Differential Revision: D67758702
Summary: Changelog: [internal] Adding a few more tests for `ReactNativeElement` for symmetry with future tests for when it implements `EventTarget`. Differential Revision: D67738147
…n of ReadOnlyNode (facebook#48427) Summary: Changelog: [internal] The `ReactNativeElement` class was refactored for performance reasons, and the current implementation does **NOT** call `super()`, and it inlines the parent constructor instead. When it eventually extends `EventTarget`, things won't work as expected because the existing `EventTarget` implementation has constructor dependencies. This refactors the current implementation of `EventTarget` to eliminate those constructor side-effects, and eliminates the constructor altogether. This breaks encapsulation, but it has some positive side-effects on performance: 1. Creating `EventTarget` instances is faster because it has no constructor logic. 2. Improves memory by not creating maps to hold the event listeners if no event listeners are ever added to the target (which is very common). 3. Improves the overall runtime performance of the methods in the class by migrating away from private methods (which are known to be slow on the babel transpiled version we're currently using). Extra: it also simplifies making window/the global scope implement the EventTarget interface :) Differential Revision: D67758408
Summary: Changelog: [internal] This improves the performance of DOM `Event` interface implementation by migrating away from private fields. Differential Revision: D67751821
a683051
to
7d02cd5
Compare
This pull request was exported from Phabricator. Differential Revision: D67751821 |
Summary:
Changelog: [internal]
This improves the performance of DOM
Event
interface implementation by migrating away from private fields.Differential Revision: D67751821