Gate Hot Loading

Summary:
public

Until we support this fature on OSS, don't show the menu option.

Reviewed By: vjeux

Differential Revision: D2791198

fb-gh-sync-id: 11b66d467c1ab784bbf549b893d0a3abd69e2741
This commit is contained in:
Martín Bigio 2015-12-28 16:43:22 -08:00 committed by facebook-github-bot-6
parent 4ffb241647
commit e43e2146d9
3 changed files with 14 additions and 1 deletions

View File

@ -47,4 +47,10 @@ typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source);
- (void)loadSourceForBridge:(RCTBridge *)bridge
withBlock:(RCTSourceLoadBlock)loadCallback;
/**
* Indicates wheather Hot Loading is supported or not.
* Note this method will get removed soon, once we support Hot Loading on OSS.
*/
- (BOOL)isHotLoadingEnabled;
@end

View File

@ -318,7 +318,10 @@ static void RCTInstallHotLoading(RCTBridge *bridge, RCTJSCExecutor *executor)
};
RCTInstallJSCProfiler(_bridge, strongSelf->_context.ctx);
RCTInstallHotLoading(_bridge, strongSelf);
if ([self.bridge.delegate respondsToSelector:@selector(isHotLoadingEnabled)] && [self.bridge.delegate isHotLoadingEnabled]) {
RCTInstallHotLoading(_bridge, strongSelf);
}
for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {
[[NSNotificationCenter defaultCenter] addObserver:strongSelf

View File

@ -110,6 +110,7 @@ describe('processRequest', () => {
entryFile: 'index.ios.js',
inlineSourceMap: false,
minify: false,
hot: false,
runModule: true,
sourceMapUrl: 'index.ios.includeRequire.map',
dev: true,
@ -130,6 +131,7 @@ describe('processRequest', () => {
entryFile: 'index.js',
inlineSourceMap: false,
minify: false,
hot: false,
runModule: true,
sourceMapUrl: 'index.map?platform=ios',
dev: true,
@ -272,6 +274,7 @@ describe('processRequest', () => {
entryFile: 'foo file',
inlineSourceMap: false,
minify: false,
hot: false,
runModule: true,
dev: true,
platform: undefined,
@ -290,6 +293,7 @@ describe('processRequest', () => {
entryFile: 'path/to/foo.js',
inlineSourceMap: false,
minify: false,
hot: false,
runModule: false,
sourceMapUrl: '/path/to/foo.map?dev=false&runModule=false',
dev: false,