react-native-tvos 0.74.0-0rc0 → 0.74.0-0rc2

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.
Files changed (85) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +10 -5
  2. package/Libraries/AppDelegate/RCTRootViewFactory.h +13 -3
  3. package/Libraries/AppDelegate/RCTRootViewFactory.mm +25 -10
  4. package/Libraries/Components/Pressable/Pressable.js +9 -13
  5. package/Libraries/Components/Touchable/TVTouchable.js +1 -1
  6. package/Libraries/Components/Touchable/TouchableHighlight.js +2 -2
  7. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  8. package/Libraries/Components/Touchable/TouchableOpacity.js +2 -2
  9. package/Libraries/Core/ReactNativeVersion.js +1 -1
  10. package/Libraries/Pressability/Pressability.js +5 -0
  11. package/Libraries/ReactNative/AppContainer-dev.js +21 -2
  12. package/React/Base/RCTBridge+Inspector.h +30 -0
  13. package/React/Base/RCTBridge+Private.h +0 -20
  14. package/React/Base/RCTBridge.mm +1 -0
  15. package/React/Base/RCTBridgeProxy.h +6 -1
  16. package/React/Base/RCTBridgeProxy.mm +4 -2
  17. package/React/Base/RCTTVNavigationEventNotification.h +37 -0
  18. package/React/Base/RCTTVNavigationEventNotification.mm +106 -0
  19. package/React/Base/RCTTVNavigationEventNotificationConstants.h +25 -0
  20. package/React/Base/RCTTVNavigationEventNotificationConstants.mm +18 -0
  21. package/React/Base/RCTTVRemoteHandler.h +0 -26
  22. package/React/Base/RCTTVRemoteHandler.m +34 -90
  23. package/React/Base/RCTTVRemoteHandlerConstants.h +37 -0
  24. package/React/Base/RCTTVRemoteHandlerConstants.mm +32 -0
  25. package/React/Base/RCTVersion.m +1 -1
  26. package/React/CoreModules/RCTDevSettings.mm +1 -0
  27. package/React/CoreModules/RCTDeviceInfo.mm +15 -16
  28. package/React/CoreModules/RCTTVNavigationEventEmitter.mm +2 -1
  29. package/React/CxxBridge/RCTCxxBridge.mm +1 -0
  30. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +11 -12
  31. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +6 -17
  32. package/React/Fabric/RCTSurfacePointerHandler.mm +1 -0
  33. package/React/Modules/RCTUIManager.m +10 -0
  34. package/React/Views/RCTTVView.m +6 -17
  35. package/React/Views/ScrollView/RCTScrollView.m +11 -12
  36. package/ReactAndroid/api/ReactAndroid.api +25 -1
  37. package/ReactAndroid/build.gradle.kts +18 -6
  38. package/ReactAndroid/gradle.properties +1 -1
  39. package/ReactAndroid/hermes-engine/build.gradle.kts +2 -0
  40. package/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +1 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +4 -0
  42. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +14 -36
  43. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +106 -9
  44. package/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt +8 -0
  45. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +2 -1
  46. package/ReactAndroid/src/main/java/com/facebook/react/fabric/internal/interop/InteropUiBlockListener.kt +8 -2
  47. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +12 -7
  48. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  49. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +64 -0
  50. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +4 -0
  51. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +1 -7
  52. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +6 -1
  53. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java +17 -1
  54. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +1 -1
  55. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  56. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +1 -1
  57. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +4 -1
  58. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +1 -1
  59. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
  60. package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -1
  61. package/ReactCommon/react/runtime/iostests/RCTHostTests.mm +2 -1
  62. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost+Internal.h +0 -2
  63. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +10 -1
  64. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +32 -9
  65. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +2 -1
  66. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +6 -12
  67. package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h +1 -1
  68. package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +3 -2
  69. package/ReactCommon/yoga/Yoga.podspec +4 -1
  70. package/package.json +22 -14
  71. package/scripts/cocoapods/helpers.rb +4 -0
  72. package/scripts/cocoapods/utils.rb +27 -7
  73. package/scripts/react_native_pods.rb +2 -0
  74. package/scripts/xcode/ccache-clang++.sh +14 -0
  75. package/scripts/xcode/ccache-clang.sh +14 -0
  76. package/scripts/xcode/ccache.conf +11 -0
  77. package/sdks/hermes-engine/utils/build-ios-framework.sh +5 -0
  78. package/sdks/hermes-engine/utils/build-mac-framework.sh +5 -0
  79. package/sdks/hermesc/osx-bin/hermes +0 -0
  80. package/sdks/hermesc/osx-bin/hermesc +0 -0
  81. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  82. package/template/ios/HelloWorld/PrivacyInfo.xcprivacy +38 -0
  83. package/template/package.json +6 -6
  84. package/third-party-podspecs/RCT-Folly.podspec +2 -2
  85. package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.java +0 -23
