From 3be8c957b029b556daf9f0e0fa104bcb2e50a67f Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Tue, 12 Jul 2016 05:13:34 -0700 Subject: [PATCH] Minor cleanup to make loader unaware of bridge Summary: The loader should be a utility that stands alone. The bridge uses the loader, not the other way around. Reviewed By: bnham Differential Revision: D3546157 fbshipit-source-id: 91016afb629df1f8c83c8fca6f42649be0b046b0 --- React/Base/RCTBridgeDelegate.h | 4 ++-- React/Base/RCTJavaScriptLoader.h | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/React/Base/RCTBridgeDelegate.h b/React/Base/RCTBridgeDelegate.h index baa3f5db1..02da39bda 100644 --- a/React/Base/RCTBridgeDelegate.h +++ b/React/Base/RCTBridgeDelegate.h @@ -7,10 +7,10 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source, int64_t sourceLength); - @class RCTBridge; +#import "RCTJavaScriptLoader.h" + @protocol RCTBridgeDelegate /** diff --git a/React/Base/RCTJavaScriptLoader.h b/React/Base/RCTJavaScriptLoader.h index bf51d31ae..f98a7bdd2 100755 --- a/React/Base/RCTJavaScriptLoader.h +++ b/React/Base/RCTJavaScriptLoader.h @@ -9,8 +9,6 @@ #import -#import "RCTBridgeDelegate.h" - extern uint32_t const RCTRAMBundleMagicNumber; extern NSString *const RCTJavaScriptLoaderErrorDomain; @@ -25,13 +23,8 @@ NS_ENUM(NSInteger) { RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously = 1000, }; -@class RCTBridge; +typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source, int64_t sourceLength); -/** - * Class that allows easy embedding, loading, life-cycle management of a - * JavaScript application inside of a native application. - * TODO: Incremental module loading. (low pri). - */ @interface RCTJavaScriptLoader : NSObject + (void)loadBundleAtURL:(NSURL *)scriptURL onComplete:(RCTSourceLoadBlock)onComplete;