-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: update flushSync for new reconciler #3554
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 0afec9b:
|
packages/fiber/package.json
Outdated
"buffer": "^6.0.3", | ||
"its-fine": "^2.0.0", | ||
"react-reconciler": "^0.31.0", | ||
"react-reconciler": "^0.32.0", |
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 a breaking change, as react-reconciler 0.32 corresponds to React 19.1.
Been thinking on this, since we could risk not supporting 19.x. We can choose to inline if we're sure it is backwards compatible.
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.
That's a good catch. I'll verify this.
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.
I confirmed flushSyncFromReconciler
is in v0.31 as well. I think it is safe to use it without inlining. We now have a test for flushSync
so going forward we can know if this breaks when updating the reconciler. I'll downgrade the minimum version though as you pointed out.
Here begins my introduction to triaging the React reconciler. In this PR you will see...
react-reconciler
updated to 0.32 along with the types.flushSync
is now properly using the internalflushSyncFromReconciler
which mimics theflushSync
behavior fromreact-dom
: https://github.com/facebook/react/blob/main/packages/react-dom/src/shared/ReactDOMFlushSync.jsflushSync
.