@rnx-kit/react-native-host 0.3.1 → 0.4.0
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.
package/ReactNativeHost.podspec
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
#import <Foundation/Foundation.h>
|
|
4
4
|
|
|
5
|
-
#if
|
|
5
|
+
#if USE_FABRIC
|
|
6
6
|
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
7
|
-
#endif //
|
|
7
|
+
#endif // USE_FABRIC
|
|
8
8
|
|
|
9
9
|
@class RCTBridge;
|
|
10
10
|
|
|
@@ -15,11 +15,11 @@ namespace facebook::react
|
|
|
15
15
|
|
|
16
16
|
NS_ASSUME_NONNULL_BEGIN
|
|
17
17
|
|
|
18
|
-
#if
|
|
18
|
+
#if USE_FABRIC
|
|
19
19
|
@interface RNXTurboModuleAdapter : NSObject <RCTTurboModuleManagerDelegate>
|
|
20
20
|
#else
|
|
21
21
|
@interface RNXTurboModuleAdapter : NSObject
|
|
22
|
-
#endif //
|
|
22
|
+
#endif // USE_FABRIC
|
|
23
23
|
|
|
24
24
|
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:
|
|
25
25
|
(RCTBridge *)bridge;
|
|
@@ -6,43 +6,41 @@
|
|
|
6
6
|
#import <cxxreact/JSExecutor.h>
|
|
7
7
|
#pragma clang diagnostic pop
|
|
8
8
|
|
|
9
|
-
#if
|
|
9
|
+
#if USE_FABRIC
|
|
10
10
|
#import <React/CoreModulesPlugins.h>
|
|
11
11
|
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
12
12
|
|
|
13
13
|
#if __has_include(<React/RCTAppSetupUtils.h>) // <0.72
|
|
14
14
|
#import <React/RCTAppSetupUtils.h>
|
|
15
|
-
#define USE_RUNTIME_SCHEDULER 0
|
|
16
15
|
#else
|
|
17
16
|
#import <React-RCTAppDelegate/RCTAppSetupUtils.h>
|
|
18
17
|
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
|
19
18
|
|
|
20
19
|
// We still get into this path because react-native-macos 0.71 picked up some
|
|
21
|
-
// 0.72 bits. AFAICT, `
|
|
22
|
-
//
|
|
23
|
-
#if __has_include(<
|
|
20
|
+
// 0.72 bits. AFAICT, `SchedulerPriorityUtils.h` is a new addition in 0.72 in
|
|
21
|
+
// both react-native and react-native-macos.
|
|
22
|
+
#if __has_include(<react/renderer/runtimescheduler/SchedulerPriorityUtils.h>)
|
|
23
|
+
#if __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>) // <0.74
|
|
24
24
|
#import <React-RCTAppDelegate/RCTLegacyInteropComponents.h>
|
|
25
|
+
#define MANUALLY_REGISTER_LEGACY_COMPONENTS 1
|
|
26
|
+
#endif // __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
|
|
25
27
|
#import <React/RCTLegacyViewManagerInteropComponentView.h>
|
|
26
28
|
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
27
29
|
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
|
|
28
30
|
#if __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
|
|
29
31
|
#import <React/RCTRuntimeExecutorFromBridge.h>
|
|
30
32
|
#endif // __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
|
|
31
|
-
#define SUPPORTS_LEGACY_COMPONENTS 1
|
|
32
33
|
#define USE_RUNTIME_SCHEDULER 1
|
|
33
|
-
#
|
|
34
|
-
#define SUPPORTS_LEGACY_COMPONENTS 0
|
|
35
|
-
#define USE_RUNTIME_SCHEDULER 0
|
|
36
|
-
#endif // __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
|
|
34
|
+
#endif // __has_include(<react/renderer/runtimescheduler/SchedulerPriorityUtils.h>)
|
|
37
35
|
|
|
38
36
|
#endif // __has_include(<React/RCTAppSetupUtils.h>)
|
|
39
37
|
|
|
40
|
-
#endif //
|
|
38
|
+
#endif // USE_FABRIC
|
|
41
39
|
|
|
42
40
|
@implementation RNXTurboModuleAdapter {
|
|
43
|
-
#if
|
|
41
|
+
#if USE_FABRIC
|
|
44
42
|
RCTTurboModuleManager *_turboModuleManager;
|
|
45
|
-
#endif //
|
|
43
|
+
#endif // USE_FABRIC
|
|
46
44
|
#if USE_RUNTIME_SCHEDULER
|
|
47
45
|
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
|
|
48
46
|
#endif // USE_RUNTIME_SCHEDULER
|
|
@@ -51,17 +49,21 @@
|
|
|
51
49
|
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:
|
|
52
50
|
(RCTBridge *)bridge
|
|
53
51
|
{
|
|
54
|
-
#if
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
#if USE_FABRIC
|
|
53
|
+
#if MANUALLY_REGISTER_LEGACY_COMPONENTS
|
|
54
|
+
for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
|
|
55
|
+
[RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
|
|
56
|
+
}
|
|
57
|
+
#endif // MANUALLY_REGISTER_LEGACY_COMPONENTS
|
|
58
|
+
// jsExecutorFactoryForBridge: (USE_FABRIC=1)
|
|
57
59
|
return [self initJsExecutorFactoryWithBridge:bridge];
|
|
58
60
|
#else
|
|
59
|
-
// jsExecutorFactoryForBridge: (
|
|
61
|
+
// jsExecutorFactoryForBridge: (USE_FABRIC=0)
|
|
60
62
|
return nullptr;
|
|
61
|
-
#endif //
|
|
63
|
+
#endif // USE_FABRIC
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
#if
|
|
66
|
+
#if USE_FABRIC
|
|
65
67
|
|
|
66
68
|
// MARK: - RCTTurboModuleManagerDelegate details
|
|
67
69
|
|
|
@@ -104,15 +106,6 @@
|
|
|
104
106
|
#endif // USE_RUNTIME_SCHEDULER
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
#if SUPPORTS_LEGACY_COMPONENTS
|
|
110
|
-
for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
|
|
111
|
-
[RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
|
|
112
|
-
}
|
|
113
|
-
#endif // SUPPORTS_LEGACY_COMPONENTS
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
#endif // USE_TURBOMODULE
|
|
109
|
+
#endif // USE_FABRIC
|
|
117
110
|
|
|
118
111
|
@end
|
package/cocoa/ReactNativeHost.mm
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
_config = config;
|
|
56
|
-
#if USE_FABRIC
|
|
56
|
+
#if USE_FABRIC
|
|
57
57
|
_turboModuleAdapter = [[RNXTurboModuleAdapter alloc] init];
|
|
58
58
|
#endif
|
|
59
59
|
_isShuttingDown = [[NSLock alloc] init];
|
|
@@ -144,13 +144,13 @@
|
|
|
144
144
|
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:
|
|
145
145
|
(RCTBridge *)bridge
|
|
146
146
|
{
|
|
147
|
-
#if
|
|
148
|
-
// jsExecutorFactoryForBridge: (
|
|
147
|
+
#if USE_FABRIC
|
|
148
|
+
// jsExecutorFactoryForBridge: (USE_FABRIC=1)
|
|
149
149
|
return [_turboModuleAdapter jsExecutorFactoryForBridge:bridge];
|
|
150
150
|
#else
|
|
151
|
-
// jsExecutorFactoryForBridge: (
|
|
151
|
+
// jsExecutorFactoryForBridge: (USE_FABRIC=0)
|
|
152
152
|
return nullptr;
|
|
153
|
-
#endif //
|
|
153
|
+
#endif // USE_FABRIC
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// MARK: - Private
|
package/package.json
CHANGED