dillon1000/react
Commit
Browse files [DOM] move `flushSync` out of the reconciler (#28500)
This PR moves `flushSync` out of the reconciler. there is still an internal implementation that is used when these semantics are needed for React methods such as `unmount` on roots. This new isomorphic `flushSync` is only used in builds that no longer support legacy mode. Additionally all the internal uses of flushSync in the reconciler have been replaced with more direct methods. There is a new `updateContainerSync` method which updates a container but forces it to the Sync lane and flushes passive effects if necessary. This combined with flushSyncWork can be used to replace flushSync for all instances of internal usage. We still maintain the original flushSync implementation as `flushSyncFromReconciler` because it will be used as the flushSync implementation for FB builds. This is because it has special legacy mode handling that the new isomorphic implementation does not need to consider. It will be removed from production OSS builds by closure though
Changed paths18 files
First-parent comparisonpackages/react-art/src/ReactART.js ModifiedM packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-dom-bindings/src/events/ReactDOMUpdateBatching.js ModifiedM packages/react-dom-bindings/src/server/ReactDOMFlightServerHostDispatcher.js ModifiedM packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js ModifiedM packages/react-dom/src/ReactDOMSharedInternals.js ModifiedM packages/react-dom/src/client/ReactDOM.js ModifiedM packages/react-dom/src/client/ReactDOMRoot.js ModifiedM packages/react-dom/src/client/ReactDOMRootFB.js ModifiedA packages/react-dom/src/shared/ReactDOMFlushSync.js AddedM packages/react-dom/src/shared/ReactDOMTypes.js ModifiedM packages/react-noop-renderer/src/createReactNoop.js ModifiedM packages/react-reconciler/src/ReactFiberHotReloading.js ModifiedM packages/react-reconciler/src/ReactFiberReconciler.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js ModifiedM packages/react-test-renderer/src/ReactTestRenderer.js ModifiedM packages/react/src/ReactCurrentBatchConfig.js ModifiedM scripts/error-codes/codes.json ModifiedPatch
Files changed
Rendering syntax-highlighted changes…