diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 6fa081399..d820d2f10 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -338,7 +338,6 @@ struct RCTInstanceCallback : public InstanceCallback { #if RCT_PROFILE ("StartSamplingProfilerOnInit", (bool)self.devSettings.startSamplingProfilerOnLaunch) #endif - , nullptr )); } } else { diff --git a/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.cpp b/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.cpp index 5208152f5..20da272c7 100644 --- a/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.cpp +++ b/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.cpp @@ -113,9 +113,9 @@ void injectJSCExecutorAndroidPlatform() { } std::unique_ptr makeAndroidJSCExecutorFactory( - const folly::dynamic& jscConfig, NativeExtensionsProvider nativeExtensionsProvider) { + const folly::dynamic& jscConfig) { detail::injectJSCExecutorAndroidPlatform(); - return folly::make_unique(std::move(jscConfig), std::move(nativeExtensionsProvider)); + return folly::make_unique(std::move(jscConfig)); } } diff --git a/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.h b/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.h index 5de2f99ee..8ad7a34df 100644 --- a/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.h +++ b/ReactAndroid/src/main/jni/react/jni/AndroidJSCFactory.h @@ -24,7 +24,7 @@ void injectJSCExecutorAndroidPlatform(); } std::unique_ptr makeAndroidJSCExecutorFactory( - const folly::dynamic& jscConfig, NativeExtensionsProvider nativeExtensionsProvider); + const folly::dynamic& jscConfig); } } diff --git a/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp b/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp index 7e7184e71..662c8bdf2 100644 --- a/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +++ b/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp @@ -34,7 +34,7 @@ class JSCJavaScriptExecutorHolder : public HybridClass initHybrid(alias_ref, ReadableNativeMap* jscConfig) { - return makeCxxInstance(makeAndroidJSCExecutorFactory(jscConfig->consume(), nullptr)); + return makeCxxInstance(makeAndroidJSCExecutorFactory(jscConfig->consume())); } static void registerNatives() { diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp index 2f1f24fd9..3c66fb39e 100644 --- a/ReactCommon/cxxreact/JSCExecutor.cpp +++ b/ReactCommon/cxxreact/JSCExecutor.cpp @@ -120,19 +120,17 @@ std::unique_ptr JSCExecutorFactory::createJSExecutor( std::shared_ptr delegate, std::shared_ptr jsQueue) { return folly::make_unique( - delegate, jsQueue, m_jscConfig, m_nativeExtensionsProvider); + delegate, jsQueue, m_jscConfig); } JSCExecutor::JSCExecutor( std::shared_ptr delegate, std::shared_ptr messageQueueThread, - const folly::dynamic& jscConfig, - NativeExtensionsProvider nativeExtensionsProvider) throw(JSException) + const folly::dynamic& jscConfig) throw(JSException) : m_delegate(delegate), m_messageQueueThread(messageQueueThread), m_nativeModules(delegate ? delegate->getModuleRegistry() : nullptr), - m_jscConfig(jscConfig), - m_nativeExtensionsProvider(nativeExtensionsProvider) { + m_jscConfig(jscConfig) { initOnJSVMThread(); { @@ -142,12 +140,6 @@ JSCExecutor::JSCExecutor( "nativeModuleProxy", exceptionWrapMethod<&JSCExecutor::getNativeModule>()); } - if (nativeExtensionsProvider) { - installGlobalProxy( - m_context, - "nativeExtensions", - exceptionWrapMethod<&JSCExecutor::getNativeExtension>()); - } } JSCExecutor::~JSCExecutor() { @@ -732,17 +724,6 @@ JSValueRef JSCExecutor::getNativeModule( return m_nativeModules.getModule(m_context, propertyName); } -JSValueRef JSCExecutor::getNativeExtension( - JSObjectRef object, - JSStringRef propertyName) { - if (m_nativeExtensionsProvider) { - folly::dynamic value = - m_nativeExtensionsProvider(String::ref(m_context, propertyName).str()); - return Value::fromDynamic(m_context, std::move(value)); - } - return JSC_JSValueMakeUndefined(m_context); -} - JSValueRef JSCExecutor::nativeRequire( size_t count, const JSValueRef arguments[]) { diff --git a/ReactCommon/cxxreact/JSCExecutor.h b/ReactCommon/cxxreact/JSCExecutor.h index b85e590d7..151ded934 100644 --- a/ReactCommon/cxxreact/JSCExecutor.h +++ b/ReactCommon/cxxreact/JSCExecutor.h @@ -27,15 +27,14 @@ class RAMBundleRegistry; class RN_EXPORT JSCExecutorFactory : public JSExecutorFactory { public: - JSCExecutorFactory(const folly::dynamic& jscConfig, NativeExtensionsProvider provider) : - m_jscConfig(jscConfig), m_nativeExtensionsProvider(provider) {} + JSCExecutorFactory(const folly::dynamic& jscConfig) : + m_jscConfig(jscConfig) {} std::unique_ptr createJSExecutor( std::shared_ptr delegate, std::shared_ptr jsQueue) override; private: std::string m_cacheDir; folly::dynamic m_jscConfig; - NativeExtensionsProvider m_nativeExtensionsProvider; }; template @@ -59,8 +58,7 @@ public: */ explicit JSCExecutor(std::shared_ptr delegate, std::shared_ptr messageQueueThread, - const folly::dynamic& jscConfig, - NativeExtensionsProvider nativeExtensionsProvider) throw(JSException); + const folly::dynamic& jscConfig) throw(JSException); ~JSCExecutor() override; virtual void loadApplicationScript( @@ -104,7 +102,6 @@ private: JSCNativeModules m_nativeModules; folly::dynamic m_jscConfig; std::once_flag m_bindFlag; - NativeExtensionsProvider m_nativeExtensionsProvider; folly::Optional m_invokeCallbackAndReturnFlushedQueueJS; folly::Optional m_callFunctionReturnFlushedQueueJS; @@ -126,7 +123,6 @@ private: void installNativeHook(const char* name); JSValueRef getNativeModule(JSObjectRef object, JSStringRef propertyName); - JSValueRef getNativeExtension(JSObjectRef object, JSStringRef propertyName); JSValueRef nativeRequire( size_t argumentCount,