Skip to content

Commit

Permalink
Back out D17720575 -- D17724498
Browse files Browse the repository at this point in the history
Summary: This stack caused FB4A builds to start failing, complaining about `RCTImageApple`.

Reviewed By: RSNara

Differential Revision: D17855088

fbshipit-source-id: 21ecedc3725dde65fab20f414d07b32c3548447c
  • Loading branch information
Ashok Menon authored and facebook-github-bot committed Oct 10, 2019
1 parent a5ad0bf commit df96de7
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 213 deletions.
2 changes: 1 addition & 1 deletion Libraries/Alert/NativeAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export type Args = {|
title?: string,
message?: string,
buttons?: Array<Object>, // TODO: have a better type
buttons?: Object, // TODO: have a better type
type?: string,
defaultValue?: string,
cancelButtonKey?: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ namespace JS {
struct Args {
NSString *title() const;
NSString *message() const;
folly::Optional<facebook::react::LazyVector<id<NSObject>>> buttons() const;
id<NSObject> _Nullable buttons() const;
NSString *type() const;
NSString *defaultValue() const;
NSString *cancelButtonKey() const;
Expand Down Expand Up @@ -2502,10 +2502,10 @@ inline NSString *JS::NativeAlertManager::Args::message() const
id const p = _v[@"message"];
return RCTBridgingToString(p);
}
inline folly::Optional<facebook::react::LazyVector<id<NSObject>>> JS::NativeAlertManager::Args::buttons() const
inline id<NSObject> _Nullable JS::NativeAlertManager::Args::buttons() const
{
id const p = _v[@"buttons"];
return RCTBridgingToOptionalVec(p, ^id<NSObject>(id itemValue_0) { return itemValue_0; });
return p;
}
inline NSString *JS::NativeAlertManager::Args::type() const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@

#import <ImageIO/ImageIO.h>
#import <QuartzCore/QuartzCore.h>
#import <React/RCTAnimatedImage.h>
#import <React/RCTUtils.h>
#import <ReactCommon/RCTTurboModule.h>

#import "RCTImagePlugins.h"

@interface RCTGIFImageDecoder() <RCTTurboModule>
@end
#import <React/RCTUtils.h>
#import <React/RCTAnimatedImage.h>

@implementation RCTGIFImageDecoder

Expand All @@ -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;
}
44 changes: 0 additions & 44 deletions Libraries/Image/RCTImagePlugins.h

This file was deleted.

36 changes: 0 additions & 36 deletions Libraries/Image/RCTImagePlugins.mm

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@

#import <React/RCTLocalAssetImageLoader.h>

#import <atomic>
#import <memory>
#import <stdatomic.h>

#import <React/RCTUtils.h>
#import <ReactCommon/RCTTurboModule.h>

#import "RCTImagePlugins.h"

@interface RCTLocalAssetImageLoader() <RCTTurboModule>
@end

@implementation RCTLocalAssetImageLoader

Expand Down Expand Up @@ -49,9 +42,9 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
{
__block auto cancelled = std::make_shared<std::atomic<bool>>(false);
__block atomic_bool cancelled = ATOMIC_VAR_INIT(NO);
RCTExecuteOnMainQueue(^{
if (cancelled->load()) {
if (atomic_load(&cancelled)) {
return;
}

Expand All @@ -69,12 +62,8 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
});

return ^{
cancelled->store(true);
atomic_store(&cancelled, YES);
};
}

@end

Class RCTLocalAssetImageLoaderCls(void) {
return RCTLocalAssetImageLoader.class;
}
13 changes: 1 addition & 12 deletions Libraries/Image/React-RCTImage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 1 addition & 3 deletions RNTester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions React/CoreModules/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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() + [
Expand All @@ -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",
],
Expand Down
3 changes: 1 addition & 2 deletions React/CoreModules/CoreModulesPlugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions React/CoreModules/CoreModulesPlugins.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@

#import <React/RCTImageEditingManager.h>

#import <UIKit/UIKit.h>

#import <React/RCTConvert.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageStoreManager.h>
#import <React/RCTImageUtils.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTLog.h>
#import <React/RCTUtils.h>
#import <UIKit/UIKit.h>

#import <UIKit/UIKit.h>

#import "RCTImagePlugins.h"

@implementation RCTImageEditingManager

Expand Down Expand Up @@ -82,7 +79,3 @@ @implementation RCTImageEditingManager
}

@end

Class RCTImageEditingManagerCls() {
return RCTImageEditingManager.class;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>

#import "RCTImagePlugins.h"
#import "CoreModulesPlugins.h"

static NSInteger RCTImageBytesForImage(UIImage *image)
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@

#import <React/RCTImageStoreManager.h>

#import <atomic>
#import <memory>
#import <stdatomic.h>

#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/UTType.h>

#import <React/RCTAssert.h>
#import <React/RCTLog.h>
#import <React/RCTUtils.h>
#import <React/RCTImageUtils.h>

#import "RCTImagePlugins.h"
#import <React/RCTImageUtils.h>

static NSString *const RCTImageStoreURLScheme = @"rct-image-store";

Expand Down Expand Up @@ -141,14 +140,14 @@ - (BOOL)canHandleRequest:(NSURLRequest *)request

- (id)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate
{
__block auto cancelled = std::make_shared<std::atomic<bool>>(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;
}

Expand Down Expand Up @@ -239,7 +238,3 @@ - (RCTImageStoreManager *)imageStoreManager
}

@end

Class RCTImageStoreManagerCls(void) {
return RCTImageStoreManager.class;
}
File renamed without changes.
Loading

0 comments on commit df96de7

Please sign in to comment.