From 4cda0df2e516a3680ea0fdbd8b503ce34a794a74 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 18 Mar 2018 19:04:30 -0700 Subject: [PATCH] Switching to the new FabricUIManager and all new shadow tree infra Reviewed By: fkgozali Differential Revision: D7230670 fbshipit-source-id: bca7d2859b87931c0d15406782b7d689de1d8c36 --- .../RCTFabricPlatformUIOperationManager.h | 2 +- React/Fabric/RCTFabricUIManagerWrapper.mm | 6 ++- ReactCommon/fabric/BUCK | 46 ------------------- ReactCommon/fabric/uimanager/BUCK | 3 +- .../fabric/uimanager/FabricUIManager.cpp | 6 ++- 5 files changed, 13 insertions(+), 50 deletions(-) delete mode 100644 ReactCommon/fabric/BUCK diff --git a/React/Fabric/RCTFabricPlatformUIOperationManager.h b/React/Fabric/RCTFabricPlatformUIOperationManager.h index 2043959760e..fe6c89ea21b 100644 --- a/React/Fabric/RCTFabricPlatformUIOperationManager.h +++ b/React/Fabric/RCTFabricPlatformUIOperationManager.h @@ -10,7 +10,7 @@ #import -#include +#include @class RCTFabricPlatformUIOperationManager; diff --git a/React/Fabric/RCTFabricUIManagerWrapper.mm b/React/Fabric/RCTFabricUIManagerWrapper.mm index 892669145d0..811aa8d0ad8 100644 --- a/React/Fabric/RCTFabricUIManagerWrapper.mm +++ b/React/Fabric/RCTFabricUIManagerWrapper.mm @@ -7,7 +7,11 @@ #import "RCTFabricUIManagerWrapper.h" -#include +#include + +#include +#include + #import "RCTFabricPlatformUIOperationManager.h" diff --git a/ReactCommon/fabric/BUCK b/ReactCommon/fabric/BUCK deleted file mode 100644 index 62a6c5ccab5..00000000000 --- a/ReactCommon/fabric/BUCK +++ /dev/null @@ -1,46 +0,0 @@ -load("//configurations/buck/apple:flag_defs.bzl", "get_debug_preprocessor_flags") -load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "react_native_xplat_target", "rn_xplat_cxx_library", "APPLE_INSPECTOR_FLAGS") - -APPLE_COMPILER_FLAGS = [] - -if not IS_OSS_BUILD: - load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_static_library_ios_flags", "flags") - APPLE_COMPILER_FLAGS = flags.get_flag_value(get_static_library_ios_flags(), 'compiler_flags') - -rn_xplat_cxx_library( - name = "fabric", - srcs = glob(["*.cpp"]), - header_namespace = "", - exported_headers = subdir_glob( - [ - ("", "*.h"), - ], - prefix = "fabric", - ), - compiler_flags = [ - "-fexceptions", - "-frtti", - "-std=c++14", - "-Wall", - ], - fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, - fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + APPLE_INSPECTOR_FLAGS, - force_static = True, - preprocessor_flags = [ - "-DLOG_TAG=\"ReactNative\"", - "-DWITH_FBSYSTRACE=1", - ], - visibility = [ - "PUBLIC", - ], - deps = [ - "xplat//fbsystrace:fbsystrace", - "xplat//folly:headers_only", - "xplat//folly:memory", - "xplat//folly:molly", - "xplat//third-party/glog:glog", - react_native_xplat_target("fabric/core:core"), - react_native_xplat_target("fabric/uimanager:uimanager"), - react_native_xplat_target("fabric/view:view"), - ], -) diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index 8b3e3ad6b73..dc7939377d9 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -46,7 +46,8 @@ rn_xplat_cxx_library( "xplat//folly:memory", "xplat//folly:molly", "xplat//third-party/glog:glog", - react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), + react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("fabric/view:view"), ], ) diff --git a/ReactCommon/fabric/uimanager/FabricUIManager.cpp b/ReactCommon/fabric/uimanager/FabricUIManager.cpp index d3576248253..14adad47c8c 100644 --- a/ReactCommon/fabric/uimanager/FabricUIManager.cpp +++ b/ReactCommon/fabric/uimanager/FabricUIManager.cpp @@ -7,6 +7,8 @@ #include "FabricUIManager.h" +#include + #include #include #include @@ -97,12 +99,14 @@ void FabricUIManager::completeRoot(int rootTag, const SharedShadowNodeUnsharedLi LayoutContext layoutContext = LayoutContext(); layoutContext.affectedShadowNodes = std::make_shared>(); + LOG(INFO) << "Shadow tree *before* layout: \n" << viewShadowNode->getDebugDescription() ; + auto nonConstViewShadowNode = std::const_pointer_cast(viewShadowNode); nonConstViewShadowNode->layout(layoutContext); rootShadowNode->sealRecursive(); - printf("## layouted rootShadowNode: %s \n", nonConstViewShadowNode->getDebugDescription(0).c_str()); + LOG(INFO) << "Shadow tree *after* layout: \n" << nonConstViewShadowNode->getDebugDescription(); } } // namespace react