mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Removing REACT_FABRIC_SYNC_EVENT_DISPATCHING_DISABLED macro
Summary: When we designed the Fabric's event priorities we followed the model "let's assign all priorities to all events as they should theoretically be and create a flag that disables sync execution (because we were unsure that it's stable enough". After some experiments, it's clear that this model is not feasible. We realized that we were often not sure about the exact event priority that should be assigned to a particular event. We also realized that the priorities in web work differently compare to RN. And we are not sure how we should ensure ordering among events in different queues with different priorities. At the same time, we want to use (or experiment with) sync events for in some cases when we sure about desired behavior and/or where async events make no sense. This diff deletes the macro that disables sync priorities and explicitly assigns async priorities to events that previously had sync ones. The actual behavior should not change. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D18950431 fbshipit-source-id: 4033ef63d4e736075b525a693cd514d7b92d5bb0
This commit is contained in:
committed by
Facebook Github Bot
parent
ae113aa697
commit
eb10d3e1d6
@@ -64,19 +64,19 @@ void TouchEventEmitter::dispatchTouchEvent(
|
||||
}
|
||||
|
||||
void TouchEventEmitter::onTouchStart(TouchEvent const &event) const {
|
||||
dispatchTouchEvent("touchStart", event, EventPriority::SynchronousUnbatched);
|
||||
dispatchTouchEvent("touchStart", event, EventPriority::AsynchronousBatched);
|
||||
}
|
||||
|
||||
void TouchEventEmitter::onTouchMove(TouchEvent const &event) const {
|
||||
dispatchTouchEvent("touchMove", event, EventPriority::SynchronousBatched);
|
||||
dispatchTouchEvent("touchMove", event, EventPriority::AsynchronousBatched);
|
||||
}
|
||||
|
||||
void TouchEventEmitter::onTouchEnd(TouchEvent const &event) const {
|
||||
dispatchTouchEvent("touchEnd", event, EventPriority::SynchronousBatched);
|
||||
dispatchTouchEvent("touchEnd", event, EventPriority::AsynchronousBatched);
|
||||
}
|
||||
|
||||
void TouchEventEmitter::onTouchCancel(TouchEvent const &event) const {
|
||||
dispatchTouchEvent("touchCancel", event, EventPriority::SynchronousBatched);
|
||||
dispatchTouchEvent("touchCancel", event, EventPriority::AsynchronousBatched);
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
#include "RawEvent.h"
|
||||
#include "UnbatchedEventQueue.h"
|
||||
|
||||
#define REACT_FABRIC_SYNC_EVENT_DISPATCHING_DISABLED
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
@@ -58,10 +56,6 @@ void EventDispatcher::dispatchStateUpdate(
|
||||
}
|
||||
|
||||
const EventQueue &EventDispatcher::getEventQueue(EventPriority priority) const {
|
||||
#ifdef REACT_FABRIC_SYNC_EVENT_DISPATCHING_DISABLED
|
||||
priority = EventPriority::AsynchronousBatched;
|
||||
#endif
|
||||
|
||||
return *eventQueues_[(int)priority];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user