Skip to content

Commit

Permalink
Naming nits
Browse files Browse the repository at this point in the history
queueRecoverableHydrationErrors -> upgradeHydrationErrorsToRecoverable
  • Loading branch information
acdlite committed Feb 4, 2022
1 parent 61ef8f4 commit 24abe60
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
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
12 changes: 6 additions & 6 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ function popComponentStackInDEV(task: Task): void {
}
}

function reportError(request: Request, error: mixed): void {
function logRecoverableError(request: Request, error: mixed): void {
// If this callback errors, we intentionally let that error bubble up to become a fatal error
// so that someone fixes the error reporting instead of hiding it.
const onError = request.onError;
Expand Down Expand Up @@ -484,7 +484,7 @@ function renderSuspenseBoundary(
}
} catch (error) {
contentRootSegment.status = ERRORED;
reportError(request, error);
logRecoverableError(request, error);
newBoundary.forceClientRender = true;
// We don't need to decrement any task numbers because we didn't spawn any new task.
// We don't need to schedule any task because we know the parent has written yet.
Expand Down Expand Up @@ -1337,7 +1337,7 @@ function erroredTask(
error: mixed,
) {
// Report the error to a global handler.
reportError(request, error);
logRecoverableError(request, error);
if (boundary === null) {
fatalError(request, error);
} else {
Expand Down Expand Up @@ -1557,7 +1557,7 @@ export function performWork(request: Request): void {
flushCompletedQueues(request, request.destination);
}
} catch (error) {
reportError(request, error);
logRecoverableError(request, error);
fatalError(request, error);
} finally {
setCurrentResponseState(prevResponseState);
Expand Down Expand Up @@ -1945,7 +1945,7 @@ export function startFlowing(request: Request, destination: Destination): void {
try {
flushCompletedQueues(request, destination);
} catch (error) {
reportError(request, error);
logRecoverableError(request, error);
fatalError(request, error);
}
}
Expand All @@ -1960,7 +1960,7 @@ export function abort(request: Request): void {
flushCompletedQueues(request, request.destination);
}
} catch (error) {
reportError(request, error);
logRecoverableError(request, error);
fatalError(request, error);
}
}
10 changes: 5 additions & 5 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export function resolveModelToJSON(
x.then(ping, ping);
return serializeByRefID(newSegment.id);
} else {
reportError(request, x);
logRecoverableError(request, x);
// Something errored. We'll still send everything we have up until this point.
// We'll replace this element with a lazy reference that throws on the client
// once it gets rendered.
Expand Down Expand Up @@ -604,7 +604,7 @@ export function resolveModelToJSON(
);
}

function reportError(request: Request, error: mixed): void {
function logRecoverableError(request: Request, error: mixed): void {
const onError = request.onError;
onError(error);
}
Expand Down Expand Up @@ -687,7 +687,7 @@ function retrySegment(request: Request, segment: Segment): void {
x.then(ping, ping);
return;
} else {
reportError(request, x);
logRecoverableError(request, x);
// This errored, we need to serialize this error to the
emitErrorChunk(request, segment.id, x);
}
Expand All @@ -711,7 +711,7 @@ function performWork(request: Request): void {
flushCompletedChunks(request, request.destination);
}
} catch (error) {
reportError(request, error);
logRecoverableError(request, error);
fatalError(request, error);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
Expand Down Expand Up @@ -794,7 +794,7 @@ export function startFlowing(request: Request, destination: Destination): void {
try {
flushCompletedChunks(request, destination);
} catch (error) {
reportError(request, error);
logRecoverableError(request, error);
fatalError(request, error);
}
}
Expand Down

0 comments on commit 24abe60

Please sign in to comment.