@@ -16,6 +16,8 @@ import static java.lang.Boolean.TRUE;
16
16
  import android.app.Activity;
17
17
  import android.content.Context;
18
18
  import android.content.Intent;
19
+ import android.net.Uri;
20
+ import android.nfc.NfcAdapter;
19
21
  import android.os.Bundle;
20
22
  import androidx.annotation.NonNull;
21
23
  import androidx.annotation.Nullable;
@@ -55,6 +57,7 @@ import com.facebook.react.fabric.FabricUIManager;
55
57
  import com.facebook.react.interfaces.TaskInterface;
56
58
  import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler;
57
59
  import com.facebook.react.interfaces.fabric.ReactSurface;
60
+ import com.facebook.react.modules.appearance.AppearanceModule;
58
61
  import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
59
62
  import com.facebook.react.modules.core.DeviceEventManagerModule;
60
63
  import com.facebook.react.runtime.internal.bolts.Continuation;
@@ -647,6 +650,67 @@ public class ReactHostImpl implements ReactHost {
647
650
  "Tried to access onActivityResult while context is not ready"));
648
651
  }
649
652
 
653
+ /* To be called when focus has changed for the hosting window. */
654
+ @ThreadConfined(UI)
655
+ @Override
656
+ public void onWindowFocusChange(boolean hasFocus) {
657
+ final String method = "onWindowFocusChange(hasFocus = \"" + hasFocus + "\")";
658
+ log(method);
659
+
660
+ ReactContext currentContext = getCurrentReactContext();
661
+ if (currentContext != null) {
662
+ currentContext.onWindowFocusChange(hasFocus);
663
+ }
664
+ ReactSoftExceptionLogger.logSoftException(
665
+ TAG,
666
+ new ReactNoCrashSoftException(
667
+ "Tried to access onWindowFocusChange while context is not ready"));
668
+ }
669
+
670
+ /* This method will give JS the opportunity to receive intents via Linking.
671
+ *
672
+ * @param intent The incoming intent
673
+ */
674
+ @ThreadConfined(UI)
675
+ @Override
676
+ public void onNewIntent(Intent intent) {
677
+ log("onNewIntent()");
678
+
679
+ ReactContext currentContext = getCurrentReactContext();
680
+ if (currentContext != null) {
681
+ String action = intent.getAction();
682
+ Uri uri = intent.getData();
683
+
684
+ if (uri != null
685
+ && (Intent.ACTION_VIEW.equals(action)
686
+ || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) {
687
+ DeviceEventManagerModule deviceEventManagerModule =
688
+ currentContext.getNativeModule(DeviceEventManagerModule.class);
689
+ if (deviceEventManagerModule != null) {
690
+ deviceEventManagerModule.emitNewIntentReceived(uri);
691
+ }
692
+ }
693
+ currentContext.onNewIntent(getCurrentActivity(), intent);
694
+ }
695
+ ReactSoftExceptionLogger.logSoftException(
696
+ TAG,
697
+ new ReactNoCrashSoftException("Tried to access onNewIntent while context is not ready"));
698
+ }
699
+
700
+ @ThreadConfined(UI)
701
+ @Override
702
+ public void onConfigurationChanged(Context updatedContext) {
703
+ ReactContext currentReactContext = getCurrentReactContext();
704
+ if (currentReactContext != null) {
705
+ AppearanceModule appearanceModule =
706
+ currentReactContext.getNativeModule(AppearanceModule.class);
707
+
708
+ if (appearanceModule != null) {
709
+ appearanceModule.onConfigurationChanged(updatedContext);
710
+ }
711
+ }
712
+ }
713
+
650
714
  @Nullable
651
715
  JavaScriptContextHolder getJavaScriptContextHolder() {
652
716
  final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult();
@@ -15,6 +15,7 @@ import com.facebook.infer.annotation.ThreadConfined;
15
15
  import com.facebook.infer.annotation.ThreadSafe;
16
16
  import com.facebook.jni.HybridData;
17
17
  import com.facebook.proguard.annotations.DoNotStrip;
18
+ import com.facebook.react.DebugCorePackage;
18
19
  import com.facebook.react.ReactPackage;
19
20
  import com.facebook.react.ViewManagerOnDemandReactPackage;
20
21
  import com.facebook.react.bridge.Arguments;
@@ -195,6 +196,9 @@ final class ReactInstance {
195
196
  new CoreReactPackage(
196
197
  bridgelessReactContext.getDevSupportManager(),
197
198
  bridgelessReactContext.getDefaultHardwareBackBtnHandler()));
199
+ if (useDevSupport) {
200
+ mReactPackages.add(new DebugCorePackage());
201
+ }
198
202
  mReactPackages.addAll(mDelegate.getReactPackages());
199
203
 
200
204
  TurboModuleManagerDelegate turboModuleManagerDelegate =
@@ -177,7 +177,7 @@ public class UIImplementation {
177
177
  *
178
178
  * @return The num of root view
179
179
  */
180
- private int getRootViewNum() {
180
+ public int getRootViewNum() {
181
181
  return mOperationsQueue.getNativeViewHierarchyManager().getRootViewNum();
182
182
  }
183
183
 
@@ -589,12 +589,6 @@ public class UIImplementation {
589
589
 
590
590
  /** Invoked at the end of the transaction to commit any updates to the node hierarchy. */
591
591
  public void dispatchViewUpdates(int batchId) {
592
- if (getRootViewNum() <= 0) {
593
- // If there are no RootViews registered, there will be no View updates to dispatch.
594
- // This is a hack to prevent this from being called when Fabric is used everywhere.
595
- // This should no longer be necessary in Bridgeless Mode.
596
- return;
597
- }
598
592
  SystraceMessage.beginSection(
599
593
  Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIImplementation.dispatchViewUpdates")
600
594
  .arg("batchId", batchId)
@@ -707,7 +707,12 @@ public class UIManagerModule extends ReactContextBaseJavaModule
707
707
  listener.willDispatchViewUpdates(this);
708
708
  }
709
709
  try {
710
- mUIImplementation.dispatchViewUpdates(batchId);
710
+ // If there are no RootViews registered, there will be no View updates to dispatch.
711
+ // This is a hack to prevent this from being called when Fabric is used everywhere.
712
+ // This should no longer be necessary in Bridgeless Mode.
713
+ if (mUIImplementation.getRootViewNum() > 0) {
714
+ mUIImplementation.dispatchViewUpdates(batchId);
715
+ }
711
716
  } finally {
712
717
  Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
713
718
  }
@@ -53,16 +53,32 @@ public final class ViewManagerRegistry implements ComponentCallbacks2 {
53
53
  * @return the {@link ViewManager} registered to the className received as a parameter
54
54
  */
55
55
  public synchronized ViewManager get(String className) {
56
+ // 1. Try to get the manager without the prefix.
56
57
  ViewManager viewManager = mViewManagers.get(className);
57
58
  if (viewManager != null) {
58
59
  return viewManager;
59
60
  }
61
+
62
+ // 2. Try to get the manager with the RCT prefix.
63
+ String rctViewManagerName = "RCT" + className;
64
+ viewManager = mViewManagers.get(rctViewManagerName);
65
+ if (viewManager != null) {
66
+ return viewManager;
67
+ }
60
68
  if (mViewManagerResolver != null) {
69
+ // 1. Try to get the manager without the prefix.
61
70
  viewManager = getViewManagerFromResolver(className);
62
71
  if (viewManager != null) return viewManager;
72
+
73
+ // 2. Try to get the manager with the RCT prefix.
74
+ viewManager = getViewManagerFromResolver(rctViewManagerName);
75
+ if (viewManager != null) return viewManager;
76
+
63
77
  throw new IllegalViewOperationException(
64
- "ViewManagerResolver returned null for "
78
+ "ViewManagerResolver returned null for either "
65
79
  + className
80
+ + " or "
81
+ + rctViewManagerName
66
82
  + ", existing names are: "
67
83
  + mViewManagerResolver.getViewManagerNames());
68
84
  }
@@ -815,7 +815,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
815
815
  // more information.
816
816
 
817
817
  if (!mScroller.isFinished() && mScroller.getCurrX() != mScroller.getFinalX()) {
818
- int scrollRange = computeHorizontalScrollRange() - getWidth();
818
+ int scrollRange = Math.max(computeHorizontalScrollRange() - getWidth(), 0);
819
819
  if (scrollX >= scrollRange) {
820
820
  mScroller.abortAnimation();
821
821
  scrollX = scrollRange;
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 74;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "0rc0";
21
+ std::string_view Prerelease = "0rc2";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
41
41
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
42
42
 
43
43
  if ENV['USE_FRAMEWORKS']
44
- s.header_mappings_dir = './'
44
+ s.header_mappings_dir = '../'
45
45
  s.module_name = 'React_jserrorhandler'
46
46
  end
47
47
 
@@ -219,7 +219,10 @@ static jsi::Value convertJSErrorDetailsToJSRuntimeError(jsi::Runtime &runtime, N
219
219
  NSString *message = jsErrorDetails[@"message"];
220
220
 
221
221
  auto jsError = createJSRuntimeError(runtime, [message UTF8String]);
222
- jsError.asObject(runtime).setProperty(runtime, "cause", convertObjCObjectToJSIValue(runtime, jsErrorDetails));
222
+ for (NSString *key in jsErrorDetails) {
223
+ id value = jsErrorDetails[key];
224
+ jsError.asObject(runtime).setProperty(runtime, [key UTF8String], convertObjCObjectToJSIValue(runtime, value));
225
+ }
223
226
 
224
227
  return jsError;
225
228
  }
@@ -674,7 +674,7 @@ static Class getFallbackClassFromName(const char *name)
674
674
  */
675
675
  if (_bridge) {
676
676
  [(id)module setValue:_bridge forKey:@"bridge"];
677
- } else if (_bridgeProxy && [self _isLegacyModuleClass:[module class]]) {
677
+ } else if (_bridgeProxy) {
678
678
  [(id)module setValue:_bridgeProxy forKey:@"bridge"];
679
679
  }
680
680
  } @catch (NSException *exception) {
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
42
42
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
43
43
 
44
44
  if ENV['USE_FRAMEWORKS']
45
- s.header_mappings_dir = './'
45
+ s.header_mappings_dir = '../../'
46
46
  s.module_name = 'React_RuntimeCore'
47
47
  end
48
48
 
@@ -168,7 +168,6 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
168
168
  .withAllocInYoung(false)
169
169
  .withRevertToYGAtTTI(true)
170
170
  .build())
171
- .withES6Proxy(false)
172
171
  .withEnableSampleProfiling(true)
173
172
  .withMicrotaskQueue(ReactNativeFeatureFlags::enableMicrotasks())
174
173
  .withVMExperimentFlags(vmExperimentFlags);
@@ -58,7 +58,8 @@ static ShimRCTInstance *shimmedRCTInstance;
58
58
  turboModuleManagerDelegate:OCMProtocolMock(@protocol(RCTTurboModuleManagerDelegate))
59
59
  jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
60
60
  return std::make_shared<facebook::react::RCTHermesInstance>();
61
- }];
61
+ }
62
+ launchOptions:nil];
62
63
  }
63
64
 
64
65
  - (void)tearDown
@@ -9,8 +9,6 @@
9
9
 
10
10
  #import "RCTContextContainerHandling.h"
11
11
 
12
- typedef NSURL * (^RCTHostBundleURLProvider)(void);
13
-
14
12
  @interface RCTHost (Internal)
15
13
 
16
14
  - (void)registerSegmentWithId:(NSNumber *)segmentId path:(NSString *)path;
@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
21
21
 
22
22
  @protocol RCTTurboModuleManagerDelegate;
23
23
 
24
+ typedef NSURL *_Nullable (^RCTHostBundleURLProvider)(void);
25
+
24
26
  // Runtime API
25
27
 
26
28
  @protocol RCTHostDelegate <NSObject>
@@ -45,10 +47,17 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
45
47
 
46
48
  @interface RCTHost : NSObject
47
49
 
50
+ - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider
51
+ hostDelegate:(id<RCTHostDelegate>)hostDelegate
52
+ turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
53
+ jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
54
+ launchOptions:(nullable NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER;
55
+
48
56
  - (instancetype)initWithBundleURL:(NSURL *)bundleURL
49
57
  hostDelegate:(id<RCTHostDelegate>)hostDelegate
50
58
  turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
51
- jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER;
59
+ jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
60
+ launchOptions:(nullable NSDictionary *)launchOptions __deprecated;
52
61
 
53
62
  @property (nonatomic, weak, nullable) id<RCTHostRuntimeDelegate> runtimeDelegate;
54
63
 
@@ -58,6 +58,8 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
58
58
  RCTHostBundleURLProvider _bundleURLProvider;
59
59
  RCTHostJSEngineProvider _jsEngineProvider;
60
60
 
61
+ NSDictionary *_launchOptions;
62
+
61
63
  // All the surfaces that need to be started after main bundle execution
62
64
  NSMutableArray<RCTFabricSurface *> *_surfaceStartBuffer;
63
65
  std::mutex _surfaceStartBufferMutex;
@@ -77,14 +79,31 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
77
79
  _RCTInitializeJSThreadConstantInternal();
78
80
  }
79
81
 
80
- /**
81
- Host initialization should not be resource intensive. A host may be created before any intention of using React Native
82
- has been expressed.
83
- */
84
82
  - (instancetype)initWithBundleURL:(NSURL *)bundleURL
85
83
  hostDelegate:(id<RCTHostDelegate>)hostDelegate
86
84
  turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
87
85
  jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
86
+ launchOptions:(nullable NSDictionary *)launchOptions
87
+ {
88
+ return [self
89
+ initWithBundleURLProvider:^{
90
+ return bundleURL;
91
+ }
92
+ hostDelegate:hostDelegate
93
+ turboModuleManagerDelegate:turboModuleManagerDelegate
94
+ jsEngineProvider:jsEngineProvider
95
+ launchOptions:launchOptions];
96
+ }
97
+
98
+ /**
99
+ Host initialization should not be resource intensive. A host may be created before any intention of using React Native
100
+ has been expressed.
101
+ */
102
+ - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider
103
+ hostDelegate:(id<RCTHostDelegate>)hostDelegate
104
+ turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
105
+ jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider
106
+ launchOptions:(nullable NSDictionary *)launchOptions
88
107
  {
89
108
  if (self = [super init]) {
90
109
  _hostDelegate = hostDelegate;
@@ -93,9 +112,9 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
93
112
  _bundleManager = [RCTBundleManager new];
94
113
  _moduleRegistry = [RCTModuleRegistry new];
95
114
  _jsEngineProvider = [jsEngineProvider copy];
115
+ _launchOptions = [launchOptions copy];
96
116
 
97
117
  __weak RCTHost *weakSelf = self;
98
-
99
118
  auto bundleURLGetter = ^NSURL *()
100
119
  {
101
120
  RCTHost *strongSelf = weakSelf;
@@ -107,7 +126,7 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
107
126
  };
108
127
 
109
128
  auto bundleURLSetter = ^(NSURL *bundleURL_) {
110
- [weakSelf _setBundleURL:bundleURL];
129
+ [weakSelf _setBundleURL:bundleURL_];
111
130
  };
112
131
 
113
132
  auto defaultBundleURLGetter = ^NSURL *()
@@ -120,7 +139,6 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
120
139
  return strongSelf->_bundleURLProvider();
121
140
  };
122
141
 
123
- [self _setBundleURL:bundleURL];
124
142
  [_bundleManager setBridgelessBundleURLGetter:bundleURLGetter
125
143
  andSetter:bundleURLSetter
126
144
  andDefaultGetter:defaultBundleURLGetter];
@@ -166,6 +184,9 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
166
184
 
167
185
  - (void)start
168
186
  {
187
+ if (_bundleURLProvider) {
188
+ [self _setBundleURL:_bundleURLProvider()];
189
+ }
169
190
  auto &inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
170
191
  if (inspectorFlags.getEnableModernCDPRegistry() && !_inspectorPageId.has_value()) {
171
192
  _inspectorTarget =
@@ -204,7 +225,8 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
204
225
  turboModuleManagerDelegate:_turboModuleManagerDelegate
205
226
  onInitialBundleLoad:_onInitialBundleLoad
206
227
  moduleRegistry:_moduleRegistry
207
- parentInspectorTarget:_inspectorTarget.get()];
228
+ parentInspectorTarget:_inspectorTarget.get()
229
+ launchOptions:_launchOptions];
208
230
  [_hostDelegate hostDidStart:self];
209
231
  }
210
232
 
@@ -284,7 +306,8 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
284
306
  turboModuleManagerDelegate:_turboModuleManagerDelegate
285
307
  onInitialBundleLoad:_onInitialBundleLoad
286
308
  moduleRegistry:_moduleRegistry
287
- parentInspectorTarget:_inspectorTarget.get()];
309
+ parentInspectorTarget:_inspectorTarget.get()
310
+ launchOptions:_launchOptions];
288
311
  [_hostDelegate hostDidStart:self];
289
312
 
290
313
  for (RCTFabricSurface *surface in [self _getAttachedSurfaces]) {
@@ -62,7 +62,8 @@ typedef void (^_Null_unspecified RCTInstanceInitialBundleLoadCompletionBlock)();
62
62
  turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
63
63
  onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
64
64
  moduleRegistry:(RCTModuleRegistry *)moduleRegistry
65
- parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget;
65
+ parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget
66
+ launchOptions:(nullable NSDictionary *)launchOptions;
66
67
 
67
68
  - (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
68
69
 
@@ -11,6 +11,7 @@
11
11
 
12
12
  #import <React/NSDataBigString.h>
13
13
  #import <React/RCTAssert.h>
14
+ #import <React/RCTBridge+Inspector.h>
14
15
  #import <React/RCTBridge+Private.h>
15
16
  #import <React/RCTBridge.h>
16
17
  #import <React/RCTBridgeModule.h>
@@ -30,7 +31,6 @@
30
31
  #import <React/RCTModuleData.h>
31
32
  #import <React/RCTPerformanceLogger.h>
32
33
  #import <React/RCTRedBox.h>
33
- #import <React/RCTReloadCommand.h>
34
34
  #import <React/RCTSurfacePresenter.h>
35
35
  #import <ReactCommon/RCTTurboModuleManager.h>
36
36
  #import <ReactCommon/RuntimeExecutor.h>
@@ -83,6 +83,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
83
83
  std::mutex _invalidationMutex;
84
84
  std::atomic<bool> _valid;
85
85
  RCTJSThreadManager *_jsThreadManager;
86
+ NSDictionary *_launchOptions;
86
87
 
87
88
  // APIs supporting interop with native modules and view managers
88
89
  RCTBridgeModuleDecorator *_bridgeModuleDecorator;
@@ -99,6 +100,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
99
100
  onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
100
101
  moduleRegistry:(RCTModuleRegistry *)moduleRegistry
101
102
  parentInspectorTarget:(jsinspector_modern::PageTarget *)parentInspectorTarget
103
+ launchOptions:(nullable NSDictionary *)launchOptions
102
104
  {
103
105
  if (self = [super init]) {
104
106
  _performanceLogger = [RCTPerformanceLogger new];
@@ -124,6 +126,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
124
126
  [weakSelf callFunctionOnJSModule:moduleName method:methodName args:args];
125
127
  }];
126
128
  }
129
+ _launchOptions = launchOptions;
127
130
 
128
131
  NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
129
132
 
@@ -132,11 +135,6 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
132
135
  name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
133
136
  object:nil];
134
137
 
135
- [defaultCenter addObserver:self
136
- selector:@selector(didReceiveReloadCommand)
137
- name:RCTTriggerReloadCommandNotification
138
- object:nil];
139
-
140
138
  [self _start];
141
139
  }
142
140
  return self;
@@ -275,7 +273,8 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
275
273
  [strongSelf registerSegmentWithId:segmentId path:path];
276
274
  }
