Permalink
Browse files

Do not send 'hot' parameter when requesting a bundle from iOS

Reviewed By: fromcelticpark

Differential Revision: D5631050

fbshipit-source-id: 1f587f3af68da4d94b5d24afabf7659abb697747
  • Loading branch information...
rafeca authored and facebook-github-bot committed Aug 16, 2017
1 parent aaae99e commit 6ad7e8281b37ee2ce6425363c0b17420d056807a
Showing with 7 additions and 15 deletions.
  1. +2 −1 React/Base/RCTBatchedBridge.mm
  2. +1 −1 React/CxxBridge/RCTCxxBridge.mm
  3. +4 −13 React/Modules/RCTDevSettings.mm
@@ -23,6 +23,7 @@
#import "RCTPerformanceLogger.h"
#import "RCTUtils.h"
#import <React/RCTDevSettings.h>
#import <React/RCTProfile.h>
#import <React/RCTRedBox.h>
@@ -549,7 +550,7 @@ - (void)executeSourceCode:(NSData *)sourceCode
}];
#if RCT_DEV
if ([RCTGetURLQueryParam(self.bundleURL, @"hot") boolValue]) {
if (_parentBridge.devSettings.isHotLoadingEnabled) {
NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash
NSString *host = self.bundleURL.host;
NSNumber *port = self.bundleURL.port;
@@ -775,7 +775,7 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
}
#if RCT_DEV
if ([RCTGetURLQueryParam(self.bundleURL, @"hot") boolValue]) {
if (self.devSettings.isHotLoadingEnabled) {
NSString *path = [self.bundleURL.path substringFromIndex:1]; // strip initial slash
NSString *host = self.bundleURL.host;
NSNumber *port = self.bundleURL.port;
@@ -316,25 +316,17 @@ - (void)_liveReloadSettingDidChange
RCT_EXPORT_METHOD(setHotLoadingEnabled:(BOOL)enabled)
{
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingHotLoadingEnabled];
[self _hotLoadingSettingDidChange];
if (self.isHotLoadingEnabled != enabled) {
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingHotLoadingEnabled];
[_bridge reload];
}
}
- (BOOL)isHotLoadingEnabled
{
return [[self settingForKey:kRCTDevSettingHotLoadingEnabled] boolValue];
}
- (void)_hotLoadingSettingDidChange
{
BOOL hotLoadingEnabled = self.isHotLoadingAvailable && self.isHotLoadingEnabled;
if (RCTGetURLQueryParam(_bridge.bundleURL, @"hot").boolValue != hotLoadingEnabled) {
_bridge.bundleURL = RCTURLByReplacingQueryParam(_bridge.bundleURL, @"hot",
hotLoadingEnabled ? @"true" : nil);
[_bridge reload];
}
}
RCT_EXPORT_METHOD(toggleElementInspector)
{
BOOL value = [[self settingForKey:kRCTDevSettingIsInspectorShown] boolValue];
@@ -439,7 +431,6 @@ - (void)_configurePackagerConnection
*/
- (void)_synchronizeAllSettings
{
[self _hotLoadingSettingDidChange];
[self _liveReloadSettingDidChange];
[self _remoteDebugSettingDidChange];
[self _profilingSettingDidChange];

0 comments on commit 6ad7e82

Please sign in to comment.