@samitouri / QOS-React-2 / commits / 2fe0fbb05e

Use accumulateTwoPhaseDispatchesSingle directly (#18203)

Dominic Gannaway committed Mar 5, 2020 at 00:04 UTC 2fe0fbb05ef2c56db760122e995b923528e6ce8f
5 files changed +10 -10
packages/legacy-events/EventPropagators.js
+1 -1
@@ -66,7 +66,7 @@ function accumulateDirectionalDispatches(inst, phase, event) {
66 * single traversal for the entire collection of events because each event may
67 * have a different target.
68 */
69 -function accumulateTwoPhaseDispatchesSingle(event) {
69 +export function accumulateTwoPhaseDispatchesSingle(event) {
70 if (event && event.dispatchConfig.phasedRegistrationNames) {
71 traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
72 }
packages/react-dom/src/events/BeforeInputEventPlugin.js
+3 -3
@@ -7,7 +7,7 @@
7
8 import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
9
10 -import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
10 +import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
11 import {canUseDOM} from 'shared/ExecutionEnvironment';
12
13 import {
@@ -276,7 +276,7 @@ function extractCompositionEvent(
276 }
277 }
278
279 - accumulateTwoPhaseDispatches(event);
279 + accumulateTwoPhaseDispatchesSingle(event);
280 return event;
281 }
282
@@ -437,7 +437,7 @@ function extractBeforeInputEvent(
437 );
438
439 event.data = chars;
440 - accumulateTwoPhaseDispatches(event);
440 + accumulateTwoPhaseDispatchesSingle(event);
441 return event;
442 }
443
packages/react-dom/src/events/ChangeEventPlugin.js
+2 -2
@@ -6,7 +6,7 @@
6 */
7
8 import {runEventsInBatch} from 'legacy-events/EventBatching';
9 -import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
9 +import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
10 import {enqueueStateRestore} from 'legacy-events/ReactControlledComponent';
11 import {batchedUpdates} from 'legacy-events/ReactGenericBatching';
12 import SyntheticEvent from 'legacy-events/SyntheticEvent';
@@ -59,7 +59,7 @@ function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
59 event.type = 'change';
60 // Flag this event loop as needing state restore.
61 enqueueStateRestore(target);
62 - accumulateTwoPhaseDispatches(event);
62 + accumulateTwoPhaseDispatchesSingle(event);
63 return event;
64 }
65 /**
packages/react-dom/src/events/SelectEventPlugin.js
+2 -2
@@ -5,7 +5,7 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
8 +import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
9 import {canUseDOM} from 'shared/ExecutionEnvironment';
10 import SyntheticEvent from 'legacy-events/SyntheticEvent';
11 import isTextInputElement from 'shared/isTextInputElement';
@@ -135,7 +135,7 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) {
135 syntheticEvent.type = 'select';
136 syntheticEvent.target = activeElement;
137
138 - accumulateTwoPhaseDispatches(syntheticEvent);
138 + accumulateTwoPhaseDispatchesSingle(syntheticEvent);
139
140 return syntheticEvent;
141 }
packages/react-dom/src/events/SimpleEventPlugin.js
+2 -2
@@ -16,7 +16,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
16 import type {PluginModule} from 'legacy-events/PluginModuleType';
17 import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
18
19 -import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
19 +import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
20 import SyntheticEvent from 'legacy-events/SyntheticEvent';
21
22 import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
@@ -191,7 +191,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
191 nativeEvent,
192 nativeEventTarget,
193 );
194 - accumulateTwoPhaseDispatches(event);
194 + accumulateTwoPhaseDispatchesSingle(event);
195 return event;
196 },
197 };