Fabric: events module was merged into core module

Summary: That's bummer that we have to do it, but it's actually reasonable. Files in `core` and `events` depend on each other creating circular dependencies and other similar hard problem.

Reviewed By: mdvacca

Differential Revision: D14195022

fbshipit-source-id: 96a44ae28631cc9ccd7d7de72a94526f9e0dd12a
This commit is contained in:
Valentin Shergin
2019-02-25 19:07:19 -08:00
committed by Facebook Github Bot
parent 4cf70306b9
commit 9a64755a18
44 changed files with 38 additions and 133 deletions

View File

@@ -12,9 +12,9 @@
#import <React/UIView+ComponentViewProtocol.h>
#import <react/components/view/ViewEventEmitter.h>
#import <react/components/view/ViewProps.h>
#import <react/core/EventEmitter.h>
#import <react/core/LayoutMetrics.h>
#import <react/core/Props.h>
#import <react/events/EventEmitter.h>
NS_ASSUME_NONNULL_BEGIN

View File

@@ -9,7 +9,7 @@
#import <React/RCTMountItemProtocol.h>
#import <React/RCTPrimitives.h>
#import <react/events/EventEmitter.h>
#import <react/core/EventEmitter.h>
NS_ASSUME_NONNULL_BEGIN

View File

@@ -8,10 +8,10 @@
#import <UIKit/UIKit.h>
#import <React/RCTPrimitives.h>
#import <react/core/EventEmitter.h>
#import <react/core/LayoutMetrics.h>
#import <react/core/LocalData.h>
#import <react/core/Props.h>
#import <react/events/EventEmitter.h>
NS_ASSUME_NONNULL_BEGIN

View File

