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

[DOM] move flushSync out of the reconciler #28500

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Commits on Apr 8, 2024

  1. Implements flushSync in react-dom without relying on the reconciler. …

    …This will only be available in builds that no longer support legacy mode because the reconciler flushSync has special logic for legacy mode which is not necessary for concurrent roots.
    
    This is one option for how we might recover existing flushSync priorities with an external flushSync implementation.
    
    To reduce hidden class checks we need to read the batch config once which requires inlining the requestCurrentTransition implementation.
    
    Moves the legacy implementation of flushSync to the fb entrypoint
    
    The cost of the separate file is not really warranted. Will use feature flag to scope build specific implementations
    
    Moved error to fiber config. The reconciler implementation should be DCE'd in builds that still support legacy mode
    
    Exposes an updateContainerSync implementation so we can avoid depending on flushSyncFromReconciler in hot reloading
    
    Removes flushSyncFromReconciler from ReactDOMRoot
    
    Removes flushSyncFromReconciler from ReactDOMUpdateBatching
    
    Removes flushSyncFromReconciler use from ReactFiberReconciler
    
    Removes flushSyncFromReconciler from ReactART
    
    Rather than use event priority or lane type semantics for the batch config it now uses a boolean. There really is only a binary of sync or not sync so we don't need to express this concept as something overly specific to Fiber.
    
    simplifies the during render case to in dev to avoid a bit of extra work. There is no harm in returning true in prod even if there is nothing to react to it.
    gnoff committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    e664514 View commit details
    Browse the repository at this point in the history