-
Notifications
You must be signed in to change notification settings - Fork 50.6k
[DevTools] Fix broken commit tree builder for initial operations #35710
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
[DevTools] Fix broken commit tree builder for initial operations #35710
Conversation
9c47351 to
aa88640
Compare
aa88640 to
86ed9f4
Compare
| flushPendingEvents(currentRoot); | ||
|
|
||
| currentRoot = (null: any); | ||
| }); | ||
|
|
||
| flushPendingEvents(); | ||
|
|
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.
This is the fix. We were flushing events for initial operations at the end without a root even though we may have been profiling.
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.
Is is possible to cover it with a small unit test?
|
Might be hard to set this up. We need to have a committed root, then inject the hook (flushInitialOperation runs), start profiling, make an update and then let the commit tree builder run. But our tests have the hook injected before we commit. |
|
Going to merge without a test for now to unblock work on moving the reconciliation to the passive phase. |
[diff facebook/react@95ffd6cd...2dd9b7cf](facebook/react@95ffd6c...2dd9b7c) <details> <summary>React upstream changes</summary> - facebook/react#35724 - facebook/react#35711 - facebook/react#35710 - facebook/react#35708 - facebook/react#35705 - facebook/react#35700 </details>
Summary
Originally thought we can stop sending the root ID entirely but it's used by the commit tree builder. That made me realize #35093 introduced a regression.
Flushing pending events is only safe without a root if we're not profiling or if we're flushing events that don't mutate the tree (e.g. console errors and warnings)
Also removes handling of
TREE_OPERATION_REMOVE_ROOTin various frontends since that operation is no longer sent by the backend.How did you test this change?