From df96de78bb2706f923b6bd4f116fda7bd2f5a081 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Thu, 10 Oct 2019 09:39:08 -0700 Subject: [PATCH] Back out D17720575 -- D17724498 Summary: This stack caused FB4A builds to start failing, complaining about `RCTImageApple`. Reviewed By: RSNara Differential Revision: D17855088 fbshipit-source-id: 21ecedc3725dde65fab20f414d07b32c3548447c --- Libraries/Alert/NativeAlertManager.js | 2 +- .../FBReactNativeSpec/FBReactNativeSpec.h | 6 +-- ...IFImageDecoder.mm => RCTGIFImageDecoder.m} | 17 ++---- Libraries/Image/RCTImagePlugins.h | 44 ---------------- Libraries/Image/RCTImagePlugins.mm | 36 ------------- ...geLoader.mm => RCTLocalAssetImageLoader.m} | 19 ++----- Libraries/Image/React-RCTImage.podspec | 13 +---- RNTester/Podfile.lock | 4 +- React/CoreModules/BUCK | 10 ++-- React/CoreModules/CoreModulesPlugins.h | 3 +- React/CoreModules/CoreModulesPlugins.mm | 3 +- .../CoreModules}/RCTImageEditingManager.h | 0 .../CoreModules/RCTImageEditingManager.m | 11 +--- .../CoreModules}/RCTImageLoader.h | 0 .../CoreModules}/RCTImageLoader.mm | 2 +- .../CoreModules}/RCTImageStoreManager.h | 0 .../CoreModules/RCTImageStoreManager.m | 17 +++--- .../RCTAlertManager.h | 0 .../RCTAlertManager.m} | 52 ++++++------------- .../RCTAsyncLocalStorage.h | 0 .../RCTAsyncLocalStorage.m} | 21 ++------ ReactCommon/fabric/imagemanager/BUCK | 1 + 22 files changed, 48 insertions(+), 213 deletions(-) rename Libraries/Image/{RCTGIFImageDecoder.mm => RCTGIFImageDecoder.m} (85%) delete mode 100644 Libraries/Image/RCTImagePlugins.h delete mode 100644 Libraries/Image/RCTImagePlugins.mm rename Libraries/Image/{RCTLocalAssetImageLoader.mm => RCTLocalAssetImageLoader.m} (82%) rename {Libraries/Image => React/CoreModules}/RCTImageEditingManager.h (100%) rename Libraries/Image/RCTImageEditingManager.mm => React/CoreModules/RCTImageEditingManager.m (95%) rename {Libraries/Image => React/CoreModules}/RCTImageLoader.h (100%) rename {Libraries/Image => React/CoreModules}/RCTImageLoader.mm (99%) rename {Libraries/Image => React/CoreModules}/RCTImageStoreManager.h (100%) rename Libraries/Image/RCTImageStoreManager.mm => React/CoreModules/RCTImageStoreManager.m (96%) rename React/{CoreModules => Modules}/RCTAlertManager.h (100%) rename React/{CoreModules/RCTAlertManager.mm => Modules/RCTAlertManager.m} (75%) rename React/{CoreModules => Modules}/RCTAsyncLocalStorage.h (100%) rename React/{CoreModules/RCTAsyncLocalStorage.mm => Modules/RCTAsyncLocalStorage.m} (96%) diff --git a/Libraries/Alert/NativeAlertManager.js b/Libraries/Alert/NativeAlertManager.js index 452be85c5b112f..345fd08c6e65a2 100644 --- a/Libraries/Alert/NativeAlertManager.js +++ b/Libraries/Alert/NativeAlertManager.js @@ -16,7 +16,7 @@ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export type Args = {| title?: string, message?: string, - buttons?: Array, // TODO: have a better type + buttons?: Object, // TODO: have a better type type?: string, defaultValue?: string, cancelButtonKey?: string, diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h index 0033bdd5042ee5..87f92a51b03fe2 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h @@ -196,7 +196,7 @@ namespace JS { struct Args { NSString *title() const; NSString *message() const; - folly::Optional>> buttons() const; + id _Nullable buttons() const; NSString *type() const; NSString *defaultValue() const; NSString *cancelButtonKey() const; @@ -2502,10 +2502,10 @@ inline NSString *JS::NativeAlertManager::Args::message() const id const p = _v[@"message"]; return RCTBridgingToString(p); } -inline folly::Optional>> JS::NativeAlertManager::Args::buttons() const +inline id _Nullable JS::NativeAlertManager::Args::buttons() const { id const p = _v[@"buttons"]; - return RCTBridgingToOptionalVec(p, ^id(id itemValue_0) { return itemValue_0; }); + return p; } inline NSString *JS::NativeAlertManager::Args::type() const { diff --git a/Libraries/Image/RCTGIFImageDecoder.mm b/Libraries/Image/RCTGIFImageDecoder.m similarity index 85% rename from Libraries/Image/RCTGIFImageDecoder.mm rename to Libraries/Image/RCTGIFImageDecoder.m index 7e24b800d88d8b..a40b42529d1619 100644 --- a/Libraries/Image/RCTGIFImageDecoder.mm +++ b/Libraries/Image/RCTGIFImageDecoder.m @@ -9,14 +9,9 @@ #import #import -#import -#import -#import - -#import "RCTImagePlugins.h" -@interface RCTGIFImageDecoder() -@end +#import +#import @implementation RCTGIFImageDecoder @@ -37,18 +32,14 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData completionHandler:(RCTImageLoaderCompletionBlock)completionHandler { RCTAnimatedImage *image = [[RCTAnimatedImage alloc] initWithData:imageData scale:scale]; - + if (!image) { completionHandler(nil, nil); return ^{}; } - + completionHandler(nil, image); return ^{}; } @end - -Class RCTGIFImageDecoderCls() { - return RCTGIFImageDecoder.class; -} diff --git a/Libraries/Image/RCTImagePlugins.h b/Libraries/Image/RCTImagePlugins.h deleted file mode 100644 index 1b44dcc3406373..00000000000000 --- a/Libraries/Image/RCTImagePlugins.h +++ /dev/null @@ -1,44 +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. - * - * @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 - -#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 RCTGIFImageDecoderCls(void) __attribute__((used)); -Class RCTImageEditingManagerCls(void) __attribute__((used)); -Class RCTImageLoaderCls(void) __attribute__((used)); -Class RCTImageStoreManagerCls(void) __attribute__((used)); -Class RCTLocalAssetImageLoaderCls(void) __attribute__((used)); - -#ifdef __cplusplus -} -#endif - -#pragma GCC diagnostic pop - -#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Libraries/Image/RCTImagePlugins.mm b/Libraries/Image/RCTImagePlugins.mm deleted file mode 100644 index 3cde9e95650e5b..00000000000000 --- a/Libraries/Image/RCTImagePlugins.mm +++ /dev/null @@ -1,36 +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. - * - * @generated by an internal plugin build system - */ - -#ifndef RN_DISABLE_OSS_PLUGIN_HEADER - -// OSS-compatibility layer - -#import "RCTImagePlugins.h" - -#import -#import - -Class RCTImageClassProvider(const char *name) { - static std::unordered_map sCoreModuleClassMap = { - {"GIFImageDecoder", RCTGIFImageDecoderCls}, - {"ImageEditingManager", RCTImageEditingManagerCls}, - {"ImageLoader", RCTImageLoaderCls}, - {"ImageStoreManager", RCTImageStoreManagerCls}, - {"LocalAssetImageLoader", RCTLocalAssetImageLoaderCls}, - }; - - auto p = sCoreModuleClassMap.find(name); - if (p != sCoreModuleClassMap.end()) { - auto classFunc = p->second; - return classFunc(); - } - return nil; -} - -#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Libraries/Image/RCTLocalAssetImageLoader.mm b/Libraries/Image/RCTLocalAssetImageLoader.m similarity index 82% rename from Libraries/Image/RCTLocalAssetImageLoader.mm rename to Libraries/Image/RCTLocalAssetImageLoader.m index f56e62539b32ca..8348c363cf9eef 100644 --- a/Libraries/Image/RCTLocalAssetImageLoader.mm +++ b/Libraries/Image/RCTLocalAssetImageLoader.m @@ -7,16 +7,9 @@ #import -#import -#import +#import #import -#import - -#import "RCTImagePlugins.h" - -@interface RCTLocalAssetImageLoader() -@end @implementation RCTLocalAssetImageLoader @@ -49,9 +42,9 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler completionHandler:(RCTImageLoaderCompletionBlock)completionHandler { - __block auto cancelled = std::make_shared>(false); + __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO); RCTExecuteOnMainQueue(^{ - if (cancelled->load()) { + if (atomic_load(&cancelled)) { return; } @@ -69,12 +62,8 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL }); return ^{ - cancelled->store(true); + atomic_store(&cancelled, YES); }; } @end - -Class RCTLocalAssetImageLoaderCls(void) { - return RCTLocalAssetImageLoader.class; -} diff --git a/Libraries/Image/React-RCTImage.podspec b/Libraries/Image/React-RCTImage.podspec index c71f996bf1f21c..62bb32cfea9569 100644 --- a/Libraries/Image/React-RCTImage.podspec +++ b/Libraries/Image/React-RCTImage.podspec @@ -17,9 +17,6 @@ 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 @@ -29,19 +26,11 @@ 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,mm}" + s.source_files = "*.{m}" 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 diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 5668cb8dcf3930..d3973e948119e7 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -212,8 +212,6 @@ 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): @@ -374,7 +372,7 @@ SPEC CHECKSUMS: React-RCTActionSheet: 090e7bd7c5774d919c47c4eeff78223a7fd8c19c React-RCTAnimation: 73d536fff417a101724d9529189c95a94263710c React-RCTBlob: acd519b1d6ec5d66f98b7cf8e70d0cd76642426f - React-RCTImage: 4d2a090c491e29665f27f87c58feb4dfcb2f4cfa + React-RCTImage: 7f5c9bff34905f1bc216be512ba0ae68f872208a React-RCTLinking: d7d7f792e63a8d57380cecbb9b7a3b31f92d1bb6 React-RCTNetwork: c8f9d40297f35ea3792ea81866f33e8b45c25935 React-RCTPushNotification: acffa8af6a20e6d41b041a8c4cb4bea0de9df0dd diff --git a/React/CoreModules/BUCK b/React/CoreModules/BUCK index d5dcde5a1cabd0..2128fab5a96caa 100644 --- a/React/CoreModules/BUCK +++ b/React/CoreModules/BUCK @@ -51,6 +51,9 @@ 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", @@ -66,12 +69,6 @@ rn_apple_library( ) + react_module_plugin_providers( name = "ActionSheetManager", native_class_func = "RCTActionSheetManagerCls", - ) + react_module_plugin_providers( - name = "AlertManager", - native_class_func = "RCTAlertManagerCls", - ) + react_module_plugin_providers( - name = "AsyncLocalStorage", - native_class_func = "RCTAsyncLocalStorageCls", ), plugins_header = "FBCoreModulesPlugins.h", preprocessor_flags = OBJC_ARC_PREPROCESSOR_FLAGS + get_debug_preprocessor_flags() + rn_extra_build_flags() + [ @@ -80,6 +77,7 @@ 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", ], diff --git a/React/CoreModules/CoreModulesPlugins.h b/React/CoreModules/CoreModulesPlugins.h index eb511531a7cb8f..6eb37cc375d18e 100644 --- a/React/CoreModules/CoreModulesPlugins.h +++ b/React/CoreModules/CoreModulesPlugins.h @@ -33,13 +33,12 @@ 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)); Class RCTSourceCodeCls(void) __attribute__((used)); Class RCTActionSheetManagerCls(void) __attribute__((used)); -Class RCTAlertManagerCls(void) __attribute__((used)); -Class RCTAsyncLocalStorageCls(void) __attribute__((used)); #ifdef __cplusplus } diff --git a/React/CoreModules/CoreModulesPlugins.mm b/React/CoreModules/CoreModulesPlugins.mm index 8aaf755f84d8f1..ddfd86244e8876 100644 --- a/React/CoreModules/CoreModulesPlugins.mm +++ b/React/CoreModules/CoreModulesPlugins.mm @@ -22,13 +22,12 @@ Class RCTCoreModulesClassProvider(const char *name) { {"Appearance", RCTAppearanceCls}, {"DeviceInfo", RCTDeviceInfoCls}, {"ExceptionsManager", RCTExceptionsManagerCls}, + {"ImageLoader", RCTImageLoaderCls}, {"PlatformConstants", RCTPlatformCls}, {"Clipboard", RCTClipboardCls}, {"I18nManager", RCTI18nManagerCls}, {"SourceCode", RCTSourceCodeCls}, {"ActionSheetManager", RCTActionSheetManagerCls}, - {"AlertManager", RCTAlertManagerCls}, - {"AsyncLocalStorage", RCTAsyncLocalStorageCls}, }; auto p = sCoreModuleClassMap.find(name); diff --git a/Libraries/Image/RCTImageEditingManager.h b/React/CoreModules/RCTImageEditingManager.h similarity index 100% rename from Libraries/Image/RCTImageEditingManager.h rename to React/CoreModules/RCTImageEditingManager.h diff --git a/Libraries/Image/RCTImageEditingManager.mm b/React/CoreModules/RCTImageEditingManager.m similarity index 95% rename from Libraries/Image/RCTImageEditingManager.mm rename to React/CoreModules/RCTImageEditingManager.m index be33c5df5a86ac..8d88390e04b5f9 100644 --- a/Libraries/Image/RCTImageEditingManager.mm +++ b/React/CoreModules/RCTImageEditingManager.m @@ -7,6 +7,8 @@ #import +#import + #import #import #import @@ -14,11 +16,6 @@ #import #import #import -#import - -#import - -#import "RCTImagePlugins.h" @implementation RCTImageEditingManager @@ -82,7 +79,3 @@ @implementation RCTImageEditingManager } @end - -Class RCTImageEditingManagerCls() { - return RCTImageEditingManager.class; -} diff --git a/Libraries/Image/RCTImageLoader.h b/React/CoreModules/RCTImageLoader.h similarity index 100% rename from Libraries/Image/RCTImageLoader.h rename to React/CoreModules/RCTImageLoader.h diff --git a/Libraries/Image/RCTImageLoader.mm b/React/CoreModules/RCTImageLoader.mm similarity index 99% rename from Libraries/Image/RCTImageLoader.mm rename to React/CoreModules/RCTImageLoader.mm index 9348e4834381ba..356ffd640f23eb 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/React/CoreModules/RCTImageLoader.mm @@ -20,7 +20,7 @@ #import #import -#import "RCTImagePlugins.h" +#import "CoreModulesPlugins.h" static NSInteger RCTImageBytesForImage(UIImage *image) { diff --git a/Libraries/Image/RCTImageStoreManager.h b/React/CoreModules/RCTImageStoreManager.h similarity index 100% rename from Libraries/Image/RCTImageStoreManager.h rename to React/CoreModules/RCTImageStoreManager.h diff --git a/Libraries/Image/RCTImageStoreManager.mm b/React/CoreModules/RCTImageStoreManager.m similarity index 96% rename from Libraries/Image/RCTImageStoreManager.mm rename to React/CoreModules/RCTImageStoreManager.m index c08676b8cfee56..1b78327f638cd5 100644 --- a/Libraries/Image/RCTImageStoreManager.mm +++ b/React/CoreModules/RCTImageStoreManager.m @@ -7,17 +7,16 @@ #import -#import -#import +#import #import #import + #import #import #import -#import -#import "RCTImagePlugins.h" +#import static NSString *const RCTImageStoreURLScheme = @"rct-image-store"; @@ -141,14 +140,14 @@ - (BOOL)canHandleRequest:(NSURLRequest *)request - (id)sendRequest:(NSURLRequest *)request withDelegate:(id)delegate { - __block auto cancelled = std::make_shared>(false); + __block atomic_bool cancelled = ATOMIC_VAR_INIT(NO); void (^cancellationBlock)(void) = ^{ - cancelled->store(true); + atomic_store(&cancelled, YES); }; // Dispatch async to give caller time to cancel the request dispatch_async(_methodQueue, ^{ - if (cancelled->load()) { + if (atomic_load(&cancelled)) { return; } @@ -239,7 +238,3 @@ - (RCTImageStoreManager *)imageStoreManager } @end - -Class RCTImageStoreManagerCls(void) { - return RCTImageStoreManager.class; -} diff --git a/React/CoreModules/RCTAlertManager.h b/React/Modules/RCTAlertManager.h similarity index 100% rename from React/CoreModules/RCTAlertManager.h rename to React/Modules/RCTAlertManager.h diff --git a/React/CoreModules/RCTAlertManager.mm b/React/Modules/RCTAlertManager.m similarity index 75% rename from React/CoreModules/RCTAlertManager.mm rename to React/Modules/RCTAlertManager.m index 6781104e61162b..bb1f3ceaa42e10 100644 --- a/React/CoreModules/RCTAlertManager.mm +++ b/React/Modules/RCTAlertManager.m @@ -7,14 +7,10 @@ #import "RCTAlertManager.h" -#import -#import -#import -#import -#import -#import - -#import "CoreModulesPlugins.h" +#import "RCTAssert.h" +#import "RCTConvert.h" +#import "RCTLog.h" +#import "RCTUtils.h" @implementation RCTConvert (UIAlertViewStyle) @@ -27,7 +23,7 @@ @implementation RCTConvert (UIAlertViewStyle) @end -@interface RCTAlertManager() +@interface RCTAlertManager() @end @@ -64,17 +60,17 @@ - (void)invalidate * The key from the `buttons` dictionary is passed back in the callback on click. * Buttons are displayed in the order they are specified. */ -RCT_EXPORT_METHOD(alertWithArgs:(JS::NativeAlertManager::Args &)args +RCT_EXPORT_METHOD(alertWithArgs:(NSDictionary *)args callback:(RCTResponseSenderBlock)callback) { - NSString *title = [RCTConvert NSString:args.title()]; - NSString *message = [RCTConvert NSString:args.message()]; - RCTAlertViewStyle type = [RCTConvert RCTAlertViewStyle:args.type()]; - NSArray *buttons = [RCTConvert NSDictionaryArray:RCTConvertOptionalVecToArray(args.buttons(), ^id(id element) { return element; })]; - NSString *defaultValue = [RCTConvert NSString:args.defaultValue()]; - NSString *cancelButtonKey = [RCTConvert NSString:args.cancelButtonKey()]; - NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()]; - UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()]; + NSString *title = [RCTConvert NSString:args[@"title"]]; + NSString *message = [RCTConvert NSString:args[@"message"]]; + RCTAlertViewStyle type = [RCTConvert RCTAlertViewStyle:args[@"type"]]; + NSArray *buttons = [RCTConvert NSDictionaryArray:args[@"buttons"]]; + NSString *defaultValue = [RCTConvert NSString:args[@"defaultValue"]]; + NSString *cancelButtonKey = [RCTConvert NSString:args[@"cancelButtonKey"]]; + NSString *destructiveButtonKey = [RCTConvert NSString:args[@"destructiveButtonKey"]]; + UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args[@"keyboardType"]]; if (!title && !message) { RCTLogError(@"Must specify either an alert title, or message, or both"); @@ -96,16 +92,7 @@ - (void)invalidate UIViewController *presentingController = RCTPresentedViewController(); if (presentingController == nil) { - RCTLogError(@"Tried to display alert view but there is no application window. args: %@", @{ - @"title": args.title() ?: [NSNull null], - @"message": args.message() ?: [NSNull null], - @"buttons": RCTConvertOptionalVecToArray(args.buttons(), ^id(id element) { return element; }) ?: [NSNull null], - @"type": args.type() ?: [NSNull null], - @"defaultValue": args.defaultValue() ?: [NSNull null], - @"cancelButtonKey": args.cancelButtonKey() ?: [NSNull null], - @"destructiveButtonKey": args.destructiveButtonKey() ?: [NSNull null], - @"keyboardType": args.keyboardType() ?: [NSNull null], - }); + RCTLogError(@"Tried to display alert view but there is no application window. args: %@", args); return; } @@ -195,13 +182,4 @@ - (void)invalidate }); } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker -{ - return std::make_shared(self, jsInvoker); -} - @end - -Class RCTAlertManagerCls(void) { - return RCTAlertManager.class; -} diff --git a/React/CoreModules/RCTAsyncLocalStorage.h b/React/Modules/RCTAsyncLocalStorage.h similarity index 100% rename from React/CoreModules/RCTAsyncLocalStorage.h rename to React/Modules/RCTAsyncLocalStorage.h diff --git a/React/CoreModules/RCTAsyncLocalStorage.mm b/React/Modules/RCTAsyncLocalStorage.m similarity index 96% rename from React/CoreModules/RCTAsyncLocalStorage.mm rename to React/Modules/RCTAsyncLocalStorage.m index b6a1f19a7ae257..c77fac403c714b 100644 --- a/React/CoreModules/RCTAsyncLocalStorage.mm +++ b/React/Modules/RCTAsyncLocalStorage.m @@ -9,15 +9,12 @@ #import -#import #import #import -#import -#import -#import - -#import "CoreModulesPlugins.h" +#import "RCTConvert.h" +#import "RCTLog.h" +#import "RCTUtils.h" static NSString *const RCTStorageDirectory = @"RCTAsyncLocalStorage_V1"; static NSString *const RCTManifestFileName = @"manifest.json"; @@ -161,9 +158,6 @@ static dispatch_queue_t RCTGetMethodQueue() #pragma mark - RCTAsyncLocalStorage -@interface RCTAsyncLocalStorage() -@end - @implementation RCTAsyncLocalStorage { BOOL _haveSetup; @@ -461,13 +455,4 @@ - (NSDictionary *)_writeEntry:(NSArray *)entry changedManifest:(BOOL } } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker -{ - return std::make_shared(self, jsInvoker); -} - @end - -Class RCTAsyncLocalStorageCls(void) { - return RCTAsyncLocalStorage.class; -} diff --git a/ReactCommon/fabric/imagemanager/BUCK b/ReactCommon/fabric/imagemanager/BUCK index 08d3d6d755912f..9e54505d0e5e3d 100644 --- a/ReactCommon/fabric/imagemanager/BUCK +++ b/ReactCommon/fabric/imagemanager/BUCK @@ -59,6 +59,7 @@ 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( [