Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ src/renderers/shared/shared/__tests__/ReactEmptyComponent-test.js
src/renderers/shared/shared/__tests__/ReactMultiChildText-test.js
* should reorder keyed text nodes

src/renderers/shared/shared/__tests__/ReactUpdates-test.js
* marks top-level updates

src/renderers/shared/shared/__tests__/refs-test.js
* Should increase refs with an increase in divs
1 change: 1 addition & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ src/renderers/shared/shared/__tests__/ReactUpdates-test.js
* should queue updates from during mount
* calls componentWillReceiveProps setState callback properly
* does not call render after a component as been deleted
* marks top-level updates
* throws in setState if the update callback is not a function
* throws in replaceState if the update callback is not a function
* throws in forceUpdate if the update callback is not a function
Expand Down
17 changes: 17 additions & 0 deletions src/renderers/shared/fiber/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var ReactFiberCompleteWork = require('ReactFiberCompleteWork');
var ReactFiberCommitWork = require('ReactFiberCommitWork');
var ReactFiberHostContext = require('ReactFiberHostContext');
var ReactCurrentOwner = require('ReactCurrentOwner');
var ReactFeatureFlags = require('ReactFeatureFlags');
var getComponentName = require('getComponentName');

var { cloneFiber } = require('ReactFiber');
Expand Down Expand Up @@ -628,6 +629,18 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
nextUnitOfWork = findNextUnitOfWork();
}

let hostRootTimeMarker;
if (
ReactFeatureFlags.logTopLevelRenders &&
nextUnitOfWork &&
nextUnitOfWork.tag === HostRoot &&
nextUnitOfWork.child
) {
const componentName = getComponentName(nextUnitOfWork.child) || '';
hostRootTimeMarker = 'React update: ' + componentName;
console.time(hostRootTimeMarker);
}

// If there's a deadline, and we're not performing Task work, perform work
// using this loop that checks the deadline on every iteration.
if (deadline && priorityLevel > TaskPriority) {
Expand Down Expand Up @@ -673,6 +686,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
}
}

if (hostRootTimeMarker) {
console.timeEnd(hostRootTimeMarker);
}

return deadlineHasExpired;
}

Expand Down