From c3d0f3b2de1688c389b9bfe09ab682eac190349a Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 27 Mar 2020 18:41:30 -0700 Subject: [PATCH] Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 --- ReactCommon/fabric/uimanager/Scheduler.cpp | 9 --------- ReactCommon/fabric/uimanager/UIManager.cpp | 12 ++++-------- ReactCommon/fabric/uimanager/UIManager.h | 3 --- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index 329e644969d..6b9c47f7a93 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -65,15 +65,6 @@ Scheduler::Scheduler( uiManager->setDelegate(this); uiManager->setComponentDescriptorRegistry(componentDescriptorRegistry_); -#ifdef ANDROID - bool stateReconciliationEnabled = reactNativeConfig_->getBool( - "react_fabric:enabled_state_reconciliation_android"); -#else - bool stateReconciliationEnabled = reactNativeConfig_->getBool( - "react_fabric:enabled_state_reconciliation_ios"); -#endif - uiManager->setStateReconciliationEnabled(stateReconciliationEnabled); - runtimeExecutor_([=](jsi::Runtime &runtime) { auto uiManagerBinding = UIManagerBinding::createAndInstallIfNeeded(runtime); uiManagerBinding->attach(uiManager); diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index a765a956ffd..c2fa6be9278 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -105,14 +105,10 @@ void UIManager::completeSurface( /* .children = */ rootChildren, }); }, - stateReconciliationEnabled_); + true); }); } -void UIManager::setStateReconciliationEnabled(bool enabled) { - stateReconciliationEnabled_ = enabled; -} - void UIManager::setJSResponder( const ShadowNode::Shared &shadowNode, const bool blockNativeResponder) const { @@ -148,7 +144,7 @@ ShadowNode::Shared const *UIManager::getNewestCloneOfShadowNode( ancestorShadowNode = oldRootShadowNode.get(); return nullptr; }, - stateReconciliationEnabled_); + true); }); auto ancestors = shadowNode->getFamily().getAncestors(*ancestorShadowNode); @@ -184,7 +180,7 @@ void UIManager::setNativeProps( }); })); }, - stateReconciliationEnabled_); + true); }); } @@ -202,7 +198,7 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics( ancestorShadowNode = oldRootShadowNode.get(); return nullptr; }, - stateReconciliationEnabled_); + true); }); } diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index 53a18ab417d..db882e3aec2 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -55,8 +55,6 @@ class UIManager final : public ShadowTreeDelegate { ShadowTree const &shadowTree, MountingCoordinator::Shared const &mountingCoordinator) const override; - void setStateReconciliationEnabled(bool enabled); - private: friend class UIManagerBinding; friend class Scheduler; @@ -124,7 +122,6 @@ class UIManager final : public ShadowTreeDelegate { UIManagerDelegate *delegate_; UIManagerBinding *uiManagerBinding_; ShadowTreeRegistry shadowTreeRegistry_{}; - bool stateReconciliationEnabled_{false}; }; } // namespace react