Skip to content

Commit 51b3703

Browse files
authored
Revert "Scheduling profiler updates (facebook#19334)"
This reverts commit 6d7555b.
1 parent c604b69 commit 51b3703

10 files changed

+15
-269
lines changed

packages/react-reconciler/src/ReactFiberClassComponent.new.js

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import {Update, Snapshot} from './ReactSideEffectTags';
1616
import {
1717
debugRenderPhaseSideEffectsForStrictMode,
1818
disableLegacyContext,
19-
enableDebugTracing,
20-
enableSchedulingProfiler,
2119
warnAboutDeprecatedLifecycles,
2220
} from 'shared/ReactFeatureFlags';
2321
import ReactStrictModeWarnings from './ReactStrictModeWarnings.new';
@@ -29,7 +27,7 @@ import invariant from 'shared/invariant';
2927
import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols';
3028

3129
import {resolveDefaultProps} from './ReactFiberLazyComponent.new';
32-
import {DebugTracingMode, StrictMode} from './ReactTypeOfMode';
30+
import {StrictMode} from './ReactTypeOfMode';
3331

3432
import {
3533
enqueueUpdate,
@@ -57,13 +55,8 @@ import {
5755
scheduleUpdateOnFiber,
5856
} from './ReactFiberWorkLoop.new';
5957
import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig';
60-
import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing';
6158

6259
import {disableLogs, reenableLogs} from 'shared/ConsolePatchingDev';
63-
import {
64-
markForceUpdateScheduled,
65-
markStateUpdateScheduled,
66-
} from './SchedulingProfiler';
6760

6861
const fakeInternalInstance = {};
6962
const isArray = Array.isArray;
@@ -210,19 +203,6 @@ const classComponentUpdater = {
210203

211204
enqueueUpdate(fiber, update);
212205
scheduleUpdateOnFiber(fiber, lane, eventTime);
213-
214-
if (__DEV__) {
215-
if (enableDebugTracing) {
216-
if (fiber.mode & DebugTracingMode) {
217-
const name = getComponentName(fiber.type) || 'Unknown';
218-
logStateUpdateScheduled(name, lane, payload);
219-
}
220-
}
221-
}
222-
223-
if (enableSchedulingProfiler) {
224-
markStateUpdateScheduled(fiber, lane);
225-
}
226206
},
227207
enqueueReplaceState(inst, payload, callback) {
228208
const fiber = getInstance(inst);
@@ -243,19 +223,6 @@ const classComponentUpdater = {
243223

244224
enqueueUpdate(fiber, update);
245225
scheduleUpdateOnFiber(fiber, lane, eventTime);
246-
247-
if (__DEV__) {
248-
if (enableDebugTracing) {
249-
if (fiber.mode & DebugTracingMode) {
250-
const name = getComponentName(fiber.type) || 'Unknown';
251-
logStateUpdateScheduled(name, lane, payload);
252-
}
253-
}
254-
}
255-
256-
if (enableSchedulingProfiler) {
257-
markStateUpdateScheduled(fiber, lane);
258-
}
259226
},
260227
enqueueForceUpdate(inst, callback) {
261228
const fiber = getInstance(inst);
@@ -275,19 +242,6 @@ const classComponentUpdater = {
275242

276243
enqueueUpdate(fiber, update);
277244
scheduleUpdateOnFiber(fiber, lane, eventTime);
278-
279-
if (__DEV__) {
280-
if (enableDebugTracing) {
281-
if (fiber.mode & DebugTracingMode) {
282-
const name = getComponentName(fiber.type) || 'Unknown';
283-
logForceUpdateScheduled(name, lane);
284-
}
285-
}
286-
}
287-
288-
if (enableSchedulingProfiler) {
289-
markForceUpdateScheduled(fiber, lane);
290-
}
291245
},
292246
};
293247

packages/react-reconciler/src/ReactFiberHooks.new.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ import type {FiberRoot} from './ReactInternalTypes';
2424
import type {OpaqueIDType} from './ReactFiberHostConfig';
2525

2626
import ReactSharedInternals from 'shared/ReactSharedInternals';
27-
import {
28-
enableDebugTracing,
29-
enableSchedulingProfiler,
30-
enableNewReconciler,
31-
} from 'shared/ReactFeatureFlags';
27+
import {enableNewReconciler} from 'shared/ReactFeatureFlags';
3228

33-
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
29+
import {NoMode, BlockingMode} from './ReactTypeOfMode';
3430
import {
3531
NoLane,
3632
NoLanes,
@@ -92,8 +88,6 @@ import {
9288
warnAboutMultipleRenderersDEV,
9389
} from './ReactMutableSource.new';
9490
import {getIsRendering} from './ReactCurrentFiber';
95-
import {logStateUpdateScheduled} from './DebugTracing';
96-
import {markStateUpdateScheduled} from './SchedulingProfiler';
9791

9892
const {ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals;
9993

@@ -1757,19 +1751,6 @@ function dispatchAction<S, A>(
17571751
}
17581752
scheduleUpdateOnFiber(fiber, lane, eventTime);
17591753
}
1760-
1761-
if (__DEV__) {
1762-
if (enableDebugTracing) {
1763-
if (fiber.mode & DebugTracingMode) {
1764-
const name = getComponentName(fiber.type) || 'Unknown';
1765-
logStateUpdateScheduled(name, lane, action);
1766-
}
1767-
}
1768-
}
1769-
1770-
if (enableSchedulingProfiler) {
1771-
markStateUpdateScheduled(fiber, lane);
1772-
}
17731754
}
17741755

17751756
export const ContextOnlyDispatcher: Dispatcher = {

packages/react-reconciler/src/ReactFiberReconciler.new.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
} from './ReactWorkTags';
4040
import getComponentName from 'shared/getComponentName';
4141
import invariant from 'shared/invariant';
42-
import {enableSchedulingProfiler} from 'shared/ReactFeatureFlags';
4342
import ReactSharedInternals from 'shared/ReactSharedInternals';
4443
import {getPublicInstance} from './ReactFiberHostConfig';
4544
import {
@@ -96,7 +95,6 @@ import {
9695
setRefreshHandler,
9796
findHostInstancesForRefresh,
9897
} from './ReactFiberHotReloading.new';
99-
import {markRenderScheduled} from './SchedulingProfiler';
10098

10199
export {registerMutableSourceForHydration} from './ReactMutableSource.new';
102100
export {createPortal} from './ReactPortal';
@@ -275,10 +273,6 @@ export function updateContainer(
275273
const suspenseConfig = requestCurrentSuspenseConfig();
276274
const lane = requestUpdateLane(current, suspenseConfig);
277275

278-
if (enableSchedulingProfiler) {
279-
markRenderScheduled(lane);
280-
}
281-
282276
const context = getContextForSubtree(parentComponent);
283277
if (container.context === null) {
284278
container.context = context;

packages/react-reconciler/src/ReactFiberThrow.new.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ import {
3131
ForceUpdateForLegacySuspense,
3232
} from './ReactSideEffectTags';
3333
import {shouldCaptureSuspense} from './ReactFiberSuspenseComponent.new';
34-
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
35-
import {
36-
enableDebugTracing,
37-
enableSchedulingProfiler,
38-
} from 'shared/ReactFeatureFlags';
34+
import {NoMode, BlockingMode} from './ReactTypeOfMode';
3935
import {createCapturedValue} from './ReactCapturedValue';
4036
import {
4137
enqueueCapturedUpdate,
@@ -58,8 +54,6 @@ import {
5854
pingSuspendedRoot,
5955
} from './ReactFiberWorkLoop.new';
6056
import {logCapturedError} from './ReactFiberErrorLogger';
61-
import {logComponentSuspended} from './DebugTracing';
62-
import {markComponentSuspended} from './SchedulingProfiler';
6357

6458
import {
6559
SyncLane,
@@ -196,19 +190,6 @@ function throwException(
196190
// This is a wakeable.
197191
const wakeable: Wakeable = (value: any);
198192

199-
if (__DEV__) {
200-
if (enableDebugTracing) {
201-
if (sourceFiber.mode & DebugTracingMode) {
202-
const name = getComponentName(sourceFiber.type) || 'Unknown';
203-
logComponentSuspended(name, wakeable);
204-
}
205-
}
206-
}
207-
208-
if (enableSchedulingProfiler) {
209-
markComponentSuspended(sourceFiber, wakeable);
210-
}
211-
212193
if ((sourceFiber.mode & BlockingMode) === NoMode) {
213194
// Reset the memoizedState to what it was before we attempted
214195
// to render it.

0 commit comments

Comments
 (0)