[flags] Delete enableDebugTracing (#31780)
This is unused, even in the one builds that uses it, and we don't plan on landing it in this form.
Ricky committed
Dec 15, 2024 at 12:16 UTC
2d320563f35ad75419983f166431055b4e7ed9f6
28 files changed
+4
-903
packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js
-50
@@ -37,56 +37,6 @@ describe('ReactDOMServerIntegration', () => {
37
resetModules();
38
});
39
40
- // Test pragmas don't support itRenders abstraction
41
- if (
42
- __EXPERIMENTAL__ &&
43
- require('shared/ReactFeatureFlags').enableDebugTracing
44
- ) {
45
- describe('React.unstable_DebugTracingMode', () => {
46
- beforeEach(() => {
47
- spyOnDevAndProd(console, 'log');
48
- });
49
-
50
- itRenders('with one child', async render => {
51
- const e = await render(
52
- <React.unstable_DebugTracingMode>
53
- <div>text1</div>
54
- </React.unstable_DebugTracingMode>,
55
- );
56
- const parent = e.parentNode;
57
- expect(parent.childNodes[0].tagName).toBe('DIV');
58
- });
59
-
60
- itRenders('mode with several children', async render => {
61
- const Header = props => {
62
- return <p>header</p>;
63
- };
64
- const Footer = props => {
65
- return (
66
- <React.unstable_DebugTracingMode>
67
- <h2>footer</h2>
68
- <h3>about</h3>
69
- </React.unstable_DebugTracingMode>
70
- );
71
- };
72
- const e = await render(
73
- <React.unstable_DebugTracingMode>
74
- <div>text1</div>
75
- <span>text2</span>
76
- <Header />
77
- <Footer />
78
- </React.unstable_DebugTracingMode>,
79
- );
80
- const parent = e.parentNode;
81
- expect(parent.childNodes[0].tagName).toBe('DIV');
82
- expect(parent.childNodes[1].tagName).toBe('SPAN');
83
- expect(parent.childNodes[2].tagName).toBe('P');
84
- expect(parent.childNodes[3].tagName).toBe('H2');
85
- expect(parent.childNodes[4].tagName).toBe('H3');
86
- });
87
- });
88
- }
89
-
40
describe('React.StrictMode', () => {
41
itRenders('a strict mode with one child', async render => {
42
const e = await render(
packages/react-reconciler/src/DebugTracing.js
deleted
-231
@@ -1,231 +0,0 @@
1
-/**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @flow
8
- */
9
-
10
-import type {Lane, Lanes} from './ReactFiberLane';
11
-import type {Wakeable} from 'shared/ReactTypes';
12
-
13
-import {enableDebugTracing} from 'shared/ReactFeatureFlags';
14
-
15
-const nativeConsole: Object = console;
16
-let nativeConsoleLog: null | Function = null;
17
-
18
-const pendingGroupArgs: Array<any> = [];
19
-let printedGroupIndex: number = -1;
20
-
21
-function formatLanes(laneOrLanes: Lane | Lanes): string {
22
- return '0b' + (laneOrLanes: any).toString(2).padStart(31, '0');
23
-}
24
-
25
-function group(...groupArgs: Array<string>): void {
26
- pendingGroupArgs.push(groupArgs);
27
-
28
- if (nativeConsoleLog === null) {
29
- nativeConsoleLog = nativeConsole.log;
30
- nativeConsole.log = log;
31
- }
32
-}
33
-
34
-function groupEnd(): void {
35
- pendingGroupArgs.pop();
36
- while (printedGroupIndex >= pendingGroupArgs.length) {
37
- nativeConsole.groupEnd();
38
- printedGroupIndex--;
39
- }
40
-
41
- if (pendingGroupArgs.length === 0) {
42
- nativeConsole.log = nativeConsoleLog;
43
- nativeConsoleLog = null;
44
- }
45
-}
46
-
47
-function log(...logArgs: Array<mixed>): void {
48
- if (printedGroupIndex < pendingGroupArgs.length - 1) {
49
- for (let i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) {
50
- const groupArgs = pendingGroupArgs[i];
51
- nativeConsole.group(...groupArgs);
52
- }
53
- printedGroupIndex = pendingGroupArgs.length - 1;
54
- }
55
- if (typeof nativeConsoleLog === 'function') {
56
- nativeConsoleLog(...logArgs);
57
- } else {
58
- nativeConsole.log(...logArgs);
59
- }
60
-}
61
-
62
-const REACT_LOGO_STYLE =
63
- 'background-color: #20232a; color: #61dafb; padding: 0 2px;';
64
-
65
-export function logCommitStarted(lanes: Lanes): void {
66
- if (__DEV__) {
67
- if (enableDebugTracing) {
68
- group(
69
- `%c⚛%c commit%c (${formatLanes(lanes)})`,
70
- REACT_LOGO_STYLE,
71
- '',
72
- 'font-weight: normal;',
73
- );
74
- }
75
- }
76
-}
77
-
78
-export function logCommitStopped(): void {
79
- if (__DEV__) {
80
- if (enableDebugTracing) {
81
- groupEnd();
82
- }
83
- }
84
-}
85
-
86
-const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
87
-// $FlowFixMe[incompatible-type]: Flow cannot handle polymorphic WeakMaps
88
-const wakeableIDs: WeakMap<Wakeable, number> = new PossiblyWeakMap();
89
-let wakeableID: number = 0;
90
-function getWakeableID(wakeable: Wakeable): number {
91
- if (!wakeableIDs.has(wakeable)) {
92
- wakeableIDs.set(wakeable, wakeableID++);
93
- }
94
- return ((wakeableIDs.get(wakeable): any): number);
95
-}
96
-
97
-export function logComponentSuspended(
98
- componentName: string,
99
- wakeable: Wakeable,
100
-): void {
101
- if (__DEV__) {
102
- if (enableDebugTracing) {
103
- const id = getWakeableID(wakeable);
104
- const display = (wakeable: any).displayName || wakeable;
105
- log(
106
- `%c⚛%c ${componentName} suspended`,
107
- REACT_LOGO_STYLE,
108
- 'color: #80366d; font-weight: bold;',
109
- id,
110
- display,
111
- );
112
- wakeable.then(
113
- () => {
114
- log(
115
- `%c⚛%c ${componentName} resolved`,
116
- REACT_LOGO_STYLE,
117
- 'color: #80366d; font-weight: bold;',
118
- id,
119
- display,
120
- );
121
- },
122
- () => {
123
- log(
124
- `%c⚛%c ${componentName} rejected`,
125
- REACT_LOGO_STYLE,
126
- 'color: #80366d; font-weight: bold;',
127
- id,
128
- display,
129
- );
130
- },
131
- );
132
- }
133
- }
134
-}
135
-
136
-export function logLayoutEffectsStarted(lanes: Lanes): void {
137
- if (__DEV__) {
138
- if (enableDebugTracing) {
139
- group(
140
- `%c⚛%c layout effects%c (${formatLanes(lanes)})`,
141
- REACT_LOGO_STYLE,
142
- '',
143
- 'font-weight: normal;',
144
- );
145
- }
146
- }
147
-}
148
-
149
-export function logLayoutEffectsStopped(): void {
150
- if (__DEV__) {
151
- if (enableDebugTracing) {
152
- groupEnd();
153
- }
154
- }
155
-}
156
-
157
-export function logPassiveEffectsStarted(lanes: Lanes): void {
158
- if (__DEV__) {
159
- if (enableDebugTracing) {
160
- group(
161
- `%c⚛%c passive effects%c (${formatLanes(lanes)})`,
162
- REACT_LOGO_STYLE,
163
- '',
164
- 'font-weight: normal;',
165
- );
166
- }
167
- }
168
-}
169
-
170
-export function logPassiveEffectsStopped(): void {
171
- if (__DEV__) {
172
- if (enableDebugTracing) {
173
- groupEnd();
174
- }
175
- }
176
-}
177
-
178
-export function logRenderStarted(lanes: Lanes): void {
179
- if (__DEV__) {
180
- if (enableDebugTracing) {
181
- group(
182
- `%c⚛%c render%c (${formatLanes(lanes)})`,
183
- REACT_LOGO_STYLE,
184
- '',
185
- 'font-weight: normal;',
186
- );
187
- }
188
- }
189
-}
190
-
191
-export function logRenderStopped(): void {
192
- if (__DEV__) {
193
- if (enableDebugTracing) {
194
- groupEnd();
195
- }
196
- }
197
-}
198
-
199
-export function logForceUpdateScheduled(
200
- componentName: string,
201
- lane: Lane,
202
-): void {
203
- if (__DEV__) {
204
- if (enableDebugTracing) {
205
- log(
206
- `%c⚛%c ${componentName} forced update %c(${formatLanes(lane)})`,
207
- REACT_LOGO_STYLE,
208
- 'color: #db2e1f; font-weight: bold;',
209
- '',
210
- );
211
- }
212
- }
213
-}
214
-
215
-export function logStateUpdateScheduled(
216
- componentName: string,
217
- lane: Lane,
218
- payloadOrAction: any,
219
-): void {
220
- if (__DEV__) {
221
- if (enableDebugTracing) {
222
- log(
223
- `%c⚛%c ${componentName} updated state %c(${formatLanes(lane)})`,
224
- REACT_LOGO_STYLE,
225
- 'color: #01a252; font-weight: bold;',
226
- '',
227
- payloadOrAction,
228
- );
229
- }
230
- }
231
-}
packages/react-reconciler/src/ReactFiber.js
-10
@@ -32,7 +32,6 @@ import {
32
enableScopeAPI,
33
enableLegacyHidden,
34
enableTransitionTracing,
35
- enableDebugTracing,
35
enableDO_NOT_USE_disableStrictPassiveEffect,
36
enableRenderableContext,
37
disableLegacyMode,
@@ -80,7 +79,6 @@ import {NoLanes} from './ReactFiberLane';
79
import {
80
NoMode,
81
ConcurrentMode,
83
- DebugTracingMode,
82
ProfileMode,
83
StrictLegacyMode,
84
StrictEffectsMode,
@@ -89,7 +87,6 @@ import {
87
import {
88
REACT_FORWARD_REF_TYPE,
89
REACT_FRAGMENT_TYPE,
92
- REACT_DEBUG_TRACING_MODE_TYPE,
90
REACT_STRICT_MODE_TYPE,
91
REACT_PROFILER_TYPE,
92
REACT_PROVIDER_TYPE,
@@ -630,13 +627,6 @@ export function createFiberFromTypeAndProps(
627
return createFiberFromTracingMarker(pendingProps, mode, lanes, key);
628
}
629
// Fall through
633
- case REACT_DEBUG_TRACING_MODE_TYPE:
634
- if (enableDebugTracing) {
635
- fiberTag = Mode;
636
- mode |= DebugTracingMode;
637
- break;
638
- }
639
- // Fall through
630
default: {
631
if (typeof type === 'object' && type !== null) {
632
switch (type.$$typeof) {
packages/react-reconciler/src/ReactFiberClassComponent.js
+1
-35
@@ -20,7 +20,6 @@ import {
20
import {
21
debugRenderPhaseSideEffectsForStrictMode,
22
disableLegacyContext,
23
- enableDebugTracing,
23
enableSchedulingProfiler,
24
enableLazyContextPropagation,
25
disableDefaultPropsExceptForClasses,
@@ -35,12 +34,7 @@ import assign from 'shared/assign';
34
import isArray from 'shared/isArray';
35
import {REACT_CONTEXT_TYPE, REACT_CONSUMER_TYPE} from 'shared/ReactSymbols';
36
38
-import {
39
- DebugTracingMode,
40
- NoMode,
41
- StrictLegacyMode,
42
- StrictEffectsMode,
43
-} from './ReactTypeOfMode';
37
+import {NoMode, StrictLegacyMode, StrictEffectsMode} from './ReactTypeOfMode';
38
39
import {
40
enqueueUpdate,
@@ -65,7 +59,6 @@ import {
59
} from './ReactFiberContext';
60
import {readContext, checkIfContextChanged} from './ReactFiberNewContext';
61
import {requestUpdateLane, scheduleUpdateOnFiber} from './ReactFiberWorkLoop';
68
-import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing';
62
import {
63
markForceUpdateScheduled,
64
markStateUpdateScheduled,
@@ -199,15 +192,6 @@ const classComponentUpdater = {
192
entangleTransitions(root, fiber, lane);
193
}
194
202
- if (__DEV__) {
203
- if (enableDebugTracing) {
204
- if (fiber.mode & DebugTracingMode) {
205
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
206
- logStateUpdateScheduled(name, lane, payload);
207
- }
208
- }
209
- }
210
-
195
if (enableSchedulingProfiler) {
196
markStateUpdateScheduled(fiber, lane);
197
}
@@ -234,15 +218,6 @@ const classComponentUpdater = {
218
entangleTransitions(root, fiber, lane);
219
}
220
237
- if (__DEV__) {
238
- if (enableDebugTracing) {
239
- if (fiber.mode & DebugTracingMode) {
240
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
241
- logStateUpdateScheduled(name, lane, payload);
242
- }
243
- }
244
- }
245
-
221
if (enableSchedulingProfiler) {
222
markStateUpdateScheduled(fiber, lane);
223
}
@@ -269,15 +244,6 @@ const classComponentUpdater = {
244
entangleTransitions(root, fiber, lane);
245
}
246
272
- if (__DEV__) {
273
- if (enableDebugTracing) {
274
- if (fiber.mode & DebugTracingMode) {
275
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
276
- logForceUpdateScheduled(name, lane);
277
- }
278
- }
279
- }
280
-
247
if (enableSchedulingProfiler) {
248
markForceUpdateScheduled(fiber, lane);
249
}
packages/react-reconciler/src/ReactFiberHooks.js
-12
@@ -35,7 +35,6 @@ import {
35
} from './ReactFiberConfig';
36
import ReactSharedInternals from 'shared/ReactSharedInternals';
37
import {
38
- enableDebugTracing,
38
enableSchedulingProfiler,
39
enableCache,
40
enableLazyContextPropagation,
@@ -56,7 +55,6 @@ import {
55
import {
56
NoMode,
57
ConcurrentMode,
59
- DebugTracingMode,
58
StrictEffectsMode,
59
StrictLegacyMode,
60
NoStrictPassiveEffectsMode,
@@ -125,7 +123,6 @@ import {
123
getIsHydrating,
124
tryToClaimNextHydratableFormMarkerInstance,
125
} from './ReactFiberHydrationContext';
128
-import {logStateUpdateScheduled} from './DebugTracing';
126
import {
127
markStateUpdateScheduled,
128
setIsStrictModeForDevtools,
@@ -3928,15 +3925,6 @@ function entangleTransitionUpdate<S, A>(
3925
}
3926
3927
function markUpdateInDevTools<A>(fiber: Fiber, lane: Lane, action: A): void {
3931
- if (__DEV__) {
3932
- if (enableDebugTracing) {
3933
- if (fiber.mode & DebugTracingMode) {
3934
- const name = getComponentNameFromFiber(fiber) || 'Unknown';
3935
- logStateUpdateScheduled(name, lane, action);
3936
- }
3937
- }
3938
- }
3939
-
3928
if (enableSchedulingProfiler) {
3929
markStateUpdateScheduled(fiber, lane);
3930
}
packages/react-reconciler/src/ReactFiberThrow.js
+1
-12
@@ -37,9 +37,8 @@ import {
37
ForceClientRender,
38
ScheduleRetry,
39
} from './ReactFiberFlags';
40
-import {NoMode, ConcurrentMode, DebugTracingMode} from './ReactTypeOfMode';
40
+import {NoMode, ConcurrentMode} from './ReactTypeOfMode';
41
import {
42
- enableDebugTracing,
42
enableLazyContextPropagation,
43
enableUpdaterTracking,
44
enablePostpone,
@@ -70,7 +69,6 @@ import {
69
} from './ReactFiberWorkLoop';
70
import {propagateParentContextChangesToDeferredTree} from './ReactFiberNewContext';
71
import {logUncaughtError, logCaughtError} from './ReactFiberErrorLogger';
73
-import {logComponentSuspended} from './DebugTracing';
72
import {isDevToolsPresent} from './ReactFiberDevToolsHook';
73
import {
74
SyncLane,
@@ -399,15 +397,6 @@ function throwException(
397
}
398
}
399
402
- if (__DEV__) {
403
- if (enableDebugTracing) {
404
- if (sourceFiber.mode & DebugTracingMode) {
405
- const name = getComponentNameFromFiber(sourceFiber) || 'Unknown';
406
- logComponentSuspended(name, wakeable);
407
- }
408
- }
409
- }
410
-
400
// Mark the nearest Suspense boundary to switch to rendering a fallback.
401
const suspenseBoundary = getSuspenseHandler();
402
if (suspenseBoundary !== null) {
packages/react-reconciler/src/ReactFiberWorkLoop.js
-75
@@ -29,7 +29,6 @@ import {
29
enableProfilerTimer,
30
enableProfilerCommitHooks,
31
enableProfilerNestedUpdatePhase,
32
- enableDebugTracing,
32
enableSchedulingProfiler,
33
enableUpdaterTracking,
34
enableCache,
@@ -55,16 +54,6 @@ import {
54
NormalPriority as NormalSchedulerPriority,
55
IdlePriority as IdleSchedulerPriority,
56
} from './Scheduler';
58
-import {
59
- logCommitStarted,
60
- logCommitStopped,
61
- logLayoutEffectsStarted,
62
- logLayoutEffectsStopped,
63
- logPassiveEffectsStarted,
64
- logPassiveEffectsStopped,
65
- logRenderStarted,
66
- logRenderStopped,
67
-} from './DebugTracing';
57
import {
58
logBlockingStart,
59
logTransitionStart,
@@ -2260,12 +2249,6 @@ function renderRootSync(
2249
prepareFreshStack(root, lanes);
2250
}
2251
2263
- if (__DEV__) {
2264
- if (enableDebugTracing) {
2265
- logRenderStarted(lanes);
2266
- }
2267
- }
2268
-
2252
if (enableSchedulingProfiler) {
2253
markRenderStarted(lanes);
2254
}
@@ -2360,12 +2343,6 @@ function renderRootSync(
2343
popDispatcher(prevDispatcher);
2344
popAsyncDispatcher(prevAsyncDispatcher);
2345
2363
- if (__DEV__) {
2364
- if (enableDebugTracing) {
2365
- logRenderStopped();
2366
- }
2367
- }
2368
-
2346
if (enableSchedulingProfiler) {
2347
markRenderStopped();
2348
}
@@ -2433,12 +2410,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
2410
workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes);
2411
}
2412
2436
- if (__DEV__) {
2437
- if (enableDebugTracing) {
2438
- logRenderStarted(lanes);
2439
- }
2440
- }
2441
-
2413
if (enableSchedulingProfiler) {
2414
markRenderStarted(lanes);
2415
}
@@ -2651,12 +2622,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
2622
popAsyncDispatcher(prevAsyncDispatcher);
2623
executionContext = prevExecutionContext;
2624
2654
- if (__DEV__) {
2655
- if (enableDebugTracing) {
2656
- logRenderStopped();
2657
- }
2658
- }
2659
-
2625
// Check if the tree has completed.
2626
if (workInProgress !== null) {
2627
// Still work remaining.
@@ -3223,27 +3188,14 @@ function commitRootImpl(
3188
}
3189
}
3190
3226
- if (__DEV__) {
3227
- if (enableDebugTracing) {
3228
- logCommitStarted(lanes);
3229
- }
3230
- }
3231
-
3191
if (enableSchedulingProfiler) {
3192
markCommitStarted(lanes);
3193
}
3194
3195
if (finishedWork === null) {
3237
- if (__DEV__) {
3238
- if (enableDebugTracing) {
3239
- logCommitStopped();
3240
- }
3241
- }
3242
-
3196
if (enableSchedulingProfiler) {
3197
markCommitStopped();
3198
}
3246
-
3199
return null;
3200
} else {
3201
if (__DEV__) {
@@ -3409,21 +3361,10 @@ function commitRootImpl(
3361
// The next phase is the layout phase, where we call effects that read
3362
// the host tree after it's been mutated. The idiomatic use case for this is
3363
// layout, but class component lifecycles also fire here for legacy reasons.
3412
- if (__DEV__) {
3413
- if (enableDebugTracing) {
3414
- logLayoutEffectsStarted(lanes);
3415
- }
3416
- }
3364
if (enableSchedulingProfiler) {
3365
markLayoutEffectsStarted(lanes);
3366
}
3367
commitLayoutEffects(finishedWork, root, lanes);
3421
- if (__DEV__) {
3422
- if (enableDebugTracing) {
3423
- logLayoutEffectsStopped();
3424
- }
3425
- }
3426
-
3368
if (enableSchedulingProfiler) {
3369
markLayoutEffectsStopped();
3370
}
@@ -3589,12 +3530,6 @@ function commitRootImpl(
3530
// If layout work was scheduled, flush it now.
3531
flushSyncWorkOnAllRoots();
3532
3592
- if (__DEV__) {
3593
- if (enableDebugTracing) {
3594
- logCommitStopped();
3595
- }
3596
- }
3597
-
3533
if (enableSchedulingProfiler) {
3534
markCommitStopped();
3535
}
@@ -3735,10 +3670,6 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
3670
if (__DEV__) {
3671
isFlushingPassiveEffects = true;
3672
didScheduleUpdateDuringPassiveEffects = false;
3738
-
3739
- if (enableDebugTracing) {
3740
- logPassiveEffectsStarted(lanes);
3741
- }
3673
}
3674
3675
let passiveEffectStartTime = 0;
@@ -3767,12 +3698,6 @@ function flushPassiveEffectsImpl(wasDelayedCommit: void | boolean) {
3698
pendingPassiveEffectsRenderEndTime,
3699
);
3700
3770
- if (__DEV__) {
3771
- if (enableDebugTracing) {
3772
- logPassiveEffectsStopped();
3773
- }
3774
- }
3775
-
3701
if (enableSchedulingProfiler) {
3702
markPassiveEffectsStopped();
3703
}
packages/react-reconciler/src/ReactTypeOfMode.js
+2
-2
@@ -12,8 +12,8 @@ export type TypeOfMode = number;
12
export const NoMode = /* */ 0b0000000;
13
// TODO: Remove ConcurrentMode by reading from the root tag instead
14
export const ConcurrentMode = /* */ 0b0000001;
15
-export const ProfileMode = /* */ 0b0000010;
16
-export const DebugTracingMode = /* */ 0b0000100;
15
+export const ProfileMode = /* */ 0b0000010;
16
+//export const DebugTracingMode = /* */ 0b0000100; // Removed
17
export const StrictLegacyMode = /* */ 0b0001000;
18
export const StrictEffectsMode = /* */ 0b0010000;
19
export const NoStrictPassiveEffectsMode = /* */ 0b1000000;
packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js
deleted
-440
@@ -1,440 +0,0 @@
1
-/**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails react-core
8
- */
9
-
10
-'use strict';
11
-
12
-describe('DebugTracing', () => {
13
- let React;
14
- let ReactNoop;
15
- let waitForPaint;
16
- let waitForAll;
17
- let act;
18
-
19
- let logs;
20
-
21
- const SYNC_LANE_STRING = '0b0000000000000000000000000000010';
22
- const DEFAULT_LANE_STRING = '0b0000000000000000000000000100000';
23
- const RETRY_LANE_STRING = '0b0000000010000000000000000000000';
24
-
25
- global.IS_REACT_ACT_ENVIRONMENT = true;
26
-
27
- beforeEach(() => {
28
- jest.resetModules();
29
-
30
- React = require('react');
31
- ReactNoop = require('react-noop-renderer');
32
- const InternalTestUtils = require('internal-test-utils');
33
- waitForPaint = InternalTestUtils.waitForPaint;
34
- waitForAll = InternalTestUtils.waitForAll;
35
- act = InternalTestUtils.act;
36
-
37
- logs = [];
38
-
39
- const groups = [];
40
-
41
- spyOnDevAndProd(console, 'log').mockImplementation(message => {
42
- logs.push(`log: ${message.replace(/%c/g, '')}`);
43
- });
44
- spyOnDevAndProd(console, 'group').mockImplementation(message => {
45
- logs.push(`group: ${message.replace(/%c/g, '')}`);
46
- groups.push(message);
47
- });
48
- spyOnDevAndProd(console, 'groupEnd').mockImplementation(() => {
49
- const message = groups.pop();
50
- logs.push(`groupEnd: ${message.replace(/%c/g, '')}`);
51
- });
52
- });
53
-
54
- // @gate enableDebugTracing
55
- it('should not log anything for sync render without suspends or state updates', async () => {
56
- await act(() => {
57
- ReactNoop.render(
58
- <React.unstable_DebugTracingMode>
59
- <div />
60
- </React.unstable_DebugTracingMode>,
61
- );
62
- });
63
-
64
- expect(logs).toEqual([]);
65
- });
66
-
67
- // @gate experimental && enableDebugTracing
68
- it('should not log anything for concurrent render without suspends or state updates', async () => {
69
- await act(() =>
70
- ReactNoop.render(
71
- <React.unstable_DebugTracingMode>
72
- <div />
73
- </React.unstable_DebugTracingMode>,
74
- ),
75
- );
76
- expect(logs).toEqual([]);
77
- });
78
-
79
- // @gate experimental && build === 'development' && enableDebugTracing && !disableLegacyMode
80
- it('should log sync render with suspense, legacy', async () => {
81
- let resolveFakeSuspensePromise;
82
- let didResolve = false;
83
- const fakeSuspensePromise = new Promise(resolve => {
84
- resolveFakeSuspensePromise = () => {
85
- didResolve = true;
86
- resolve();
87
- };
88
- });
89
-
90
- function Example() {
91
- if (!didResolve) {
92
- throw fakeSuspensePromise;
93
- }
94
- return null;
95
- }
96
-
97
- ReactNoop.renderLegacySyncRoot(
98
- <React.unstable_DebugTracingMode>
99
- <React.Suspense fallback={null}>
100
- <Example />
101
- </React.Suspense>
102
- </React.unstable_DebugTracingMode>,
103
- );
104
-
105
- expect(logs).toEqual([
106
- `group: ⚛ render (${SYNC_LANE_STRING})`,
107
- 'log: ⚛ Example suspended',
108
- `groupEnd: ⚛ render (${SYNC_LANE_STRING})`,
109
- ]);
110
-
111
- logs.splice(0);
112
-
113
- resolveFakeSuspensePromise();
114
- await waitForAll([]);
115
-
116
- expect(logs).toEqual(['log: ⚛ Example resolved']);
117
- });
118
-
119
- // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense && !disableLegacyMode
120
- it('should log sync render with CPU suspense, legacy', async () => {
121
- function Example() {
122
- console.log('<Example/>');
123
- return null;
124
- }
125
-
126
- function Wrapper({children}) {
127
- console.log('<Wrapper/>');
128
- return children;
129
- }
130
-
131
- ReactNoop.renderLegacySyncRoot(
132
- <React.unstable_DebugTracingMode>
133
- <Wrapper>
134
- <React.Suspense fallback={null} unstable_expectedLoadTime={1}>
135
- <Example />
136
- </React.Suspense>
137
- </Wrapper>
138
- </React.unstable_DebugTracingMode>,
139
- );
140
-
141
- expect(logs).toEqual([
142
- `group: ⚛ render (${SYNC_LANE_STRING})`,
143
- 'log: <Wrapper/>',
144
- `groupEnd: ⚛ render (${SYNC_LANE_STRING})`,
145
- ]);
146
-
147
- logs.splice(0);
148
-
149
- await waitForPaint([]);
150
-
151
- expect(logs).toEqual([
152
- `group: ⚛ render (${RETRY_LANE_STRING})`,
153
- 'log: <Example/>',
154
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
155
- ]);
156
- });
157
-
158
- // @gate experimental && build === 'development' && enableDebugTracing
159
- it('should log concurrent render with suspense', async () => {
160
- let isResolved = false;
161
- let resolveFakeSuspensePromise;
162
- const fakeSuspensePromise = new Promise(resolve => {
163
- resolveFakeSuspensePromise = () => {
164
- resolve();
165
- isResolved = true;
166
- };
167
- });
168
-
169
- function Example() {
170
- if (!isResolved) {
171
- throw fakeSuspensePromise;
172
- }
173
- return null;
174
- }
175
-
176
- await act(() =>
177
- ReactNoop.render(
178
- <React.unstable_DebugTracingMode>
179
- <React.Suspense fallback={null}>
180
- <Example />
181
- </React.Suspense>
182
- </React.unstable_DebugTracingMode>,
183
- ),
184
- );
185
-
186
- expect(logs).toEqual([
187
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
188
- 'log: ⚛ Example suspended',
189
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
190
-
191
- ...(gate('enableSiblingPrerendering')
192
- ? [
193
- `group: ⚛ render (${RETRY_LANE_STRING})`,
194
- 'log: ⚛ Example suspended',
195
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
196
- ]
197
- : []),
198
- ]);
199
-
200
- logs.splice(0);
201
-
202
- await act(async () => await resolveFakeSuspensePromise());
203
- expect(logs).toEqual([
204
- 'log: ⚛ Example resolved',
205
-
206
- ...(gate('enableSiblingPrerendering')
207
- ? ['log: ⚛ Example resolved']
208
- : []),
209
- ]);
210
- });
211
-
212
- // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense
213
- it('should log concurrent render with CPU suspense', async () => {
214
- function Example() {
215
- console.log('<Example/>');
216
- return null;
217
- }
218
-
219
- function Wrapper({children}) {
220
- console.log('<Wrapper/>');
221
- return children;
222
- }
223
-
224
- await act(() =>
225
- ReactNoop.render(
226
- <React.unstable_DebugTracingMode>
227
- <Wrapper>
228
- <React.Suspense fallback={null} unstable_expectedLoadTime={1}>
229
- <Example />
230
- </React.Suspense>
231
- </Wrapper>
232
- </React.unstable_DebugTracingMode>,
233
- ),
234
- );
235
-
236
- expect(logs).toEqual([
237
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
238
- 'log: <Wrapper/>',
239
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
240
- `group: ⚛ render (${RETRY_LANE_STRING})`,
241
- 'log: <Example/>',
242
- `groupEnd: ⚛ render (${RETRY_LANE_STRING})`,
243
- ]);
244
- });
245
-
246
- // @gate experimental && build === 'development' && enableDebugTracing
247
- it('should log cascading class component updates', async () => {
248
- class Example extends React.Component {
249
- state = {didMount: false};
250
- componentDidMount() {
251
- this.setState({didMount: true});
252
- }
253
- render() {
254
- return null;
255
- }
256
- }
257
-
258
- await act(() =>
259
- ReactNoop.render(
260
- <React.unstable_DebugTracingMode>
261
- <Example />
262
- </React.unstable_DebugTracingMode>,
263
- ),
264
- );
265
-
266
- expect(logs).toEqual([
267
- `group: ⚛ commit (${DEFAULT_LANE_STRING})`,
268
- `group: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
269
- `log: ⚛ Example updated state (${SYNC_LANE_STRING})`,
270
- `groupEnd: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
271
- `groupEnd: ⚛ commit (${DEFAULT_LANE_STRING})`,
272
- ]);
273
- });
274
-
275
- // @gate experimental && build === 'development' && enableDebugTracing
276
- it('should log render phase state updates for class component', async () => {
277
- class Example extends React.Component {
278
- state = {didRender: false};
279
- render() {
280
- if (this.state.didRender === false) {
281
- this.setState({didRender: true});
282
- }
283
- return null;
284
- }
285
- }
286
-
287
- await expect(async () => {
288
- await act(() => {
289
- ReactNoop.render(
290
- <React.unstable_DebugTracingMode>
291
- <Example />
292
- </React.unstable_DebugTracingMode>,
293
- );
294
- });
295
- }).toErrorDev(
296
- 'Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.',
297
- );
298
-
299
- expect(logs).toEqual([
300
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
301
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
302
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
303
- ]);
304
- });
305
-
306
- // @gate experimental && build === 'development' && enableDebugTracing
307
- it('should log cascading layout updates', async () => {
308
- function Example() {
309
- const [didMount, setDidMount] = React.useState(false);
310
- React.useLayoutEffect(() => {
311
- setDidMount(true);
312
- }, []);
313
- return didMount;
314
- }
315
-
316
- await act(() =>
317
- ReactNoop.render(
318
- <React.unstable_DebugTracingMode>
319
- <Example />
320
- </React.unstable_DebugTracingMode>,
321
- ),
322
- );
323
-
324
- expect(logs).toEqual([
325
- `group: ⚛ commit (${DEFAULT_LANE_STRING})`,
326
- `group: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
327
- `log: ⚛ Example updated state (${SYNC_LANE_STRING})`,
328
- `groupEnd: ⚛ layout effects (${DEFAULT_LANE_STRING})`,
329
- `groupEnd: ⚛ commit (${DEFAULT_LANE_STRING})`,
330
- ]);
331
- });
332
-
333
- // @gate experimental && build === 'development' && enableDebugTracing
334
- it('should log cascading passive updates', async () => {
335
- function Example() {
336
- const [didMount, setDidMount] = React.useState(false);
337
- React.useEffect(() => {
338
- setDidMount(true);
339
- }, []);
340
- return didMount;
341
- }
342
-
343
- await act(() => {
344
- ReactNoop.render(
345
- <React.unstable_DebugTracingMode>
346
- <Example />
347
- </React.unstable_DebugTracingMode>,
348
- );
349
- });
350
- expect(logs).toEqual([
351
- `group: ⚛ passive effects (${DEFAULT_LANE_STRING})`,
352
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
353
- `groupEnd: ⚛ passive effects (${DEFAULT_LANE_STRING})`,
354
- ]);
355
- });
356
-
357
- // @gate experimental && build === 'development' && enableDebugTracing
358
- it('should log render phase updates', async () => {
359
- function Example() {
360
- const [didRender, setDidRender] = React.useState(false);
361
- if (!didRender) {
362
- setDidRender(true);
363
- }
364
- return didRender;
365
- }
366
-
367
- await act(() => {
368
- ReactNoop.render(
369
- <React.unstable_DebugTracingMode>
370
- <Example />
371
- </React.unstable_DebugTracingMode>,
372
- );
373
- });
374
-
375
- expect(logs).toEqual([
376
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
377
- `log: ⚛ Example updated state (${DEFAULT_LANE_STRING})`,
378
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
379
- ]);
380
- });
381
-
382
- // @gate experimental && build === 'development' && enableDebugTracing
383
- it('should log when user code logs', async () => {
384
- function Example() {
385
- console.log('Hello from user code');
386
- return null;
387
- }
388
-
389
- await act(() =>
390
- ReactNoop.render(
391
- <React.unstable_DebugTracingMode>
392
- <Example />
393
- </React.unstable_DebugTracingMode>,
394
- ),
395
- );
396
-
397
- expect(logs).toEqual([
398
- `group: ⚛ render (${DEFAULT_LANE_STRING})`,
399
- 'log: Hello from user code',
400
- `groupEnd: ⚛ render (${DEFAULT_LANE_STRING})`,
401
- ]);
402
- });
403
-
404
- // @gate experimental && enableDebugTracing
405
- it('should not log anything outside of a unstable_DebugTracingMode subtree', async () => {
406
- function ExampleThatCascades() {
407
- const [didMount, setDidMount] = React.useState(false);
408
- React.useLayoutEffect(() => {
409
- setDidMount(true);
410
- }, []);
411
- return didMount;
412
- }
413
-
414
- const fakeSuspensePromise = {then() {}};
415
-
416
- function ExampleThatSuspends() {
417
- throw fakeSuspensePromise;
418
- }
419
-
420
- function Example() {
421
- return null;
422
- }
423
-
424
- await act(() =>
425
- ReactNoop.render(
426
- <React.Fragment>
427
- <ExampleThatCascades />
428
- <React.Suspense fallback={null}>
429
- <ExampleThatSuspends />
430
- </React.Suspense>
431
- <React.unstable_DebugTracingMode>
432
- <Example />
433
- </React.unstable_DebugTracingMode>
434
- </React.Fragment>,
435
- ),
436
- );
437
-
438
- expect(logs).toEqual([]);
439
- });
440
-});
packages/react-server/src/ReactFizzServer.js
-2
@@ -134,7 +134,6 @@ import {
134
REACT_LAZY_TYPE,
135
REACT_SUSPENSE_TYPE,
136
REACT_LEGACY_HIDDEN_TYPE,
137
- REACT_DEBUG_TRACING_MODE_TYPE,
137
REACT_STRICT_MODE_TYPE,
138
REACT_PROFILER_TYPE,
139
REACT_SUSPENSE_LIST_TYPE,
@@ -2136,7 +2135,6 @@ function renderElement(
2135
// www build. As a migration step, we could add a special prop to Offscreen
2136
// that simulates the old behavior (no hiding, no change to effects).
2137
case REACT_LEGACY_HIDDEN_TYPE:
2139
- case REACT_DEBUG_TRACING_MODE_TYPE:
2138
case REACT_STRICT_MODE_TYPE:
2139
case REACT_PROFILER_TYPE:
2140
case REACT_FRAGMENT_TYPE: {
packages/react/index.development.js
-1
@@ -45,7 +45,6 @@ export {
45
memo,
46
cache,
47
startTransition,
48
- unstable_DebugTracingMode,
48
unstable_LegacyHidden,
49
unstable_Activity,
50
unstable_Scope,
packages/react/index.experimental.development.js
-1
@@ -28,7 +28,6 @@ export {
28
memo,
29
cache,
30
startTransition,
31
- unstable_DebugTracingMode,
31
unstable_Activity,
32
unstable_postpone,
33
unstable_getCacheForType,
packages/react/index.experimental.js
-1
@@ -28,7 +28,6 @@ export {
28
memo,
29
cache,
30
startTransition,
31
- unstable_DebugTracingMode,
31
unstable_Activity,
32
unstable_postpone,
33
unstable_getCacheForType,
packages/react/index.fb.js
-1
@@ -33,7 +33,6 @@ export {
33
StrictMode,
34
Suspense,
35
unstable_Activity,
36
- unstable_DebugTracingMode,
36
unstable_getCacheForType,
37
unstable_LegacyHidden,
38
unstable_Scope,
packages/react/index.js
-1
@@ -46,7 +46,6 @@ export {
46
memo,
47
cache,
48
startTransition,
49
- unstable_DebugTracingMode,
49
unstable_LegacyHidden,
50
unstable_Activity,
51
unstable_Scope,
packages/react/src/ReactClient.js
-2
@@ -10,7 +10,6 @@
10
import ReactVersion from 'shared/ReactVersion';
11
import {
12
REACT_FRAGMENT_TYPE,
13
- REACT_DEBUG_TRACING_MODE_TYPE,
13
REACT_PROFILER_TYPE,
14
REACT_STRICT_MODE_TYPE,
15
REACT_SUSPENSE_TYPE,
@@ -105,7 +104,6 @@ export {
104
REACT_FRAGMENT_TYPE as Fragment,
105
REACT_PROFILER_TYPE as Profiler,
106
REACT_STRICT_MODE_TYPE as StrictMode,
108
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
107
REACT_SUSPENSE_TYPE as Suspense,
108
createElement,
109
cloneElement,
packages/react/src/ReactServer.experimental.development.js
-2
@@ -15,7 +15,6 @@ import {
15
REACT_PROFILER_TYPE,
16
REACT_STRICT_MODE_TYPE,
17
REACT_SUSPENSE_TYPE,
18
- REACT_DEBUG_TRACING_MODE_TYPE,
18
} from 'shared/ReactSymbols';
19
import {
20
cloneElement,
@@ -71,7 +70,6 @@ export {
70
memo,
71
cache,
72
startTransition,
74
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
73
REACT_SUSPENSE_TYPE as unstable_SuspenseList,
74
getCacheForType as unstable_getCacheForType,
75
postpone as unstable_postpone,
packages/react/src/ReactServer.experimental.js
-2
@@ -15,7 +15,6 @@ import {
15
REACT_PROFILER_TYPE,
16
REACT_STRICT_MODE_TYPE,
17
REACT_SUSPENSE_TYPE,
18
- REACT_DEBUG_TRACING_MODE_TYPE,
18
} from 'shared/ReactSymbols';
19
import {
20
cloneElement,
@@ -70,7 +69,6 @@ export {
69
memo,
70
cache,
71
startTransition,
73
- REACT_DEBUG_TRACING_MODE_TYPE as unstable_DebugTracingMode,
72
REACT_SUSPENSE_TYPE as unstable_SuspenseList,
73
getCacheForType as unstable_getCacheForType,
74
postpone as unstable_postpone,
packages/shared/ReactFeatureFlags.js
-5
@@ -267,11 +267,6 @@ export const enableProfilerCommitHooks = __PROFILE__;
267
// Phase param passed to onRender callback differentiates between an "update" and a "cascading-update".
268
export const enableProfilerNestedUpdatePhase = __PROFILE__;
269
270
-// Adds verbose console logging for e.g. state updates, suspense, and work loop
271
-// stuff. Intended to enable React core members to more easily debug scheduling
272
-// issues in DEV builds.
273
-export const enableDebugTracing = false;
274
-
270
export const enableAsyncDebugInfo = __EXPERIMENTAL__;
271
272
// Track which Fiber(s) schedule render work.
packages/shared/ReactSymbols.js
-3
@@ -33,9 +33,6 @@ export const REACT_SUSPENSE_LIST_TYPE: symbol = Symbol.for(
33
export const REACT_MEMO_TYPE: symbol = Symbol.for('react.memo');
34
export const REACT_LAZY_TYPE: symbol = Symbol.for('react.lazy');
35
export const REACT_SCOPE_TYPE: symbol = Symbol.for('react.scope');
36
-export const REACT_DEBUG_TRACING_MODE_TYPE: symbol = Symbol.for(
37
- 'react.debug_trace_mode',
38
-);
36
export const REACT_OFFSCREEN_TYPE: symbol = Symbol.for('react.offscreen');
37
export const REACT_LEGACY_HIDDEN_TYPE: symbol = Symbol.for(
38
'react.legacy_hidden',
packages/shared/forks/ReactFeatureFlags.native-fb.js
-1
@@ -47,7 +47,6 @@ export const enableAsyncIterableChildren = false;
47
export const enableCache = true;
48
export const enableCPUSuspense = true;
49
export const enableCreateEventHandleAPI = false;
50
-export const enableDebugTracing = false;
50
export const enableDeferRootSchedulingToMicrotask = true;
51
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
52
export const enableMoveBefore = true;
packages/shared/forks/ReactFeatureFlags.native-oss.js
-1
@@ -34,7 +34,6 @@ export const enableAsyncIterableChildren = false;
34
export const enableCache = true;
35
export const enableCPUSuspense = false;
36
export const enableCreateEventHandleAPI = false;
37
-export const enableDebugTracing = false;
37
export const enableDeferRootSchedulingToMicrotask = true;
38
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
39
export const enableFabricCompleteRootInCommitPhase = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
-1
@@ -11,7 +11,6 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
11
import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
12
13
export const debugRenderPhaseSideEffectsForStrictMode = false;
14
-export const enableDebugTracing = false;
14
export const enableAsyncDebugInfo = false;
15
export const enableSchedulingProfiler = false;
16
export const enableProfilerTimer = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
-1
@@ -26,7 +26,6 @@ export const enableAsyncIterableChildren = false;
26
export const enableCache = true;
27
export const enableCPUSuspense = true;
28
export const enableCreateEventHandleAPI = false;
29
-export const enableDebugTracing = false;
29
export const enableDeferRootSchedulingToMicrotask = true;
30
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
31
export const enableMoveBefore = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-1
@@ -11,7 +11,6 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
11
import typeof * as ExportsType from './ReactFeatureFlags.test-renderer.www';
12
13
export const debugRenderPhaseSideEffectsForStrictMode = false;
14
-export const enableDebugTracing = false;
14
export const enableAsyncDebugInfo = false;
15
export const enableSchedulingProfiler = false;
16
export const enableProfilerTimer = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.www-dynamic.js
-6
@@ -32,12 +32,6 @@ export const retryLaneExpirationMs = 5000;
32
export const syncLaneExpirationMs = 250;
33
export const transitionLaneExpirationMs = 5000;
34
35
-// Enable this flag to help with concurrent mode debugging.
36
-// It logs information to the console about React scheduling, rendering, and commit phases.
37
-//
38
-// NOTE: This feature will only work in DEV mode; all callsites are wrapped with __DEV__.
39
-export const enableDebugTracing = __EXPERIMENTAL__;
40
-
35
export const enableSchedulingProfiler = __VARIANT__;
36
37
export const enableInfiniteRenderLoopDetection = __VARIANT__;
packages/shared/forks/ReactFeatureFlags.www.js
-1
@@ -19,7 +19,6 @@ export const {
19
disableDefaultPropsExceptForClasses,
20
disableLegacyContextForFunctionComponents,
21
disableSchedulerTimeoutInWorkLoop,
22
- enableDebugTracing,
22
enableDeferRootSchedulingToMicrotask,
23
enableDO_NOT_USE_disableStrictPassiveEffect,
24
enableHiddenSubtreeInsertionEffectCleanup,
packages/shared/isValidElementType.js
-3
@@ -14,7 +14,6 @@ import {
14
REACT_FORWARD_REF_TYPE,
15
REACT_FRAGMENT_TYPE,
16
REACT_PROFILER_TYPE,
17
- REACT_DEBUG_TRACING_MODE_TYPE,
17
REACT_STRICT_MODE_TYPE,
18
REACT_SUSPENSE_TYPE,
19
REACT_SUSPENSE_LIST_TYPE,
@@ -28,7 +27,6 @@ import {
27
import {
28
enableScopeAPI,
29
enableTransitionTracing,
31
- enableDebugTracing,
30
enableLegacyHidden,
31
enableRenderableContext,
32
} from './ReactFeatureFlags';
@@ -46,7 +44,6 @@ export default function isValidElementType(type: mixed): boolean {
44
if (
45
type === REACT_FRAGMENT_TYPE ||
46
type === REACT_PROFILER_TYPE ||
49
- (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) ||
47
type === REACT_STRICT_MODE_TYPE ||
48
type === REACT_SUSPENSE_TYPE ||
49
type === REACT_SUSPENSE_LIST_TYPE ||