Move RCTImage NativeModules back to RCTImage

Summary: In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`.

Reviewed By: PeteTheHeat

Differential Revision: D17720575

fbshipit-source-id: 44b07cfa07cbb2b87254132810f86974edc7edab
This commit is contained in:
Ramanpreet Nara 2019-10-09 12:24:51 -07:00 коммит произвёл Facebook Github Bot
Родитель 2a3fa968b4
Коммит 3aa8a40659
14 изменённых файлов: 88 добавлений и 10 удалений

Просмотреть файл

Просмотреть файл

@ -20,7 +20,7 @@
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import "CoreModulesPlugins.h"
#import "RCTImagePlugins.h"
static NSInteger RCTImageBytesForImage(UIImage *image)
{

Просмотреть файл

@ -0,0 +1,40 @@
/**
* 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.
*
* @generated by an internal plugin build system
*/
#ifdef RN_DISABLE_OSS_PLUGIN_HEADER
// FB Internal: FBRCTImagePlugins.h is autogenerated by the build system.
#import "FBRCTImagePlugins.h"
#else
// OSS-compatibility layer
#import <Foundation/Foundation.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#ifdef __cplusplus
extern "C" {
#endif
// RCTTurboModuleManagerDelegate should call this to resolve module classes.
Class RCTImageClassProvider(const char *name);
// Lookup functions
Class RCTImageLoaderCls(void) __attribute__((used));
#ifdef __cplusplus
}
#endif
#pragma GCC diagnostic pop
#endif // RN_DISABLE_OSS_PLUGIN_HEADER

Просмотреть файл

@ -0,0 +1,32 @@
/**
* 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.
*
* @generated by an internal plugin build system
*/
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
// OSS-compatibility layer
#import "RCTImagePlugins.h"
#import <string>
#import <unordered_map>
Class RCTImageClassProvider(const char *name) {
static std::unordered_map<std::string, Class (*)(void)> sCoreModuleClassMap = {
{"ImageLoader", RCTImageLoaderCls},
};
auto p = sCoreModuleClassMap.find(name);
if (p != sCoreModuleClassMap.end()) {
auto classFunc = p->second;
return classFunc();
}
return nil;
}
#endif // RN_DISABLE_OSS_PLUGIN_HEADER

Просмотреть файл

@ -17,6 +17,9 @@ else
source[:tag] = "v#{version}"
end
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2018.10.22.00'
Pod::Spec.new do |s|
s.name = "React-RCTImage"
s.version = version
@ -26,11 +29,19 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m}"
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "RCTImage"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Folly\""
}
s.dependency "Folly", folly_version
s.dependency "FBReactNativeSpec", version
s.dependency "React-Core/RCTImageHeaders", version
s.dependency "React-RCTNetwork", version
end

Просмотреть файл

@ -212,6 +212,8 @@ PODS:
- React-jsi (= 1000.0.0)
- React-RCTNetwork (= 1000.0.0)
- React-RCTImage (1000.0.0):
- FBReactNativeSpec (= 1000.0.0)
- Folly (= 2018.10.22.00)
- React-Core/RCTImageHeaders (= 1000.0.0)
- React-RCTNetwork (= 1000.0.0)
- React-RCTLinking (1000.0.0):
@ -372,7 +374,7 @@ SPEC CHECKSUMS:
React-RCTActionSheet: 090e7bd7c5774d919c47c4eeff78223a7fd8c19c
React-RCTAnimation: 73d536fff417a101724d9529189c95a94263710c
React-RCTBlob: acd519b1d6ec5d66f98b7cf8e70d0cd76642426f
React-RCTImage: 7f5c9bff34905f1bc216be512ba0ae68f872208a
React-RCTImage: 4d2a090c491e29665f27f87c58feb4dfcb2f4cfa
React-RCTLinking: d7d7f792e63a8d57380cecbb9b7a3b31f92d1bb6
React-RCTNetwork: c8f9d40297f35ea3792ea81866f33e8b45c25935
React-RCTPushNotification: acffa8af6a20e6d41b041a8c4cb4bea0de9df0dd

Просмотреть файл

@ -51,9 +51,6 @@ rn_apple_library(
) + react_module_plugin_providers(
name = "ExceptionsManager",
native_class_func = "RCTExceptionsManagerCls",
) + react_module_plugin_providers(
name = "ImageLoader",
native_class_func = "RCTImageLoaderCls",
) + react_module_plugin_providers(
name = "PlatformConstants",
native_class_func = "RCTPlatformCls",
@ -77,7 +74,6 @@ rn_apple_library(
reexport_all_header_dependencies = True,
visibility = ["PUBLIC"],
exported_deps = [
"fbsource//xplat/js:RCTImageApple",
"fbsource//xplat/js/react-native-github:ReactInternalApple",
"fbsource//xplat/js/react-native-github/Libraries/FBReactNativeSpec:FBReactNativeSpecApple",
],

Просмотреть файл

@ -33,7 +33,6 @@ Class RCTAccessibilityManagerCls(void) __attribute__((used));
Class RCTAppearanceCls(void) __attribute__((used));
Class RCTDeviceInfoCls(void) __attribute__((used));
Class RCTExceptionsManagerCls(void) __attribute__((used));
Class RCTImageLoaderCls(void) __attribute__((used));
Class RCTPlatformCls(void) __attribute__((used));
Class RCTClipboardCls(void) __attribute__((used));
Class RCTI18nManagerCls(void) __attribute__((used));

Просмотреть файл

@ -22,7 +22,6 @@ Class RCTCoreModulesClassProvider(const char *name) {
{"Appearance", RCTAppearanceCls},
{"DeviceInfo", RCTDeviceInfoCls},
{"ExceptionsManager", RCTExceptionsManagerCls},
{"ImageLoader", RCTImageLoaderCls},
{"PlatformConstants", RCTPlatformCls},
{"Clipboard", RCTClipboardCls},
{"I18nManager", RCTI18nManagerCls},

Просмотреть файл

@ -59,7 +59,6 @@ rn_xplat_cxx_library(
ios_deps = [
"fbsource//xplat/js:RCTImage",
"fbsource//xplat/js/react-native-github:RCTCxxBridge",
"fbsource//xplat/js/react-native-github/React/CoreModules:CoreModules",
],
ios_exported_headers = subdir_glob(
[