From 80f9e1f7de407ea417cecb04b3ba20b05696b478 Mon Sep 17 00:00:00 2001 From: Alex Dvornikov Date: Tue, 26 Dec 2017 14:34:08 -0800 Subject: [PATCH] remove "prepareReact" call from the Android bridge Reviewed By: alexeylang Differential Revision: D6596304 fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f --- .../facebook/react/ReactInstanceManager.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 217d2c117..d1ef9b3da 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -137,7 +137,6 @@ public class ReactInstanceManager { private final @Nullable JSBundleLoader mBundleLoader; private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */ private final List mPackages; - private final List mInitFunctions; private final DevSupportManager mDevSupportManager; private final boolean mUseDeveloperSupport; private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener; @@ -217,7 +216,6 @@ public class ReactInstanceManager { mBundleLoader = bundleLoader; mJSMainModulePath = jsMainModulePath; mPackages = new ArrayList<>(); - mInitFunctions = new ArrayList<>(); mUseDeveloperSupport = useDeveloperSupport; mDevSupportManager = DevSupportManagerFactory.create( @@ -356,28 +354,6 @@ public class ReactInstanceManager { catalystInstance.extendNativeModules(nativeModuleRegistry); } - /** - * If the JavaScript bundle for this app requires initialization as part of bridge start up, - * register a function using its @param module and @param method and optional arguments. - */ - public void registerInitFunction(String module, String method, @Nullable NativeArray arguments) { - CatalystInstanceImpl.PendingJSCall init = - new CatalystInstanceImpl.PendingJSCall(module, method, arguments); - synchronized (this) { - mInitFunctions.add(init); - } - ReactContext context = getCurrentReactContext(); - CatalystInstance catalystInstance = context == null ? null : context.getCatalystInstance(); - if (catalystInstance == null) { - return; - } else { - // CatalystInstance is only visible after running jsBundle, so these will be put on the native - // JS queue - // TODO T20546472 remove cast when catalystInstance and InstanceImpl are renamed/merged - ((CatalystInstanceImpl) catalystInstance).callFunction(init); - } - } - /** * Recreate the react application and context. This should be called if configuration has changed * or the developer has requested the app to be reloaded. It should only be called after an @@ -1135,13 +1111,6 @@ public class ReactInstanceManager { } ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START); catalystInstance.runJSBundle(); - // Transitions functions in the minitFunctions list to catalystInstance, to run after the bundle - // TODO T20546472 - if (!mInitFunctions.isEmpty()) { - for (CatalystInstanceImpl.PendingJSCall function : mInitFunctions) { - ((CatalystInstanceImpl) catalystInstance).callFunction(function); - } - } reactContext.initializeWithInstance(catalystInstance); return reactContext;