Skip to content

Commit

Permalink
Give RNTesterTurboModuleManagerDelegate a Builder
Browse files Browse the repository at this point in the history
Summary:
We'll pass these ReactPackageTurboModuleManagerDelegate.Builders to ReactInstanceManager. ReactInstanceManager will then use these builders to initialize the TurboModule system. To allow TurboModules to work with RNTester, we have to switch RNTester over to using these Builders.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26193054

fbshipit-source-id: d98b857226be3ebaa22b1b734a4e76c0f4be6608
  • Loading branch information
RSNara authored and facebook-github-bot committed Feb 3, 2021
1 parent 2a1b519 commit 48e4e34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ public JSIModule get() {

return new TurboModuleManager(
reactApplicationContext.getCatalystInstance().getRuntimeExecutor(),
new RNTesterTurboModuleManagerDelegate(
reactApplicationContext, packages),
new RNTesterTurboModuleManagerDelegate.Builder()
.setPackages(packages)
.setReactApplicationContext(reactApplicationContext)
.build(),
reactApplicationContext
.getCatalystInstance()
.getJSCallInvokerHolder(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ public class RNTesterTurboModuleManagerDelegate extends ReactPackageTurboModuleM
@VisibleForTesting
native boolean canCreateTurboModule(String moduleName);

public RNTesterTurboModuleManagerDelegate(
private RNTesterTurboModuleManagerDelegate(
ReactApplicationContext context, List<ReactPackage> packages) {
super(context, packages);
}

public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
protected RNTesterTurboModuleManagerDelegate build(
ReactApplicationContext context, List<ReactPackage> packages) {
return new RNTesterTurboModuleManagerDelegate(context, packages);
}
}

@Override
protected void maybeLoadOtherSoLibraries() {
maybeLoadSoLibraries();
Expand Down

0 comments on commit 48e4e34

Please sign in to comment.