mirror of
https://github.com/facebook/react.git
synced 2026-02-25 05:03:03 +00:00
* Split performWork into renderRoot and commitRoot It turns out that the scheduler is too coupled to how the DOM renderer works. Specifically, the requestIdleCallback model, and how roots are committed immediately after completing. Other renderers have different constraints for when to yield and when to commit work. We're moving towards a model where the scheduler only works on a single root at a time, and the render phase and commit phase are split into distinct entry points. This gives the renderer more control over when roots are committed, coordinating multiple roots, deferring the commit phase, batching updates, when to yield execution, and so on. In this initial commit, I've left the renderers alone and only changed the scheduler. Mostly, this involved extracting logic related to multiple roots and moving it into its own section at the bottom of the file. The idea is that this section can be lifted pretty much as-is into the renderers. I'll do that next. * Remove FiberRoot scheduleAt Isn't actually used anywhere * Make the root schedule a linked list again Since this still lives inside the renderer, let's just use the FiberRoot type. The FiberRoot concept will likely be lifted out eventually, anyway. * commitRoot should accept a HostRoot This way it's less reliant on the alternate model * Unify branches * Remove dead branch onUncaughtError is only called while we're working on a root. * remainingWork -> remainingExpirationTime I was wary of leaking NoWork but mixing numbers and null is worse so let's just do it until we think of something better. * Rename stuff