@rnx-kit/react-native-host 0.5.0 → 0.5.2

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.
@@ -49,10 +49,36 @@ using SharedJSRuntimeFactory = std::shared_ptr<facebook::react::JSRuntimeFactory
49
49
  @end
50
50
 
51
51
  #ifdef USE_FEATURE_FLAGS
52
+ #if __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>) || __has_include(<React_RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
53
+ #define USE_UNIFIED_FEATURE_FLAGS 1
54
+ #endif // __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
55
+
52
56
  // https://github.com/facebook/react-native/blob/0.74-stable/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm#L272-L286
53
57
  class RNXBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults
54
58
  {
55
59
  public:
60
+ #ifdef USE_UNIFIED_FEATURE_FLAGS // >= 0.77
61
+ bool enableBridgelessArchitecture() override
62
+ {
63
+ return true;
64
+ }
65
+ bool enableFabricRenderer() override
66
+ {
67
+ return true;
68
+ }
69
+ bool useTurboModules() override
70
+ {
71
+ return true;
72
+ }
73
+ bool useNativeViewConfigsInBridgelessMode() override
74
+ {
75
+ return true;
76
+ }
77
+ bool enableFixForViewCommandRace() override
78
+ {
79
+ return true;
80
+ }
81
+ #else // < 0.77
56
82
  bool useModernRuntimeScheduler() override
57
83
  {
58
84
  return true;
@@ -67,6 +93,7 @@ public:
67
93
  {
68
94
  return true;
69
95
  }
96
+ #endif // USE_UNIFIED_FEATURE_FLAGS
70
97
  };
71
98
  #endif // USE_FEATURE_FLAGS
72
99
 
@@ -1,10 +1,6 @@
1
1
  #import "RNXTurboModuleAdapter.h"
2
2
 
3
3
  #include "FollyConfig.h"
4
- #pragma clang diagnostic push
5
- #pragma clang diagnostic ignored "-Wcomma"
6
- #import <cxxreact/JSExecutor.h>
7
- #pragma clang diagnostic pop
8
4
 
9
5
  #if USE_FABRIC
10
6
  #import <React/CoreModulesPlugins.h>
@@ -102,7 +98,11 @@
102
98
 
103
99
  - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
104
100
  {
101
+ #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>) || __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
102
+ return RCTAppSetupDefaultModuleFromClass(moduleClass, nil);
103
+ #else
105
104
  return RCTAppSetupDefaultModuleFromClass(moduleClass);
105
+ #endif // __has_include(<React-RCTAppDelegate/RCTArchConfiguratorProtocol.h>)
106
106
  }
107
107
 
108
108
  // MARK: - Private
@@ -59,10 +59,7 @@ static NSString *const kReactConcurrentRoot = @"concurrentRoot";
59
59
  #elif USE_BRIDGELESS
60
60
  RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName
61
61
  initialProperties:initialProps];
62
- RCTSurfaceSizeMeasureMode sizeMeasureMode =
63
- RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact;
64
- return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface
65
- sizeMeasureMode:sizeMeasureMode];
62
+ return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
66
63
  #else
67
64
  RCTFabricSurface *surface =
68
65
  [[RCTFabricSurface alloc] initWithSurfacePresenter:self.surfacePresenter
@@ -1,10 +1,6 @@
1
1
  #import "ReactNativeHost.h"
2
2
 
3
3
  #include "FollyConfig.h"
4
- #pragma clang diagnostic push
5
- #pragma clang diagnostic ignored "-Wcomma"
6
- #import <cxxreact/JSExecutor.h>
7
- #pragma clang diagnostic pop
8
4
 
9
5
  #import <React/RCTBridge.h>
10
6
  #import <React/RCTBundleURLProvider.h>
@@ -252,7 +248,9 @@ using ReactNativeConfig = facebook::react::EmptyReactNativeConfig const;
252
248
  }
253
249
 
254
250
  #if USE_BRIDGELESS
251
+ #ifndef USE_UNIFIED_FEATURE_FLAGS
255
252
  RCTSetUseNativeViewConfigsInBridgelessMode(YES);
253
+ #endif
256
254
  RCTEnableTurboModuleInterop(YES);
257
255
  RCTEnableTurboModuleInteropBridgeProxy(YES);
258
256
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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",
@@ -31,7 +31,6 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@rnx-kit/scripts": "*",
34
- "@rnx-kit/tsconfig": "*",
35
34
  "prettier": "^3.0.0"
36
35
  },
37
36
  "engines": {