From 3e4a8e35fe204b6ab74951d6718ad784cb13f6e1 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 1 Apr 2019 10:47:04 -0700 Subject: [PATCH] Fabric `ShadowTree` (and co) was moved to `mounting` module Summary: Because it's kinda more logical and we will rely on this in comming diffs. Reviewed By: mdvacca Differential Revision: D14587124 fbshipit-source-id: 94ae9410b4ffeffd0fcb4da4a0518f0bb0d2ba63 --- .../src/main/java/com/facebook/react/fabric/jsi/jni/BUCK | 1 + .../main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp | 2 +- ReactCommon/fabric/mounting/BUCK | 3 +++ ReactCommon/fabric/{uimanager => mounting}/ShadowTree.cpp | 6 +++++- ReactCommon/fabric/{uimanager => mounting}/ShadowTree.h | 2 +- .../fabric/{uimanager => mounting}/ShadowTreeDelegate.h | 0 .../fabric/{uimanager => mounting}/ShadowTreeRegistry.cpp | 0 .../fabric/{uimanager => mounting}/ShadowTreeRegistry.h | 2 +- ReactCommon/fabric/uimanager/BUCK | 2 +- ReactCommon/fabric/uimanager/Scheduler.cpp | 2 +- ReactCommon/fabric/uimanager/Scheduler.h | 6 +++--- ReactCommon/fabric/uimanager/UIManager.cpp | 2 +- ReactCommon/fabric/uimanager/UIManager.h | 2 +- ReactCommon/{fabric/uimanager => utils}/TimeUtils.h | 0 14 files changed, 19 insertions(+), 11 deletions(-) rename ReactCommon/fabric/{uimanager => mounting}/ShadowTree.cpp (98%) rename ReactCommon/fabric/{uimanager => mounting}/ShadowTree.h (98%) rename ReactCommon/fabric/{uimanager => mounting}/ShadowTreeDelegate.h (100%) rename ReactCommon/fabric/{uimanager => mounting}/ShadowTreeRegistry.cpp (100%) rename ReactCommon/fabric/{uimanager => mounting}/ShadowTreeRegistry.h (97%) rename ReactCommon/{fabric/uimanager => utils}/TimeUtils.h (100%) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/BUCK index 590d06c63c6..75b75835b3b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/BUCK @@ -29,6 +29,7 @@ rn_xplat_cxx_library( react_native_xplat_target("config:config"), react_native_xplat_target("fabric/uimanager:uimanager"), react_native_xplat_target("fabric/components/scrollview:scrollview"), + react_native_xplat_target("utils:utils"), react_native_target("jni/react/jni:jni"), "fbsource//xplat/fbsystrace:fbsystrace", "fbsource//xplat/folly:molly", diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp index 3be8ba82e99..0fd303f2c82 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp @@ -18,8 +18,8 @@ #include #include #include -#include #include +#include using namespace facebook::jni; using namespace facebook::jsi; diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index 674ad5b5611..23cf786a296 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -55,8 +55,11 @@ rn_xplat_cxx_library( "fbsource//xplat/folly:molly", "fbsource//xplat/third-party/glog:glog", react_native_xplat_target("better:better"), + react_native_xplat_target("fabric/components/root:root"), + react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("utils:utils"), ], ) diff --git a/ReactCommon/fabric/uimanager/ShadowTree.cpp b/ReactCommon/fabric/mounting/ShadowTree.cpp similarity index 98% rename from ReactCommon/fabric/uimanager/ShadowTree.cpp rename to ReactCommon/fabric/mounting/ShadowTree.cpp index b008825bbf1..391471073a5 100644 --- a/ReactCommon/fabric/uimanager/ShadowTree.cpp +++ b/ReactCommon/fabric/mounting/ShadowTree.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "ShadowTreeDelegate.h" @@ -96,6 +96,10 @@ ShadowTree::ShadowTree( /* .props = */ props, /* .eventEmitter = */ noopEventEmitter, })); + +#ifdef RN_SHADOW_TREE_INTROSPECTION + stubViewTree_ = stubViewTreeFromShadowNode(*rootShadowNode_); +#endif } ShadowTree::~ShadowTree() { diff --git a/ReactCommon/fabric/uimanager/ShadowTree.h b/ReactCommon/fabric/mounting/ShadowTree.h similarity index 98% rename from ReactCommon/fabric/uimanager/ShadowTree.h rename to ReactCommon/fabric/mounting/ShadowTree.h index 32811919764..09ca34f35cf 100644 --- a/ReactCommon/fabric/uimanager/ShadowTree.h +++ b/ReactCommon/fabric/mounting/ShadowTree.h @@ -13,8 +13,8 @@ #include #include #include +#include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/ShadowTreeDelegate.h b/ReactCommon/fabric/mounting/ShadowTreeDelegate.h similarity index 100% rename from ReactCommon/fabric/uimanager/ShadowTreeDelegate.h rename to ReactCommon/fabric/mounting/ShadowTreeDelegate.h diff --git a/ReactCommon/fabric/uimanager/ShadowTreeRegistry.cpp b/ReactCommon/fabric/mounting/ShadowTreeRegistry.cpp similarity index 100% rename from ReactCommon/fabric/uimanager/ShadowTreeRegistry.cpp rename to ReactCommon/fabric/mounting/ShadowTreeRegistry.cpp diff --git a/ReactCommon/fabric/uimanager/ShadowTreeRegistry.h b/ReactCommon/fabric/mounting/ShadowTreeRegistry.h similarity index 97% rename from ReactCommon/fabric/uimanager/ShadowTreeRegistry.h rename to ReactCommon/fabric/mounting/ShadowTreeRegistry.h index 06549953c34..6f808d9aee1 100644 --- a/ReactCommon/fabric/uimanager/ShadowTreeRegistry.h +++ b/ReactCommon/fabric/mounting/ShadowTreeRegistry.h @@ -8,7 +8,7 @@ #include #include -#include +#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index e92abaaa1c8..359f3b9e2b4 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -57,11 +57,11 @@ rn_xplat_cxx_library( "fbsource//xplat/jsi:jsi", "fbsource//xplat/third-party/glog:glog", react_native_xplat_target("config:config"), - react_native_xplat_target("fabric/components/root:root"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/mounting:mounting"), react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("utils:utils"), ], ) diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index 37f2151cbcb..728bedcfa87 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -11,10 +11,10 @@ #include #include #include -#include #include #include #include +#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/Scheduler.h b/ReactCommon/fabric/uimanager/Scheduler.h index 6bad79fc144..4426eda9a66 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.h +++ b/ReactCommon/fabric/uimanager/Scheduler.h @@ -12,13 +12,13 @@ #include #include #include +#include +#include +#include #include #include #include #include -#include -#include -#include #include #include #include diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index 6c6c9552dfd..dc2df34ab85 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index 02fd1eda2f3..f8ccb65dd5b 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -8,8 +8,8 @@ #include #include +#include #include -#include #include namespace facebook { diff --git a/ReactCommon/fabric/uimanager/TimeUtils.h b/ReactCommon/utils/TimeUtils.h similarity index 100% rename from ReactCommon/fabric/uimanager/TimeUtils.h rename to ReactCommon/utils/TimeUtils.h