Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fiber] Unify Hook Unmounting into ReactFiberCommitEffects #30979

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 1 addition & 7 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,7 @@
FormReset,
Cloned,
} from './ReactFiberFlags';
import {
getCommitTime,
getCompleteTime,
pushNestedEffectDurations,
popNestedEffectDurations,
bubbleNestedEffectDurations,
} from './ReactProfilerTimer';
import {getCommitTime, getCompleteTime} from './ReactProfilerTimer';
import {logComponentRender} from './ReactFiberPerformanceTrack';
import {ConcurrentMode, NoMode, ProfileMode} from './ReactTypeOfMode';
import {deferHiddenCallbacks} from './ReactFiberClassUpdateQueue';
Expand Down Expand Up @@ -419,7 +413,7 @@
break;
}
case HostRoot: {
const prevEffectDuration = pushNestedEffectDurations();

Check failure on line 416 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'pushNestedEffectDurations' is not defined
recursivelyTraverseLayoutEffects(
finishedRoot,
finishedWork,
Expand All @@ -430,7 +424,7 @@
}
if (enableProfilerTimer && enableProfilerCommitHooks) {
finishedRoot.effectDuration +=
popNestedEffectDurations(prevEffectDuration);

Check failure on line 427 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'popNestedEffectDurations' is not defined
}
break;
}
Expand Down Expand Up @@ -474,7 +468,7 @@
// TODO: Should this fire inside an offscreen tree? Or should it wait to
// fire when the tree becomes visible again.
if (flags & Update) {
const prevEffectDuration = pushNestedEffectDurations();

Check failure on line 471 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'pushNestedEffectDurations' is not defined

recursivelyTraverseLayoutEffects(
finishedRoot,
Expand All @@ -488,7 +482,7 @@
// Propagate layout effect durations to the next nearest Profiler ancestor.
// Do not reset these values until the next render so DevTools has a chance to read them first.
profilerInstance.effectDuration +=
bubbleNestedEffectDurations(prevEffectDuration);

Check failure on line 485 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'bubbleNestedEffectDurations' is not defined
}

commitProfilerUpdate(
Expand Down Expand Up @@ -1784,7 +1778,7 @@
return;
}
case HostRoot: {
const prevEffectDuration = pushNestedEffectDurations();

Check failure on line 1781 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'pushNestedEffectDurations' is not defined

if (supportsResources) {
prepareToCommitHoistables();
Expand Down Expand Up @@ -1830,7 +1824,7 @@
}

if (enableProfilerTimer && enableProfilerCommitHooks) {
root.effectDuration += popNestedEffectDurations(prevEffectDuration);

Check failure on line 1827 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'popNestedEffectDurations' is not defined
}

return;
Expand Down Expand Up @@ -1861,7 +1855,7 @@
return;
}
case Profiler: {
const prevEffectDuration = pushNestedEffectDurations();

Check failure on line 1858 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'pushNestedEffectDurations' is not defined

recursivelyTraverseMutationEffects(root, finishedWork, lanes);
commitReconciliationEffects(finishedWork);
Expand All @@ -1871,7 +1865,7 @@
// Propagate layout effect durations to the next nearest Profiler ancestor.
// Do not reset these values until the next render so DevTools has a chance to read them first.
profilerInstance.effectDuration +=
bubbleNestedEffectDurations(prevEffectDuration);

Check failure on line 1868 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'bubbleNestedEffectDurations' is not defined
}
return;
}
Expand Down Expand Up @@ -2271,7 +2265,7 @@
case Profiler: {
// TODO: Figure out how Profiler updates should work with Offscreen
if (includeWorkInProgressEffects && flags & Update) {
const prevEffectDuration = pushNestedEffectDurations();

Check failure on line 2268 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'pushNestedEffectDurations' is not defined

recursivelyTraverseReappearLayoutEffects(
finishedRoot,
Expand All @@ -2285,7 +2279,7 @@
// Propagate layout effect durations to the next nearest Profiler ancestor.
// Do not reset these values until the next render so DevTools has a chance to read them first.
profilerInstance.effectDuration +=
bubbleNestedEffectDurations(prevEffectDuration);

Check failure on line 2282 in packages/react-reconciler/src/ReactFiberCommitWork.js

View workflow job for this annotation

GitHub Actions / Run eslint

'bubbleNestedEffectDurations' is not defined
}

commitProfilerUpdate(
Expand Down
Loading