@@ -7,7 +7,7 @@
#include <CoreFoundation/CFRunLoop.h>
#include <CoreFoundation/CoreFoundation.h>
#include <react/events/EventBeat.h>
#include <react/core/EventBeat.h>
#include <react/uimanager/primitives.h>
namespace facebook {

View File

@@ -7,7 +7,7 @@
#include <CoreFoundation/CFRunLoop.h>
#include <CoreFoundation/CoreFoundation.h>
#include <react/events/EventBeat.h>
#include <react/core/EventBeat.h>
#include <react/uimanager/primitives.h>
namespace facebook {

View File

@@ -5,7 +5,7 @@
#pragma once
#include <jsi/jsi.h>
#include <react/events/EventBeat.h>
#include <react/core/EventBeat.h>
#include "EventBeatManager.h"
namespace facebook {

View File

@@ -13,8 +13,8 @@
#include <jsi/jsi.h>
#include <react/components/scrollview/ScrollViewProps.h>
#include <react/debug/SystraceSection.h>
#include <react/events/EventBeat.h>
#include <react/events/EventEmitter.h>
#include <react/core/EventBeat.h>
#include <react/core/EventEmitter.h>
#include <react/uimanager/ComponentDescriptorFactory.h>
#include <react/uimanager/ContextContainer.h>
#include <react/uimanager/Scheduler.h>

View File

@@ -6,7 +6,7 @@
#include <fb/fbjni.h>
#include <jsi/jsi.h>
#include <react/events/EventBeat.h>
#include <react/core/EventBeat.h>
#include <mutex>
#include <unordered_set>

View File

@@ -5,7 +5,7 @@
#pragma once
#include <fb/fbjni.h>
#include <react/events/EventEmitter.h>
#include <react/core/EventEmitter.h>
#include <react/jni/ReadableNativeMap.h>
namespace facebook {

View File

@@ -10,7 +10,7 @@
#include <folly/dynamic.h>
#include <react/components/view/ViewEventEmitter.h>
#include <react/events/EventEmitter.h>
#include <react/core/EventEmitter.h>
#include <react/graphics/Geometry.h>
namespace facebook {

View File

@@ -6,9 +6,9 @@
*/
#pragma once
#include <react/core/EventEmitter.h>
#include <react/core/LayoutMetrics.h>
#include <react/core/ReactPrimitives.h>
#include <react/events/EventEmitter.h>
namespace facebook {
namespace react {

View File

@@ -47,10 +47,11 @@ rn_xplat_cxx_library(
"fbsource//xplat/folly:headers_only",
"fbsource//xplat/folly:memory",
"fbsource//xplat/folly:molly",
"fbsource//xplat/jsi:JSIDynamic",
"fbsource//xplat/jsi:jsi",
"fbsource//xplat/third-party/glog:glog",
react_native_xplat_target("utils:utils"),
react_native_xplat_target("fabric/debug:debug"),
react_native_xplat_target("fabric/events:events"),
react_native_xplat_target("fabric/graphics:graphics"),
],
)

View File

@@ -11,10 +11,10 @@
#include <memory>
#include <react/core/ComponentDescriptor.h>
#include <react/core/EventDispatcher.h>
#include <react/core/Props.h>
#include <react/core/ShadowNode.h>
#include <react/core/ShadowNodeFragment.h>
#include <react/events/EventDispatcher.h>
namespace facebook {
namespace react {

View File

@@ -7,7 +7,7 @@
#pragma once
#include <react/events/EventQueue.h>
#include <react/core/EventQueue.h>
namespace facebook {
namespace react {

View File

@@ -11,7 +11,7 @@
#include <mutex>
#include <vector>
#include <react/events/EventBeat.h>
#include <react/core/EventBeat.h>
namespace facebook {
namespace react {

View File

@@ -9,11 +9,11 @@
#include <array>
#include <memory>
#include <react/events/EventBeat.h>
#include <react/events/EventPipe.h>
#include <react/events/EventPriority.h>
#include <react/events/EventQueue.h>
#include <react/events/RawEvent.h>
#include <react/core/EventBeat.h>
#include <react/core/EventPipe.h>
#include <react/core/EventPriority.h>
#include <react/core/EventQueue.h>
#include <react/core/RawEvent.h>
namespace facebook {
namespace react {

View File

@@ -10,9 +10,9 @@
#include <mutex>
#include <folly/dynamic.h>
#include <react/events/EventDispatcher.h>
#include <react/events/EventPriority.h>
#include <react/events/EventTarget.h>
#include <react/core/EventDispatcher.h>
#include <react/core/EventPriority.h>
#include <react/core/EventTarget.h>
namespace facebook {
namespace react {

View File

@@ -11,8 +11,8 @@
#include <string>
#include <jsi/jsi.h>
#include <react/events/EventTarget.h>
#include <react/events/ValueFactory.h>
#include <react/core/EventTarget.h>
#include <react/core/ValueFactory.h>
namespace facebook {
namespace react {

View File

@@ -12,9 +12,9 @@
#include <vector>
#include <jsi/jsi.h>
#include <react/events/EventBeat.h>
#include <react/events/EventPipe.h>
#include <react/events/RawEvent.h>
#include <react/core/EventBeat.h>
#include <react/core/EventPipe.h>
#include <react/core/RawEvent.h>
namespace facebook {
namespace react {

View File

@@ -9,8 +9,8 @@
#include <memory>
#include <string>
#include <react/events/EventTarget.h>
#include <react/events/ValueFactory.h>
#include <react/core/EventTarget.h>
#include <react/core/ValueFactory.h>
namespace facebook {
namespace react {

View File

@@ -7,7 +7,7 @@
#pragma once
#include <react/events/EventQueue.h>
#include <react/core/EventQueue.h>
namespace facebook {
namespace react {

View File

@@ -11,12 +11,12 @@
#include <string>
#include <vector>
#include <react/core/EventEmitter.h>
#include <react/core/LocalData.h>
#include <react/core/Props.h>
#include <react/core/ReactPrimitives.h>
#include <react/core/Sealable.h>
#include <react/debug/DebugStringConvertible.h>
#include <react/events/EventEmitter.h>
namespace facebook {
namespace react {

View File

@@ -7,11 +7,11 @@
#pragma once
#include <react/core/EventEmitter.h>
#include <react/core/LocalData.h>
#include <react/core/Props.h>
#include <react/core/ReactPrimitives.h>
#include <react/core/ShadowNode.h>
#include <react/events/EventEmitter.h>
namespace facebook {
namespace react {

View File

@@ -1,80 +0,0 @@
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 = "events",
srcs = glob(
["**/*.cpp"],
exclude = glob(["tests/**/*.cpp"]),
),
headers = glob(
["**/*.h"],
exclude = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
[
("", "*.h"),
],
prefix = "react/events",
),
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(),
force_static = True,
macosx_tests_override = [],
platforms = (ANDROID, APPLE),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
# Systraces are temporary disabled.
# "-DWITH_FBSYSTRACE=1",
],
tests = [":tests"],
visibility = ["PUBLIC"],
deps = [
"fbsource//xplat/fbsystrace:fbsystrace",
"fbsource//xplat/folly:headers_only",
"fbsource//xplat/folly:memory",
"fbsource//xplat/folly:molly",
"fbsource//xplat/jsi:JSIDynamic",
"fbsource//xplat/jsi:jsi",
"fbsource//xplat/third-party/glog:glog",
react_native_xplat_target("fabric/debug:debug"),
],
)
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 = [
"fbsource//xplat/folly:molly",
"fbsource//xplat/third-party/gmock:gtest",
":events",
],
)

View File

@@ -1,14 +0,0 @@
/**
* 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(EventsTest, testSomething) {
// TODO
}

View File

@@ -57,7 +57,6 @@ rn_xplat_cxx_library(
react_native_xplat_target("better:better"),
react_native_xplat_target("fabric/core:core"),
react_native_xplat_target("fabric/debug:debug"),
react_native_xplat_target("fabric/events:events"),
],
)

View File

@@ -6,12 +6,12 @@
#pragma once
#include <folly/Hash.h>
#include <react/core/EventEmitter.h>
#include <react/core/LayoutMetrics.h>
#include <react/core/LocalData.h>
#include <react/core/Props.h>
#include <react/core/ReactPrimitives.h>
#include <react/core/ShadowNode.h>
#include <react/events/EventEmitter.h>
namespace facebook {
namespace react {

View File

@@ -62,7 +62,6 @@ rn_xplat_cxx_library(
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"),
],
)

View File

@@ -10,7 +10,7 @@
#include <memory>
#include <react/core/ComponentDescriptor.h>
#include <react/events/EventDispatcher.h>
#include <react/core/EventDispatcher.h>
#include <react/uimanager/ContextContainer.h>
#include "ComponentDescriptorRegistry.h"

View File

@@ -5,8 +5,8 @@
#include <folly/dynamic.h>
#include <jsi/JSIDynamic.h>
#include <jsi/jsi.h>
#include <react/core/EventHandler.h>
#include <react/core/ShadowNode.h>
#include <react/events/EventHandler.h>
namespace facebook {
namespace react {