Skip to content

Commit

Permalink
Force local builds to use regular JS bundles
Browse files Browse the repository at this point in the history
Reviewed By: dcaspi

Differential Revision: D5824552

fbshipit-source-id: a435fc0ad5b43a8bd3c6a873a4147c4d92190f4e
  • Loading branch information
pakoito authored and facebook-github-bot committed Sep 18, 2017
1 parent 6e28179 commit 6b733a4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions React/Base/RCTJavaScriptLoader.mm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -157,15 +157,25 @@ + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL
case facebook::react::ScriptTag::RAMBundle: case facebook::react::ScriptTag::RAMBundle:
break; break;


case facebook::react::ScriptTag::String: case facebook::react::ScriptTag::String: {
#if RCT_ENABLE_INSPECTOR
NSData *source = [NSData dataWithContentsOfFile:scriptURL.path
options:NSDataReadingMappedIfSafe
error:error];
if (sourceLength && source != nil) {
*sourceLength = source.length;
}
return source;
#else
if (error) { if (error) {
*error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain
code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously
userInfo:@{NSLocalizedDescriptionKey: userInfo:@{NSLocalizedDescriptionKey:
@"Cannot load text/javascript files synchronously"}]; @"Cannot load text/javascript files synchronously"}];
} }
return nil; return nil;

#endif
}
case facebook::react::ScriptTag::BCBundle: case facebook::react::ScriptTag::BCBundle:
if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) { if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) {
if (error) { if (error) {
Expand Down

0 comments on commit 6b733a4

Please sign in to comment.