Skip to content

Commit

Permalink
Delete RCTTurboModuleManagerDelegate getTurboModule:initParams
Browse files Browse the repository at this point in the history
Summary:
D27316129 made it mandatory for all RCTTurboModules to have a getTurboModule: method. So, there's no need to keep the getTurboModule:initParams method in RCTTurboModuleManagerDelegate. So, to simplify the TurboModule infra, this diff gets rid of that TurboModuleManager delegate method.

Changelog: [iOS][Removed] - Delete RCTTurboModuleManagerDelegate getTurboModule:initParams

Reviewed By: fkgozali

Differential Revision: D27316873

fbshipit-source-id: c0b8449c6088bf08f17ba9a8d1c2cb644e5a242d
  • Loading branch information
RSNara authored and facebook-github-bot committed Apr 9, 2021
1 parent e0b8f50 commit c4c34a1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@

@protocol RCTTurboModuleManagerDelegate <NSObject>

// TODO: Move to xplat codegen.
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params;
@optional
- (NSArray<NSString *> *)getEagerInitModuleNames;
- (NSArray<NSString *> *)getEagerInitMainQueueModuleNames;

@optional

/**
* Given a module name, return its actual class. If not provided, basic ObjC class lookup is performed.
*/
Expand Down
7 changes: 0 additions & 7 deletions packages/rn-tester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,6 @@ - (Class)getModuleClassFromName:(const char *)name
return facebook::react::RNTesterTurboModuleProvider(name, jsInvoker);
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return facebook::react::RNTesterTurboModuleProvider(name, params);
}

- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
if (moduleClass == RCTImageLoader.class) {
Expand Down
6 changes: 0 additions & 6 deletions packages/rn-tester/RNTester/RNTesterTurboModuleProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ Class RNTesterTurboModuleClassProvider(const char *name);
*/
std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name, std::shared_ptr<CallInvoker> jsInvoker);

/**
* Provide an instance of a ObjCTurboModule, given the ObjC instance, specific to this app.
*/
std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name,
const ObjCTurboModule::InitParams &params);

} // namespace react
} // namespace facebook
9 changes: 0 additions & 9 deletions packages/rn-tester/RNTester/RNTesterTurboModuleProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,5 @@ Class RNTesterTurboModuleClassProvider(const char *name) {
return nullptr;
}

std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name,
const ObjCTurboModule::InitParams &params) {
if (name == "SampleTurboModule") {
return std::make_shared<NativeSampleTurboModuleSpecJSI>(params);
}

return nullptr;
}

} // namespace react
} // namespace facebook

0 comments on commit c4c34a1

Please sign in to comment.