Skip to content

Commit 80f9e1f

Browse files
fromcelticparkfacebook-github-bot
authored andcommitted
remove "prepareReact" call from the Android bridge
Reviewed By: alexeylang Differential Revision: D6596304 fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f
1 parent 56a42e5 commit 80f9e1f

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

-31
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public interface ReactInstanceEventListener {
137137
private final @Nullable JSBundleLoader mBundleLoader;
138138
private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */
139139
private final List<ReactPackage> mPackages;
140-
private final List<CatalystInstanceImpl.PendingJSCall> mInitFunctions;
141140
private final DevSupportManager mDevSupportManager;
142141
private final boolean mUseDeveloperSupport;
143142
private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;
@@ -217,7 +216,6 @@ public static ReactInstanceManagerBuilder builder() {
217216
mBundleLoader = bundleLoader;
218217
mJSMainModulePath = jsMainModulePath;
219218
mPackages = new ArrayList<>();
220-
mInitFunctions = new ArrayList<>();
221219
mUseDeveloperSupport = useDeveloperSupport;
222220
mDevSupportManager =
223221
DevSupportManagerFactory.create(
@@ -356,28 +354,6 @@ public void registerAdditionalPackages(List<ReactPackage> packages) {
356354
catalystInstance.extendNativeModules(nativeModuleRegistry);
357355
}
358356

359-
/**
360-
* If the JavaScript bundle for this app requires initialization as part of bridge start up,
361-
* register a function using its @param module and @param method and optional arguments.
362-
*/
363-
public void registerInitFunction(String module, String method, @Nullable NativeArray arguments) {
364-
CatalystInstanceImpl.PendingJSCall init =
365-
new CatalystInstanceImpl.PendingJSCall(module, method, arguments);
366-
synchronized (this) {
367-
mInitFunctions.add(init);
368-
}
369-
ReactContext context = getCurrentReactContext();
370-
CatalystInstance catalystInstance = context == null ? null : context.getCatalystInstance();
371-
if (catalystInstance == null) {
372-
return;
373-
} else {
374-
// CatalystInstance is only visible after running jsBundle, so these will be put on the native
375-
// JS queue
376-
// TODO T20546472 remove cast when catalystInstance and InstanceImpl are renamed/merged
377-
((CatalystInstanceImpl) catalystInstance).callFunction(init);
378-
}
379-
}
380-
381357
/**
382358
* Recreate the react application and context. This should be called if configuration has changed
383359
* or the developer has requested the app to be reloaded. It should only be called after an
@@ -1135,13 +1111,6 @@ private ReactApplicationContext createReactContext(
11351111
}
11361112
ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);
11371113
catalystInstance.runJSBundle();
1138-
// Transitions functions in the minitFunctions list to catalystInstance, to run after the bundle
1139-
// TODO T20546472
1140-
if (!mInitFunctions.isEmpty()) {
1141-
for (CatalystInstanceImpl.PendingJSCall function : mInitFunctions) {
1142-
((CatalystInstanceImpl) catalystInstance).callFunction(function);
1143-
}
1144-
}
11451114
reactContext.initializeWithInstance(catalystInstance);
11461115

11471116
return reactContext;

0 commit comments

Comments
 (0)