Skip to content

Commit

Permalink
cleanup enableProfilerNestedUpdateScheduledHook feature flag (faceboo…
Browse files Browse the repository at this point in the history
…k#28509)

## Summary

Looks like this was added years ago for instrumentation at meta that
never ended up rolling out. Should be safe to clean up.

## How did you test this change?
`yarn test`
  • Loading branch information
noahlemen authored and AndyPengc12 committed Apr 15, 2024
1 parent 32c315c commit 89d26c9
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 504 deletions.
36 changes: 0 additions & 36 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
enableProfilerTimer,
enableProfilerCommitHooks,
enableProfilerNestedUpdatePhase,
enableProfilerNestedUpdateScheduledHook,
enableDebugTracing,
enableSchedulingProfiler,
disableSchedulerTimeoutInWorkLoop,
Expand Down Expand Up @@ -107,7 +106,6 @@ import {
ForwardRef,
MemoComponent,
SimpleMemoComponent,
Profiler,
HostComponent,
HostHoistable,
HostSingleton,
Expand Down Expand Up @@ -581,10 +579,6 @@ let hasUncaughtError = false;
let firstUncaughtError = null;
let legacyErrorBoundariesThatAlreadyFailed: Set<mixed> | null = null;

// Only used when enableProfilerNestedUpdateScheduledHook is true;
// to track which root is currently committing layout effects.
let rootCommittingMutationOrLayoutEffects: FiberRoot | null = null;

let rootDoesHavePassiveEffects: boolean = false;
let rootWithPendingPassiveEffects: FiberRoot | null = null;
let pendingPassiveEffectsLanes: Lanes = NoLanes;
Expand Down Expand Up @@ -807,26 +801,6 @@ export function scheduleUpdateOnFiber(

warnIfUpdatesNotWrappedWithActDEV(fiber);

if (enableProfilerTimer && enableProfilerNestedUpdateScheduledHook) {
if (
(executionContext & CommitContext) !== NoContext &&
root === rootCommittingMutationOrLayoutEffects
) {
if (fiber.mode & ProfileMode) {
let current: null | Fiber = fiber;
while (current !== null) {
if (current.tag === Profiler) {
const {id, onNestedUpdateScheduled} = current.memoizedProps;
if (typeof onNestedUpdateScheduled === 'function') {
onNestedUpdateScheduled(id);
}
}
current = current.return;
}
}
}
}

if (enableTransitionTracing) {
const transition = ReactCurrentBatchConfig.transition;
if (transition !== null && transition.name != null) {
Expand Down Expand Up @@ -2938,12 +2912,6 @@ function commitRootImpl(
recordCommitTime();
}

if (enableProfilerTimer && enableProfilerNestedUpdateScheduledHook) {
// Track the root here, rather than in commitLayoutEffects(), because of ref setters.
// Updates scheduled during ref detachment should also be flagged.
rootCommittingMutationOrLayoutEffects = root;
}

// The next phase is the mutation phase, where we mutate the host tree.
commitMutationEffects(root, finishedWork, lanes);

Expand Down Expand Up @@ -2982,10 +2950,6 @@ function commitRootImpl(
markLayoutEffectsStopped();
}

if (enableProfilerTimer && enableProfilerNestedUpdateScheduledHook) {
rootCommittingMutationOrLayoutEffects = null;
}

// Tell Scheduler to yield at the end of the frame, so the browser has an
// opportunity to paint.
requestPaint();
Expand Down
Loading

0 comments on commit 89d26c9

Please sign in to comment.