Skip to content

Commit

Permalink
Remove scheduler priority from hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Mar 9, 2021
1 parent 73e900b commit 6ba1dfd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/react-dom/src/events/ReactDOMEventReplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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 +393,7 @@ function attemptExplicitHydrationTarget(
// Increase its priority.
queuedTarget.blockedOn = instance;
attemptHydrationAtPriority(queuedTarget.lanePriority, () => {
runWithPriority(queuedTarget.priority, () => {
attemptHydrationAtCurrentPriority(nearestMounted);
});
attemptHydrationAtCurrentPriority(nearestMounted);
});

return;
Expand All @@ -417,17 +414,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 6ba1dfd

Please sign in to comment.