277
275
  }
278
- runtime:_reactInstance->getJavaScriptContext()];
276
+ runtime:_reactInstance->getJavaScriptContext()
277
+ launchOptions:_launchOptions];
279
278
  bridgeProxy.jsCallInvoker = jsCallInvoker;
280
279
  [RCTBridge setCurrentBridge:(RCTBridge *)bridgeProxy];
281
280
 
@@ -518,9 +517,4 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
518
517
  isFatal:errorMap.getBool(JSErrorHandlerKey::kIsFatal)];
519
518
  }
520
519
 
521
- - (void)didReceiveReloadCommand
522
- {
523
- [self _loadJSBundle:[_bridgeModuleDecorator.bundleManager bundleURL]];
524
- }
525
-
526
520
  @end
@@ -11,7 +11,7 @@
11
11
 
12
12
  @property int initCount;
13
13
  @property int invalidateCount;
14
-
14
+ @property NSDictionary *launchOptions;
15
15
  @property NSString *jsModuleName;
16
16
  @property NSString *method;
17
17
  @property NSArray *args;
@@ -24,7 +24,7 @@ static __weak ShimRCTInstance *weakShim = nil;
24
24
  [ShimRCTInstance class],
25
25
  @selector(initWithDelegate:
26
26
  jsRuntimeFactory:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry
27
- :parentInspectorTarget:));
27
+ :parentInspectorTarget:launchOptions:));
28
28
  RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate));
