-
Notifications
You must be signed in to change notification settings - Fork 48.8k
Remove callbackId field from FiberRoot #19458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 71681be:
|
Details of bundled changes.Comparing: c24b641...71681be react-dom
react-native-renderer
react-reconciler
react-art
react-test-renderer
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (stable) |
Details of bundled changes.Comparing: c24b641...71681be react-dom
react-reconciler
react-art
react-test-renderer
react-native-renderer
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (experimental) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -689,37 +689,32 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) { | |||
markStarvedLanesAsExpired(root, currentTime); | |||
|
|||
// Determine the next lanes to work on, and their priority. | |||
const newCallbackId = getNextLanes( | |||
const nextLanes = getNextLanes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the comment on line 681 (which references the expiration time) is out of date, should we update that as well?
@@ -741,7 +736,6 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) { | |||
); | |||
} | |||
|
|||
root.callbackId = newCallbackId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to update the root callbackId
with the next lane, why don't we need to do anything with the next lane in the new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was only used by this function. Since we don't need it for the logic above anymore, we don't have to store it.
The old expiration times implementation used this field to infer when the priority of a task had changed at a more granular level than a Scheduler priority level. Now that we have the LanePriority type, which is React-specific, we no longer need the `callbackId` field.
13518ec
to
71681be
Compare
The old expiration times implementation used this field to infer when the priority of a task had changed at a more granular level than a Scheduler priority level.
Now that we have the LanePriority type, which is React-specific, we no longer need the
callbackId
field.