-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Remove renderPhaseUpdates Map #17625
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 811a659:
|
Details of bundled changes.Comparing: 29b4d07...811a659 react-dom
react-test-renderer
react-native-renderer
react-art
react-reconciler
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (experimental) |
Details of bundled changes.Comparing: 29b4d07...811a659 react-art
react-reconciler
react-native-renderer
react-dom
react-test-renderer
ReactDOM: size: 🔺+0.4%, gzip: 🔺+0.2% Size changes (stable) |
a35a6c6
to
a37b65e
Compare
// | ||
// Only reset the updates from the queue if it has a clone. If it does | ||
// not have a clone, that means it wasn't processed, and the updates were | ||
// scheduled before we entered the render phase. |
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.
@sebmarkbage I think if we change the list to an array, we would just need some other mechanism to determine if it was processed or not. I added tests so we don't forget.
9c445d4
to
85b2209
Compare
Ok I think this is ready for review now |
6f4d988
to
3045820
Compare
33d7247
to
37d0878
Compare
Follow up to facebook#17484, which was reverted due to a bug found in www.
When resetting render phase updates after a throw, we should only clear the pending queue of hooks that were already processed.
Detects if a queue has been processed by whether the hook was cloned. If we change the implementation to an array instead of a list, we'll need some other mechanism to determine whether the hook was processed.
useTransition uses the state hook as part of its implementation, so we need to fork it in the dispatcher used for re-renders, too.
37d0878
to
811a659
Compare
Follow up to #17484, which was reverted due to a bug found in www.
(I haven't actually found this bug yet, still trying to repro.)Found and fixedAlso addresses a separate bug where updates that are thought to be render phase updates are cleared, but they are actually normal updates: 8a347ed#r36440099