Skip to content

Commit

Permalink
Remove guard around isHotLoadingAvailable
Browse files Browse the repository at this point in the history
Summary:
@public
With this guard removed, the functionality is the same in RCT_DEV and non-RCT_DEV builds because RCTDevSettings will return NO (or not exist) in non-RCT_DEV builds, so this code will not be run.

Pros to this approach:
- Hot loading can be enabled in a non-RCT_DEV build

Cons:
- all builds now have this extra block of code, even if it won't be run

If the cons are too strong, I can move this code into a new RCT_DEFINE that inherits from RCT_DEV. (but notably, can be overridden)

Reviewed By: shergin

Differential Revision: D17118516

fbshipit-source-id: cc6c01cca6b2450c35274eccc939c9a2123e6b93
  • Loading branch information
Mehdi Mulani authored and facebook-github-bot committed Sep 3, 2019
1 parent d2cb52b commit b070f05
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
[self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:completion];
}

#if RCT_DEV
if (self.devSettings.isHotLoadingAvailable) {
NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash
NSString *host = self.bundleURL.host;
Expand All @@ -926,7 +925,6 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
args:@[@"ios", path, host, RCTNullIfNil(port), @(isHotLoadingEnabled)]
completion:NULL];
}
#endif
}

- (void)handleError:(NSError *)error
Expand Down

0 comments on commit b070f05

Please sign in to comment.