Skip to content

Commit 34c4054

Browse files
Keion Anvaripourfacebook-github-bot
Keion Anvaripour
authored andcommitted
Add HERMES_BYTECODE_VERSION to JS bundle requestUrl
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
1 parent 213b02b commit 34c4054

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

React/Base/RCTBundleURLProvider.mm

+2-8
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
#import "RCTConvert.h"
1111
#import "RCTDefines.h"
1212

13-
#if __has_include("hermes.h") || __has_include(<hermes/hermes.h>)
14-
#import <hermes/hermes.h>
15-
#define HAS_BYTECODE_VERSION
16-
#endif
17-
1813
NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProviderUpdatedNotification";
1914

2015
const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;
@@ -236,9 +231,8 @@ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
236231
runModule:(BOOL)runModule
237232
{
238233
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
239-
#ifdef HAS_BYTECODE_VERSION
240-
NSString *runtimeBytecodeVersion =
241-
[NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", facebook::hermes::HermesRuntime::getBytecodeVersion()];
234+
#ifdef HERMES_BYTECODE_VERSION
235+
NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
242236
#else
243237
NSString *runtimeBytecodeVersion = @"";
244238
#endif

0 commit comments

Comments
 (0)