diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index 8ba0b3458d23bf..1b621d6b129ba2 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -36,15 +36,6 @@ void schedulerDidRequestPreliminaryViewAllocation(SurfaceId surfaceId, const Sha // This delegate method is not currently used on iOS. } - void schedulerDidCloneShadowNode( - SurfaceId surfaceId, - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) override - { - // Does nothing. - // This delegate method is not currently used on iOS. - } - void schedulerDidDispatchCommand( const ShadowView &shadowView, const std::string &commandName, diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 247129cd574080..5ae2595e628a25 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -94,9 +94,6 @@ public class ReactFeatureFlags { public static boolean insertZReorderBarriersOnViewGroupChildren = true; - /** Feature Flag for mitigatin concurrent root crashes */ - public static boolean disablePreallocationOnClone = false; - /** * Feature Flag to control the size of the cache used by TextLayoutManager in Fabric. Used from * JNI. diff --git a/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index 31c19407fb115e..1468aa9e4263dc 100644 --- a/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -375,9 +375,6 @@ void Binding::installFabricUIManager( disableRevisionCheckForPreallocation_ = config->getBool("react_fabric:disable_revision_check_for_preallocation"); - disablePreallocationOnClone_ = - getFeatureFlagValue("disablePreallocationOnClone"); - if (enableFabricLogs_) { LOG(WARNING) << "Binding::installFabricUIManager() was called (address: " << this << ")."; @@ -535,37 +532,6 @@ void Binding::schedulerDidRequestPreliminaryViewAllocation( preallocateView(surfaceId, shadowNode); } -void Binding::schedulerDidCloneShadowNode( - SurfaceId surfaceId, - ShadowNode const &oldShadowNode, - ShadowNode const &newShadowNode) { - if (disablePreallocationOnClone_) { - return; - } - // This is only necessary if view preallocation was skipped during - // createShadowNode - - // We may need to PreAllocate a ShadowNode at this point if this is the - // earliest point it is possible to do so: - // 1. The revision is exactly 1 - // 2. At revision 0 (the old node), View Preallocation would have been skipped - - if (!disableRevisionCheckForPreallocation_) { - if (newShadowNode.getProps()->revision != 1) { - return; - } - if (oldShadowNode.getProps()->revision != 0) { - return; - } - } - - // If the new node is concrete and the old wasn't, we can preallocate - if (!oldShadowNode.getTraits().check(ShadowNodeTraits::Trait::FormsView) && - newShadowNode.getTraits().check(ShadowNodeTraits::Trait::FormsView)) { - preallocateView(surfaceId, newShadowNode); - } -} - void Binding::preallocateView( SurfaceId surfaceId, ShadowNode const &shadowNode) { diff --git a/ReactAndroid/src/main/jni/react/fabric/Binding.h b/ReactAndroid/src/main/jni/react/fabric/Binding.h index bf9d5c34e6b096..e27e2d04ec7104 100644 --- a/ReactAndroid/src/main/jni/react/fabric/Binding.h +++ b/ReactAndroid/src/main/jni/react/fabric/Binding.h @@ -102,11 +102,6 @@ class Binding : public jni::HybridClass, const SurfaceId surfaceId, const ShadowNode &shadowNode) override; - void schedulerDidCloneShadowNode( - SurfaceId surfaceId, - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) override; - void schedulerDidDispatchCommand( const ShadowView &shadowView, std::string const &commandName, @@ -158,7 +153,6 @@ class Binding : public jni::HybridClass, bool enableFabricLogs_{false}; bool disableRevisionCheckForPreallocation_{false}; bool dispatchPreallocationInBackground_{false}; - bool disablePreallocationOnClone_{false}; }; } // namespace react diff --git a/ReactCommon/react/renderer/core/Props.cpp b/ReactCommon/react/renderer/core/Props.cpp index ddf2a662bd635f..c52951b66ab1a7 100644 --- a/ReactCommon/react/renderer/core/Props.cpp +++ b/ReactCommon/react/renderer/core/Props.cpp @@ -26,8 +26,7 @@ Props::Props( rawProps, "nativeID", sourceProps.nativeId, - {})), - revision(sourceProps.revision + 1) + {})) #ifdef ANDROID , rawProps( diff --git a/ReactCommon/react/renderer/core/Props.h b/ReactCommon/react/renderer/core/Props.h index e63f274a3070ef..91b3e7ab567637 100644 --- a/ReactCommon/react/renderer/core/Props.h +++ b/ReactCommon/react/renderer/core/Props.h @@ -56,15 +56,6 @@ class Props : public virtual Sealable, public virtual DebugStringConvertible { std::string nativeId; - /* - * Special value that represents generation number of `Props` object, which - * increases when the object was constructed with some source `Props` object. - * Default props objects (that was constructed using default constructor) have - * revision equals `0`. - * The value might be used for optimization purposes. - */ - int const revision{0}; - #ifdef ANDROID folly::dynamic rawProps = folly::dynamic::object(); diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index 620191a4f2c14b..fc0a1641ed6f1b 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -309,17 +309,6 @@ void Scheduler::uiManagerDidCreateShadowNode(const ShadowNode &shadowNode) { } } -void Scheduler::uiManagerDidCloneShadowNode( - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) { - SystraceSection s("Scheduler::uiManagerDidCloneShadowNode"); - - if (delegate_ != nullptr) { - delegate_->schedulerDidCloneShadowNode( - newShadowNode.getSurfaceId(), oldShadowNode, newShadowNode); - } -} - void Scheduler::uiManagerDidDispatchCommand( const ShadowNode::Shared &shadowNode, std::string const &commandName, diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.h b/ReactCommon/react/renderer/scheduler/Scheduler.h index eaba25e16f451c..d42bfe802bb0a4 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.h +++ b/ReactCommon/react/renderer/scheduler/Scheduler.h @@ -90,9 +90,6 @@ class Scheduler final : public UIManagerDelegate { void uiManagerDidFinishTransaction( MountingCoordinator::Shared const &mountingCoordinator) override; void uiManagerDidCreateShadowNode(const ShadowNode &shadowNode) override; - void uiManagerDidCloneShadowNode( - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) override; void uiManagerDidDispatchCommand( const ShadowNode::Shared &shadowNode, std::string const &commandName, diff --git a/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h b/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h index e1bf4fda5bb475..db36d2c04098cc 100644 --- a/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +++ b/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h @@ -36,14 +36,6 @@ class SchedulerDelegate { SurfaceId surfaceId, const ShadowNode &shadowView) = 0; - /* - * Called right after a ShadowNode is cloned. - */ - virtual void schedulerDidCloneShadowNode( - SurfaceId surfaceId, - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) = 0; - virtual void schedulerDidDispatchCommand( const ShadowView &shadowView, std::string const &commandName, diff --git a/ReactCommon/react/renderer/uimanager/UIManager.cpp b/ReactCommon/react/renderer/uimanager/UIManager.cpp index 3e7b912e7b7eb5..44692eeab2615d 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -121,10 +121,6 @@ ShadowNode::Shared UIManager::cloneNode( /* .children = */ children, }); - if (delegate_ != nullptr) { - delegate_->uiManagerDidCloneShadowNode(shadowNode, *clonedShadowNode); - } - return clonedShadowNode; } diff --git a/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h b/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h index a36feaed21cd8e..77f1e4e3b62be4 100644 --- a/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +++ b/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h @@ -32,15 +32,6 @@ class UIManagerDelegate { */ virtual void uiManagerDidCreateShadowNode(const ShadowNode &shadowNode) = 0; - /* - * Called each time when UIManager clones a Shadow Node. Receiver - * might use this to optimistically allocate a new native view - * instances. - */ - virtual void uiManagerDidCloneShadowNode( - const ShadowNode &oldShadowNode, - const ShadowNode &newShadowNode) = 0; - /* * Called when UIManager wants to dispatch a command to the mounting layer. */