Skip to content

Commit

Permalink
rncli.h -> autolinking.h (#44829)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44829

Another renaming that now we can merge to make clear what's the intent of this header.

Changelog:
[Internal] [Changed] - rncli.h -> autolinking.h

Reviewed By: javache

Differential Revision: D58284662

fbshipit-source-id: 7b69118f72d9b34a88ece7e0855918f5c717999a
  • Loading branch information
cortinico authored and facebook-github-bot committed Jun 9, 2024
1 parent 2483c63 commit 6937c70
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,17 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
}
}

return CPP_TEMPLATE.replace("{{ rncliCppIncludes }}", cppIncludes)
.replace("{{ rncliCppTurboModuleJavaProviders }}", cppTurboModuleJavaProviders)
.replace("{{ rncliCppTurboModuleCxxProviders }}", cppTurboModuleCxxProviders)
.replace("{{ rncliCppComponentDescriptors }}", cppComponentDescriptors)
return CPP_TEMPLATE.replace("{{ autolinkingCppIncludes }}", cppIncludes)
.replace("{{ autolinkingCppTurboModuleJavaProviders }}", cppTurboModuleJavaProviders)
.replace("{{ autolinkingCppTurboModuleCxxProviders }}", cppTurboModuleCxxProviders)
.replace("{{ autolinkingCppComponentDescriptors }}", cppComponentDescriptors)
}

companion object {
const val CMAKE_FILENAME = "Android-autolinking.cmake"

// This needs to be changed to not be `rncli.h`, but requires change to CMake pipeline
const val H_FILENAME = "rncli.h"
const val CPP_FILENAME = "rncli.cpp"
const val H_FILENAME = "autolinking.h"
const val CPP_FILENAME = "autolinking.cpp"

const val CODEGEN_LIB_PREFIX = "react_codegen_"

Expand Down Expand Up @@ -186,24 +185,24 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
*
*/
#include "rncli.h"
{{ rncliCppIncludes }}
#include "autolinking.h"
{{ autolinkingCppIncludes }}
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
{{ rncliCppTurboModuleJavaProviders }}
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
{{ autolinkingCppTurboModuleJavaProviders }}
return nullptr;
}
std::shared_ptr<TurboModule> rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
{{ rncliCppTurboModuleCxxProviders }}
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
{{ autolinkingCppTurboModuleCxxProviders }}
return nullptr;
}
void rncli_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
{{ rncliCppComponentDescriptors }}
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
{{ autolinkingCppComponentDescriptors }}
return;
}
Expand Down Expand Up @@ -234,9 +233,9 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
std::shared_ptr<TurboModule> rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker);
void rncli_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry);
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker);
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry);
} // namespace react
} // namespace facebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,23 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
*
*/
#include "rncli.h"
#include "autolinking.h"
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
return nullptr;
}
std::shared_ptr<TurboModule> rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
return nullptr;
}
void rncli_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
return;
}
Expand Down Expand Up @@ -209,14 +209,14 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
*
*/
#include "rncli.h"
#include "autolinking.h"
#include <aPackage.h>
#include <anotherPackage.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
auto module_aPackage = aPackage_ModuleProvider(moduleName, params);
if (module_aPackage != nullptr) {
return module_aPackage;
Expand All @@ -228,12 +228,12 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
return nullptr;
}
std::shared_ptr<TurboModule> rncli_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
return nullptr;
}
void rncli_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include <DefaultComponentsRegistry.h>
#include <DefaultTurboModuleManagerDelegate.h>
#include <autolinking.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <rncli.h>
#include <rncore.h>

#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
Expand All @@ -56,8 +56,8 @@ void registerComponents(
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
#endif

// And we fallback to the components autolinked by RN CLI
rncli_registerProviders(registry);
// And we fallback to the components autolinked
autolinking_registerProviders(registry);
}

std::shared_ptr<TurboModule> cxxModuleProvider(
Expand All @@ -71,8 +71,8 @@ std::shared_ptr<TurboModule> cxxModuleProvider(
// return std::make_shared<NativeCxxModuleExample>(jsInvoker);
// }

// And we fallback to the CXX module providers autolinked by RN CLI
return rncli_cxxModuleProvider(name, jsInvoker);
// And we fallback to the CXX module providers autolinked
return autolinking_cxxModuleProvider(name, jsInvoker);
}

std::shared_ptr<TurboModule> javaModuleProvider(
Expand Down Expand Up @@ -101,8 +101,8 @@ std::shared_ptr<TurboModule> javaModuleProvider(
return module;
}

// And we fallback to the module providers autolinked by RN CLI
if (auto module = rncli_ModuleProvider(name, params)) {
// And we fallback to the module providers autolinked
if (auto module = autolinking_ModuleProvider(name, params)) {
return module;
}

Expand Down

0 comments on commit 6937c70

Please sign in to comment.