From b070f05926c1bb67ec6cf0e880fa51963775cc0e Mon Sep 17 00:00:00 2001 From: Mehdi Mulani Date: Tue, 3 Sep 2019 15:52:22 -0700 Subject: [PATCH] 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 --- React/CxxBridge/RCTCxxBridge.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 5cb522237d7..f1daad54b40 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -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