Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily Remove DebugTracing from the New Reconciler #18697

Merged
merged 3 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 1 addition & 41 deletions packages/react-reconciler/src/ReactFiberClassComponent.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import type {Fiber} from './ReactInternalTypes';
import type {ExpirationTime} from './ReactFiberExpirationTime.new';
import type {UpdateQueue} from './ReactUpdateQueue.new';
import type {ReactPriorityLevel} from './ReactInternalTypes';

import * as React from 'react';
import {Update, Snapshot} from './ReactSideEffectTags';
import {
debugRenderPhaseSideEffectsForStrictMode,
disableLegacyContext,
enableDebugTracing,
warnAboutDeprecatedLifecycles,
} from 'shared/ReactFeatureFlags';
import ReactStrictModeWarnings from './ReactStrictModeWarnings.new';
Expand All @@ -29,7 +27,7 @@ import invariant from 'shared/invariant';
import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols';

import {resolveDefaultProps} from './ReactFiberLazyComponent.new';
import {DebugTracingMode, StrictMode} from './ReactTypeOfMode';
import {StrictMode} from './ReactTypeOfMode';

import {
enqueueUpdate,
Expand All @@ -55,10 +53,8 @@ import {
requestCurrentTimeForUpdate,
computeExpirationForFiber,
scheduleUpdateOnFiber,
priorityLevelToLabel,
} from './ReactFiberWorkLoop.new';
import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig';
import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing';

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

Expand Down Expand Up @@ -211,18 +207,6 @@ const classComponentUpdater = {

enqueueUpdate(fiber, update);
scheduleUpdateOnFiber(fiber, expirationTime);

if (__DEV__) {
if (enableDebugTracing) {
if (fiber.mode & DebugTracingMode) {
const label = priorityLevelToLabel(
((update.priority: any): ReactPriorityLevel),
);
const name = getComponentName(fiber.type) || 'Unknown';
logStateUpdateScheduled(name, label, payload);
}
}
}
},
enqueueReplaceState(inst, payload, callback) {
const fiber = getInstance(inst);
Expand All @@ -247,18 +231,6 @@ const classComponentUpdater = {

enqueueUpdate(fiber, update);
scheduleUpdateOnFiber(fiber, expirationTime);

if (__DEV__) {
if (enableDebugTracing) {
if (fiber.mode & DebugTracingMode) {
const label = priorityLevelToLabel(
((update.priority: any): ReactPriorityLevel),
);
const name = getComponentName(fiber.type) || 'Unknown';
logStateUpdateScheduled(name, label, payload);
}
}
}
},
enqueueForceUpdate(inst, callback) {
const fiber = getInstance(inst);
Expand All @@ -282,18 +254,6 @@ const classComponentUpdater = {

enqueueUpdate(fiber, update);
scheduleUpdateOnFiber(fiber, expirationTime);

if (__DEV__) {
if (enableDebugTracing) {
if (fiber.mode & DebugTracingMode) {
const label = priorityLevelToLabel(
((update.priority: any): ReactPriorityLevel),
);
const name = getComponentName(fiber.type) || 'Unknown';
logForceUpdateScheduled(name, label);
}
}
}
},
};

Expand Down
29 changes: 2 additions & 27 deletions packages/react-reconciler/src/ReactFiberHooks.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ import type {FiberRoot} from './ReactInternalTypes';
import type {OpaqueIDType} from './ReactFiberHostConfig';

import ReactSharedInternals from 'shared/ReactSharedInternals';
import {enableDebugTracing} from 'shared/ReactFeatureFlags';

import {markRootExpiredAtTime} from './ReactFiberRoot.new';
import {
inferPriorityFromExpirationTime,
NoWork,
Sync,
} from './ReactFiberExpirationTime.new';
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
import {NoWork, Sync} from './ReactFiberExpirationTime.new';
import {NoMode, BlockingMode} from './ReactTypeOfMode';
import {readContext} from './ReactFiberNewContext.new';
import {createDeprecatedResponderListener} from './ReactFiberDeprecatedEvents.new';
import {
Expand All @@ -54,7 +49,6 @@ import {
warnIfNotScopedWithMatchingAct,
markRenderEventTimeAndConfig,
markUnprocessedUpdateTime,
priorityLevelToLabel,
} from './ReactFiberWorkLoop.new';

import invariant from 'shared/invariant';
Expand Down Expand Up @@ -83,7 +77,6 @@ import {
warnAboutMultipleRenderersDEV,
} from './ReactMutableSource.new';
import {getIsRendering} from './ReactCurrentFiber';
import {logStateUpdateScheduled} from './DebugTracing';

const {ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals;

Expand Down Expand Up @@ -1655,10 +1648,6 @@ function dispatchAction<S, A>(
next: (null: any),
};

if (__DEV__) {
update.priority = getCurrentPriorityLevel();
}

// Append the update to the end of the list.
const pending = queue.pending;
if (pending === null) {
Expand Down Expand Up @@ -1729,20 +1718,6 @@ function dispatchAction<S, A>(
}
scheduleUpdateOnFiber(fiber, expirationTime);
}

if (__DEV__) {
if (enableDebugTracing) {
if (fiber.mode & DebugTracingMode) {
const priorityLevel = inferPriorityFromExpirationTime(
currentTime,
expirationTime,
);
const label = priorityLevelToLabel(priorityLevel);
const name = getComponentName(fiber.type) || 'Unknown';
logStateUpdateScheduled(name, label, action);
}
}
}
}

export const ContextOnlyDispatcher: Dispatcher = {
Expand Down
13 changes: 1 addition & 12 deletions packages/react-reconciler/src/ReactFiberThrow.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import {
LifecycleEffectMask,
} from './ReactSideEffectTags';
import {shouldCaptureSuspense} from './ReactFiberSuspenseComponent.new';
import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode';
import {enableDebugTracing} from 'shared/ReactFeatureFlags';
import {NoMode, BlockingMode} from './ReactTypeOfMode';
import {createCapturedValue} from './ReactCapturedValue';
import {
enqueueCapturedUpdate,
Expand All @@ -55,7 +54,6 @@ import {
pingSuspendedRoot,
} from './ReactFiberWorkLoop.new';
import {logCapturedError} from './ReactFiberErrorLogger';
import {logComponentSuspended} from './DebugTracing';

import {Sync, NoWork} from './ReactFiberExpirationTime.new';

Expand Down Expand Up @@ -195,15 +193,6 @@ function throwException(
// This is a wakeable.
const wakeable: Wakeable = (value: any);

if (__DEV__) {
if (enableDebugTracing) {
if (sourceFiber.mode & DebugTracingMode) {
const name = getComponentName(sourceFiber.type) || 'Unknown';
logComponentSuspended(name, wakeable);
}
}
}

if ((sourceFiber.mode & BlockingMode) === NoMode) {
// Reset the memoizedState to what it was before we attempted
// to render it.
Expand Down
Loading