remove "prepareReact" call from the Android bridge

Reviewed By: alexeylang

Differential Revision: D6596304

fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f
This commit is contained in:
Alex Dvornikov 2017-12-26 14:34:08 -08:00 committed by Facebook Github Bot
parent 56a42e57d0
commit 80f9e1f7de
1 changed files with 0 additions and 31 deletions

View File

@ -137,7 +137,6 @@ public class ReactInstanceManager {
private final @Nullable JSBundleLoader mBundleLoader; private final @Nullable JSBundleLoader mBundleLoader;
private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */ private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */
private final List<ReactPackage> mPackages; private final List<ReactPackage> mPackages;
private final List<CatalystInstanceImpl.PendingJSCall> mInitFunctions;
private final DevSupportManager mDevSupportManager; private final DevSupportManager mDevSupportManager;
private final boolean mUseDeveloperSupport; private final boolean mUseDeveloperSupport;
private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener; private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;
@ -217,7 +216,6 @@ public class ReactInstanceManager {
mBundleLoader = bundleLoader; mBundleLoader = bundleLoader;
mJSMainModulePath = jsMainModulePath; mJSMainModulePath = jsMainModulePath;
mPackages = new ArrayList<>(); mPackages = new ArrayList<>();
mInitFunctions = new ArrayList<>();
mUseDeveloperSupport = useDeveloperSupport; mUseDeveloperSupport = useDeveloperSupport;
mDevSupportManager = mDevSupportManager =
DevSupportManagerFactory.create( DevSupportManagerFactory.create(
@ -356,28 +354,6 @@ public class ReactInstanceManager {
catalystInstance.extendNativeModules(nativeModuleRegistry); 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 * 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 * 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); ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);
catalystInstance.runJSBundle(); 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); reactContext.initializeWithInstance(catalystInstance);
return reactContext; return reactContext;