Skip to content

Commit

Permalink
Require passing in JSCallInvokerHolder to TurboModuleManager
Browse files Browse the repository at this point in the history
Summary: Right now TurboModuleManager gets the JSCallInvokerHolder from the bridge in its constructor; this diff changes the constructor to make the JSCallInvokerHolder a required argument so that TurboModuleManager doesn't directly depend on the bridge.

Reviewed By: axe-fb, RSNara

Differential Revision: D15227184

fbshipit-source-id: b16e6abaa727587986a132d0e124163acdf55408
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed May 9, 2019
1 parent 335c81e commit 078f14c
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.turbomodule.core.interfaces.JSCallInvokerHolder;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import com.facebook.soloader.SoLoader;

Expand All @@ -34,16 +35,11 @@ public class TurboModuleManager implements JSIModule {
private final HybridData mHybridData;

public TurboModuleManager(
ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext, TurboModuleManagerDelegate tmmDelegate) {
ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext, TurboModuleManagerDelegate tmmDelegate, JSCallInvokerHolder instanceHolder) {
mReactApplicationContext = reactApplicationContext;
JSCallInvokerHolderImpl instanceHolder =
(JSCallInvokerHolderImpl) mReactApplicationContext
.getCatalystInstance()
.getJSCallInvokerHolder();
mHybridData = initHybrid(jsContext.get(), instanceHolder, tmmDelegate);
mHybridData = initHybrid(jsContext.get(), (JSCallInvokerHolderImpl) instanceHolder, tmmDelegate);
mTurbomoduleManagerDelegate = tmmDelegate;
}

@DoNotStrip
@SuppressWarnings("unused")
private TurboModule getJavaModule(String name) {
Expand Down

0 comments on commit 078f14c

Please sign in to comment.