Remove guard around isHotLoadingAvailable

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
This commit is contained in:
Mehdi Mulani
2019-09-03 15:54:11 -07:00
committed by Facebook Github Bot
parent d2cb52beee
commit b070f05926
-2
View File
@@ -915,7 +915,6 @@ struct RCTInstanceCallback : public InstanceCallback {
[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;
@@ -926,7 +925,6 @@ struct RCTInstanceCallback : public InstanceCallback {
args:@[@"ios", path, host, RCTNullIfNil(port), @(isHotLoadingEnabled)]
completion:NULL];
}
#endif
}
- (void)handleError:(NSError *)error