diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js
index 9dbac22704d17..5770bd1e20c9f 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js
@@ -37,56 +37,6 @@ describe('ReactDOMServerIntegration', () => {
resetModules();
});
- // Test pragmas don't support itRenders abstraction
- if (
- __EXPERIMENTAL__ &&
- require('shared/ReactFeatureFlags').enableDebugTracing
- ) {
- describe('React.unstable_DebugTracingMode', () => {
- beforeEach(() => {
- spyOnDevAndProd(console, 'log');
- });
-
- itRenders('with one child', async render => {
- const e = await render(
-
- text1
- ,
- );
- const parent = e.parentNode;
- expect(parent.childNodes[0].tagName).toBe('DIV');
- });
-
- itRenders('mode with several children', async render => {
- const Header = props => {
- return
header
;
- };
- const Footer = props => {
- return (
-
- footer
- about
-
- );
- };
- const e = await render(
-
- text1
- text2
-
-
- ,
- );
- const parent = e.parentNode;
- expect(parent.childNodes[0].tagName).toBe('DIV');
- expect(parent.childNodes[1].tagName).toBe('SPAN');
- expect(parent.childNodes[2].tagName).toBe('P');
- expect(parent.childNodes[3].tagName).toBe('H2');
- expect(parent.childNodes[4].tagName).toBe('H3');
- });
- });
- }
-
describe('React.StrictMode', () => {
itRenders('a strict mode with one child', async render => {
const e = await render(
diff --git a/packages/react-reconciler/src/DebugTracing.js b/packages/react-reconciler/src/DebugTracing.js
deleted file mode 100644
index 16606748be696..0000000000000
--- a/packages/react-reconciler/src/DebugTracing.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- */
-
-import type {Lane, Lanes} from './ReactFiberLane';
-import type {Wakeable} from 'shared/ReactTypes';
-
-import {enableDebugTracing} from 'shared/ReactFeatureFlags';
-
-const nativeConsole: Object = console;
-let nativeConsoleLog: null | Function = null;
-
-const pendingGroupArgs: Array = [];
-let printedGroupIndex: number = -1;
-
-function formatLanes(laneOrLanes: Lane | Lanes): string {
- return '0b' + (laneOrLanes: any).toString(2).padStart(31, '0');
-}
-
-function group(...groupArgs: Array): void {
- pendingGroupArgs.push(groupArgs);
-
- if (nativeConsoleLog === null) {
- nativeConsoleLog = nativeConsole.log;
- nativeConsole.log = log;
- }
-}
-
-function groupEnd(): void {
- pendingGroupArgs.pop();
- while (printedGroupIndex >= pendingGroupArgs.length) {
- nativeConsole.groupEnd();
- printedGroupIndex--;
- }
-
- if (pendingGroupArgs.length === 0) {
- nativeConsole.log = nativeConsoleLog;
- nativeConsoleLog = null;
- }
-}
-
-function log(...logArgs: Array): void {
- if (printedGroupIndex < pendingGroupArgs.length - 1) {
- for (let i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) {
- const groupArgs = pendingGroupArgs[i];
- nativeConsole.group(...groupArgs);
- }
- printedGroupIndex = pendingGroupArgs.length - 1;
- }
- if (typeof nativeConsoleLog === 'function') {
- nativeConsoleLog(...logArgs);
- } else {
- nativeConsole.log(...logArgs);
- }
-}
-
-const REACT_LOGO_STYLE =
- 'background-color: #20232a; color: #61dafb; padding: 0 2px;';
-
-export function logCommitStarted(lanes: Lanes): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- group(
- `%c⚛%c commit%c (${formatLanes(lanes)})`,
- REACT_LOGO_STYLE,
- '',
- 'font-weight: normal;',
- );
- }
- }
-}
-
-export function logCommitStopped(): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- groupEnd();
- }
- }
-}
-
-const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
-// $FlowFixMe[incompatible-type]: Flow cannot handle polymorphic WeakMaps
-const wakeableIDs: WeakMap = new PossiblyWeakMap();
-let wakeableID: number = 0;
-function getWakeableID(wakeable: Wakeable): number {
- if (!wakeableIDs.has(wakeable)) {
- wakeableIDs.set(wakeable, wakeableID++);
- }
- return ((wakeableIDs.get(wakeable): any): number);
-}
-
-export function logComponentSuspended(
- componentName: string,
- wakeable: Wakeable,
-): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- const id = getWakeableID(wakeable);
- const display = (wakeable: any).displayName || wakeable;
- log(
- `%c⚛%c ${componentName} suspended`,
- REACT_LOGO_STYLE,
- 'color: #80366d; font-weight: bold;',
- id,
- display,
- );
- wakeable.then(
- () => {
- log(
- `%c⚛%c ${componentName} resolved`,
- REACT_LOGO_STYLE,
- 'color: #80366d; font-weight: bold;',
- id,
- display,
- );
- },
- () => {
- log(
- `%c⚛%c ${componentName} rejected`,
- REACT_LOGO_STYLE,
- 'color: #80366d; font-weight: bold;',
- id,
- display,
- );
- },
- );
- }
- }
-}
-
-export function logLayoutEffectsStarted(lanes: Lanes): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- group(
- `%c⚛%c layout effects%c (${formatLanes(lanes)})`,
- REACT_LOGO_STYLE,
- '',
- 'font-weight: normal;',
- );
- }
- }
-}
-
-export function logLayoutEffectsStopped(): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- groupEnd();
- }
- }
-}
-
-export function logPassiveEffectsStarted(lanes: Lanes): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- group(
- `%c⚛%c passive effects%c (${formatLanes(lanes)})`,
- REACT_LOGO_STYLE,
- '',
- 'font-weight: normal;',
- );
- }
- }
-}
-
-export function logPassiveEffectsStopped(): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- groupEnd();
- }
- }
-}
-
-export function logRenderStarted(lanes: Lanes): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- group(
- `%c⚛%c render%c (${formatLanes(lanes)})`,
- REACT_LOGO_STYLE,
- '',
- 'font-weight: normal;',
- );
- }
- }
-}
-
-export function logRenderStopped(): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- groupEnd();
- }
- }
-}
-
-export function logForceUpdateScheduled(
- componentName: string,
- lane: Lane,
-): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- log(
- `%c⚛%c ${componentName} forced update %c(${formatLanes(lane)})`,
- REACT_LOGO_STYLE,
- 'color: #db2e1f; font-weight: bold;',
- '',
- );
- }
- }
-}
-
-export function logStateUpdateScheduled(
- componentName: string,
- lane: Lane,
- payloadOrAction: any,
-): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- log(
- `%c⚛%c ${componentName} updated state %c(${formatLanes(lane)})`,
- REACT_LOGO_STYLE,
- 'color: #01a252; font-weight: bold;',
- '',
- payloadOrAction,
- );
- }
- }
-}
diff --git a/packages/react-reconciler/src/ReactFiber.js b/packages/react-reconciler/src/ReactFiber.js
index 29a8931038c8d..42f347f4ba956 100644
--- a/packages/react-reconciler/src/ReactFiber.js
+++ b/packages/react-reconciler/src/ReactFiber.js
@@ -32,7 +32,6 @@ import {
enableScopeAPI,
enableLegacyHidden,
enableTransitionTracing,
- enableDebugTracing,
enableDO_NOT_USE_disableStrictPassiveEffect,
enableRenderableContext,
disableLegacyMode,
@@ -80,7 +79,6 @@ import {NoLanes} from './ReactFiberLane';
import {
NoMode,
ConcurrentMode,
- DebugTracingMode,
ProfileMode,
StrictLegacyMode,
StrictEffectsMode,
@@ -89,7 +87,6 @@ import {
import {
REACT_FORWARD_REF_TYPE,
REACT_FRAGMENT_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_PROFILER_TYPE,
REACT_PROVIDER_TYPE,
@@ -630,13 +627,6 @@ export function createFiberFromTypeAndProps(
return createFiberFromTracingMarker(pendingProps, mode, lanes, key);
}
// Fall through
- case REACT_DEBUG_TRACING_MODE_TYPE:
- if (enableDebugTracing) {
- fiberTag = Mode;
- mode |= DebugTracingMode;
- break;
- }
- // Fall through
default: {
if (typeof type === 'object' && type !== null) {
switch (type.$$typeof) {
diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.js b/packages/react-reconciler/src/ReactFiberClassComponent.js
index c32525702e944..f5d5c96a2a93c 100644
--- a/packages/react-reconciler/src/ReactFiberClassComponent.js
+++ b/packages/react-reconciler/src/ReactFiberClassComponent.js
@@ -20,7 +20,6 @@ import {
import {
debugRenderPhaseSideEffectsForStrictMode,
disableLegacyContext,
- enableDebugTracing,
enableSchedulingProfiler,
enableLazyContextPropagation,
disableDefaultPropsExceptForClasses,
@@ -35,12 +34,7 @@ import assign from 'shared/assign';
import isArray from 'shared/isArray';
import {REACT_CONTEXT_TYPE, REACT_CONSUMER_TYPE} from 'shared/ReactSymbols';
-import {
- DebugTracingMode,
- NoMode,
- StrictLegacyMode,
- StrictEffectsMode,
-} from './ReactTypeOfMode';
+import {NoMode, StrictLegacyMode, StrictEffectsMode} from './ReactTypeOfMode';
import {
enqueueUpdate,
@@ -65,7 +59,6 @@ import {
} from './ReactFiberContext';
import {readContext, checkIfContextChanged} from './ReactFiberNewContext';
import {requestUpdateLane, scheduleUpdateOnFiber} from './ReactFiberWorkLoop';
-import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing';
import {
markForceUpdateScheduled,
markStateUpdateScheduled,
@@ -199,15 +192,6 @@ const classComponentUpdater = {
entangleTransitions(root, fiber, lane);
}
- if (__DEV__) {
- if (enableDebugTracing) {
- if (fiber.mode & DebugTracingMode) {
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
- logStateUpdateScheduled(name, lane, payload);
- }
- }
- }
-
if (enableSchedulingProfiler) {
markStateUpdateScheduled(fiber, lane);
}
@@ -234,15 +218,6 @@ const classComponentUpdater = {
entangleTransitions(root, fiber, lane);
}
- if (__DEV__) {
- if (enableDebugTracing) {
- if (fiber.mode & DebugTracingMode) {
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
- logStateUpdateScheduled(name, lane, payload);
- }
- }
- }
-
if (enableSchedulingProfiler) {
markStateUpdateScheduled(fiber, lane);
}
@@ -269,15 +244,6 @@ const classComponentUpdater = {
entangleTransitions(root, fiber, lane);
}
- if (__DEV__) {
- if (enableDebugTracing) {
- if (fiber.mode & DebugTracingMode) {
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
- logForceUpdateScheduled(name, lane);
- }
- }
- }
-
if (enableSchedulingProfiler) {
markForceUpdateScheduled(fiber, lane);
}
diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js
index d2df61063f687..11851d213b0fb 100644
--- a/packages/react-reconciler/src/ReactFiberHooks.js
+++ b/packages/react-reconciler/src/ReactFiberHooks.js
@@ -35,7 +35,6 @@ import {
} from './ReactFiberConfig';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import {
- enableDebugTracing,
enableSchedulingProfiler,
enableCache,
enableLazyContextPropagation,
@@ -56,7 +55,6 @@ import {
import {
NoMode,
ConcurrentMode,
- DebugTracingMode,
StrictEffectsMode,
StrictLegacyMode,
NoStrictPassiveEffectsMode,
@@ -125,7 +123,6 @@ import {
getIsHydrating,
tryToClaimNextHydratableFormMarkerInstance,
} from './ReactFiberHydrationContext';
-import {logStateUpdateScheduled} from './DebugTracing';
import {
markStateUpdateScheduled,
setIsStrictModeForDevtools,
@@ -3928,15 +3925,6 @@ function entangleTransitionUpdate(
}
function markUpdateInDevTools(fiber: Fiber, lane: Lane, action: A): void {
- if (__DEV__) {
- if (enableDebugTracing) {
- if (fiber.mode & DebugTracingMode) {
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
- logStateUpdateScheduled(name, lane, action);
- }
- }
- }
-
if (enableSchedulingProfiler) {
markStateUpdateScheduled(fiber, lane);
}
diff --git a/packages/react-reconciler/src/ReactFiberThrow.js b/packages/react-reconciler/src/ReactFiberThrow.js
index e901486c1d448..a4bdb84e6c4e7 100644
--- a/packages/react-reconciler/src/ReactFiberThrow.js
+++ b/packages/react-reconciler/src/ReactFiberThrow.js
@@ -37,9 +37,8 @@ import {
ForceClientRender,
ScheduleRetry,
} from './ReactFiberFlags';
-import {NoMode, ConcurrentMode, DebugTracingMode} from './ReactTypeOfMode';
+import {NoMode, ConcurrentMode} from './ReactTypeOfMode';
import {
- enableDebugTracing,
enableLazyContextPropagation,
enableUpdaterTracking,
enablePostpone,
@@ -70,7 +69,6 @@ import {
} from './ReactFiberWorkLoop';
import {propagateParentContextChangesToDeferredTree} from './ReactFiberNewContext';
import {logUncaughtError, logCaughtError} from './ReactFiberErrorLogger';
-import {logComponentSuspended} from './DebugTracing';
import {isDevToolsPresent} from './ReactFiberDevToolsHook';
import {
SyncLane,
@@ -399,15 +397,6 @@ function throwException(
}
}
- if (__DEV__) {
- if (enableDebugTracing) {
- if (sourceFiber.mode & DebugTracingMode) {
- const name = getComponentNameFromFiber(sourceFiber) || 'Unknown';
- logComponentSuspended(name, wakeable);
- }
- }
- }
-
// Mark the nearest Suspense boundary to switch to rendering a fallback.
const suspenseBoundary = getSuspenseHandler();
if (suspenseBoundary !== null) {
diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js
index f812d16c9c65a..654abfeafcdf6 100644
--- a/packages/react-reconciler/src/ReactFiberWorkLoop.js
+++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js
@@ -29,7 +29,6 @@ import {
enableProfilerTimer,
enableProfilerCommitHooks,
enableProfilerNestedUpdatePhase,
- enableDebugTracing,
enableSchedulingProfiler,
enableUpdaterTracking,
enableCache,
@@ -55,16 +54,6 @@ import {
NormalPriority as NormalSchedulerPriority,
IdlePriority as IdleSchedulerPriority,
} from './Scheduler';
-import {
- logCommitStarted,
- logCommitStopped,
- logLayoutEffectsStarted,
- logLayoutEffectsStopped,
- logPassiveEffectsStarted,
- logPassiveEffectsStopped,
- logRenderStarted,
- logRenderStopped,
-} from './DebugTracing';
import {
logBlockingStart,
logTransitionStart,
@@ -2249,12 +2238,6 @@ function renderRootSync(
prepareFreshStack(root, lanes);
}
- if (__DEV__) {
- if (enableDebugTracing) {
- logRenderStarted(lanes);
- }
- }
-
if (enableSchedulingProfiler) {
markRenderStarted(lanes);
}
@@ -2349,12 +2332,6 @@ function renderRootSync(
popDispatcher(prevDispatcher);
popAsyncDispatcher(prevAsyncDispatcher);
- if (__DEV__) {
- if (enableDebugTracing) {
- logRenderStopped();
- }
- }
-
if (enableSchedulingProfiler) {
markRenderStopped();
}
@@ -2422,12 +2399,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes);
}
- if (__DEV__) {
- if (enableDebugTracing) {
- logRenderStarted(lanes);
- }
- }
-
if (enableSchedulingProfiler) {
markRenderStarted(lanes);
}
@@ -2640,12 +2611,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
popAsyncDispatcher(prevAsyncDispatcher);
executionContext = prevExecutionContext;
- if (__DEV__) {
- if (enableDebugTracing) {
- logRenderStopped();
- }
- }
-
// Check if the tree has completed.
if (workInProgress !== null) {
// Still work remaining.
@@ -3208,27 +3173,14 @@ function commitRootImpl(
}
}
- if (__DEV__) {
- if (enableDebugTracing) {
- logCommitStarted(lanes);
- }
- }
-
if (enableSchedulingProfiler) {
markCommitStarted(lanes);
}
if (finishedWork === null) {
- if (__DEV__) {
- if (enableDebugTracing) {
- logCommitStopped();
- }
- }
-
if (enableSchedulingProfiler) {
markCommitStopped();
}
-
return null;
} else {
if (__DEV__) {
@@ -3394,21 +3346,10 @@ function commitRootImpl(
// The next phase is the layout phase, where we call effects that read
// the host tree after it's been mutated. The idiomatic use case for this is
// layout, but class component lifecycles also fire here for legacy reasons.
- if (__DEV__) {
- if (enableDebugTracing) {
- logLayoutEffectsStarted(lanes);
- }
- }
if (enableSchedulingProfiler) {
markLayoutEffectsStarted(lanes);
}
commitLayoutEffects(finishedWork, root, lanes);
- if (__DEV__) {
- if (enableDebugTracing) {
- logLayoutEffectsStopped();
- }
- }
-
if (enableSchedulingProfiler) {
markLayoutEffectsStopped();
}
@@ -3574,12 +3515,6 @@ function commitRootImpl(
// If layout work was scheduled, flush it now.
flushSyncWorkOnAllRoots();
- if (__DEV__) {
- if (enableDebugTracing) {
- logCommitStopped();
- }
- }
-
if (enableSchedulingProfiler) {
markCommitStopped();
}
@@ -3720,10 +3655,6 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
if (__DEV__) {
isFlushingPassiveEffects = true;
didScheduleUpdateDuringPassiveEffects = false;
-
- if (enableDebugTracing) {
- logPassiveEffectsStarted(lanes);
- }
}
let passiveEffectStartTime = 0;
@@ -3752,12 +3683,6 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
pendingPassiveEffectsRenderEndTime,
);
- if (__DEV__) {
- if (enableDebugTracing) {
- logPassiveEffectsStopped();
- }
- }
-
if (enableSchedulingProfiler) {
markPassiveEffectsStopped();
}
diff --git a/packages/react-reconciler/src/ReactTypeOfMode.js b/packages/react-reconciler/src/ReactTypeOfMode.js
index 7542c8eff528c..fd67d9979f8bb 100644
--- a/packages/react-reconciler/src/ReactTypeOfMode.js
+++ b/packages/react-reconciler/src/ReactTypeOfMode.js
@@ -12,8 +12,8 @@ export type TypeOfMode = number;
export const NoMode = /* */ 0b0000000;
// TODO: Remove ConcurrentMode by reading from the root tag instead
export const ConcurrentMode = /* */ 0b0000001;
-export const ProfileMode = /* */ 0b0000010;
-export const DebugTracingMode = /* */ 0b0000100;
+export const ProfileMode = /* */ 0b0000010;
+//export const DebugTracingMode = /* */ 0b0000100; // Removed
export const StrictLegacyMode = /* */ 0b0001000;
export const StrictEffectsMode = /* */ 0b0010000;
export const NoStrictPassiveEffectsMode = /* */ 0b1000000;
diff --git a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js
deleted file mode 100644
index ba0451c4c5f0b..0000000000000
--- a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js
+++ /dev/null
@@ -1,440 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @emails react-core
- */
-
-'use strict';
-
-describe('DebugTracing', () => {
- let React;
- let ReactNoop;
- let waitForPaint;
- let waitForAll;
- let act;
-
- let logs;
-
- const SYNC_LANE_STRING = '0b0000000000000000000000000000010';
- const DEFAULT_LANE_STRING = '0b0000000000000000000000000100000';
- const RETRY_LANE_STRING = '0b0000000010000000000000000000000';
-
- global.IS_REACT_ACT_ENVIRONMENT = true;
-
- beforeEach(() => {
- jest.resetModules();
-
- React = require('react');
- ReactNoop = require('react-noop-renderer');
- const InternalTestUtils = require('internal-test-utils');
- waitForPaint = InternalTestUtils.waitForPaint;
- waitForAll = InternalTestUtils.waitForAll;
- act = InternalTestUtils.act;
-
- logs = [];
-
- const groups = [];
-
- spyOnDevAndProd(console, 'log').mockImplementation(message => {
- logs.push(`log: ${message.replace(/%c/g, '')}`);
- });
- spyOnDevAndProd(console, 'group').mockImplementation(message => {
- logs.push(`group: ${message.replace(/%c/g, '')}`);
- groups.push(message);
- });
- spyOnDevAndProd(console, 'groupEnd').mockImplementation(() => {
- const message = groups.pop();
- logs.push(`groupEnd: ${message.replace(/%c/g, '')}`);
- });
- });
-
- // @gate enableDebugTracing
- it('should not log anything for sync render without suspends or state updates', async () => {
- await act(() => {
- ReactNoop.render(
-
-
- ,
- );
- });
-
- expect(logs).toEqual([]);
- });
-
- // @gate experimental && enableDebugTracing
- it('should not log anything for concurrent render without suspends or state updates', async () => {
- await act(() =>
- ReactNoop.render(
-
-
- ,
- ),
- );
- expect(logs).toEqual([]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing && !disableLegacyMode
- it('should log sync render with suspense, legacy', async () => {
- let resolveFakeSuspensePromise;
- let didResolve = false;
- const fakeSuspensePromise = new Promise(resolve => {
- resolveFakeSuspensePromise = () => {
- didResolve = true;
- resolve();
- };
- });
-
- function Example() {
- if (!didResolve) {
- throw fakeSuspensePromise;
- }
- return null;
- }
-
- ReactNoop.renderLegacySyncRoot(
-
-
-
-
- ,
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${SYNC_LANE_STRING})`,
- 'log: ⚛ Example suspended',
- `groupEnd: ⚛ render (${SYNC_LANE_STRING})`,
- ]);
-
- logs.splice(0);
-
- resolveFakeSuspensePromise();
- await waitForAll([]);
-
- expect(logs).toEqual(['log: ⚛ Example resolved']);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense && !disableLegacyMode
- it('should log sync render with CPU suspense, legacy', async () => {
- function Example() {
- console.log('');
- return null;
- }
-
- function Wrapper({children}) {
- console.log('');
- return children;
- }
-
- ReactNoop.renderLegacySyncRoot(
-
-
-
-
-
-
- ,
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${SYNC_LANE_STRING})`,
- 'log: ',
- `groupEnd: ⚛ render (${SYNC_LANE_STRING})`,
- ]);
-
- logs.splice(0);
-
- await waitForPaint([]);
-
- expect(logs).toEqual([
- `group: ⚛ render (${RETRY_LANE_STRING})`,
- 'log: ',
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log concurrent render with suspense', async () => {
- let isResolved = false;
- let resolveFakeSuspensePromise;
- const fakeSuspensePromise = new Promise(resolve => {
- resolveFakeSuspensePromise = () => {
- resolve();
- isResolved = true;
- };
- });
-
- function Example() {
- if (!isResolved) {
- throw fakeSuspensePromise;
- }
- return null;
- }
-
- await act(() =>
- ReactNoop.render(
-
-
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
- 'log: ⚛ Example suspended',
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
-
- ...(gate('enableSiblingPrerendering')
- ? [
- `group: ⚛ render (${RETRY_LANE_STRING})`,
- 'log: ⚛ Example suspended',
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
- ]
- : []),
- ]);
-
- logs.splice(0);
-
- await act(async () => await resolveFakeSuspensePromise());
- expect(logs).toEqual([
- 'log: ⚛ Example resolved',
-
- ...(gate('enableSiblingPrerendering')
- ? ['log: ⚛ Example resolved']
- : []),
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense
- it('should log concurrent render with CPU suspense', async () => {
- function Example() {
- console.log('');
- return null;
- }
-
- function Wrapper({children}) {
- console.log('');
- return children;
- }
-
- await act(() =>
- ReactNoop.render(
-
-
-
-
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
- 'log: ',
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
- `group: ⚛ render (${RETRY_LANE_STRING})`,
- 'log: ',
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log cascading class component updates', async () => {
- class Example extends React.Component {
- state = {didMount: false};
- componentDidMount() {
- this.setState({didMount: true});
- }
- render() {
- return null;
- }
- }
-
- await act(() =>
- ReactNoop.render(
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([
- `group: ⚛ commit (${DEFAULT_LANE_STRING})`,
- `group: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
- `log: ⚛ Example updated state (${SYNC_LANE_STRING})`,
- `groupEnd: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
- `groupEnd: ⚛ commit (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log render phase state updates for class component', async () => {
- class Example extends React.Component {
- state = {didRender: false};
- render() {
- if (this.state.didRender === false) {
- this.setState({didRender: true});
- }
- return null;
- }
- }
-
- await expect(async () => {
- await act(() => {
- ReactNoop.render(
-
-
- ,
- );
- });
- }).toErrorDev(
- 'Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.',
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log cascading layout updates', async () => {
- function Example() {
- const [didMount, setDidMount] = React.useState(false);
- React.useLayoutEffect(() => {
- setDidMount(true);
- }, []);
- return didMount;
- }
-
- await act(() =>
- ReactNoop.render(
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([
- `group: ⚛ commit (${DEFAULT_LANE_STRING})`,
- `group: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
- `log: ⚛ Example updated state (${SYNC_LANE_STRING})`,
- `groupEnd: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
- `groupEnd: ⚛ commit (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log cascading passive updates', async () => {
- function Example() {
- const [didMount, setDidMount] = React.useState(false);
- React.useEffect(() => {
- setDidMount(true);
- }, []);
- return didMount;
- }
-
- await act(() => {
- ReactNoop.render(
-
-
- ,
- );
- });
- expect(logs).toEqual([
- `group: ⚛ passive effects (${DEFAULT_LANE_STRING})`,
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
- `groupEnd: ⚛ passive effects (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log render phase updates', async () => {
- function Example() {
- const [didRender, setDidRender] = React.useState(false);
- if (!didRender) {
- setDidRender(true);
- }
- return didRender;
- }
-
- await act(() => {
- ReactNoop.render(
-
-
- ,
- );
- });
-
- expect(logs).toEqual([
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && build === 'development' && enableDebugTracing
- it('should log when user code logs', async () => {
- function Example() {
- console.log('Hello from user code');
- return null;
- }
-
- await act(() =>
- ReactNoop.render(
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
- 'log: Hello from user code',
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
- ]);
- });
-
- // @gate experimental && enableDebugTracing
- it('should not log anything outside of a unstable_DebugTracingMode subtree', async () => {
- function ExampleThatCascades() {
- const [didMount, setDidMount] = React.useState(false);
- React.useLayoutEffect(() => {
- setDidMount(true);
- }, []);
- return didMount;
- }
-
- const fakeSuspensePromise = {then() {}};
-
- function ExampleThatSuspends() {
- throw fakeSuspensePromise;
- }
-
- function Example() {
- return null;
- }
-
- await act(() =>
- ReactNoop.render(
-
-
-
-
-
-
-
-
- ,
- ),
- );
-
- expect(logs).toEqual([]);
- });
-});
diff --git a/packages/react-server/src/ReactFizzServer.js b/packages/react-server/src/ReactFizzServer.js
index f245861ba0012..e6f0d8e02fd6e 100644
--- a/packages/react-server/src/ReactFizzServer.js
+++ b/packages/react-server/src/ReactFizzServer.js
@@ -136,7 +136,6 @@ import {
REACT_LAZY_TYPE,
REACT_SUSPENSE_TYPE,
REACT_LEGACY_HIDDEN_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_PROFILER_TYPE,
REACT_SUSPENSE_LIST_TYPE,
@@ -2161,7 +2160,6 @@ function renderElement(
// www build. As a migration step, we could add a special prop to Offscreen
// that simulates the old behavior (no hiding, no change to effects).
case REACT_LEGACY_HIDDEN_TYPE:
- case REACT_DEBUG_TRACING_MODE_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_PROFILER_TYPE:
case REACT_FRAGMENT_TYPE: {
diff --git a/packages/react/index.development.js b/packages/react/index.development.js
index 8472789ba36cd..809e940f070ba 100644
--- a/packages/react/index.development.js
+++ b/packages/react/index.development.js
@@ -45,7 +45,6 @@ export {
memo,
cache,
startTransition,
- unstable_DebugTracingMode,
unstable_LegacyHidden,
unstable_Activity,
unstable_Scope,
diff --git a/packages/react/index.experimental.development.js b/packages/react/index.experimental.development.js
index d41774e1feedc..cc753cd9c5ed8 100644
--- a/packages/react/index.experimental.development.js
+++ b/packages/react/index.experimental.development.js
@@ -28,7 +28,6 @@ export {
memo,
cache,
startTransition,
- unstable_DebugTracingMode,
unstable_Activity,
unstable_postpone,
unstable_getCacheForType,
diff --git a/packages/react/index.experimental.js b/packages/react/index.experimental.js
index ae98e3b91f19c..ab97c58caa5d2 100644
--- a/packages/react/index.experimental.js
+++ b/packages/react/index.experimental.js
@@ -28,7 +28,6 @@ export {
memo,
cache,
startTransition,
- unstable_DebugTracingMode,
unstable_Activity,
unstable_postpone,
unstable_getCacheForType,
diff --git a/packages/react/index.fb.js b/packages/react/index.fb.js
index 4764281481dbb..8cded91b9854d 100644
--- a/packages/react/index.fb.js
+++ b/packages/react/index.fb.js
@@ -33,7 +33,6 @@ export {
StrictMode,
Suspense,
unstable_Activity,
- unstable_DebugTracingMode,
unstable_getCacheForType,
unstable_LegacyHidden,
unstable_Scope,
diff --git a/packages/react/index.js b/packages/react/index.js
index 2edb0a2c1de09..3e087509ccb06 100644
--- a/packages/react/index.js
+++ b/packages/react/index.js
@@ -46,7 +46,6 @@ export {
memo,
cache,
startTransition,
- unstable_DebugTracingMode,
unstable_LegacyHidden,
unstable_Activity,
unstable_Scope,
diff --git a/packages/react/src/ReactClient.js b/packages/react/src/ReactClient.js
index 478d9e026aae8..90ce18b133a34 100644
--- a/packages/react/src/ReactClient.js
+++ b/packages/react/src/ReactClient.js
@@ -10,7 +10,6 @@
import ReactVersion from 'shared/ReactVersion';
import {
REACT_FRAGMENT_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
REACT_PROFILER_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_SUSPENSE_TYPE,
@@ -105,7 +104,6 @@ export {
REACT_FRAGMENT_TYPE as Fragment,
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
REACT_SUSPENSE_TYPE as Suspense,
createElement,
cloneElement,
diff --git a/packages/react/src/ReactServer.experimental.development.js b/packages/react/src/ReactServer.experimental.development.js
index ccf423d79ecc7..82aff0d615fb4 100644
--- a/packages/react/src/ReactServer.experimental.development.js
+++ b/packages/react/src/ReactServer.experimental.development.js
@@ -15,7 +15,6 @@ import {
REACT_PROFILER_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_SUSPENSE_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
} from 'shared/ReactSymbols';
import {
cloneElement,
@@ -71,7 +70,6 @@ export {
memo,
cache,
startTransition,
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
REACT_SUSPENSE_TYPE as unstable_SuspenseList,
getCacheForType as unstable_getCacheForType,
postpone as unstable_postpone,
diff --git a/packages/react/src/ReactServer.experimental.js b/packages/react/src/ReactServer.experimental.js
index 97b548f82d6b6..e77e249930e21 100644
--- a/packages/react/src/ReactServer.experimental.js
+++ b/packages/react/src/ReactServer.experimental.js
@@ -15,7 +15,6 @@ import {
REACT_PROFILER_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_SUSPENSE_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
} from 'shared/ReactSymbols';
import {
cloneElement,
@@ -70,7 +69,6 @@ export {
memo,
cache,
startTransition,
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
REACT_SUSPENSE_TYPE as unstable_SuspenseList,
getCacheForType as unstable_getCacheForType,
postpone as unstable_postpone,
diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js
index 212afaabc4216..3855fa9b5180c 100644
--- a/packages/shared/ReactFeatureFlags.js
+++ b/packages/shared/ReactFeatureFlags.js
@@ -269,11 +269,6 @@ export const enableProfilerCommitHooks = __PROFILE__;
// Phase param passed to onRender callback differentiates between an "update" and a "cascading-update".
export const enableProfilerNestedUpdatePhase = __PROFILE__;
-// Adds verbose console logging for e.g. state updates, suspense, and work loop
-// stuff. Intended to enable React core members to more easily debug scheduling
-// issues in DEV builds.
-export const enableDebugTracing = false;
-
export const enableAsyncDebugInfo = __EXPERIMENTAL__;
// Track which Fiber(s) schedule render work.
diff --git a/packages/shared/ReactSymbols.js b/packages/shared/ReactSymbols.js
index 002870896f00f..0d1208b21af0c 100644
--- a/packages/shared/ReactSymbols.js
+++ b/packages/shared/ReactSymbols.js
@@ -33,9 +33,6 @@ export const REACT_SUSPENSE_LIST_TYPE: symbol = Symbol.for(
export const REACT_MEMO_TYPE: symbol = Symbol.for('react.memo');
export const REACT_LAZY_TYPE: symbol = Symbol.for('react.lazy');
export const REACT_SCOPE_TYPE: symbol = Symbol.for('react.scope');
-export const REACT_DEBUG_TRACING_MODE_TYPE: symbol = Symbol.for(
- 'react.debug_trace_mode',
-);
export const REACT_OFFSCREEN_TYPE: symbol = Symbol.for('react.offscreen');
export const REACT_LEGACY_HIDDEN_TYPE: symbol = Symbol.for(
'react.legacy_hidden',
diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js
index 7493a34494d82..6734444e01dc5 100644
--- a/packages/shared/forks/ReactFeatureFlags.native-fb.js
+++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js
@@ -47,7 +47,6 @@ export const enableAsyncIterableChildren = false;
export const enableCache = true;
export const enableCPUSuspense = true;
export const enableCreateEventHandleAPI = false;
-export const enableDebugTracing = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableMoveBefore = true;
diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js
index e034a723d7574..d4facd9ad2de5 100644
--- a/packages/shared/forks/ReactFeatureFlags.native-oss.js
+++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js
@@ -34,7 +34,6 @@ export const enableAsyncIterableChildren = false;
export const enableCache = true;
export const enableCPUSuspense = false;
export const enableCreateEventHandleAPI = false;
-export const enableDebugTracing = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFabricCompleteRootInCommitPhase = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js
index fe518f955e949..7e62adb318085 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js
@@ -11,7 +11,6 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
export const debugRenderPhaseSideEffectsForStrictMode = false;
-export const enableDebugTracing = false;
export const enableAsyncDebugInfo = false;
export const enableSchedulingProfiler = false;
export const enableProfilerTimer = __PROFILE__;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
index 0b0da8b8cb326..82ac86a2cdb14 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
@@ -26,7 +26,6 @@ export const enableAsyncIterableChildren = false;
export const enableCache = true;
export const enableCPUSuspense = true;
export const enableCreateEventHandleAPI = false;
-export const enableDebugTracing = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableMoveBefore = false;
diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
index 63f76b4a3a7c4..21efe3c6d51e8 100644
--- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
+++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
@@ -11,7 +11,6 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
import typeof * as ExportsType from './ReactFeatureFlags.test-renderer.www';
export const debugRenderPhaseSideEffectsForStrictMode = false;
-export const enableDebugTracing = false;
export const enableAsyncDebugInfo = false;
export const enableSchedulingProfiler = false;
export const enableProfilerTimer = __PROFILE__;
diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js
index 7c28c76fb1392..69da420d0422c 100644
--- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js
+++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js
@@ -32,12 +32,6 @@ export const retryLaneExpirationMs = 5000;
export const syncLaneExpirationMs = 250;
export const transitionLaneExpirationMs = 5000;
-// Enable this flag to help with concurrent mode debugging.
-// It logs information to the console about React scheduling, rendering, and commit phases.
-//
-// NOTE: This feature will only work in DEV mode; all callsites are wrapped with __DEV__.
-export const enableDebugTracing = __EXPERIMENTAL__;
-
export const enableSchedulingProfiler = __VARIANT__;
export const enableInfiniteRenderLoopDetection = __VARIANT__;
diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js
index f54c73a4647d4..ae12e5caf92ea 100644
--- a/packages/shared/forks/ReactFeatureFlags.www.js
+++ b/packages/shared/forks/ReactFeatureFlags.www.js
@@ -19,7 +19,6 @@ export const {
disableDefaultPropsExceptForClasses,
disableLegacyContextForFunctionComponents,
disableSchedulerTimeoutInWorkLoop,
- enableDebugTracing,
enableDeferRootSchedulingToMicrotask,
enableDO_NOT_USE_disableStrictPassiveEffect,
enableHiddenSubtreeInsertionEffectCleanup,
diff --git a/packages/shared/isValidElementType.js b/packages/shared/isValidElementType.js
index 6d5397be33e70..346992b118865 100644
--- a/packages/shared/isValidElementType.js
+++ b/packages/shared/isValidElementType.js
@@ -14,7 +14,6 @@ import {
REACT_FORWARD_REF_TYPE,
REACT_FRAGMENT_TYPE,
REACT_PROFILER_TYPE,
- REACT_DEBUG_TRACING_MODE_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_SUSPENSE_TYPE,
REACT_SUSPENSE_LIST_TYPE,
@@ -28,7 +27,6 @@ import {
import {
enableScopeAPI,
enableTransitionTracing,
- enableDebugTracing,
enableLegacyHidden,
enableRenderableContext,
} from './ReactFeatureFlags';
@@ -46,7 +44,6 @@ export default function isValidElementType(type: mixed): boolean {
if (
type === REACT_FRAGMENT_TYPE ||
type === REACT_PROFILER_TYPE ||
- (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) ||
type === REACT_STRICT_MODE_TYPE ||
type === REACT_SUSPENSE_TYPE ||
type === REACT_SUSPENSE_LIST_TYPE ||