Skip to content

Commit d1d9054

Browse files
authored
Revert "Re-enabled DebugTracing feature for old reconciler fork (#19142)" (#19159)
This reverts commit cc7c1ae.
1 parent 090c6ed commit d1d9054

7 files changed

Lines changed: 47 additions & 189 deletions

File tree

packages/react-reconciler/src/DebugTracing.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* @flow
88
*/
99

10-
import type {Lane, Lanes} from './ReactFiberLane';
1110
import type {Wakeable} from 'shared/ReactTypes';
1211

1312
import {enableDebugTracing} from 'shared/ReactFeatureFlags';
@@ -18,10 +17,6 @@ let nativeConsoleLog: null | Function = null;
1817
const pendingGroupArgs: Array<any> = [];
1918
let printedGroupIndex: number = -1;
2019

21-
function formatLanes(laneOrLanes: Lane | Lanes): string {
22-
return '0b' + (laneOrLanes: any).toString(2).padStart(31, '0');
23-
}
24-
2520
function group(...groupArgs): void {
2621
pendingGroupArgs.push(groupArgs);
2722

@@ -62,11 +57,11 @@ function log(...logArgs): void {
6257
const REACT_LOGO_STYLE =
6358
'background-color: #20232a; color: #61dafb; padding: 0 2px;';
6459

65-
export function logCommitStarted(lanes: Lanes): void {
60+
export function logCommitStarted(priorityLabel: string): void {
6661
if (__DEV__) {
6762
if (enableDebugTracing) {
6863
group(
69-
`%c⚛️%c commit%c (${formatLanes(lanes)})`,
64+
`%c⚛️%c commit%c (priority: ${priorityLabel})`,
7065
REACT_LOGO_STYLE,
7166
'',
7267
'font-weight: normal;',
@@ -133,11 +128,11 @@ export function logComponentSuspended(
133128
}
134129
}
135130

136-
export function logLayoutEffectsStarted(lanes: Lanes): void {
131+
export function logLayoutEffectsStarted(priorityLabel: string): void {
137132
if (__DEV__) {
138133
if (enableDebugTracing) {
139134
group(
140-
`%c⚛️%c layout effects%c (${formatLanes(lanes)})`,
135+
`%c⚛️%c layout effects%c (priority: ${priorityLabel})`,
141136
REACT_LOGO_STYLE,
142137
'',
143138
'font-weight: normal;',
@@ -154,11 +149,11 @@ export function logLayoutEffectsStopped(): void {
154149
}
155150
}
156151

157-
export function logPassiveEffectsStarted(lanes: Lanes): void {
152+
export function logPassiveEffectsStarted(priorityLabel: string): void {
158153
if (__DEV__) {
159154
if (enableDebugTracing) {
160155
group(
161-
`%c⚛️%c passive effects%c (${formatLanes(lanes)})`,
156+
`%c⚛️%c passive effects%c (priority: ${priorityLabel})`,
162157
REACT_LOGO_STYLE,
163158
'',
164159
'font-weight: normal;',
@@ -175,11 +170,11 @@ export function logPassiveEffectsStopped(): void {
175170
}
176171
}
177172

178-
export function logRenderStarted(lanes: Lanes): void {
173+
export function logRenderStarted(priorityLabel: string): void {
179174
if (__DEV__) {
180175
if (enableDebugTracing) {
181176
group(
182-
`%c⚛️%c render%c (${formatLanes(lanes)})`,
177+
`%c⚛️%c render%c (priority: ${priorityLabel})`,
183178
REACT_LOGO_STYLE,
184179
'',
185180
'font-weight: normal;',
@@ -198,12 +193,12 @@ export function logRenderStopped(): void {
198193

199194
export function logForceUpdateScheduled(
200195
componentName: string,
201-
lane: Lane,
196+
priorityLabel: string,
202197
): void {
203198
if (__DEV__) {
204199
if (enableDebugTracing) {
205200
log(
206-
`%c⚛️%c ${componentName} forced update %c(${formatLanes(lane)})`,
201+
`%c⚛️%c ${componentName} forced update %c(priority: ${priorityLabel})`,
207202
REACT_LOGO_STYLE,
208203
'color: #db2e1f; font-weight: bold;',
209204
'',
@@ -214,13 +209,13 @@ export function logForceUpdateScheduled(
214209

215210
export function logStateUpdateScheduled(
216211
componentName: string,
217-
lane: Lane,
212+
priorityLabel: string,
218213
payloadOrAction: any,
219214
): void {
220215
if (__DEV__) {
221216
if (enableDebugTracing) {
222217
log(
223-
`%c⚛️%c ${componentName} updated state %c(${formatLanes(lane)})`,
218+
`%c⚛️%c ${componentName} updated state %c(priority: ${priorityLabel})`,
224219
REACT_LOGO_STYLE,
225220
'color: #01a252; font-weight: bold;',
226221
'',

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

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {Update, Snapshot} from './ReactSideEffectTags';
1616
import {
1717
debugRenderPhaseSideEffectsForStrictMode,
1818
disableLegacyContext,
19-
enableDebugTracing,
2019
warnAboutDeprecatedLifecycles,
2120
} from 'shared/ReactFeatureFlags';
2221
import ReactStrictModeWarnings from './ReactStrictModeWarnings.old';
@@ -28,7 +27,7 @@ import invariant from 'shared/invariant';
2827
import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols';
2928

3029
import {resolveDefaultProps} from './ReactFiberLazyComponent.old';
31-
import {DebugTracingMode, StrictMode} from './ReactTypeOfMode';
30+
import {StrictMode} from './ReactTypeOfMode';
3231

3332
import {
3433
enqueueUpdate,
@@ -56,7 +55,6 @@ import {
5655
scheduleUpdateOnFiber,
5756
} from './ReactFiberWorkLoop.old';
5857
import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig';
59-
import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing';
6058

6159
import {disableLogs, reenableLogs} from 'shared/ConsolePatchingDev';
6260

@@ -205,15 +203,6 @@ const classComponentUpdater = {
205203

206204
enqueueUpdate(fiber, update);
207205
scheduleUpdateOnFiber(fiber, lane, eventTime);
208-
209-
if (__DEV__) {
210-
if (enableDebugTracing) {
211-
if (fiber.mode & DebugTracingMode) {
212-
const name = getComponentName(fiber.type) || 'Unknown';
213-
logStateUpdateScheduled(name, lane, payload);
214-
}
215-
}
216-
}
217206
},
218207
enqueueReplaceState(inst, payload, callback) {
219208
const fiber = getInstance(inst);
@@ -234,15 +223,6 @@ const classComponentUpdater = {
234223

235224
enqueueUpdate(fiber, update);
236225
scheduleUpdateOnFiber(fiber, lane, eventTime);
237-
238-
if (__DEV__) {
239-
if (enableDebugTracing) {
240-
if (fiber.mode & DebugTracingMode) {
241-
const name = getComponentName(fiber.type) || 'Unknown';
242-
logStateUpdateScheduled(name, lane, payload);
243-
}
244-
}
245-
}
246226
},
247227
enqueueForceUpdate(inst, callback) {
248228
const fiber = getInstance(inst);
@@ -262,15 +242,6 @@ const classComponentUpdater = {
262242

263243
enqueueUpdate(fiber, update);
264244
scheduleUpdateOnFiber(fiber, lane, eventTime);
265-
266-
if (__DEV__) {
267-
if (enableDebugTracing) {
268-
if (fiber.mode & DebugTracingMode) {
269-
const name = getComponentName(fiber.type) || 'Unknown';
270-
logForceUpdateScheduled(name, lane);
271-
}
272-
}
273-
}
274245
},
275246
};
276247

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +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-
enableNewReconciler,
30-
} from 'shared/ReactFeatureFlags';
27+
import {enableNewReconciler} from 'shared/ReactFeatureFlags';
3128

32-
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
29+
import {NoMode, BlockingMode} from './ReactTypeOfMode';
3330
import {
3431
NoLane,
3532
NoLanes,
@@ -86,7 +83,6 @@ import {
8683
warnAboutMultipleRenderersDEV,
8784
} from './ReactMutableSource.old';
8885
import {getIsRendering} from './ReactCurrentFiber';
89-
import {logStateUpdateScheduled} from './DebugTracing';
9086

9187
const {ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals;
9288

@@ -1741,15 +1737,6 @@ function dispatchAction<S, A>(
17411737
}
17421738
scheduleUpdateOnFiber(fiber, lane, eventTime);
17431739
}
1744-
1745-
if (__DEV__) {
1746-
if (enableDebugTracing) {
1747-
if (fiber.mode & DebugTracingMode) {
1748-
const name = getComponentName(fiber.type) || 'Unknown';
1749-
logStateUpdateScheduled(name, lane, action);
1750-
}
1751-
}
1752-
}
17531740
}
17541741

17551742
export const ContextOnlyDispatcher: Dispatcher = {

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ import {
3030
LifecycleEffectMask,
3131
} from './ReactSideEffectTags';
3232
import {shouldCaptureSuspense} from './ReactFiberSuspenseComponent.old';
33-
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
34-
import {enableDebugTracing} from 'shared/ReactFeatureFlags';
33+
import {NoMode, BlockingMode} from './ReactTypeOfMode';
3534
import {createCapturedValue} from './ReactCapturedValue';
3635
import {
3736
enqueueCapturedUpdate,
@@ -54,7 +53,6 @@ import {
5453
pingSuspendedRoot,
5554
} from './ReactFiberWorkLoop.old';
5655
import {logCapturedError} from './ReactFiberErrorLogger';
57-
import {logComponentSuspended} from './DebugTracing';
5856

5957
import {
6058
SyncLane,
@@ -191,15 +189,6 @@ function throwException(
191189
// This is a wakeable.
192190
const wakeable: Wakeable = (value: any);
193191

194-
if (__DEV__) {
195-
if (enableDebugTracing) {
196-
if (sourceFiber.mode & DebugTracingMode) {
197-
const name = getComponentName(sourceFiber.type) || 'Unknown';
198-
logComponentSuspended(name, wakeable);
199-
}
200-
}
201-
}
202-
203192
if ((sourceFiber.mode & BlockingMode) === NoMode) {
204193
// Reset the memoizedState to what it was before we attempted
205194
// to render it.

0 commit comments

Comments
 (0)