Skip to content

Commit

Permalink
remove cxx TM autolinking (#45967)
Browse files Browse the repository at this point in the history
Summary:
Changelog: [iOS][Android][Breaking]

Pull Request resolved: #45967

this was a meaningful exploration, but since we have support in TM for jsi runtime access and that's been widely advertised and accepted, let's get rid of this. it's a bit hacky and hard to use (shown by no one using it), so i want to stop any possibility of its usage.

if interested in accessing jsi::Runtime via a native module, please consider the following options:
- [Android] BindingsInstaller: #44526
- [iOS] RCTTurboModuleWithJSIBindings: #44486
- C++ TurboModules (no autolinking): https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules-xplat.md

Reviewed By: christophpurrer

Differential Revision: D61059182

fbshipit-source-id: da5d74e2b6161ea7e8dd5f664ae0eb927bb1e2c3
  • Loading branch information
philIip authored and facebook-github-bot committed Aug 12, 2024
1 parent d01f1b3 commit 184646e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <jsi/jsi.h>

#include <ReactCommon/BindingsInstallerHolder.h>
#include <ReactCommon/CxxTurboModuleUtils.h>
#include <ReactCommon/JavaInteropTurboModule.h>
#include <ReactCommon/TurboCxxModule.h>
#include <ReactCommon/TurboModuleBinding.h>
Expand Down Expand Up @@ -169,14 +168,6 @@ std::shared_ptr<TurboModule> TurboModuleManager::getTurboModule(
return cxxModule;
}

auto& cxxTurboModuleMapProvider = globalExportedCxxTurboModuleMap();
auto it = cxxTurboModuleMapProvider.find(name);
if (it != cxxTurboModuleMapProvider.end()) {
auto turboModule = it->second(jsCallInvoker_);
turboModuleCache_.insert({name, turboModule});
return turboModule;
}

static auto getTurboJavaModule =
javaPart->getClass()
->getMethod<jni::alias_ref<JTurboModule>(const std::string&)>(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#import <React/RCTPerformanceLogger.h>
#import <React/RCTRuntimeExecutorModule.h>
#import <React/RCTUtils.h>
#import <ReactCommon/CxxTurboModuleUtils.h>
#import <ReactCommon/RCTTurboModuleWithJSIBindings.h>
#import <ReactCommon/TurboCxxModule.h>
#import <ReactCommon/TurboModulePerfLogger.h>
Expand Down Expand Up @@ -329,14 +328,6 @@ - (instancetype)initWithBridgeProxy:(RCTBridgeProxy *)bridgeProxy
TurboModulePerfLogger::moduleCreateFail(moduleName, moduleId);
}

auto &cxxTurboModuleMapProvider = globalExportedCxxTurboModuleMap();
auto it = cxxTurboModuleMapProvider.find(moduleName);
if (it != cxxTurboModuleMapProvider.end()) {
auto turboModule = it->second(_jsInvoker);
_turboModuleCache.insert({moduleName, turboModule});
return turboModule;
}

/**
* Step 2: Look for platform-specific modules.
*/
Expand Down

0 comments on commit 184646e

Please sign in to comment.