29
29
  RCTSwizzleInstanceSelector(
30
30
  [RCTInstance class], [ShimRCTInstance class], @selector(callFunctionOnJSModule:method:args:));
@@ -40,7 +40,7 @@ static __weak ShimRCTInstance *weakShim = nil;
40
40
  [ShimRCTInstance class],
41
41
  @selector(initWithDelegate:
42
42
  jsRuntimeFactory:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry
43
- :parentInspectorTarget:));
43
+ :parentInspectorTarget:launchOptions:));
44
44
  RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate));
45
45
  RCTSwizzleInstanceSelector(
46
46
  [RCTInstance class], [ShimRCTInstance class], @selector(callFunctionOnJSModule:method:args:));
@@ -55,6 +55,7 @@ static __weak ShimRCTInstance *weakShim = nil;
55
55
  onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
56
56
  moduleRegistry:(RCTModuleRegistry *)moduleRegistry
57
57
  parentInspectorTarget:(facebook::react::jsinspector_modern::PageTarget *)parentInspectorTarget
58
+ launchOptions:(NSDictionary *)launchOptions
58
59
  {
59
60
  weakShim.initCount++;
60
61
  return self;
@@ -32,7 +32,10 @@ Pod::Spec.new do |spec|
32
32
  spec.requires_arc = false
33
33
  spec.pod_target_xcconfig = {
34
34
  'DEFINES_MODULE' => 'YES'
35
- }
35
+ }.merge!(ENV['USE_FRAMEWORKS'] != nil ? {
36
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)"'
37
+ } : {})
38
+
36
39
  spec.compiler_flags = [
37
40
  '-fno-omit-frame-pointer',
38
41
  '-fexceptions',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.74.0-0rc0",
3
+ "version": "0.74.0-0rc2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -65,6 +65,9 @@
65
65
  "scripts/hermes/hermes-utils.js",
66
66
  "scripts/hermes/prepare-hermes-for-build.js",
67
67
  "scripts/ios-configure-glog.sh",
68
+ "scripts/xcode/ccache-clang++.sh",
69
+ "scripts/xcode/ccache-clang.sh",
70
+ "scripts/xcode/ccache.conf",
68
71
  "scripts/xcode/with-environment.sh",
69
72
  "scripts/native_modules.rb",
70
73
  "scripts/node-binary.sh",
@@ -95,21 +98,26 @@
95
98
  "featureflags-update": "node ./scripts/featureflags/index.js"
96
99
  },
97
100
  "peerDependencies": {
101
+ "@types/react": "^18.2.6",
98
102
  "react": "18.2.0"
99
103
  },
104
+ "peerDependenciesMeta": {
105
+ "@types/react": {
106
+ "optional": true
107
+ }
108
+ },
100
109
  "dependencies": {
101
110
  "@jest/create-cache-key-function": "^29.6.3",
102
- "@react-native-community/cli": "13.6.2",
103
- "@react-native-community/cli-platform-android": "13.6.2",
104
- "@react-native-community/cli-platform-ios": "13.6.2",
105
- "@react-native/assets-registry": "0.74.75",
106
- "@react-native/codegen": "0.74.75",
107
- "@react-native/community-cli-plugin": "0.74.75",
108
- "@react-native/gradle-plugin": "0.74.75",
109
- "@react-native/js-polyfills": "0.74.75",
110
- "@react-native/normalize-colors": "0.74.75",
111
- "@react-native/virtualized-lists": "0.74.75",
112
- "@react-native-tvos/virtualized-lists": "0.74.0-0rc0",
111
+ "@react-native-community/cli": "13.6.4",
112
+ "@react-native-community/cli-platform-android": "13.6.4",
113
+ "@react-native-community/cli-platform-ios": "13.6.4",
114
+ "@react-native/assets-registry": "0.74.79",
115
+ "@react-native/codegen": "0.74.79",
116
+ "@react-native/community-cli-plugin": "0.74.79",
117
+ "@react-native/gradle-plugin": "0.74.79",
118
+ "@react-native/js-polyfills": "0.74.79",
119
+ "@react-native/normalize-colors": "0.74.79",
120
+ "@react-native-tvos/virtualized-lists": "0.74.0-0rc2",
113
121
  "abort-controller": "^3.0.0",
114
122
  "anser": "^1.4.9",
115
123
  "ansi-regex": "^5.0.0",
@@ -156,6 +164,6 @@
156
164
  ]
157
165
  },
158
166
  "devDependencies": {
159
- "react-native-core": "npm:react-native@0.74.0-rc.3"
167
+ "react-native-core": "npm:react-native@0.74.0-rc.8"
160
168
  }
161
- }
169
+ }
@@ -41,6 +41,10 @@ module Helpers
41
41
  return '13.4'
42
42
  end
43
43
 
44
+ def self.min_xcode_version_supported
45
+ return '14.3'
46
+ end
47
+
44
48
  def self.folly_config
45
49
  return {
46
50
  :version => '2024.01.01.00',