@rnx-kit/react-native-host 0.5.10 → 0.5.12

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,8 +1,6 @@
1
- #if USE_BRIDGELESS
2
-
3
- // clang-format off
4
1
  #import "RNXFeatureMacros.h"
5
- // clang-format on
2
+
3
+ #if USE_BRIDGELESS
6
4
 
7
5
  #import <React/RCTSurfacePresenterBridgeAdapter.h>
8
6
  #import <ReactCommon/RCTHost+Internal.h>
@@ -1,5 +1,7 @@
1
1
  #import "RNXFabricAdapter.h"
2
2
 
3
+ #import "RNXFeatureMacros.h"
4
+
3
5
  #if USE_FABRIC && !USE_BRIDGELESS
4
6
  #include "FollyConfig.h"
5
7
  #pragma clang diagnostic push
@@ -1,10 +1,19 @@
1
+ // Force enable Hermes if JSC is not available
1
2
  #if !__has_include(<ReactCommon/RCTJscInstance.h>)
2
3
  #ifdef USE_HERMES
3
4
  #undef USE_HERMES
4
- #endif // !USE_HERMES
5
+ #endif // USE_HERMES
5
6
  #define USE_HERMES 1
6
7
  #endif // !__has_include(<ReactCommon/RCTJscInstance.h>)
7
8
 
9
+ // Force enable bridgeless mode if New Architecture is enabled and requires it
10
+ #if USE_FABRIC && !__has_include(<react/config/ReactNativeConfig.h>)
11
+ #ifdef USE_BRIDGELESS
12
+ #undef USE_BRIDGELESS
13
+ #endif // USE_BRIDGELESS
14
+ #define USE_BRIDGELESS 1
15
+ #endif // USE_FABRIC && !__has_include(<react/config/ReactNativeConfig.h>)
16
+
8
17
  #if USE_BRIDGELESS
9
18
 
10
19
  #if __has_include(<react/config/ReactNativeConfig.h>)
@@ -48,6 +48,13 @@
48
48
  #import <react/nativemodule/defaults/DefaultTurboModules.h>
49
49
  #endif
50
50
 
51
+ #if __has_include(<ReactAppDependencyProvider/RCTAppDependencyProvider.h>)
52
+ #import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>
53
+ #define USE_OSS_CODEGEN 1
54
+ #else
55
+ #define USE_OSS_CODEGEN 0
56
+ #endif // __has_include(<ReactAppDependencyProvider/RCTAppDependencyProvider.h>)
57
+
51
58
  #endif // USE_FABRIC
52
59
 
53
60
  @implementation RNXTurboModuleAdapter {
@@ -113,11 +120,13 @@
113
120
 
114
121
  - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
115
122
  {
116
- #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>) || __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
123
+ #if USE_OSS_CODEGEN
124
+ return RCTAppSetupDefaultModuleFromClass(moduleClass, [RCTAppDependencyProvider new]);
125
+ #elif __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>) || __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
117
126
  return RCTAppSetupDefaultModuleFromClass(moduleClass, nil);
118
127
  #else
119
128
  return RCTAppSetupDefaultModuleFromClass(moduleClass);
120
- #endif // __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
129
+ #endif // USE_OSS_CODEGEN
121
130
  }
122
131
 
123
132
  // MARK: - Private
@@ -1,4 +1,8 @@
1
+ // clang-format off
1
2
  #import "ReactNativeHost+Private.h"
3
+ // clang-format on
4
+
5
+ #import "RNXFeatureMacros.h"
2
6
 
3
7
  #ifdef USE_FABRIC
4
8
  #if __has_include(<React/RCTFabricSurfaceHostingProxyRootView.h>)
@@ -12,6 +12,7 @@
12
12
 
13
13
  #import "RNXBridgelessHeaders.h"
14
14
  #import "RNXFabricAdapter.h"
15
+ #import "RNXFeatureMacros.h"
15
16
  #import "RNXHostConfig.h"
16
17
  #import "RNXHostReleaser.h"
17
18
  #import "RNXTurboModuleAdapter.h"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.5.10",
3
+ "version": "0.5.12",
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",