Skip to content
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 flushDiscreteUpdates, discreteUpdates and syncUpdates #18710

Merged
merged 1 commit into from
May 5, 2020

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Apr 23, 2020

We're simplifying discrete by merging it with sync. As such flushSync() can be used to flush already pending discrete work. flushSync(() => ...) replaces discreteUpdates. syncUpdates could in theory be used to enter the discrete phase in a non-discrete event but might as well use flushSync(() => ...) then to simplify the API surface area.

Currently flushSync errors if nested. We might need to relax that and always flush on the inner one. Let's see if we hit it.

I'm going to remove flushControlled as well. I need to see if I can just use flushSync for that. In Draft's case I might be able to just let the new heuristics take over and make flushControlled a noop.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 23, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 23, 2020

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 ed32e8d:

Sandbox Source
elastic-ride-hub3i Configuration

@sizebot
Copy link

sizebot commented Apr 23, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against ed32e8d

@sizebot
Copy link

sizebot commented Apr 23, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against ed32e8d

@acdlite
Copy link
Collaborator

acdlite commented Apr 23, 2020

Is it intentional that you didn't actually remove the flushDiscreteUpdates implementation? Is the idea to remove the API only and then clean up the implementation later?

@sebmarkbage
Copy link
Collaborator Author

sebmarkbage commented Apr 23, 2020

The implementation is still used by the event system. I'll need to implement the new model and then remove it.

Copy link
Contributor

@trueadm trueadm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sebmarkbage sebmarkbage merged commit cd4a960 into facebook:master May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants