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

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.
@@ -23,9 +23,9 @@
23
23
 
24
24
  #if __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
25
25
  #define USE_CODEGEN_PROVIDER 1
26
- #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
27
26
  #import <React/RCTComponentViewFactory.h>
28
- #endif // __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
27
+ #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
28
+ #endif // __has_include(<ReactCodegen/RCTThirdPartyComponentsProvider.h>)
29
29
 
30
30
  #if __has_include(<react/runtime/JSEngineInstance.h>)
31
31
  using SharedJSRuntimeFactory = std::shared_ptr<facebook::react::JSEngineInstance>;
@@ -1,6 +1,7 @@
1
1
  #include <memory>
2
2
 
3
3
  #import <Foundation/Foundation.h>
4
+ #include <cxxreact/JSExecutor.h>
4
5
 
5
6
  #if USE_FABRIC
6
7
  #import <ReactCommon/RCTTurboModuleManager.h>
@@ -8,11 +9,6 @@
8
9
 
9
10
  @class RCTBridge;
10
11
 
11
- namespace facebook::react
12
- {
13
- class JSExecutorFactory;
14
- } // namespace facebook::react
15
-
16
12
  NS_ASSUME_NONNULL_BEGIN
17
13
 
18
14
  #if USE_FABRIC
@@ -59,8 +59,19 @@ static NSString *const kReactConcurrentRoot = @"concurrentRoot";
59
59
  #elif USE_BRIDGELESS
60
60
  RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName
61
61
  initialProperties:initialProps];
62
+ #if __has_include(<react/renderer/graphics/LinearGradient.h>) // >=0.77
62
63
  return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
63
64
  #else
65
+ // `-initWithSurface:` implicitly calls `start` and causes race conditions.
66
+ // This was fixed in 0.76.7, but for backwards compatibility, we should call
67
+ // `-initWithSurface:sizeMeasureMode` when possible. For more details, see
68
+ // https://github.com/facebook/react-native/pull/47313.
69
+ RCTSurfaceSizeMeasureMode sizeMeasureMode =
70
+ RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact;
71
+ return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface
72
+ sizeMeasureMode:sizeMeasureMode];
73
+ #endif // __has_include(<react/renderer/graphics/LinearGradient.h>)
74
+ #else // __has_include(<React/RCTFabricSurfaceHostingProxyRootView.h>)
64
75
  RCTFabricSurface *surface =
65
76
  [[RCTFabricSurface alloc] initWithSurfacePresenter:self.surfacePresenter
66
77
  moduleName:moduleName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
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",