mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Lazily instantiate native modules
Summary: Instead of sending a list of modules over to JS on startup (and actually blocking script execution) instead provide a proxy object that constructs each of these lazily. Reviewed By: lexs Differential Revision: D3936979 fbshipit-source-id: 71bde822f01eb17a29f56c5e60e95e98e207d74d
This commit is contained in:
committed by
Facebook Github Bot
parent
606fc11487
commit
9ed9bca0bf
@@ -15,6 +15,7 @@
|
||||
#include "ExecutorToken.h"
|
||||
#include "JSCHelpers.h"
|
||||
#include "Value.h"
|
||||
#include "JSCNativeModules.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
@@ -102,6 +103,7 @@ private:
|
||||
std::string m_deviceCacheDir;
|
||||
std::shared_ptr<MessageQueueThread> m_messageQueueThread;
|
||||
std::unique_ptr<JSModulesUnbundle> m_unbundle;
|
||||
JSCNativeModules m_nativeModules;
|
||||
folly::dynamic m_jscConfig;
|
||||
|
||||
folly::Optional<Object> m_invokeCallbackAndReturnFlushedQueueJS;
|
||||
@@ -142,10 +144,8 @@ private:
|
||||
|
||||
template< JSValueRef (JSCExecutor::*method)(size_t, const JSValueRef[])>
|
||||
void installNativeHook(const char* name);
|
||||
JSValueRef getNativeModule(JSObjectRef object, JSStringRef propertyName);
|
||||
|
||||
JSValueRef nativeRequireModuleConfig(
|
||||
size_t argumentCount,
|
||||
const JSValueRef arguments[]);
|
||||
JSValueRef nativeStartWorker(
|
||||
size_t argumentCount,
|
||||
const JSValueRef arguments[]);
|
||||
|
||||
Reference in New Issue
Block a user