Skip to content

Commit

Permalink
Naming nits
Browse files Browse the repository at this point in the history
- logRecoverableError -> reportError
- queueRecoverableHydrationErrors -> upgradeHydrationErrorsToRecoverable
  • Loading branch information
acdlite committed Feb 4, 2022
1 parent 98894be commit 537d1ca
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,6 @@ export function detachDeletedInstance(node: Instance): void {
// noop
}

export function logRecoverableError(error) {
export function reportError(error) {
// noop
}
3 changes: 1 addition & 2 deletions packages/react-dom/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ export function getCurrentEventPriority(): * {
return getEventPriority(currentEvent.type);
}

/* global reportError */
export const logRecoverableError =
export const reportError =
// $FlowFixMe Flow doesn't know about reportError
typeof reportError === 'function'
? // In modern browsers, reportError will dispatch an error event,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,6 @@ export function detachDeletedInstance(node: Instance): void {
// noop
}

export function logRecoverableError(error: mixed): void {
export function reportError(error: mixed): void {
// noop
}
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,6 @@ export function detachDeletedInstance(node: Instance): void {
// noop
}

export function logRecoverableError(error: mixed): void {
export function reportError(error: mixed): void {
// noop
}
2 changes: 1 addition & 1 deletion packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {

detachDeletedInstance() {},

logRecoverableError() {
reportError() {
// no-op
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberCompleteWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ import {
resetHydrationState,
getIsHydrating,
hasUnhydratedTailNodes,
queueRecoverableHydrationErrors,
upgradeHydrationErrorsToRecoverable,
} from './ReactFiberHydrationContext.new';
import {
enableSuspenseCallback,
Expand Down Expand Up @@ -1105,7 +1105,7 @@ function completeWork(
// there may have been recoverable errors during first hydration
// attempt. If so, add them to a queue so we can log them in the
// commit phase.
queueRecoverableHydrationErrors();
upgradeHydrationErrorsToRecoverable();
}

if ((workInProgress.flags & DidCapture) !== NoFlags) {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberCompleteWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ import {
resetHydrationState,
getIsHydrating,
hasUnhydratedTailNodes,
queueRecoverableHydrationErrors,
upgradeHydrationErrorsToRecoverable,
} from './ReactFiberHydrationContext.old';
import {
enableSuspenseCallback,
Expand Down Expand Up @@ -1105,7 +1105,7 @@ function completeWork(
// there may have been recoverable errors during first hydration
// attempt. If so, add them to a queue so we can log them in the
// commit phase.
queueRecoverableHydrationErrors();
upgradeHydrationErrorsToRecoverable();
}

if ((workInProgress.flags & DidCapture) !== NoFlags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ function resetHydrationState(): void {
isHydrating = false;
}

export function queueRecoverableHydrationErrors(): void {
export function upgradeHydrationErrorsToRecoverable(): void {
if (hydrationErrors !== null) {
// Successfully completed a forced client render. The errors that occurred
// during the hydration attempt are now recovered. We will log them in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ function resetHydrationState(): void {
isHydrating = false;
}

export function queueRecoverableHydrationErrors(): void {
export function upgradeHydrationErrorsToRecoverable(): void {
if (hydrationErrors !== null) {
// Successfully completed a forced client render. The errors that occurred
// during the hydration attempt are now recovered. We will log them in
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import {
supportsMicrotasks,
errorHydratingContainer,
scheduleMicrotask,
logRecoverableError,
reportError,
} from './ReactFiberHostConfig';

import {
Expand Down Expand Up @@ -2121,7 +2121,7 @@ function commitRootImpl(
} else {
// No user-provided onRecoverableError. Use the default behavior
// provided by the renderer's host config.
logRecoverableError(recoverableError);
reportError(recoverableError);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import {
supportsMicrotasks,
errorHydratingContainer,
scheduleMicrotask,
logRecoverableError,
reportError,
} from './ReactFiberHostConfig';

import {
Expand Down Expand Up @@ -2121,7 +2121,7 @@ function commitRootImpl(
} else {
// No user-provided onRecoverableError. Use the default behavior
// provided by the renderer's host config.
logRecoverableError(recoverableError);
reportError(recoverableError);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const prepareScopeUpdate = $$$hostConfig.preparePortalMount;
export const getInstanceFromScope = $$$hostConfig.getInstanceFromScope;
export const getCurrentEventPriority = $$$hostConfig.getCurrentEventPriority;
export const detachDeletedInstance = $$$hostConfig.detachDeletedInstance;
export const logRecoverableError = $$$hostConfig.logRecoverableError;
export const reportError = $$$hostConfig.reportError;

// -------------------
// Microtasks
Expand Down
2 changes: 1 addition & 1 deletion packages/react-test-renderer/src/ReactTestHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,6 @@ export function detachDeletedInstance(node: Instance): void {
// noop
}

export function logRecoverableError(error: mixed): void {
export function reportError(error: mixed): void {
// noop
}

0 comments on commit 537d1ca

Please sign in to comment.