Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added iOS support for loading multiple RAM bundles
Differential Revision: D5850970 fbshipit-source-id: 88ab6fe3822f1bc4195007f8ec83177a84c27569
- Loading branch information
1 parent
7982191
commit 1aeb767
Showing
8 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#include "JSIndexedRAMBundleRegistry.h" | ||
|
||
#include <cxxreact/JSIndexedRAMBundle.h> | ||
#include <folly/Memory.h> | ||
|
||
#include "oss-compat-util.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
std::unique_ptr<JSModulesUnbundle> JSIndexedRAMBundleRegistry::bundleById(uint32_t index) const { | ||
return folly::make_unique<JSIndexedRAMBundle>(bundlePathById(index).c_str()); | ||
} | ||
|
||
std::string JSIndexedRAMBundleRegistry::bundlePathById(uint32_t index) const { | ||
return m_baseDirectoryPath + "/js-bundles/" + toString(index) + ".jsbundle"; | ||
} | ||
|
||
} // namespace react | ||
} // namespace facebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include <cxxreact/RAMBundleRegistry.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class JSIndexedRAMBundleRegistry: public RAMBundleRegistry { | ||
public: | ||
JSIndexedRAMBundleRegistry( | ||
std::unique_ptr<JSModulesUnbundle> mainBundle, | ||
std::string baseDirectoryPath): | ||
RAMBundleRegistry(std::move(mainBundle)), m_baseDirectoryPath(baseDirectoryPath) {} | ||
|
||
protected: | ||
virtual std::unique_ptr<JSModulesUnbundle> bundleById(uint32_t index) const override; | ||
private: | ||
std::string bundlePathById(uint32_t index) const; | ||
|
||
std::string m_baseDirectoryPath; | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook |