diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index cf667c325..535f22c1b 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -35,8 +35,8 @@ #import #import #import -#include #import +#import #import #import "NSDataBigString.h" @@ -1185,8 +1185,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR [self->_performanceLogger markStopForTag:RCTPLRAMBundleLoad]; [self->_performanceLogger setValue:scriptStr->size() forTag:RCTPLRAMStartupCodeSize]; if (self->_reactInstance) { - std::string baseDirectoryPath = sourceUrlStr.stringByDeletingLastPathComponent.UTF8String; - auto registry = std::make_unique(std::move(ramBundle), baseDirectoryPath); + auto registry = std::make_unique(std::move(ramBundle)); self->_reactInstance->loadRAMBundle(std::move(registry), std::move(scriptStr), sourceUrlStr.UTF8String, !async); } diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index b6677d57f..f8aa22880 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -1103,7 +1103,6 @@ C654505E1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; }; C654505F1F3BD9280090799B /* RCTManagedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C654505D1F3BD9280090799B /* RCTManagedPointer.h */; }; C669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; }; - C669D8B91F72E4B7006748EB /* JSIndexedRAMBundleRegistry.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6D3801E1F71D91600621378 /* JSIndexedRAMBundleRegistry.h */; }; C6827DF61EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; C6827DF71EF17CCC00D66BEF /* RCTJSEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; C6827DFB1EF1800E00D66BEF /* RCTJSEnvironment.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */; }; @@ -1112,10 +1111,6 @@ C6D3801B1F71D76200621378 /* RAMBundleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D380181F71D75B00621378 /* RAMBundleRegistry.h */; }; C6D3801C1F71D76700621378 /* RAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */; }; C6D3801D1F71D76800621378 /* RAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */; }; - C6D380201F71D91D00621378 /* JSIndexedRAMBundleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D3801E1F71D91600621378 /* JSIndexedRAMBundleRegistry.h */; }; - C6D380211F71D91E00621378 /* JSIndexedRAMBundleRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D3801E1F71D91600621378 /* JSIndexedRAMBundleRegistry.h */; }; - C6D380221F71D92300621378 /* JSIndexedRAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D3801F1F71D91600621378 /* JSIndexedRAMBundleRegistry.cpp */; }; - C6D380231F71D92400621378 /* JSIndexedRAMBundleRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D3801F1F71D91600621378 /* JSIndexedRAMBundleRegistry.cpp */; }; CF2731C01E7B8DE40044CA4F /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */; }; CF2731C11E7B8DE40044CA4F /* RCTDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */; }; CF2731C21E7B8DEF0044CA4F /* RCTDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */; }; @@ -1615,7 +1610,6 @@ dstPath = include/cxxreact; dstSubfolderSpec = 16; files = ( - C669D8B91F72E4B7006748EB /* JSIndexedRAMBundleRegistry.h in Copy Headers */, C669D8981F72E3DE006748EB /* RAMBundleRegistry.h in Copy Headers */, 3DA981A01E5B0E34004F2374 /* CxxModule.h in Copy Headers */, 3DA981A11E5B0E34004F2374 /* CxxNativeModule.h in Copy Headers */, @@ -2112,8 +2106,6 @@ C6827DF51EF17CCC00D66BEF /* RCTJSEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSEnvironment.h; sourceTree = ""; }; C6D380181F71D75B00621378 /* RAMBundleRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAMBundleRegistry.h; sourceTree = ""; }; C6D380191F71D75B00621378 /* RAMBundleRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RAMBundleRegistry.cpp; sourceTree = ""; }; - C6D3801E1F71D91600621378 /* JSIndexedRAMBundleRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSIndexedRAMBundleRegistry.h; sourceTree = ""; }; - C6D3801F1F71D91600621378 /* JSIndexedRAMBundleRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIndexedRAMBundleRegistry.cpp; sourceTree = ""; }; CF2731BE1E7B8DE40044CA4F /* RCTDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDeviceInfo.h; sourceTree = ""; }; CF2731BF1E7B8DE40044CA4F /* RCTDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDeviceInfo.m; sourceTree = ""; }; E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextDecorationLineType.h; sourceTree = ""; }; @@ -2784,8 +2776,6 @@ 3D92B0AB1E03699D0018521A /* JSExecutor.h */, 3D92B0C61E03699D0018521A /* JSIndexedRAMBundle.cpp */, 3D92B0C71E03699D0018521A /* JSIndexedRAMBundle.h */, - C6D3801F1F71D91600621378 /* JSIndexedRAMBundleRegistry.cpp */, - C6D3801E1F71D91600621378 /* JSIndexedRAMBundleRegistry.h */, 3D92B0C81E03699D0018521A /* JSModulesUnbundle.h */, 3D92B0C91E03699D0018521A /* MessageQueueThread.h */, 3D92B0CA1E03699D0018521A /* MethodCall.cpp */, @@ -3017,7 +3007,6 @@ 27595AC61E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */, 27595AD71E575C7800CCE2B1 /* SampleCxxModule.h in Headers */, 27595AD21E575C7800CCE2B1 /* MethodCall.h in Headers */, - C6D380211F71D91E00621378 /* JSIndexedRAMBundleRegistry.h in Headers */, 3D3030221DF8294C00D6DDAE /* JSBundleType.h in Headers */, 27595ACA1E575C7800CCE2B1 /* JSCMemory.h in Headers */, 3D74547D1E54758900E74ADD /* JSBigString.h in Headers */, @@ -3107,7 +3096,6 @@ 27595AAB1E575C7800CCE2B1 /* JsArgumentHelpers.h in Headers */, 27595ABC1E575C7800CCE2B1 /* SampleCxxModule.h in Headers */, 27595AB71E575C7800CCE2B1 /* MethodCall.h in Headers */, - C6D380201F71D91D00621378 /* JSIndexedRAMBundleRegistry.h in Headers */, 3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */, 27595AAF1E575C7800CCE2B1 /* JSCMemory.h in Headers */, 3D74547C1E54758900E74ADD /* JSBigString.h in Headers */, @@ -3970,7 +3958,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C6D380221F71D92300621378 /* JSIndexedRAMBundleRegistry.cpp in Sources */, 3DC159E51E83E1E9007B1282 /* JSBigString.cpp in Sources */, 13F8877B1E29726200C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */, 13F8877D1E29726200C3C7A1 /* ModuleRegistry.cpp in Sources */, @@ -3996,7 +3983,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C6D380231F71D92400621378 /* JSIndexedRAMBundleRegistry.cpp in Sources */, 3DC159E61E83E1FA007B1282 /* JSBigString.cpp in Sources */, 13F8878E1E29726300C3C7A1 /* JSIndexedRAMBundle.cpp in Sources */, 13F887901E29726300C3C7A1 /* ModuleRegistry.cpp in Sources */, diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index 7e64ce3f9..fae8dbaab 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -18,7 +18,6 @@ LOCAL_SRC_FILES := \ JSCTracing.cpp \ JSCUtils.cpp \ JSIndexedRAMBundle.cpp \ - JSIndexedRAMBundleRegistry.cpp \ MethodCall.cpp \ ModuleRegistry.cpp \ NativeToJsBridge.cpp \ diff --git a/ReactCommon/cxxreact/BUCK b/ReactCommon/cxxreact/BUCK index 4012972ac..6b567cca0 100644 --- a/ReactCommon/cxxreact/BUCK +++ b/ReactCommon/cxxreact/BUCK @@ -80,7 +80,6 @@ CXXREACT_PUBLIC_HEADERS = [ "JSCExecutor.h", "JSCNativeModules.h", "JSIndexedRAMBundle.h", - "JSIndexedRAMBundleRegistry.h", "JSModulesUnbundle.h", "MessageQueueThread.h", "MethodCall.h", diff --git a/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp b/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp index 1fb50627e..b5fc10dfb 100644 --- a/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +++ b/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp @@ -3,6 +3,7 @@ #include "JSIndexedRAMBundle.h" #include "oss-compat-util.h" +#include "JSBigString.h" namespace facebook { namespace react { diff --git a/ReactCommon/cxxreact/JSIndexedRAMBundle.h b/ReactCommon/cxxreact/JSIndexedRAMBundle.h index 79e2587f3..8898fe4ed 100644 --- a/ReactCommon/cxxreact/JSIndexedRAMBundle.h +++ b/ReactCommon/cxxreact/JSIndexedRAMBundle.h @@ -5,7 +5,6 @@ #include #include -#include #include #ifndef RN_EXPORT @@ -15,6 +14,9 @@ namespace facebook { namespace react { +class JSBigString; +class JSBigBufferString; + class RN_EXPORT JSIndexedRAMBundle : public JSModulesUnbundle { public: // Throws std::runtime_error on failure. diff --git a/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.cpp b/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.cpp deleted file mode 100644 index 92d1fdbfb..000000000 --- a/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#include "JSIndexedRAMBundleRegistry.h" - -#include -#include - -#include "oss-compat-util.h" - -namespace facebook { -namespace react { - -std::unique_ptr JSIndexedRAMBundleRegistry::bundleById(uint32_t index) const { - return folly::make_unique(bundlePathById(index).c_str()); -} - -std::string JSIndexedRAMBundleRegistry::bundlePathById(uint32_t index) const { - return m_baseDirectoryPath + "/js-bundles/" + toString(index) + ".jsbundle"; -} - -} // namespace react -} // namespace facebook diff --git a/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.h b/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.h deleted file mode 100644 index 77f187a03..000000000 --- a/ReactCommon/cxxreact/JSIndexedRAMBundleRegistry.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#pragma once - -#include - -namespace facebook { -namespace react { - -class JSIndexedRAMBundleRegistry: public RAMBundleRegistry { -public: - JSIndexedRAMBundleRegistry( - std::unique_ptr mainBundle, - std::string baseDirectoryPath): - RAMBundleRegistry(std::move(mainBundle)), m_baseDirectoryPath(baseDirectoryPath) {} - -protected: - virtual std::unique_ptr bundleById(uint32_t index) const override; -private: - std::string bundlePathById(uint32_t index) const; - - std::string m_baseDirectoryPath; -}; - -} // namespace react -} // namespace facebook