GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use update lane priority to set pending updates on roots (#20918) · react/react@d745597

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberWorkLoop.new.js
    • ReactFiberWorkLoop.old.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberWorkLoop.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,27 @@ export function scheduleUpdateOnFiber(
598598
flushSyncCallbackQueue();
599599
}
600600
}
601+
} else if (decoupleUpdatePriorityFromScheduler) {
602+
const updateLanePriority = getCurrentUpdateLanePriority();
603+
604+
// Schedule a discrete update but only if it's not Sync.
605+
if (
606+
(executionContext & DiscreteEventContext) !== NoContext &&
607+
// Only updates at user-blocking priority or greater are considered
608+
// discrete, even inside a discrete event.
609+
updateLanePriority === InputDiscreteLanePriority
610+
) {
611+
// This is the result of a discrete event. Track the lowest priority
612+
// discrete update per root so we can flush them early, if needed.
613+
if (rootsWithPendingDiscreteUpdates === null) {
614+
rootsWithPendingDiscreteUpdates = new Set([root]);
615+
} else {
616+
rootsWithPendingDiscreteUpdates.add(root);
617+
}
618+
}
619+
// Schedule other updates after in case the callback is sync.
620+
ensureRootIsScheduled(root, eventTime);
621+
schedulePendingInteractions(root, lane);
601622
} else {
602623
// Schedule a discrete update but only if it's not Sync.
603624
if (
Collapse file

‎packages/react-reconciler/src/ReactFiberWorkLoop.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,27 @@ export function scheduleUpdateOnFiber(
598598
flushSyncCallbackQueue();
599599
}
600600
}
601+
} else if (decoupleUpdatePriorityFromScheduler) {
602+
const updateLanePriority = getCurrentUpdateLanePriority();
603+
604+
// Schedule a discrete update but only if it's not Sync.
605+
if (
606+
(executionContext & DiscreteEventContext) !== NoContext &&
607+
// Only updates at user-blocking priority or greater are considered
608+
// discrete, even inside a discrete event.
609+
updateLanePriority === InputDiscreteLanePriority
610+
) {
611+
// This is the result of a discrete event. Track the lowest priority
612+
// discrete update per root so we can flush them early, if needed.
613+
if (rootsWithPendingDiscreteUpdates === null) {
614+
rootsWithPendingDiscreteUpdates = new Set([root]);
615+
} else {
616+
rootsWithPendingDiscreteUpdates.add(root);
617+
}
618+
}
619+
// Schedule other updates after in case the callback is sync.
620+
ensureRootIsScheduled(root, eventTime);
621+
schedulePendingInteractions(root, lane);
601622
} else {
602623
// Schedule a discrete update but only if it's not Sync.
603624
if (

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.