@rnx-kit/react-native-host 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,9 @@
1
1
  #if USE_BRIDGELESS
2
2
 
3
+ // clang-format off
4
+ #import "RNXFeatureMacros.h"
5
+ // clang-format on
6
+
3
7
  #import <React/RCTSurfacePresenterBridgeAdapter.h>
4
8
  #import <ReactCommon/RCTHost+Internal.h>
5
9
  #import <ReactCommon/RCTHost.h>
@@ -10,22 +14,19 @@
10
14
  #import <ReactCommon/RCTJscInstance.h>
11
15
  #endif // USE_HERMES
12
16
 
13
- #if __has_include(<react/config/ReactNativeConfig.h>)
17
+ #ifdef USE_REACT_NATIVE_CONFIG
14
18
  #import <react/config/ReactNativeConfig.h>
15
- #define USE_REACT_NATIVE_CONFIG
16
- #endif // __has_include(<react/config/ReactNativeConfig.h>)
19
+ #endif // USE_REACT_NATIVE_CONFIG
17
20
 
18
- #if __has_include(<react/featureflags/ReactNativeFeatureFlags.h>)
21
+ #ifdef USE_FEATURE_FLAGS
19
22
  #import <react/featureflags/ReactNativeFeatureFlags.h>
20
23
  #import <react/featureflags/ReactNativeFeatureFlagsDefaults.h>
21
- #define USE_FEATURE_FLAGS
22
- #endif // __has_include(<react/featureflags/ReactNativeFeatureFlags.h>)
24
+ #endif // USE_FEATURE_FLAGS
23
25
 
24
- #if __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
25
- #define USE_CODEGEN_PROVIDER 1
26
+ #ifdef USE_CODEGEN_PROVIDER
26
27
  #import <React/RCTComponentViewFactory.h>
27
28
  #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
28
- #endif // __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
29
+ #endif // USE_CODEGEN_PROVIDER
29
30
 
30
31
  #if __has_include(<react/runtime/JSEngineInstance.h>)
31
32
  using SharedJSRuntimeFactory = std::shared_ptr<facebook::react::JSEngineInstance>;
@@ -58,9 +59,6 @@ using SharedJSRuntimeFactory = std::shared_ptr<facebook::react::JSRuntimeFactory
58
59
  @end
59
60
 
60
61
  #ifdef USE_FEATURE_FLAGS
61
- #if __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
62
- #define USE_UNIFIED_FEATURE_FLAGS 1
63
- #endif // __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
64
62
 
65
63
  // https://github.com/facebook/react-native/blob/0.74-stable/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm#L272-L286
66
64
  class RNXBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults
@@ -83,12 +81,22 @@ public:
83
81
  {
84
82
  return true;
85
83
  }
86
- #if !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>) && !__has_include(<React_RCTAppDelegate/RCTReactNativeFactory.h>) // 0.77
84
+ #if USE_VIEW_COMMAND_RACE_FIX // 0.77
87
85
  bool enableFixForViewCommandRace() override
88
86
  {
89
87
  return true;
90
88
  }
91
- #endif // 0.77
89
+ #endif // USE_VIEW_COMMAND_RACE_FIX
90
+ #if USE_UPDATE_RUNTIME_SHADOW_NODE_REFS_ON_COMMIT // >= 0.79
91
+ bool updateRuntimeShadowNodeReferencesOnCommit() override
92
+ {
93
+ return true;
94
+ }
95
+ bool useShadowNodeStateOnClone() override
96
+ {
97
+ return true;
98
+ }
99
+ #endif // USE_UPDATE_RUNTIME_SHADOW_NODE_REFS_ON_COMMIT
92
100
  #else // < 0.77
93
101
  bool useModernRuntimeScheduler() override
94
102
  {
@@ -0,0 +1,31 @@
1
+ #if USE_BRIDGELESS
2
+
3
+ #if __has_include(<react/config/ReactNativeConfig.h>)
4
+ #define USE_REACT_NATIVE_CONFIG 1
5
+ #endif // __has_include(<react/config/ReactNativeConfig.h>)
6
+
7
+ #if __has_include(<react/featureflags/ReactNativeFeatureFlags.h>)
8
+ #define USE_FEATURE_FLAGS 1
9
+ #endif // __has_include(<react/featureflags/ReactNativeFeatureFlags.h>)
10
+
11
+ #if __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
12
+ #define USE_CODEGEN_PROVIDER 1
13
+ #endif // __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
14
+
15
+ #ifdef USE_FEATURE_FLAGS
16
+
17
+ #if __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
18
+ #define USE_UNIFIED_FEATURE_FLAGS 1
19
+ #endif // __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
20
+
21
+ #if !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>) && !__has_include(<React_RCTAppDelegate/RCTReactNativeFactory.h>)
22
+ #define USE_VIEW_COMMAND_RACE_FIX 1
23
+ #endif // !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>)
24
+
25
+ #if __has_include(<React-RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>)
26
+ #define USE_UPDATE_RUNTIME_SHADOW_NODE_REFS_ON_COMMIT 1
27
+ #endif // __has_include(<React-RCTAppDelegate/RCTJSRuntimeConfiguratorProtocol.h>)
28
+
29
+ #endif // USE_FEATURE_FLAGS
30
+
31
+ #endif // USE_BRIDGELESS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Simplify React Native initialization",
5
5
  "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/react-native-host#readme",
6
6
  "license": "MIT",