remove "prepareReact" call from the Android bridge
Reviewed By: alexeylang Differential Revision: D6596304 fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f
This commit is contained in:
parent
56a42e57d0
commit
80f9e1f7de
|
@ -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<ReactPackage> mPackages;
|
||||
private final List<CatalystInstanceImpl.PendingJSCall> 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;
|
||||
|
|
Loading…
Reference in New Issue