@rnx-kit/react-native-host 0.3.0 → 0.3.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.
@@ -8,7 +8,7 @@ version = package['version']
8
8
  repository = package['repository']
9
9
  repo_dir = repository['directory']
10
10
 
11
- new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
11
+ new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' && ENV['USE_NEW_ARCH'] != '0'
12
12
  preprocessor_definitions = [
13
13
  'FOLLY_CFG_NO_COROUTINES=1',
14
14
  'FOLLY_HAVE_CLOCK_GETTIME=1',
@@ -0,0 +1,7 @@
1
+ #include <folly/Portability.h>
2
+ #if FOLLY_HAS_COROUTINES
3
+ // TODO: `FOLLY_CFG_NO_COROUTINES` was added in 0.73. We can drop this block
4
+ // when we drop support for 0.72:
5
+ // https://github.com/facebook/react-native/commit/17154a661fe06ed25bf599f47bd4193eba011971
6
+ #define FOLLY_HAS_COROUTINES 0
7
+ #endif
@@ -1,6 +1,7 @@
1
1
  #import "RNXFabricAdapter.h"
2
2
 
3
3
  #ifdef USE_FABRIC
4
+ #include "FollyConfig.h"
4
5
  #pragma clang diagnostic push
5
6
  #pragma clang diagnostic ignored "-Wcomma"
6
7
  #pragma clang diagnostic ignored "-Wdocumentation"
@@ -1,12 +1,6 @@
1
1
  #import "RNXTurboModuleAdapter.h"
2
2
 
3
- #include <folly/Portability.h>
4
- #if FOLLY_HAS_COROUTINES
5
- // TODO: `FOLLY_CFG_NO_COROUTINES` was added in 0.73. We can drop this block
6
- // when we drop support for 0.72:
7
- // https://github.com/facebook/react-native/commit/17154a661fe06ed25bf599f47bd4193eba011971
8
- #define FOLLY_HAS_COROUTINES 0
9
- #endif
3
+ #include "FollyConfig.h"
10
4
  #pragma clang diagnostic push
11
5
  #pragma clang diagnostic ignored "-Wcomma"
12
6
  #import <cxxreact/JSExecutor.h>
@@ -18,28 +12,26 @@
18
12
 
19
13
  #if __has_include(<React/RCTAppSetupUtils.h>) // <0.72
20
14
  #import <React/RCTAppSetupUtils.h>
21
- #define USE_RUNTIME_SCHEDULER 0
22
15
  #else
23
16
  #import <React-RCTAppDelegate/RCTAppSetupUtils.h>
24
17
  #import <React/RCTSurfacePresenterBridgeAdapter.h>
25
18
 
26
19
  // We still get into this path because react-native-macos 0.71 picked up some
27
- // 0.72 bits. AFAICT, `RCTLegacyInteropComponents.h` is a new addition in 0.72
28
- // in both react-native and react-native-macos.
29
- #if __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
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
30
24
  #import <React-RCTAppDelegate/RCTLegacyInteropComponents.h>
25
+ #define MANUALLY_REGISTER_LEGACY_COMPONENTS 1
26
+ #endif // __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
31
27
  #import <React/RCTLegacyViewManagerInteropComponentView.h>
32
28
  #import <react/renderer/runtimescheduler/RuntimeScheduler.h>
33
29
  #import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
34
30
  #if __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
35
31
  #import <React/RCTRuntimeExecutorFromBridge.h>
36
32
  #endif // __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
37
- #define SUPPORTS_LEGACY_COMPONENTS 1
38
33
  #define USE_RUNTIME_SCHEDULER 1
39
- #else
40
- #define SUPPORTS_LEGACY_COMPONENTS 0
41
- #define USE_RUNTIME_SCHEDULER 0
42
- #endif // __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
34
+ #endif // __has_include(<react/renderer/runtimescheduler/SchedulerPriorityUtils.h>)
43
35
 
44
36
  #endif // __has_include(<React/RCTAppSetupUtils.h>)
45
37
 
@@ -58,7 +50,11 @@
58
50
  (RCTBridge *)bridge
59
51
  {
60
52
  #if USE_TURBOMODULE
61
- [self registerLegacyViewManagers];
53
+ #if MANUALLY_REGISTER_LEGACY_COMPONENTS
54
+ for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
55
+ [RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
56
+ }
57
+ #endif // MANUALLY_REGISTER_LEGACY_COMPONENTS
62
58
  // jsExecutorFactoryForBridge: (USE_TURBOMODULE=1)
63
59
  return [self initJsExecutorFactoryWithBridge:bridge];
64
60
  #else
@@ -90,7 +86,8 @@
90
86
 
91
87
  // MARK: - Private
92
88
 
93
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)initJsExecutorFactoryWithBridge:(RCTBridge *)bridge
89
+ - (std::unique_ptr<facebook::react::JSExecutorFactory>)initJsExecutorFactoryWithBridge:
90
+ (RCTBridge *)bridge
94
91
  {
95
92
  #if USE_RUNTIME_SCHEDULER
96
93
  _runtimeScheduler =
@@ -109,15 +106,6 @@
109
106
  #endif // USE_RUNTIME_SCHEDULER
110
107
  }
111
108
 
112
- - (void)registerLegacyViewManagers
113
- {
114
- #if SUPPORTS_LEGACY_COMPONENTS
115
- for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
116
- [RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
117
- }
118
- #endif // SUPPORTS_LEGACY_COMPONENTS
119
- }
120
-
121
109
  #endif // USE_TURBOMODULE
122
110
 
123
111
  @end
@@ -1,12 +1,6 @@
1
1
  #import "ReactNativeHost.h"
2
2
 
3
- #include <folly/Portability.h>
4
- #if FOLLY_HAS_COROUTINES
5
- // TODO: `FOLLY_CFG_NO_COROUTINES` was added in 0.73. We can drop this block
6
- // when we drop support for 0.72:
7
- // https://github.com/facebook/react-native/commit/17154a661fe06ed25bf599f47bd4193eba011971
8
- #define FOLLY_HAS_COROUTINES 0
9
- #endif
3
+ #include "FollyConfig.h"
10
4
  #pragma clang diagnostic push
11
5
  #pragma clang diagnostic ignored "-Wcomma"
12
6
  #import <cxxreact/JSExecutor.h>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.3.0",
3
+ "version": "0.3.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",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@rnx-kit/scripts": "*",
31
+ "@rnx-kit/tsconfig": "*",
31
32
  "prettier": "^3.0.0"
32
33
  }
33
34
  }