diff --git a/packages/nitrogen/src/autolinking/android/createHybridObjectInitializer.ts b/packages/nitrogen/src/autolinking/android/createHybridObjectInitializer.ts index ad434a7e..c0c0d603 100644 --- a/packages/nitrogen/src/autolinking/android/createHybridObjectInitializer.ts +++ b/packages/nitrogen/src/autolinking/android/createHybridObjectInitializer.ts @@ -18,17 +18,7 @@ export function createHybridObjectIntializer(): SourceFile[] { const autolinkingClassName = `${NitroConfig.getAndroidCxxLibName()}OnLoad` const jniRegistrations = getJNINativeRegistrations() - .map((r) => { - const code = `${r.namespace}::${r.className}::registerNatives();` - if (r.ifGuard != null) { - return ` -#if ${r.ifGuard} -${code} -#endif`.trim() - } else { - return code - } - }) + .map((r) => `${r.namespace}::${r.className}::registerNatives();`) .filter(isNotDuplicate) const autolinkedHybridObjects = NitroConfig.getAutolinkedHybridObjects() diff --git a/packages/nitrogen/src/syntax/kotlin/JNINativeRegistrations.ts b/packages/nitrogen/src/syntax/kotlin/JNINativeRegistrations.ts index 0e3fd98d..4d001123 100644 --- a/packages/nitrogen/src/syntax/kotlin/JNINativeRegistrations.ts +++ b/packages/nitrogen/src/syntax/kotlin/JNINativeRegistrations.ts @@ -4,7 +4,6 @@ export interface JNINativeRegistration { namespace: string className: string import: SourceImport - ifGuard?: string } const jniNativeRegistrations: JNINativeRegistration[] = [] diff --git a/packages/nitrogen/src/views/CppHybridViewComponent.ts b/packages/nitrogen/src/views/CppHybridViewComponent.ts index 20354812..3065cd07 100644 --- a/packages/nitrogen/src/views/CppHybridViewComponent.ts +++ b/packages/nitrogen/src/views/CppHybridViewComponent.ts @@ -70,10 +70,8 @@ ${createFileMetadataString(`${component}.hpp`)} #pragma once -#include -#if REACT_NATIVE_VERSION_MINOR >= 78 - #include +#include #include #include #include @@ -158,10 +156,6 @@ namespace ${namespace} { /* The actual view for "${spec.name}" needs to be implemented in platform-specific code. */ } // namespace ${namespace} - -#else -#warning "View Component '${HybridT}' will be unavailable in React Native, because it requires React Native 78 or higher." -#endif `.trim() // .cpp code @@ -193,12 +187,11 @@ ${name}([&]() -> CachedProp<${type}> { ${createFileMetadataString(`${component}.cpp`)} #include "${component}.hpp" -#include -#if REACT_NATIVE_VERSION_MINOR >= 78 #include #include #include +#include #include #include #include @@ -241,8 +234,6 @@ namespace ${namespace} { } } // namespace ${namespace} - -#endif `.trim() const files: SourceFile[] = [ diff --git a/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts b/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts index fbc96d21..92d6d468 100644 --- a/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts +++ b/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts @@ -109,10 +109,8 @@ ${createFileMetadataString(`J${stateUpdaterName}.hpp`)} #pragma once -#include -#if REACT_NATIVE_VERSION_MINOR >= 78 - #include +#include #include #include "${JHybridTSpec}.hpp" @@ -138,8 +136,6 @@ public: }; } // namespace ${cxxNamespace} - -#endif `.trim() const propsUpdaterCalls = spec.properties.map((p) => { @@ -154,10 +150,8 @@ if (props.${name}.isDirty) { ${createFileMetadataString(`J${stateUpdaterName}.cpp`)} #include "J${stateUpdaterName}.hpp" -#include -#if REACT_NATIVE_VERSION_MINOR >= 78 - #include "views/${component}.hpp" +#include namespace ${cxxNamespace} { @@ -182,8 +176,6 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref, } } // namespace ${cxxNamespace} - -#endif `.trim() addJNINativeRegistration({ @@ -194,7 +186,6 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref, space: 'user', language: 'c++', }, - ifGuard: `REACT_NATIVE_VERSION_MINOR >= 78`, }) return [ diff --git a/packages/nitrogen/src/views/swift/SwiftHybridViewManager.ts b/packages/nitrogen/src/views/swift/SwiftHybridViewManager.ts index 3efd917c..94205474 100644 --- a/packages/nitrogen/src/views/swift/SwiftHybridViewManager.ts +++ b/packages/nitrogen/src/views/swift/SwiftHybridViewManager.ts @@ -47,10 +47,9 @@ if (newViewProps.${name}.isDirty) { ${createFileMetadataString(`${component}.mm`)} #import "${component}.hpp" -#include -#if REACT_NATIVE_VERSION_MINOR >= 78 #import +#import #import #import #import @@ -123,8 +122,6 @@ using namespace ${namespace}::views; } @end - -#endif ` return [ diff --git a/packages/react-native-nitro-modules/cpp/utils/NitroDefines.hpp b/packages/react-native-nitro-modules/cpp/utils/NitroDefines.hpp index b2b55772..7d314a59 100644 --- a/packages/react-native-nitro-modules/cpp/utils/NitroDefines.hpp +++ b/packages/react-native-nitro-modules/cpp/utils/NitroDefines.hpp @@ -52,14 +52,4 @@ #define SWIFT_NONCOPYABLE #endif -// React Native Support -#if __has_include() -#include -#endif -#ifndef REACT_NATIVE_VERSION_MINOR -#define REACT_NATIVE_VERSION_MAJOR 0 -#define REACT_NATIVE_VERSION_MINOR 0 -#define REACT_NATIVE_VERSION_PATCH 0 -#endif - #endif /* NitroDefines_h */