mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00:00
Add: expose hot & live reload, remote debug, profiling
Summary: Explain the **motivation** for making this change. What existing problem does the pull request solve? - Being able to call these from JS is really useful in envs where action sheets are not available (eg: App Extensions). I made the functions act as explicit toggles, this way it's easy to set the wanted behavior. **Test plan (required)** - I tested the functions manually.  Closes https://github.com/facebook/react-native/pull/9242 Differential Revision: D3749568 fbshipit-source-id: 2cea1d609dc792aec73d4bcf1eae07575725b4b7
This commit is contained in:
parent
027a2706d2
commit
38354c4cbf
@ -569,13 +569,19 @@ RCT_EXPORT_METHOD(reload)
|
|||||||
[_bridge requestReload];
|
[_bridge requestReload];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(debugRemotely:(BOOL)enableDebug)
|
||||||
|
{
|
||||||
|
Class jsDebuggingExecutorClass = NSClassFromString(@"RCTWebSocketExecutor");
|
||||||
|
self.executorClass = enableDebug ? jsDebuggingExecutorClass : nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setShakeToShow:(BOOL)shakeToShow
|
- (void)setShakeToShow:(BOOL)shakeToShow
|
||||||
{
|
{
|
||||||
_shakeToShow = shakeToShow;
|
_shakeToShow = shakeToShow;
|
||||||
[self updateSetting:@"shakeToShow" value:@(_shakeToShow)];
|
[self updateSetting:@"shakeToShow" value:@(_shakeToShow)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setProfilingEnabled:(BOOL)enabled
|
RCT_EXPORT_METHOD(setProfilingEnabled:(BOOL)enabled)
|
||||||
{
|
{
|
||||||
_profilingEnabled = enabled;
|
_profilingEnabled = enabled;
|
||||||
[self updateSetting:@"profilingEnabled" value:@(_profilingEnabled)];
|
[self updateSetting:@"profilingEnabled" value:@(_profilingEnabled)];
|
||||||
@ -591,7 +597,7 @@ RCT_EXPORT_METHOD(reload)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setLiveReloadEnabled:(BOOL)enabled
|
RCT_EXPORT_METHOD(setLiveReloadEnabled:(BOOL)enabled)
|
||||||
{
|
{
|
||||||
_liveReloadEnabled = enabled;
|
_liveReloadEnabled = enabled;
|
||||||
[self updateSetting:@"liveReloadEnabled" value:@(_liveReloadEnabled)];
|
[self updateSetting:@"liveReloadEnabled" value:@(_liveReloadEnabled)];
|
||||||
@ -609,7 +615,7 @@ RCT_EXPORT_METHOD(reload)
|
|||||||
return _bridge.bundleURL && !_bridge.bundleURL.fileURL; // Only works when running from server
|
return _bridge.bundleURL && !_bridge.bundleURL.fileURL; // Only works when running from server
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setHotLoadingEnabled:(BOOL)enabled
|
RCT_EXPORT_METHOD(setHotLoadingEnabled:(BOOL)enabled)
|
||||||
{
|
{
|
||||||
_hotLoadingEnabled = enabled;
|
_hotLoadingEnabled = enabled;
|
||||||
[self updateSetting:@"hotLoadingEnabled" value:@(_hotLoadingEnabled)];
|
[self updateSetting:@"hotLoadingEnabled" value:@(_hotLoadingEnabled)];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user