|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#if __has_include(<cxxreact/ReactNativeVersion.h>) |
| 4 | +#include <cxxreact/ReactNativeVersion.h> |
| 5 | +#define REACT_NATIVE_VERSION \ |
| 6 | + REACT_NATIVE_VERSION_MAJOR * 1000000 + REACT_NATIVE_VERSION_MINOR * 1000 + \ |
| 7 | + REACT_NATIVE_VERSION_PATCH |
| 8 | +#else |
| 9 | +#define REACT_NATIVE_VERSION 0 |
| 10 | +#endif // __has_include(<cxxreact/ReactNativeVersion.h>) |
| 11 | + |
| 12 | +// Force enable New Architecture if it cannot be disabled (>= 0.82). Build |
| 13 | +// systems that don't set preprocessor definitions (e.g. SwiftPM) rely on this. |
| 14 | +#if !USE_FABRIC && REACT_NATIVE_VERSION >= 82000 |
| 15 | +#ifdef USE_FABRIC |
| 16 | +#undef USE_FABRIC |
| 17 | +#endif // USE_FABRIC |
| 18 | +#define USE_FABRIC 1 |
| 19 | +#endif // !USE_FABRIC && REACT_NATIVE_VERSION >= 82000 |
| 20 | + |
1 | 21 | // Force enable Hermes if JSC is not available |
2 | 22 | #if !__has_include(<ReactCommon/RCTJscInstance.h>) |
3 | 23 | #ifdef USE_HERMES |
|
16 | 36 |
|
17 | 37 | #if USE_BRIDGELESS |
18 | 38 |
|
19 | | -#if __has_include(<cxxreact/ReactNativeVersion.h>) |
20 | | -#include <cxxreact/ReactNativeVersion.h> |
21 | | -#define REACT_NATIVE_VERSION \ |
22 | | - REACT_NATIVE_VERSION_MAJOR * 1000000 + REACT_NATIVE_VERSION_MINOR * 1000 + \ |
23 | | - REACT_NATIVE_VERSION_PATCH |
24 | | -#else |
25 | | -#define REACT_NATIVE_VERSION 0 |
26 | | -#endif // __has_include(<cxxreact/ReactNativeVersion.h>) |
27 | | - |
28 | 39 | #if __has_include(<react/config/ReactNativeConfig.h>) |
29 | 40 | #define USE_REACT_NATIVE_CONFIG 1 |
30 | 41 | #endif // __has_include(<react/config/ReactNativeConfig.h>) |
|
39 | 50 |
|
40 | 51 | #ifdef USE_FEATURE_FLAGS |
41 | 52 |
|
42 | | -#if __has_include(<react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h>) // >= 0.80 |
| 53 | +#if REACT_NATIVE_VERSION >= 80000 |
43 | 54 | #define USE_FEATURE_FLAGS_OSS_OVERRIDES 1 |
44 | 55 | #define USE_UNIFIED_FEATURE_FLAGS 1 |
45 | 56 | #elif __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTArchConfiguratorProtocol.h>) |
46 | 57 | #define USE_UNIFIED_FEATURE_FLAGS 1 |
47 | | -#endif // __has_include(<react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h>) |
| 58 | +#endif // REACT_NATIVE_VERSION >= 80000 |
48 | 59 |
|
49 | 60 | #if !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>) && !__has_include(<React_RCTAppDelegate/RCTReactNativeFactory.h>) |
50 | 61 | #define USE_VIEW_COMMAND_RACE_FIX 1 |
51 | 62 | #endif // !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>) |
52 | 63 |
|
53 | 64 | // `useShadowNodeStateOnClone` should be enabled from 0.79 and is on by default in 0.85 |
54 | | -#if REACT_NATIVE_VERSION < 85000 && (__has_include(<React-RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>)) |
| 65 | +#if REACT_NATIVE_VERSION >= 79000 && REACT_NATIVE_VERSION < 85000 |
55 | 66 | #define USE_UPDATE_RUNTIME_SHADOW_NODE_REFS_ON_COMMIT 1 |
56 | | -#endif // __has_include(<React-RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>) |
| 67 | +#endif // REACT_NATIVE_VERSION >= 79000 && REACT_NATIVE_VERSION < 85000 |
57 | 68 |
|
58 | 69 | #if REACT_NATIVE_VERSION >= 87000 |
59 | 70 | #define RCT_REMOVE_LEGACY_ARCH 1 |
|
0 commit comments