fix extraModulesForBridge: in interop

Summary:
Changelog: [Internal]

the delegate of TMM is RCTInstance, but RCTInstance doesn't forward all of the APIs and we aren't protected by the compiler because of the optional in TMMDelegate

i found that this backwards compat API did not actually get set up correctly and was never working in the first place... this is why we should avoid optional

long term, TMMDelegate needs to be pushed down to the infra layer and not exist in product, cc blakef

Reviewed By: javache

Differential Revision: D66148789

fbshipit-source-id: 925a6d4ebb6ba6bfb0b1aec6710695e7551ba475
This commit is contained in:
Phillip Pan
2024-11-21 23:02:15 -08:00
committed by Facebook GitHub Bot
parent e2c621c5fc
commit 3575e21f73
@@ -144,8 +144,8 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
{
std::lock_guard<std::mutex> lock(_invalidationMutex);
_valid = false;
if (self->_reactInstance) {
self->_reactInstance->unregisterFromInspector();
if (_reactInstance) {
_reactInstance->unregisterFromInspector();
}
[_surfacePresenter suspend];
[_jsThreadManager dispatchToJSThread:^{
@@ -210,6 +210,15 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
return nullptr;
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
if ([_appTMMDelegate respondsToSelector:@selector(extraModulesForBridge:)]) {
return [_appTMMDelegate extraModulesForBridge:nil];
}
return @[];
}
#pragma mark - Private
- (void)_start