Commit Graph

3 Commits

Author SHA1 Message Date
Samuel Susla 2016460528 Pass event priority to React
Summary:
Changelog: [internal]

This is a mechanism that will guess event's React priority based on other events ongoing on the platform.

If an event happens within span of ContinuousStart -> ContinuousEnd and its category is unspecified, we deduce it's React priority to be default. All other events are discrete.

Special case: `onScroll`, which is always treated as "Default".

Reviewed By: JoshuaGross

Differential Revision: D28485060

fbshipit-source-id: d2eae63dbcf03271dfed97128a1590dd165a3ce2
2021-05-25 01:16:04 -07:00
Samuel Susla 1866566d52 Introduce a way to specify React priority for events
Summary:
Changelog: [internal]

Introduce a way to specify React priority for events.
These APIs will be called from React here: https://github.com/facebook/react/blob/0e100ed00fb52cfd107db1d1081ef18fe4b9167f/packages/react-native-renderer/src/ReactFabricHostConfig.js#L345

React does similar thing on the web: https://github.com/facebook/react/blob/8ea11306ad473b26a2c899ef7a893d25413f3510/packages/react-dom/src/client/ReactDOMHostConfig.js#L378

Take a look at D28483983 that shows how React will be calling these APIs.

Reviewed By: JoshuaGross

Differential Revision: D28481260

fbshipit-source-id: c965a8aa0ba5192246c216046d49bcb046152a5a
2021-05-25 01:16:04 -07:00
Samuel Susla 285406103d Introduce EventQueueProcessor
Summary:
Changelog: [internal]

Pulling out event queue processing to its separate class. We will be adding more logic there so it makes sense to separate it for simplicity and testability purposes.

Alternative names that came to mind: `EventsProcessor`, `EventsDispatcher`.

Reviewed By: JoshuaGross

Differential Revision: D28572283

fbshipit-source-id: 1cb2459f616b9995f66da80d50c401e68002da7f
2021-05-25 01:16:04 -07:00