You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is a single priority field `pendingWorkPriority` that
represents the priority of the entire subtree. The scheduler does a
breadth-first search to find the next unit of work with a matching
priority level. If a subtree's priority does not match, that entire
subtree is skipped. That means when an update is scheduled deep in the
tree (`setState`), its priority must be bubbled to the top of the tree.
The problem is that this causes the all the parent priorities to be
overridden — there's no way to schedule a high priority update inside
a low priority tree without increasing the priority of the entire tree.
To address this, this PR introduces a separate priority field called
`pendingUpdatePriority` (not 100% sold on the name). The new field
represents the priority of the pending props and state, which may be
lower than the priority of the entire tree. Now, when the scheduler is
searching for work to perform, it only matches if the `
pendingUpdatePriority` matches. It continues to use the
`pendingWorkPriority` as a way to ignore subtrees if they do not match.
(To elaborate further: because the work priority is the highest priority
of any node in the entire tree, if it does not match, the tree can
be skipped.)
0 commit comments