Skip to content

Commit e43e214

Browse files
martinbigiofacebook-github-bot-6
authored andcommitted
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
1 parent 4ffb241 commit e43e214

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

React/Base/RCTBridgeDelegate.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source);
4747
- (void)loadSourceForBridge:(RCTBridge *)bridge
4848
withBlock:(RCTSourceLoadBlock)loadCallback;
4949

50+
/**
51+
* Indicates wheather Hot Loading is supported or not.
52+
* Note this method will get removed soon, once we support Hot Loading on OSS.
53+
*/
54+
- (BOOL)isHotLoadingEnabled;
55+
5056
@end

React/Executors/RCTJSCExecutor.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ - (void)setUp
318318
};
319319

320320
RCTInstallJSCProfiler(_bridge, strongSelf->_context.ctx);
321-
RCTInstallHotLoading(_bridge, strongSelf);
321+
322+
if ([self.bridge.delegate respondsToSelector:@selector(isHotLoadingEnabled)] && [self.bridge.delegate isHotLoadingEnabled]) {
323+
RCTInstallHotLoading(_bridge, strongSelf);
324+
}
322325

323326
for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {
324327
[[NSNotificationCenter defaultCenter] addObserver:strongSelf

packager/react-packager/src/Server/__tests__/Server-test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ describe('processRequest', () => {
110110
entryFile: 'index.ios.js',
111111
inlineSourceMap: false,
112112
minify: false,
113+
hot: false,
113114
runModule: true,
114115
sourceMapUrl: 'index.ios.includeRequire.map',
115116
dev: true,
@@ -130,6 +131,7 @@ describe('processRequest', () => {
130131
entryFile: 'index.js',
131132
inlineSourceMap: false,
132133
minify: false,
134+
hot: false,
133135
runModule: true,
134136
sourceMapUrl: 'index.map?platform=ios',
135137
dev: true,
@@ -272,6 +274,7 @@ describe('processRequest', () => {
272274
entryFile: 'foo file',
273275
inlineSourceMap: false,
274276
minify: false,
277+
hot: false,
275278
runModule: true,
276279
dev: true,
277280
platform: undefined,
@@ -290,6 +293,7 @@ describe('processRequest', () => {
290293
entryFile: 'path/to/foo.js',
291294
inlineSourceMap: false,
292295
minify: false,
296+
hot: false,
293297
runModule: false,
294298
sourceMapUrl: '/path/to/foo.map?dev=false&runModule=false',
295299
dev: false,

0 commit comments

Comments
 (0)