mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-21 10:34:31 +08:00
Add native delta client for Metro
Summary: Adds C++ delta client that keeps modules in memory, and can be used as a RAM bundle. For now, this client expects a `folly::dynamic` object as payload for patches, i.e. the JSON response retrieved from Metro needs to be parsed with `folly::parseJson` by the caller. In the future, we will replace JSON with a streaming friendly binary format. Reviewed By: fromcelticpark Differential Revision: D7845136 fbshipit-source-id: f003f98a2607c8354c427a7e60e01e19e20295b1
This commit is contained in:
committed by
Facebook Github Bot
parent
e8662a2123
commit
4d931d529e
@@ -82,7 +82,7 @@ JSModulesUnbundle::Module JniJSModulesUnbundle::getModule(uint32_t moduleId) con
|
||||
buffer = static_cast<const char *>(AAsset_getBuffer(asset.get()));
|
||||
}
|
||||
if (buffer == nullptr) {
|
||||
throw ModuleNotFound("Module not found: " + sourceUrl);
|
||||
throw ModuleNotFound(moduleId);
|
||||
}
|
||||
return {sourceUrl, std::string(buffer, AAsset_getLength(asset.get()))};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user