Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Centralize the pointer updates in the scheduler
  • Loading branch information
gaearon committed Sep 28, 2017
commit 3afc7b41ff48566c547e9bb98c7daafc5d5e3c48
4 changes: 0 additions & 4 deletions src/renderers/shared/fiber/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
return bailoutOnLowPriority(current, workInProgress);
}

if (__DEV__) {
ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
}

switch (workInProgress.tag) {
case IndeterminateComponent:
return mountIndeterminateComponent(
Expand Down
8 changes: 0 additions & 8 deletions src/renderers/shared/fiber/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ var {
var {Placement, Ref, Update} = ReactTypeOfSideEffect;
var {OffscreenPriority} = ReactPriorityLevel;

if (__DEV__) {
var ReactDebugCurrentFiber = require('ReactDebugCurrentFiber');
}

var invariant = require('fbjs/lib/invariant');

module.exports = function<T, P, I, TI, PI, C, CX, PL>(
Expand Down Expand Up @@ -187,10 +183,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
workInProgress: Fiber,
renderPriority: PriorityLevel,
): Fiber | null {
if (__DEV__) {
ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
}

// Get the latest props.
let newProps = workInProgress.pendingProps;
if (newProps === null) {
Expand Down
20 changes: 14 additions & 6 deletions src/renderers/shared/fiber/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,13 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
// means that we don't need an additional field on the work in
// progress.
const current = workInProgress.alternate;
if (__DEV__) {
ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
}
const next = completeWork(current, workInProgress, nextPriorityLevel);
if (__DEV__) {
ReactDebugCurrentFiber.resetCurrentFiber();
}

const returnFiber = workInProgress.return;
const siblingFiber = workInProgress.sibling;
Expand Down Expand Up @@ -706,8 +712,12 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
// See if beginning this work spawns more work.
if (__DEV__) {
startWorkTimer(workInProgress);
ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
}
let next = beginWork(current, workInProgress, nextPriorityLevel);
if (__DEV__) {
ReactDebugCurrentFiber.resetCurrentFiber();
}
if (__DEV__ && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onBeginWork(workInProgress);
}
Expand All @@ -718,9 +728,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
}

ReactCurrentOwner.current = null;
if (__DEV__) {
ReactDebugCurrentFiber.resetCurrentFiber();
}

return next;
}
Expand All @@ -735,8 +742,12 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
// See if beginning this work spawns more work.
if (__DEV__) {
startWorkTimer(workInProgress);
ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
}
let next = beginFailedWork(current, workInProgress, nextPriorityLevel);
if (__DEV__) {
ReactDebugCurrentFiber.resetCurrentFiber();
}
if (__DEV__ && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onBeginWork(workInProgress);
}
Expand All @@ -747,9 +758,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
}

ReactCurrentOwner.current = null;
if (__DEV__) {
ReactDebugCurrentFiber.resetCurrentFiber();
}

return next;
}
Expand Down