-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
[Fiber] State Updates #7941
[Fiber] State Updates #7941
Conversation
Looks good! 👍 |
Oh oops didn't see you still have steps to do. Commits so far look good. |
Well at this point maybe we need quicker turn around on PRs for collaboration. |
@@ -291,7 +291,7 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) { | |||
const prevProps = current.memoizedProps; | |||
// TODO: This is the new state. We don't currently have the previous | |||
// state anymore. |
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.
Can remove this TODO
d2fe722
to
de85aa5
Compare
Can we get it merged as is for now? It's hard to fix/test/explore Fiber with massive changes hanging in a PR. I don't think anybody expects it to be perfect. |
Agreed, the existing commits are useful even without the remaining steps. |
I'm going to mark this as accepted to indicate that the existing commits should be merged, but if you disagree @sebmarkbage feel free to remove it. |
Refactors the class logic a bit. I moved scheduleUpdate out into the scheduler since that's where the scheduling normally happens. I also moved it so that we can rely on hoisting to resolve the cycle statically. I moved the updater to a new class component file. I suspect we will need a bit of space in here since the class initialization code is quite complex. The class component dependency is currently fixed in BeginWork so we can't move complete or commit phase stuff to it. If we need to, we have to initialize it in the scheduler and pass it to the other phases.
The root is always a host container.
We forgot to clone this value so it didn't work before. This is covered by existing tests in ReactDOMProduction.
de85aa5
to
c50502c
Compare
Cool I'll continue in a new PR. I have found another bug. |
I'm putting some work into state updates since there is currently a bug that I haven't been able to track down. Builds on top #7707.