Skip to content

Commit

Permalink
remove "prepareReact" call from the Android bridge
Browse files Browse the repository at this point in the history
Reviewed By: alexeylang

Differential Revision: D6596304

fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f
  • Loading branch information
fromcelticpark authored and facebook-github-bot committed Dec 26, 2017
1 parent 56a42e5 commit 80f9e1f
Showing 1 changed file with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public interface ReactInstanceEventListener {
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;
Expand Down Expand Up @@ -217,7 +216,6 @@ public static ReactInstanceManagerBuilder builder() {
mBundleLoader = bundleLoader;
mJSMainModulePath = jsMainModulePath;
mPackages = new ArrayList<>();
mInitFunctions = new ArrayList<>();
mUseDeveloperSupport = useDeveloperSupport;
mDevSupportManager =
DevSupportManagerFactory.create(
Expand Down Expand Up @@ -356,28 +354,6 @@ public void registerAdditionalPackages(List<ReactPackage> packages) {
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
Expand Down Expand Up @@ -1135,13 +1111,6 @@ private ReactApplicationContext createReactContext(
}
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;
Expand Down

0 comments on commit 80f9e1f

Please sign in to comment.