-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract ComponentNameRegistry out of Fabric modules
Summary: This diff extracts ComponentNameRegistry out of Fabric modules This is necessary to avoid depending on Fabric and regressing APK size for other RN apps (e.g. IG) changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D26765328 fbshipit-source-id: 0a22c4279146f5243473c74a84e78fad7f08f956
- Loading branch information
1 parent
056f1fd
commit fca0442
Showing
14 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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. | ||
|
||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := uimanagerjni | ||
|
||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) | ||
|
||
LOCAL_SHARED_LIBRARIES := libyoga libglog libfb libfbjni libglog_init libfolly_json libfolly_futures react_render_componentregistry librrc_native | ||
|
||
LOCAL_STATIC_LIBRARIES := | ||
|
||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ | ||
|
||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ | ||
|
||
LOCAL_CFLAGS := \ | ||
-DLOG_TAG=\"ReacTNative\" | ||
|
||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall | ||
|
||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
$(call import-module,fbgloginit) | ||
$(call import-module,folly) | ||
$(call import-module,fb) | ||
$(call import-module,fbjni) | ||
$(call import-module,yogajni) | ||
$(call import-module,glog) | ||
|
||
$(call import-module,react/renderer/componentregistry) | ||
$(call import-module,react/renderer/componentregistry/native) |
41 changes: 41 additions & 0 deletions
41
ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/BUCK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "FBJNI_TARGET", "react_native_target", "react_native_xplat_target", "rn_xplat_cxx_library", "subdir_glob") | ||
|
||
rn_xplat_cxx_library( | ||
name = "jni", | ||
srcs = glob(["*.cpp"]), | ||
headers = glob(["*.h"]), | ||
header_namespace = "", | ||
exported_headers = subdir_glob( | ||
[ | ||
("", "**/*.h"), | ||
], | ||
prefix = "react/uimanager/jni", | ||
), | ||
compiler_flags = [ | ||
"-fexceptions", | ||
"-frtti", | ||
"-std=c++14", | ||
"-Wall", | ||
], | ||
fbandroid_allow_jni_merging = True, | ||
labels = ["supermodule:xplat/default/public.react_native.infra"], | ||
platforms = (ANDROID), | ||
preprocessor_flags = [ | ||
"-DLOG_TAG=\"ReactNative\"", | ||
"-DWITH_FBSYSTRACE=1", | ||
], | ||
soname = "libuimanagerjni.$(ext)", | ||
visibility = ["PUBLIC"], | ||
deps = [ | ||
react_native_xplat_target("runtimeexecutor:runtimeexecutor"), | ||
react_native_xplat_target("react/renderer/componentregistry:componentregistry"), | ||
react_native_xplat_target("react/renderer/componentregistry/native:native"), | ||
react_native_target("jni/react/jni:jni"), | ||
"//xplat/fbsystrace:fbsystrace", | ||
"//xplat/folly:molly", | ||
"//xplat/jsi:JSIDynamic", | ||
"//xplat/jsi:jsi", | ||
"//xplat/third-party/linker_lib:atomic", | ||
FBJNI_TARGET, | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/OnLoad.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* 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 <fbjni/fbjni.h> | ||
|
||
#include "ComponentNameResolverManager.h" | ||
|
||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { | ||
return facebook::jni::initialize(vm, [] { | ||
facebook::react::ComponentNameResolverManager::registerNatives(); | ||
}); | ||
} |
29 changes: 29 additions & 0 deletions
29
ReactCommon/react/renderer/componentregistry/native/Android.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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. | ||
|
||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := rrc_native | ||
|
||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../ | ||
|
||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) | ||
|
||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../ | ||
|
||
LOCAL_SHARED_LIBRARIES := libjsi libfolly_futures libfolly_json libreact_render_core libreact_render_debug libreact_utils libglog_init libreact_debug | ||
|
||
LOCAL_CFLAGS := \ | ||
-DLOG_TAG=\"Fabric\" | ||
|
||
LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall | ||
|
||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
$(call import-module,fbgloginit) | ||
$(call import-module,folly) | ||
$(call import-module,jsi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
load( | ||
"//tools/build_defs/oss:rn_defs.bzl", | ||
"ANDROID", | ||
"APPLE", | ||
"CXX", | ||
"get_apple_compiler_flags", | ||
"get_apple_inspector_flags", | ||
"get_preprocessor_flags_for_build_mode", | ||
"rn_xplat_cxx_library", | ||
"subdir_glob", | ||
) | ||
|
||
APPLE_COMPILER_FLAGS = get_apple_compiler_flags() | ||
|
||
rn_xplat_cxx_library( | ||
name = "native", | ||
srcs = glob( | ||
["**/*.cpp"], | ||
exclude = glob(["tests/**/*.cpp"]), | ||
), | ||
headers = glob( | ||
["**/*.h"], | ||
exclude = glob(["tests/**/*.h"]), | ||
), | ||
header_namespace = "", | ||
exported_headers = subdir_glob( | ||
[ | ||
("", "*.h"), | ||
], | ||
prefix = "react/renderer/componentregistry/native", | ||
), | ||
compiler_flags = [ | ||
"-fexceptions", | ||
"-frtti", | ||
"-std=c++14", | ||
"-Wall", | ||
], | ||
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, | ||
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), | ||
force_static = True, | ||
labels = ["supermodule:xplat/default/public.react_native.infra"], | ||
macosx_tests_override = [], | ||
platforms = (ANDROID, APPLE, CXX), | ||
preprocessor_flags = [ | ||
"-DLOG_TAG=\"ReactNative\"", | ||
"-DWITH_FBSYSTRACE=1", | ||
], | ||
visibility = ["PUBLIC"], | ||
deps = [ | ||
"//third-party/glog:glog", | ||
"//xplat/fbsystrace:fbsystrace", | ||
"//xplat/folly:headers_only", | ||
"//xplat/folly:memory", | ||
"//xplat/folly:molly", | ||
"//xplat/jsi:JSIDynamic", | ||
"//xplat/jsi:jsi", | ||
], | ||
) |
File renamed without changes.
File renamed without changes.