Skip to content

Commit 9d5033a

Browse files
Delete non C++ Turbo Module SampleCxxModule (#52407)
Summary: Pull Request resolved: #52407 Changelog: [Internal] The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore. Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps: https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules Reviewed By: javache Differential Revision: D77765443 fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
1 parent e870935 commit 9d5033a

5 files changed

Lines changed: 1 addition & 263 deletions

File tree

packages/react-native/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ let reactCxxReact = RNTarget(
178178
name: .reactCxxReact,
179179
path: "ReactCommon/cxxreact",
180180
searchPaths: [CallInvokerPath],
181-
excludedPaths: ["tests", "SampleCXXModule.cpp"],
181+
excludedPaths: ["tests"],
182182
dependencies: [.reactNativeDependencies, .jsi, .reactPerfLogger, .logger, .reactDebug, .reactJsInspector]
183183

184184
)

packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Pod::Spec.new do |s|
2828
s.platforms = min_supported_versions
2929
s.source = source
3030
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
31-
s.exclude_files = "SampleCxxModule.*"
3231
s.pod_target_xcconfig = {
3332
"HEADER_SEARCH_PATHS" => "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
3433
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()

packages/react-native/ReactCommon/cxxreact/SampleCxxModule.cpp

Lines changed: 0 additions & 178 deletions
This file was deleted.

packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h

Lines changed: 0 additions & 55 deletions
This file was deleted.

private/cxx-public-api/ReactNativeCPP.api

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9216,34 +9216,6 @@ struct RecoverableError : public std::exception {
92169216
};
92179217
} // namespace facebook::react
92189218

9219-
/// @src {packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h}:
9220-
namespace facebook {
9221-
namespace xplat {
9222-
namespace samples {
9223-
class Sample {
9224-
public:
9225-
std::string hello();
9226-
double add(double a, double b);
9227-
std::string concat(const std::string& a, const std::string& b);
9228-
std::string repeat(int count, const std::string& str);
9229-
void save(std::map<std::string, std::string> dict);
9230-
std::map<std::string, std::string> load();
9231-
void call_later(int msec, std::function<void()> f);
9232-
void except();
9233-
double twice(double n);
9234-
};
9235-
class SampleCxxModule : public module::CxxModule {
9236-
public:
9237-
SampleCxxModule(std::unique_ptr<Sample> sample);
9238-
std::string getName();
9239-
virtual auto getConstants() -> std::map<std::string, folly::dynamic>;
9240-
virtual auto getMethods() -> std::vector<Method>;
9241-
};
9242-
} // namespace samples
9243-
} // namespace xplat
9244-
} // namespace facebook
9245-
extern "C" facebook::xplat::module::CxxModule* SampleCxxModule();
9246-
92479219
/// @src {packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h}:
92489220
namespace facebook {
92499221
namespace xplat {

0 commit comments

Comments
 (0)