Skip to content

Commit

Permalink
Add HERMES_BYTECODE_VERSION to JS bundle requestUrl
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[General][Added] - Adds the Hermes runtime bytecode version number to the JS bundle requestURL. This allows Metro with Bytecode to work with prebuilt binaries.

Reviewed By: cpojer

Differential Revision: D24327852

fbshipit-source-id: e8ee8db4f9b01f0500ab9dd851b5818c4adf3303
  • Loading branch information
Keion Anvaripour authored and facebook-github-bot committed Oct 16, 2020
1 parent 213b02b commit 34c4054
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions React/Base/RCTBundleURLProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
#import "RCTConvert.h"
#import "RCTDefines.h"

#if __has_include("hermes.h") || __has_include(<hermes/hermes.h>)
#import <hermes/hermes.h>
#define HAS_BYTECODE_VERSION
#endif

NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProviderUpdatedNotification";

const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;
Expand Down Expand Up @@ -236,9 +231,8 @@ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
runModule:(BOOL)runModule
{
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
#ifdef HAS_BYTECODE_VERSION
NSString *runtimeBytecodeVersion =
[NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", facebook::hermes::HermesRuntime::getBytecodeVersion()];
#ifdef HERMES_BYTECODE_VERSION
NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
#else
NSString *runtimeBytecodeVersion = @"";
#endif
Expand Down

0 comments on commit 34c4054

Please sign in to comment.