File tree Expand file tree Collapse file tree 8 files changed +10
-28
lines changed
Examples/UIExplorer/UIExplorer Expand file tree Collapse file tree 8 files changed +10
-28
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith
5555
5656- (NSURL *)sourceURLForBridge : (__unused RCTBridge *)bridge
5757{
58- NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings ] jsBundleURLForBundleRoot: @" Examples/UIExplorer/js/UIExplorerApp.ios" fallbackResource: nil ];
59-
58+ NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings ] jsBundleURLForBundleRoot: @" Examples/UIExplorer/js/UIExplorerApp.ios"
59+ fallbackResource: nil ];
6060 if (!getenv (" CI_USE_PACKAGER" )) {
6161 jsCodeLocation = [[NSBundle mainBundle ] URLForResource: @" main" withExtension: @" jsbundle" ];
6262 }
Original file line number Diff line number Diff line change 2121#import " RCTModuleData.h"
2222#import " RCTPerformanceLogger.h"
2323#import " RCTProfile.h"
24- #import " RCTSourceCode.h"
2524#import " RCTUtils.h"
2625#import " RCTRedBox.h"
2726#import " RCTDevLoadingView.h"
@@ -497,9 +496,6 @@ - (void)executeSourceCode:(NSData *)sourceCode
497496 return ;
498497 }
499498
500- RCTSourceCode *sourceCodeModule = [self moduleForClass: [RCTSourceCode class ]];
501- sourceCodeModule.scriptURL = self.bundleURL ;
502-
503499 [self enqueueApplicationScript: sourceCode url: self .bundleURL onComplete: ^(NSError *loadError) {
504500 if (!self->_valid ) {
505501 return ;
Original file line number Diff line number Diff line change 1212#import " RCTBridge.h"
1313#import " RCTConvert.h"
1414#import " RCTJSCWrapper.h"
15- #import " RCTSourceCode.h"
1615#import " RCTUtils.h"
1716#import " RCTPerformanceLogger.h"
1817#import " RCTMultipartDataTask.h"
Original file line number Diff line number Diff line change 2020#import " RCTKeyCommands.h"
2121#import " RCTLog.h"
2222#import " RCTPerformanceLogger.h"
23- #import " RCTSourceCode.h"
2423#import " RCTTouchHandler.h"
2524#import " RCTUIManager.h"
2625#import " RCTUtils.h"
Original file line number Diff line number Diff line change 2727#import " RCTPerformanceLogger.h"
2828#import " RCTUtils.h"
2929#import " RCTJSCProfiler.h"
30- #import " RCTRedBox.h"
31- #import " RCTSourceCode.h"
3230#import " RCTJSCWrapper.h"
3331#import " RCTJSCErrorHandling.h"
3432#import " JSCSamplingProfiler.h"
Original file line number Diff line number Diff line change 1919#import " RCTLog.h"
2020#import " RCTProfile.h"
2121#import " RCTRootView.h"
22- #import " RCTSourceCode.h"
2322#import " RCTUtils.h"
2423#import " RCTWebSocketProxy.h"
2524
@@ -376,17 +375,12 @@ - (void)jsLoaded:(NSNotification *)notification
376375 _jsLoaded = YES ;
377376
378377 // Check if live reloading is available
379- _liveReloadURL = nil ;
380- RCTSourceCode *sourceCodeModule = [_bridge moduleForClass: [RCTSourceCode class ]];
381- if (!sourceCodeModule.scriptURL ) {
382- if (!sourceCodeModule) {
383- RCTLogWarn (@" RCTSourceCode module not found" );
384- } else if (!RCTRunningInTestEnvironment ()) {
385- RCTLogWarn (@" RCTSourceCode module scriptURL has not been set" );
386- }
387- } else if (!sourceCodeModule.scriptURL .fileURL ) {
378+ NSURL *scriptURL = _bridge.bundleURL ;
379+ if (![scriptURL isFileURL ]) {
388380 // Live reloading is disabled when running from bundled JS file
389- _liveReloadURL = [[NSURL alloc ] initWithString: @" /onchange" relativeToURL: sourceCodeModule.scriptURL];
381+ _liveReloadURL = [[NSURL alloc ] initWithString: @" /onchange" relativeToURL: scriptURL];
382+ } else {
383+ _liveReloadURL = nil ;
390384 }
391385
392386 dispatch_async (dispatch_get_main_queue (), ^{
Original file line number Diff line number Diff line change 1313
1414@interface RCTSourceCode : NSObject <RCTBridgeModule>
1515
16- @property (nonatomic , copy ) NSURL *scriptURL;
17-
1816@end
Original file line number Diff line number Diff line change 99
1010#import " RCTSourceCode.h"
1111
12- #import " RCTDefines.h"
13- #import " RCTAssert.h"
1412#import " RCTBridge.h"
15- #import " RCTUtils.h"
1613
1714@implementation RCTSourceCode
1815
@@ -22,8 +19,9 @@ @implementation RCTSourceCode
2219
2320- (NSDictionary <NSString *, id> *)constantsToExport
2421{
25- NSString *URL = self.bridge .bundleURL .absoluteString ?: @" " ;
26- return @{@" scriptURL" : URL};
22+ return @{
23+ @" scriptURL" : self.bridge .bundleURL .absoluteString ?: @" "
24+ };
2725}
2826
2927@end
You can’t perform that action at this time.
0 commit comments