From 34c405462f890afbccdfeaa7804791f7e9bcaa83 Mon Sep 17 00:00:00 2001 From: Keion Anvaripour Date: Fri, 16 Oct 2020 16:36:58 -0700 Subject: [PATCH] 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 --- React/Base/RCTBundleURLProvider.mm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/React/Base/RCTBundleURLProvider.mm b/React/Base/RCTBundleURLProvider.mm index d43e2a0e96954c..751afb8a7d8ca6 100644 --- a/React/Base/RCTBundleURLProvider.mm +++ b/React/Base/RCTBundleURLProvider.mm @@ -10,11 +10,6 @@ #import "RCTConvert.h" #import "RCTDefines.h" -#if __has_include("hermes.h") || __has_include() -#import -#define HAS_BYTECODE_VERSION -#endif - NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProviderUpdatedNotification"; const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT; @@ -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