@rnx-kit/react-native-host 0.5.4 → 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
|
-
#
|
|
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>;
|
|
@@ -83,10 +83,12 @@ public:
|
|
|
83
83
|
{
|
|
84
84
|
return true;
|
|
85
85
|
}
|
|
86
|
+
#if !__has_include(<React-RCTAppDelegate/RCTReactNativeFactory.h>) && !__has_include(<React_RCTAppDelegate/RCTReactNativeFactory.h>) // 0.77
|
|
86
87
|
bool enableFixForViewCommandRace() override
|
|
87
88
|
{
|
|
88
89
|
return true;
|
|
89
90
|
}
|
|
91
|
+
#endif // 0.77
|
|
90
92
|
#else // < 0.77
|
|
91
93
|
bool useModernRuntimeScheduler() override
|
|
92
94
|
{
|
|
@@ -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.
|
|
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",
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
"react-native": ">=0.66"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@rnx-kit/scripts": "*"
|
|
34
|
-
"prettier": "^3.0.0"
|
|
33
|
+
"@rnx-kit/scripts": "*"
|
|
35
34
|
},
|
|
36
35
|
"engines": {
|
|
37
36
|
"node": ">=16.17"
|