Remove performWithPriority from scheduler (#10638)
Clement Hoang committed
Sep 7, 2017 at 17:35 UTC
7d77d795c2c647effbea40272de3834bb38f4e52
3 files changed
-21
src/renderers/noop/ReactNoopEntry.js
-5
@@ -25,7 +25,6 @@ import type {UpdateQueue} from 'ReactFiberUpdateQueue';
25
var ReactFiberInstrumentation = require('ReactFiberInstrumentation');
26
var ReactFiberReconciler = require('ReactFiberReconciler');
27
var ReactInstanceMap = require('ReactInstanceMap');
28
-var {TaskPriority} = require('ReactPriorityLevel');
28
var emptyObject = require('fbjs/lib/emptyObject');
29
30
var expect = require('jest-matchers');
@@ -351,10 +350,6 @@ var ReactNoop = {
350
return !!scheduledCallback;
351
},
352
354
- taskUpdates(fn: Function) {
355
- NoopRenderer.performWithPriority(TaskPriority, fn);
356
- },
357
-
353
batchedUpdates: NoopRenderer.batchedUpdates,
354
355
deferredUpdates: NoopRenderer.deferredUpdates,
src/renderers/shared/fiber/ReactFiberReconciler.js
-5
@@ -14,7 +14,6 @@
14
15
import type {Fiber} from 'ReactFiber';
16
import type {FiberRoot} from 'ReactFiberRoot';
17
-import type {PriorityLevel} from 'ReactPriorityLevel';
17
import type {ReactNodeList} from 'ReactTypes';
18
19
var ReactFeatureFlags = require('ReactFeatureFlags');
@@ -163,7 +162,6 @@ export type Reconciler<C, I, TI> = {
162
parentComponent: ?React$Component<any, any>,
163
callback: ?Function,
164
): void,
166
- performWithPriority(priorityLevel: PriorityLevel, fn: Function): void,
165
batchedUpdates<A>(fn: () => A): A,
166
unbatchedUpdates<A>(fn: () => A): A,
167
flushSync<A>(fn: () => A): A,
@@ -196,7 +194,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
194
var {
195
scheduleUpdate,
196
getPriorityContext,
199
- performWithPriority,
197
batchedUpdates,
198
unbatchedUpdates,
199
flushSync,
@@ -284,8 +281,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
281
scheduleTopLevelUpdate(current, element, callback);
282
},
283
287
- performWithPriority,
288
-
284
batchedUpdates,
285
286
unbatchedUpdates,
src/renderers/shared/fiber/ReactFiberScheduler.js
-11
@@ -1501,16 +1501,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
1501
scheduleUpdateImpl(fiber, TaskPriority, true);
1502
}
1503
1504
- function performWithPriority(priorityLevel: PriorityLevel, fn: Function) {
1505
- const previousPriorityContext = priorityContext;
1506
- priorityContext = priorityLevel;
1507
- try {
1508
- fn();
1509
- } finally {
1510
- priorityContext = previousPriorityContext;
1511
- }
1512
- }
1513
-
1504
function batchedUpdates<A, R>(fn: (a: A) => R, a: A): R {
1505
const previousIsBatchingUpdates = isBatchingUpdates;
1506
isBatchingUpdates = true;
@@ -1573,7 +1563,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
1563
return {
1564
scheduleUpdate: scheduleUpdate,
1565
getPriorityContext: getPriorityContext,
1576
- performWithPriority: performWithPriority,
1566
batchedUpdates: batchedUpdates,
1567
unbatchedUpdates: unbatchedUpdates,
1568
flushSync: flushSync,