Skip to content

Commit

Permalink
Remove scheduler priority from hydration (#20957)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii authored Mar 9, 2021
1 parent 73e900b commit 5d1d167
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/react-dom/src/events/ReactDOMEventReplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import type {LanePriority} from 'react-reconciler/src/ReactFiberLane.old';

import {enableSelectiveHydration} from 'shared/ReactFeatureFlags';
import {
unstable_runWithPriority as runWithPriority,
unstable_scheduleCallback as scheduleCallback,
unstable_NormalPriority as NormalPriority,
unstable_getCurrentPriorityLevel as getCurrentPriorityLevel,
} from 'scheduler';
import {
getNearestMountedFiber,
Expand Down Expand Up @@ -111,7 +109,6 @@ const queuedPointerCaptures: Map<number, QueuedReplayableEvent> = new Map();
type QueuedHydrationTarget = {|
blockedOn: null | Container | SuspenseInstance,
target: Node,
priority: number,
lanePriority: LanePriority,
|};
const queuedExplicitHydrationTargets: Array<QueuedHydrationTarget> = [];
Expand Down Expand Up @@ -394,9 +391,7 @@ function attemptExplicitHydrationTarget(
// Increase its priority.
queuedTarget.blockedOn = instance;
attemptHydrationAtPriority(queuedTarget.lanePriority, () => {
runWithPriority(queuedTarget.priority, () => {
attemptHydrationAtCurrentPriority(nearestMounted);
});
attemptHydrationAtCurrentPriority(nearestMounted);
});

return;
Expand All @@ -417,17 +412,17 @@ function attemptExplicitHydrationTarget(

export function queueExplicitHydrationTarget(target: Node): void {
if (enableSelectiveHydration) {
const schedulerPriority = getCurrentPriorityLevel();
const updateLanePriority = getCurrentUpdatePriority();
const queuedTarget: QueuedHydrationTarget = {
blockedOn: null,
target: target,
priority: schedulerPriority,
lanePriority: updateLanePriority,
};
let i = 0;
for (; i < queuedExplicitHydrationTargets.length; i++) {
if (schedulerPriority <= queuedExplicitHydrationTargets[i].priority) {
if (
updateLanePriority <= queuedExplicitHydrationTargets[i].lanePriority
) {
break;
}
}
Expand Down

0 comments on commit 5d1d167

Please sign in to comment.