Skip to content

Commit

Permalink
Rename Executor to JSExecutor
Browse files Browse the repository at this point in the history
Summary:
* Cleanup some header files so we use more forward declarations
* Rename Executor to JSExecutor.h
* Move some typedefs to more appropriate locations

Reviewed By: mhorowitz

Differential Revision: D5301913

fbshipit-source-id: e75154797eb3f531d2f42a5e95409f4062b85f91
  • Loading branch information
javache authored and facebook-github-bot committed Jun 24, 2017
1 parent 6aea140 commit e2628f9
Show file tree
Hide file tree
Showing 31 changed files with 124 additions and 129 deletions.
2 changes: 1 addition & 1 deletion React/CxxBridge/RCTObjcExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#import <React/RCTDefines.h>
#import <React/RCTJavaScriptExecutor.h>
#include <cxxreact/Executor.h>
#import <cxxreact/JSExecutor.h>

namespace facebook {
namespace react {
Expand Down
5 changes: 3 additions & 2 deletions React/CxxBridge/RCTObjcExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#import <React/RCTLog.h>
#import <React/RCTProfile.h>
#import <React/RCTUtils.h>
#import <cxxreact/Executor.h>
#import <cxxreact/JSBigString.h>
#import <cxxreact/JSExecutor.h>
#import <cxxreact/MessageQueueThread.h>
#import <cxxreact/ModuleRegistry.h>
#import <folly/json.h>
Expand Down Expand Up @@ -91,7 +92,7 @@ void loadApplicationScript(
}

void setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle>) override {
RCTLogWarn(@"Unbundle is not supported in RCTObjcExecutor");
RCTAssert(NO, @"Unbundle is not supported in RCTObjcExecutor");
}

void callFunction(const std::string &module, const std::string &method,
Expand Down
20 changes: 10 additions & 10 deletions React/React.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
19F61C071E8495FF00571D81 /* Value.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B10D1E0369AD0018521A /* Value.h */; };
27595AA41E575C7800CCE2B1 /* CxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };
27595AA51E575C7800CCE2B1 /* CxxNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };
27595AA61E575C7800CCE2B1 /* Executor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* Executor.h */; };
27595AA61E575C7800CCE2B1 /* JSExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };
27595AA91E575C7800CCE2B1 /* Instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };
27595AAA1E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };
27595AAB1E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };
Expand All @@ -243,7 +243,7 @@
27595ABD1E575C7800CCE2B1 /* SystraceSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };
27595ABF1E575C7800CCE2B1 /* CxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };
27595AC01E575C7800CCE2B1 /* CxxNativeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };
27595AC11E575C7800CCE2B1 /* Executor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* Executor.h */; };
27595AC11E575C7800CCE2B1 /* JSExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };
27595AC41E575C7800CCE2B1 /* Instance.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };
27595AC51E575C7800CCE2B1 /* JsArgumentHelpers-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };
27595AC61E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };
Expand Down Expand Up @@ -794,7 +794,7 @@
3DA9819E1E5B0DBB004F2374 /* NSDataBigString.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7454B31E54786200E74ADD /* NSDataBigString.h */; };
3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };
3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };
3DA981A21E5B0E34004F2374 /* Executor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* Executor.h */; };
3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };
3DA981A51E5B0E34004F2374 /* Instance.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };
3DA981A61E5B0E34004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };
3DA981A71E5B0E34004F2374 /* JsArgumentHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };
Expand Down Expand Up @@ -933,7 +933,7 @@
3DA982391E5B0F8A004F2374 /* UIView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F15A171B7CC46900F10295 /* UIView+Private.h */; };
3DA9823B1E5B1053004F2374 /* CxxModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A71E03699D0018521A /* CxxModule.h */; };
3DA9823C1E5B1053004F2374 /* CxxNativeModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0A91E03699D0018521A /* CxxNativeModule.h */; };
3DA9823D1E5B1053004F2374 /* Executor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* Executor.h */; };
3DA9823D1E5B1053004F2374 /* JSExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AB1E03699D0018521A /* JSExecutor.h */; };
3DA982401E5B1053004F2374 /* Instance.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0AF1E03699D0018521A /* Instance.h */; };
3DA982411E5B1053004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */; };
3DA982421E5B1053004F2374 /* JsArgumentHelpers.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0B11E03699D0018521A /* JsArgumentHelpers.h */; };
Expand Down Expand Up @@ -1317,7 +1317,7 @@
files = (
3DA9823B1E5B1053004F2374 /* CxxModule.h in Copy Headers */,
3DA9823C1E5B1053004F2374 /* CxxNativeModule.h in Copy Headers */,
3DA9823D1E5B1053004F2374 /* Executor.h in Copy Headers */,
3DA9823D1E5B1053004F2374 /* JSExecutor.h in Copy Headers */,
3DA982401E5B1053004F2374 /* Instance.h in Copy Headers */,
3DA982411E5B1053004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */,
3DA982421E5B1053004F2374 /* JsArgumentHelpers.h in Copy Headers */,
Expand Down Expand Up @@ -1533,7 +1533,7 @@
files = (
3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */,
3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */,
3DA981A21E5B0E34004F2374 /* Executor.h in Copy Headers */,
3DA981A21E5B0E34004F2374 /* JSExecutor.h in Copy Headers */,
3DA981A51E5B0E34004F2374 /* Instance.h in Copy Headers */,
3DA981A61E5B0E34004F2374 /* JsArgumentHelpers-inl.h in Copy Headers */,
3DA981A71E5B0E34004F2374 /* JsArgumentHelpers.h in Copy Headers */,
Expand Down Expand Up @@ -1862,7 +1862,7 @@
3D92B0A71E03699D0018521A /* CxxModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CxxModule.h; sourceTree = "<group>"; };
3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CxxNativeModule.cpp; sourceTree = "<group>"; };
3D92B0A91E03699D0018521A /* CxxNativeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CxxNativeModule.h; sourceTree = "<group>"; };
3D92B0AB1E03699D0018521A /* Executor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Executor.h; sourceTree = "<group>"; };
3D92B0AB1E03699D0018521A /* JSExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExecutor.h; sourceTree = "<group>"; };
3D92B0AE1E03699D0018521A /* Instance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Instance.cpp; sourceTree = "<group>"; };
3D92B0AF1E03699D0018521A /* Instance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Instance.h; sourceTree = "<group>"; };
3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JsArgumentHelpers-inl.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2593,7 +2593,7 @@
3D92B0A71E03699D0018521A /* CxxModule.h */,
3D92B0A81E03699D0018521A /* CxxNativeModule.cpp */,
3D92B0A91E03699D0018521A /* CxxNativeModule.h */,
3D92B0AB1E03699D0018521A /* Executor.h */,
3D92B0AB1E03699D0018521A /* JSExecutor.h */,
3D92B0AE1E03699D0018521A /* Instance.cpp */,
3D92B0AF1E03699D0018521A /* Instance.h */,
3D92B0B01E03699D0018521A /* JsArgumentHelpers-inl.h */,
Expand Down Expand Up @@ -2852,7 +2852,7 @@
27595AD01E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */,
27595AD31E575C7800CCE2B1 /* ModuleRegistry.h in Headers */,
27595ACC1E575C7800CCE2B1 /* JSCPerfStats.h in Headers */,
27595AC11E575C7800CCE2B1 /* Executor.h in Headers */,
27595AC11E575C7800CCE2B1 /* JSExecutor.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2941,7 +2941,7 @@
27595AB51E575C7800CCE2B1 /* JSIndexedRAMBundle.h in Headers */,
27595AB81E575C7800CCE2B1 /* ModuleRegistry.h in Headers */,
27595AB11E575C7800CCE2B1 /* JSCPerfStats.h in Headers */,
27595AA61E575C7800CCE2B1 /* Executor.h in Headers */,
27595AA61E575C7800CCE2B1 /* JSExecutor.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
16 changes: 7 additions & 9 deletions ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
#include <mutex>
#include <condition_variable>

#include <folly/dynamic.h>
#include <folly/Memory.h>

#include <fb/log.h>

#include <jni/Countable.h>
#include <jni/LocalReference.h>

#include <cxxreact/CxxNativeModule.h>
#include <cxxreact/Instance.h>
#include <cxxreact/JSBigString.h>
#include <cxxreact/JSBundleType.h>
#include <cxxreact/JSIndexedRAMBundle.h>
#include <cxxreact/MethodCall.h>
#include <cxxreact/RecoverableError.h>
#include <cxxreact/ModuleRegistry.h>
#include <cxxreact/CxxNativeModule.h>
#include <fb/log.h>
#include <folly/dynamic.h>
#include <folly/Memory.h>
#include <jni/Countable.h>
#include <jni/LocalReference.h>

#include "CxxModuleWrapper.h"
#include "JavaScriptExecutorHolder.h"
Expand Down
8 changes: 5 additions & 3 deletions ReactAndroid/src/main/jni/react/jni/JSLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

#include "JSLoader.h"

#include <folly/Conv.h>
#include <folly/Memory.h>
#include <android/asset_manager_jni.h>
#include <cxxreact/JSBigString.h>
#include <fb/fbjni.h>
#include <fb/log.h>
#include <folly/Conv.h>
#include <folly/Memory.h>
#include <fstream>
#include <sstream>
#include <streambuf>
#include <string>
#include <fb/log.h>

#ifdef WITH_FBSYSTRACE
#include <fbsystrace.h>
using fbsystrace::FbSystraceSection;
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/jni/JSLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string>

#include <android/asset_manager.h>
#include <cxxreact/Executor.h>
#include <cxxreact/JSExecutor.h>
#include <fb/fbjni.h>

namespace facebook {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

#include <memory>

#include <cxxreact/JSExecutor.h>
#include <fb/fbjni.h>

#include <cxxreact/Executor.h>

namespace facebook {
namespace react {

Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/jni/MethodInvoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include <vector>

#include <cxxreact/JSExecutor.h>
#include <fb/fbjni.h>
#include <folly/dynamic.h>
#include <cxxreact/Executor.h>

namespace facebook {
namespace react {
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/src/main/jni/react/jni/OnLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include <string>

#include <cxxreact/Executor.h>
#include <jschelpers/JSCHelpers.h>
#include <cxxreact/JSExecutor.h>
#include <cxxreact/JSCExecutor.h>
#include <cxxreact/Platform.h>
#include <jschelpers/JSCHelpers.h>
#include <fb/fbjni.h>
#include <fb/glog_init.h>
#include <fb/log.h>
Expand Down
3 changes: 1 addition & 2 deletions ReactAndroid/src/main/jni/react/jni/OnLoad.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#pragma once

#include <jni.h>
#include <jni/Countable.h>
#include <cxxreact/Executor.h>

namespace facebook {
namespace react {

jmethodID getLogMarkerMethod();

} // namespace react
} // namespace facebook
10 changes: 5 additions & 5 deletions ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

#include "ProxyExecutor.h"

#include <cxxreact/JSBigString.h>
#include <cxxreact/ModuleRegistry.h>
#include <cxxreact/SystraceSection.h>
#include <fb/assert.h>
#include <fb/Environment.h>
#include <jni/LocalReference.h>
#include <jni/LocalString.h>
#include <folly/json.h>
#include <folly/Memory.h>

#include <cxxreact/SystraceSection.h>
#include <cxxreact/ModuleRegistry.h>
#include <jni/LocalReference.h>
#include <jni/LocalString.h>

namespace facebook {
namespace react {
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma once

#include <cxxreact/Executor.h>
#include <cxxreact/JSExecutor.h>
#include <fb/fbjni.h>
#include <jni.h>
#include <jni/GlobalReference.h>
Expand Down
38 changes: 19 additions & 19 deletions ReactCommon/cxxreact/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if THIS_IS_FBOBJC:

rn_xplat_cxx_library(
name = "module",
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
header_namespace = "",
exported_headers = subdir_glob(
[
("", "CxxModule.h"),
Expand All @@ -20,8 +20,8 @@ rn_xplat_cxx_library(
],
prefix = "cxxreact",
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
force_static = True,
header_namespace = "",
visibility = [
"PUBLIC",
],
Expand All @@ -36,16 +36,16 @@ rn_xplat_cxx_library(
srcs = [
"JSBigString.cpp",
],
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
header_namespace = "",
exported_headers = subdir_glob(
[("", "JSBigString.h")],
prefix = "cxxreact",
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
force_static = True,
header_namespace = "",
visibility = [
"PUBLIC",
],
Expand All @@ -58,12 +58,12 @@ rn_xplat_cxx_library(
rn_xplat_cxx_library(
name = "samplemodule",
srcs = ["SampleCxxModule.cpp"],
header_namespace = "",
exported_headers = ["SampleCxxModule.h"],
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fno-omit-frame-pointer",
"-fexceptions",
],
exported_headers = ["SampleCxxModule.h"],
header_namespace = "",
soname = "libxplat_react_module_samplemodule.so",
visibility = [
"PUBLIC",
Expand All @@ -77,9 +77,9 @@ rn_xplat_cxx_library(

CXXREACT_PUBLIC_HEADERS = [
"CxxNativeModule.h",
"Executor.h",
"Instance.h",
"JSBundleType.h",
"JSExecutor.h",
"JSCExecutor.h",
"JSCNativeModules.h",
"JSIndexedRAMBundle.h",
Expand All @@ -104,17 +104,22 @@ rn_xplat_cxx_library(
"SampleCxxModule.cpp",
],
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
headers = glob(
["*.h"],
excludes = CXXREACT_PUBLIC_HEADERS,
),
header_namespace = "",
exported_headers = dict([
(
"cxxreact/%s" % header,
header,
)
for header in CXXREACT_PUBLIC_HEADERS
]),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
fbandroid_preprocessor_flags = [
"-DWITH_JSC_EXTRA_TRACING=1",
"-DWITH_JSC_MEMORY_PRESSURE=1",
Expand Down Expand Up @@ -144,11 +149,6 @@ rn_xplat_cxx_library(
fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS,
fbobjc_visibility = ["PUBLIC"],
force_static = True,
header_namespace = "",
headers = glob(
["*.h"],
excludes = CXXREACT_PUBLIC_HEADERS,
),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
Expand Down
Loading

0 comments on commit e2628f9

Please sign in to comment.