Skip to content

Commit

Permalink
Introducing fabric/mounting module
Browse files Browse the repository at this point in the history
Summary:
ShadowView, ShadowViewMutation, and Differentiator were decoupled to separate module.
That enables us to use ShadowView more widely without facing a circular dependency problem.

Reviewed By: mdvacca

Differential Revision: D13205229

fbshipit-source-id: 7373864bf153a7813c2f97edb263a41454ce0b88
  • Loading branch information
shergin authored and facebook-github-bot committed Nov 28, 2018
1 parent 28c3981 commit 62173a1
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 11 deletions.
4 changes: 2 additions & 2 deletions React/Fabric/Mounting/RCTMountingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#import <UIKit/UIKit.h>

#import <react/core/ReactPrimitives.h>
#import <react/uimanager/ShadowView.h>
#import <react/uimanager/ShadowViewMutation.h>
#import <react/mounting/ShadowView.h>
#import <react/mounting/ShadowViewMutation.h>
#import <React/RCTPrimitives.h>
#import <React/RCTMountingManagerDelegate.h>

Expand Down
2 changes: 1 addition & 1 deletion React/Fabric/RCTScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import <React/RCTPrimitives.h>
#import <react/core/LayoutConstraints.h>
#import <react/core/LayoutContext.h>
#import <react/uimanager/ShadowViewMutation.h>
#import <react/mounting/ShadowViewMutation.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions ReactCommon/fabric/imagemanager/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ rn_xplat_cxx_library(
"xplat//third-party/glog:glog",
"xplat//yoga:yoga",
react_native_xplat_target("fabric/core:core"),
react_native_xplat_target("fabric/mounting:mounting"),
react_native_xplat_target("fabric/debug:debug"),
react_native_xplat_target("fabric/graphics:graphics"),
],
Expand Down
82 changes: 82 additions & 0 deletions ReactCommon/fabric/mounting/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_debug_preprocessor_flags")
load(
"//tools/build_defs/oss:rn_defs.bzl",
"ANDROID",
"APPLE",
"fb_xplat_cxx_test",
"get_apple_compiler_flags",
"get_apple_inspector_flags",
"react_native_xplat_target",
"rn_xplat_cxx_library",
"subdir_glob",
)

APPLE_COMPILER_FLAGS = get_apple_compiler_flags()

rn_xplat_cxx_library(
name = "mounting",
srcs = glob(
["**/*.cpp"],
exclude = glob(["tests/**/*.cpp"]),
),
headers = glob(
["**/*.h"],
exclude = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
[
("", "*.h"),
],
prefix = "react/mounting",
),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
fbobjc_tests = [
":tests",
],
force_static = True,
macosx_tests_override = [],
platforms = (ANDROID, APPLE),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [],
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/debug:debug"),
react_native_xplat_target("fabric/events:events"),
],
)

fb_xplat_cxx_test(
name = "tests",
srcs = glob(["tests/**/*.cpp"]),
headers = glob(["tests/**/*.h"]),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
platforms = (ANDROID, APPLE),
deps = [
"xplat//folly:molly",
"xplat//third-party/gmock:gtest",
":mounting",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#pragma once

#include <react/core/ShadowNode.h>
#include <react/uimanager/ShadowViewMutation.h>
#include <react/mounting/ShadowViewMutation.h>

namespace facebook {
namespace react {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <vector>

#include <react/uimanager/ShadowView.h>
#include <react/mounting/ShadowView.h>

namespace facebook {
namespace react {
Expand Down
14 changes: 14 additions & 0 deletions ReactCommon/fabric/mounting/tests/MountingTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#include <memory>

#include <gtest/gtest.h>

TEST(MountingTest, testSomething) {
// TODO
}
1 change: 1 addition & 0 deletions ReactCommon/fabric/uimanager/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rn_xplat_cxx_library(
"xplat//third-party/glog:glog",
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("fabric/events:events"),
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/fabric/uimanager/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <react/uimanager/UITemplateProcessor.h>

#include "ComponentDescriptorFactory.h"
#include "Differentiator.h"

namespace facebook {
namespace react {
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/fabric/uimanager/SchedulerDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <react/core/ReactPrimitives.h>
#include <react/core/ShadowNode.h>
#include <react/uimanager/ShadowViewMutation.h>
#include <react/mounting/ShadowViewMutation.h>

namespace facebook {
namespace react {
Expand Down
4 changes: 2 additions & 2 deletions ReactCommon/fabric/uimanager/ShadowTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#include <react/core/LayoutContext.h>
#include <react/core/LayoutPrimitives.h>
#include <react/mounting/Differentiator.h>
#include <react/mounting/ShadowViewMutation.h>

#include "Differentiator.h"
#include "ShadowTreeDelegate.h"
#include "ShadowViewMutation.h"

namespace facebook {
namespace react {
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/fabric/uimanager/ShadowTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <react/core/LayoutConstraints.h>
#include <react/core/ReactPrimitives.h>
#include <react/core/ShadowNode.h>
#include <react/mounting/ShadowViewMutation.h>
#include <react/uimanager/ShadowTreeDelegate.h>
#include <react/uimanager/ShadowViewMutation.h>

namespace facebook {
namespace react {
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/fabric/uimanager/ShadowTreeDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include <react/uimanager/ShadowViewMutation.h>
#include <react/mounting/ShadowViewMutation.h>

namespace facebook {
namespace react {
Expand Down

0 comments on commit 62173a1

Please sign in to comment.