From 3df83fb73823f34d049e581e125db5fbcd29b276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Tue, 12 Sep 2023 15:27:43 +0200 Subject: [PATCH 1/7] feat: add visionos support --- .../Libraries/AppDelegate/RCTAppDelegate.mm | 26 + .../NativeAnimation/RCTAnimationUtils.h | 1 + .../RCTPushNotificationManager.h | 2 +- .../RCTPushNotificationManager.mm | 8 +- .../Libraries/Text/Text/RCTTextView.mm | 2 +- .../Text/TextInput/RCTBaseTextInputView.mm | 4 + packages/react-native/React-Core.podspec | 2 +- packages/react-native/React/Base/RCTConvert.m | 5 + .../react-native/React/Base/RCTKeyCommands.m | 5 +- packages/react-native/React/Base/RCTUtils.h | 8 + packages/react-native/React/Base/RCTUtils.m | 29 +- .../React/CoreModules/RCTAlertController.mm | 4 +- .../React/CoreModules/RCTDevLoadingView.mm | 20 +- .../React/CoreModules/RCTDeviceInfo.mm | 20 +- .../React/CoreModules/RCTPerfMonitor.mm | 7 +- .../React/CoreModules/RCTRedBox.mm | 7 +- .../React/CoreModules/RCTStatusBarManager.mm | 28 +- .../CoreModules/React-CoreModules.podspec | 2 +- .../RCTInputAccessoryComponentView.mm | 4 + .../Modal/RCTFabricModalHostViewController.mm | 13 + .../ScrollView/RCTScrollViewComponentView.mm | 4 + .../Text/RCTParagraphComponentView.mm | 2 +- .../TextInput/RCTTextInputComponentView.mm | 2 + .../TextInput/RCTTextInputUtils.mm | 2 + .../View/RCTViewComponentView.mm | 4 + .../React/Fabric/RCTSurfacePointerHandler.mm | 7 +- .../React/Fabric/RCTSurfaceTouchHandler.mm | 2 + .../react-native/React/Modules/RCTUIManager.m | 7 +- .../react-native/React/UIUtils/RCTUIUtils.m | 15 +- .../React/Views/RCTModalHostView.m | 5 +- .../React/Views/RCTModalHostViewController.m | 9 +- .../react-native/React/Views/RCTViewManager.h | 19 + .../react-native/React/Views/RCTViewManager.m | 10 +- .../React/Views/RCTWrapperViewController.m | 3 + .../React/Views/ScrollView/RCTScrollView.m | 4 + .../Views/ScrollView/RCTScrollViewManager.h | 6 + .../Views/ScrollView/RCTScrollViewManager.m | 6 +- .../ios/ReactCommon/RCTSampleTurboModule.mm | 11 +- .../scripts/cocoapods/jsengine.rb | 2 +- .../react-native/scripts/react_native_pods.rb | 10 +- .../sdks/hermes-engine/hermes-engine.podspec | 4 +- .../third-party-podspecs/SocketRocket.podspec | 24 + .../third-party-podspecs/YogaKit.podspec | 39 ++ .../third-party-podspecs/libevent.podspec | 560 ++++++++++++++++++ packages/rn-tester/Gemfile | 3 +- packages/rn-tester/Podfile | 10 +- packages/rn-tester/Podfile.lock | 444 ++++---------- packages/rn-tester/RNTester/AppDelegate.mm | 4 +- .../RNTesterPods.xcodeproj/project.pbxproj | 72 +-- 49 files changed, 1058 insertions(+), 429 deletions(-) create mode 100644 packages/react-native/third-party-podspecs/SocketRocket.podspec create mode 100644 packages/react-native/third-party-podspecs/YogaKit.podspec create mode 100644 packages/react-native/third-party-podspecs/libevent.podspec diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 348355bae359dd..fea12e7002f363 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -12,6 +12,7 @@ #import #import "RCTAppSetupUtils.h" #import "RCTLegacyInteropComponents.h" +#import #if RCT_NEW_ARCH_ENABLED #if RN_DISABLE_OSS_PLUGIN_HEADER @@ -53,6 +54,21 @@ @interface RCTAppDelegate () < #endif + +#if TARGET_OS_VISION +@interface GlassViewController : UIViewController + +@end + +@implementation GlassViewController + +- (UIContainerBackgroundStyle)preferredContainerBackgroundStyle { + return UIContainerBackgroundStyleGlass; +} + +@end +#endif + @interface RCTAppDelegate () { std::shared_ptr _runtimeScheduler; } @@ -125,7 +141,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *initProps = [self prepareInitialProps]; rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps]; } + +#if TARGET_OS_VISION + self.window = [[UIWindow alloc] initWithFrame:RCTForegroundWindow().bounds]; +#else self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; +#endif + UIViewController *rootViewController = [self createRootViewController]; [self setRootView:rootView toRootViewController:rootViewController]; self.window.rootViewController = rootViewController; @@ -177,7 +199,11 @@ - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge - (UIViewController *)createRootViewController { +#if TARGET_OS_VISION + return [GlassViewController new]; +#else return [UIViewController new]; +#endif } - (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController diff --git a/packages/react-native/Libraries/NativeAnimation/RCTAnimationUtils.h b/packages/react-native/Libraries/NativeAnimation/RCTAnimationUtils.h index 77152f4a5773de..562913126e9442 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTAnimationUtils.h +++ b/packages/react-native/Libraries/NativeAnimation/RCTAnimationUtils.h @@ -7,6 +7,7 @@ #import #import +#import #import diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h index 778db415b5875c..64db4431c3e1b3 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h @@ -13,7 +13,7 @@ extern NSString *const RCTRemoteNotificationReceived; typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result); -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION + (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; + (void)didReceiveRemoteNotification:(NSDictionary *)notification; diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index 0d586d8e65dd99..b184d600aaf3d1 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -24,7 +24,7 @@ static NSString *const kErrorUnableToRequestPermissions = @"E_UNABLE_TO_REQUEST_PERMISSIONS"; -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION @implementation RCTConvert (NSCalendarUnit) RCT_ENUM_CONVERTER( @@ -81,13 +81,13 @@ + (UILocalNotification *)UILocalNotification:(id)json @end #else -@interface RCTPushNotificationManager () +@interface RCTPushNotificationManager () @end #endif // TARGET_OS_UIKITFORMAC @implementation RCTPushNotificationManager -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification) { @@ -140,7 +140,7 @@ - (dispatch_queue_t)methodQueue return dispatch_get_main_queue(); } -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION - (void)startObserving { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/packages/react-native/Libraries/Text/Text/RCTTextView.mm b/packages/react-native/Libraries/Text/Text/RCTTextView.mm index 3f64e313ab58f1..5e5362bc6e76d9 100644 --- a/packages/react-native/Libraries/Text/Text/RCTTextView.mm +++ b/packages/react-native/Libraries/Text/Text/RCTTextView.mm @@ -225,7 +225,7 @@ - (void)disableContextMenu - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture { // TODO: Adopt showMenuFromRect (necessary for UIKitForMac) -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION UIMenuController *menuController = [UIMenuController sharedMenuController]; if (menuController.isMenuVisible) { diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm index b0d71dcd3508bb..c6f15d8679bfc2 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm @@ -642,6 +642,7 @@ - (void)didSetProps:(NSArray *)changedProps - (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID { +#if !TARGET_OS_VISION __weak RCTBaseTextInputView *weakSelf = self; [_bridge.uiManager rootViewForReactTag:self.reactTag withCompletion:^(UIView *rootView) { @@ -656,10 +657,12 @@ - (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID } } }]; +#endif } - (void)setDefaultInputAccessoryView { +#if !TARGET_OS_VISION UIView *textInputView = self.backedTextInputView; UIKeyboardType keyboardType = textInputView.keyboardType; @@ -691,6 +694,7 @@ - (void)setDefaultInputAccessoryView textInputView.inputAccessoryView = nil; } [self reloadInputViewsIfNecessary]; +#endif } - (void)reloadInputViewsIfNecessary diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index 5f94cc4455f6a8..81813b175e665d 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -18,7 +18,7 @@ end folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32' folly_version = '2023.08.07.00' -socket_rocket_version = '0.6.1' +socket_rocket_version = '0.6.1.1' boost_compiler_flags = '-Wno-documentation' use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' diff --git a/packages/react-native/React/Base/RCTConvert.m b/packages/react-native/React/Base/RCTConvert.m index 34822463593f8f..650105169c4d85 100644 --- a/packages/react-native/React/Base/RCTConvert.m +++ b/packages/react-native/React/Base/RCTConvert.m @@ -538,8 +538,13 @@ + (UIKeyboardType)UIKeyboardType:(id)json RCT_DYNAMIC (@{ @"default" : @(UIBarStyleDefault), @"black" : @(UIBarStyleBlack), +#if TARGET_OS_VISION + @"blackOpaque" : @(UIBarStyleBlack), + @"blackTranslucent" : @(UIBarStyleBlack), +#else @"blackOpaque" : @(UIBarStyleBlackOpaque), @"blackTranslucent" : @(UIBarStyleBlackTranslucent), +#endif }), UIBarStyleDefault, integerValue) diff --git a/packages/react-native/React/Base/RCTKeyCommands.m b/packages/react-native/React/Base/RCTKeyCommands.m index 1ceaf6ec0dceb1..2643e368afc819 100644 --- a/packages/react-native/React/Base/RCTKeyCommands.m +++ b/packages/react-native/React/Base/RCTKeyCommands.m @@ -127,8 +127,11 @@ - (void)handleKeyUIEventSwizzle:(UIEvent *)event if ([event respondsToSelector:@selector(_isKeyDown)]) { isKeyDown = [event _isKeyDown]; } - +#if !TARGET_OS_VISION BOOL interactionEnabled = !RCTSharedApplication().isIgnoringInteractionEvents; +#else + BOOL interactionEnabled = true; +#endif BOOL hasFirstResponder = NO; if (isKeyDown && modifiedInput.length > 0 && interactionEnabled) { UIResponder *firstResponder = nil; diff --git a/packages/react-native/React/Base/RCTUtils.h b/packages/react-native/React/Base/RCTUtils.h index dc218c47f199fc..2260a8ea4f8808 100644 --- a/packages/react-native/React/Base/RCTUtils.h +++ b/packages/react-native/React/Base/RCTUtils.h @@ -91,6 +91,14 @@ RCT_EXTERN UIApplication *__nullable RCTSharedApplication(void); // or view controller RCT_EXTERN UIWindow *__nullable RCTKeyWindow(void); +#if TARGET_OS_VISION +// Returns the current active UIWindow based on UIWindowScene +RCT_EXTERN UIWindow *__nullable RCTForegroundWindow(void); + +// Returns UIStatusBarManager to get it's configuration info. +RCT_EXTERN UIStatusBarManager *__nullable RCTUIStatusBarManager(void); +#endif + // Returns the presented view controller, useful if you need // e.g. to present a modal view controller or alert over it RCT_EXTERN UIViewController *__nullable RCTPresentedViewController(void); diff --git a/packages/react-native/React/Base/RCTUtils.m b/packages/react-native/React/Base/RCTUtils.m index 01bd5cde9fc3df..49fe1d9985a0f8 100644 --- a/packages/react-native/React/Base/RCTUtils.m +++ b/packages/react-native/React/Base/RCTUtils.m @@ -301,18 +301,23 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp void RCTComputeScreenScale(void) { +#if !TARGET_OS_VISION dispatch_once(&onceTokenScreenScale, ^{ screenScale = [UIScreen mainScreen].scale; }); +#endif } CGFloat RCTScreenScale(void) { +#if !TARGET_OS_VISION RCTUnsafeExecuteOnMainQueueOnceSync(&onceTokenScreenScale, ^{ screenScale = [UIScreen mainScreen].scale; }); - return screenScale; +#endif + + return 1; } CGFloat RCTFontSizeMultiplier(void) @@ -347,9 +352,14 @@ CGSize RCTScreenSize(void) static CGSize size; static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ RCTUnsafeExecuteOnMainQueueSync(^{ +#if TARGET_OS_VISION + size = RCTKeyWindow().bounds.size; +#else size = [UIScreen mainScreen].bounds.size; +#endif }); }); @@ -557,6 +567,23 @@ BOOL RCTRunningInAppExtension(void) return nil; } +#if TARGET_OS_VISION +UIWindow *__nullable RCTForegroundWindow(void) +{ + // React native only supports single scene apps. + NSSet *scenes = RCTSharedApplication().connectedScenes; + UIWindowScene *firstScene = [scenes anyObject]; + return [[UIWindow alloc] initWithWindowScene:firstScene]; +} + +UIStatusBarManager *__nullable RCTUIStatusBarManager(void) { + NSSet *connectedScenes = RCTSharedApplication().connectedScenes; + UIWindowScene *windowScene = [connectedScenes anyObject]; + return windowScene.statusBarManager; +} + +#endif + UIViewController *__nullable RCTPresentedViewController(void) { if ([RCTUtilsUIOverride hasPresentedViewController]) { diff --git a/packages/react-native/React/CoreModules/RCTAlertController.mm b/packages/react-native/React/CoreModules/RCTAlertController.mm index cd01ef56d72684..2d9d3dcef83a34 100644 --- a/packages/react-native/React/CoreModules/RCTAlertController.mm +++ b/packages/react-native/React/CoreModules/RCTAlertController.mm @@ -21,7 +21,8 @@ - (UIWindow *)alertWindow { if (_alertWindow == nil) { _alertWindow = [self getUIWindowFromScene]; - + +#if !TARGET_OS_VISION if (_alertWindow == nil) { UIWindow *keyWindow = RCTSharedApplication().keyWindow; if (keyWindow) { @@ -31,6 +32,7 @@ - (UIWindow *)alertWindow NSLog(@"Unable to create alert window: keyWindow is nil"); } } +#endif if (_alertWindow) { _alertWindow.rootViewController = [UIViewController new]; diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index ab9c945790e358..92edb7ed0d5ce9 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -114,13 +114,30 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( dispatch_async(dispatch_get_main_queue(), ^{ self->_showDate = [NSDate date]; if (!self->_window && !RCTRunningInTestEnvironment()) { + +#if TARGET_OS_VISION + UIWindow *window = RCTKeyWindow(); + CGSize screenSize = window.bounds.size; + + self->_window = + [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 30)]; + self->_label = + [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top + 5, screenSize.width, 20)]; +#else CGSize screenSize = [UIScreen mainScreen].bounds.size; - UIWindow *window = RCTSharedApplication().keyWindow; + self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 10)]; self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top - 10, screenSize.width, 20)]; +#endif + + + self->_window = + [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 30)]; + self->_label = + [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top + 5, screenSize.width, 20)]; [self->_window addSubview:self->_label]; self->_window.windowLevel = UIWindowLevelStatusBar + 1; @@ -142,6 +159,7 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( }); [self hideBannerAfter:15.0]; + } RCT_EXPORT_METHOD(showMessage diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index f2d55e334a9a1f..65928bf751196f 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -51,6 +51,8 @@ - (void)initialize selector:@selector(didReceiveNewContentSizeMultiplier) name:RCTAccessibilityManagerDidUpdateMultiplierNotification object:[_moduleRegistry moduleForName:"AccessibilityManager"]]; + +#if !TARGET_OS_VISION _currentInterfaceOrientation = [RCTSharedApplication() statusBarOrientation]; @@ -58,6 +60,7 @@ - (void)initialize selector:@selector(interfaceOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; +#endif _currentInterfaceDimensions = [self _exportedDimensions]; @@ -85,15 +88,16 @@ - (void)invalidate static BOOL RCTIsIPhoneNotched() { static BOOL isIPhoneNotched = NO; - static dispatch_once_t onceToken; +#if !TARGET_OS_VISION + static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - RCTAssertMainQueue(); - - // 20pt is the top safeArea value in non-notched devices - isIPhoneNotched = RCTSharedApplication().keyWindow.safeAreaInsets.top > 20; - }); + dispatch_once(&onceToken, ^{ + RCTAssertMainQueue(); + // 20pt is the top safeArea value in non-notched devices + isIPhoneNotched = RCTSharedApplication().keyWindow.safeAreaInsets.top > 20; + }); +#endif return isIPhoneNotched; } @@ -176,6 +180,7 @@ - (void)interfaceOrientationDidChange - (void)_interfaceOrientationDidChange { +#if !TARGET_OS_VISION UIApplication *application = RCTSharedApplication(); UIInterfaceOrientation nextOrientation = [application statusBarOrientation]; @@ -205,6 +210,7 @@ - (void)_interfaceOrientationDidChange _isFullscreen = isRunningInFullScreen; #pragma clang diagnostic pop } +#endif } - (void)interfaceFrameDidChange diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index a089054feb6fb0..d588c594bea0cb 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -183,7 +183,12 @@ - (UIPanGestureRecognizer *)gestureRecognizer - (UIView *)container { if (!_container) { - CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size; +#if TARGET_OS_VISION + CGSize statusBarSize = RCTUIStatusBarManager().statusBarFrame.size; +#else + CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size; +#endif + CGFloat statusBarHeight = statusBarSize.height; _container = [[UIView alloc] initWithFrame:CGRectMake(10, statusBarHeight, 180, RCTPerfMonitorBarHeight)]; _container.layer.borderWidth = 2; diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index dc58594a80702c..8bd77dfbbacd0a 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -594,7 +594,12 @@ - (void)showErrorMessage:(NSString *)message #pragma clang diagnostic pop if (!self->_window) { - self->_window = [[RCTRedBoxWindow alloc] initWithFrame:[UIScreen mainScreen].bounds +#if TARGET_OS_VISION + CGRect frame = RCTForegroundWindow().bounds; +#else + CGRect frame = [UIScreen mainScreen].bounds; +#endif + self->_window = [[RCTRedBoxWindow alloc] initWithFrame:frame customButtonTitles:self->_customButtonTitles customButtonHandlers:self->_customButtonHandlers]; self->_window.actionDelegate = self; diff --git a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm index 29309135309eac..af2154d0dea098 100644 --- a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm +++ b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm @@ -76,6 +76,7 @@ + (BOOL)requiresMainQueueSetup - (void)startObserving { +#if !TARGET_OS_VISION NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(applicationDidChangeStatusBarFrame:) @@ -85,6 +86,7 @@ - (void)startObserving selector:@selector(applicationWillChangeStatusBarFrame:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil]; +#endif } - (void)stopObserving @@ -94,6 +96,7 @@ - (void)stopObserving - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notification { +#if !TARGET_OS_VISION CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue]; NSDictionary *event = @{ @"frame" : @{ @@ -104,6 +107,7 @@ - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notifi }, }; [self sendEventWithName:eventName body:event]; +#endif } - (void)applicationDidChangeStatusBarFrame:(NSNotification *)notification @@ -118,13 +122,20 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification RCT_EXPORT_METHOD(getHeight : (RCTResponseSenderBlock)callback) { +#if !TARGET_OS_VISION callback(@[ @{ @"height" : @(RCTSharedApplication().statusBarFrame.size.height), } ]); +#else + callback(@[ @{ + @"height" : @(RCTUIStatusBarManager().statusBarFrame.size), + } ]); +#endif } RCT_EXPORT_METHOD(setStyle : (NSString *)style animated : (BOOL)animated) { +#if !TARGET_OS_VISION dispatch_async(dispatch_get_main_queue(), ^{ UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle:style]; if (RCTViewControllerBasedStatusBarAppearance()) { @@ -133,14 +144,16 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification } else { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - [RCTSharedApplication() setStatusBarStyle:statusBarStyle animated:animated]; - } + [RCTSharedApplication() setStatusBarStyle:statusBarStyle animated:animated]; + } #pragma clang diagnostic pop }); +#endif } RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (NSString *)withAnimation) { +#if !TARGET_OS_VISION dispatch_async(dispatch_get_main_queue(), ^{ UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation:withAnimation]; if (RCTViewControllerBasedStatusBarAppearance()) { @@ -149,17 +162,18 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification } else { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - [RCTSharedApplication() setStatusBarHidden:hidden withAnimation:animation]; + [RCTSharedApplication() setStatusBarHidden:hidden withAnimation:animation]; #pragma clang diagnostic pop } }); +#endif } RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible) { - dispatch_async(dispatch_get_main_queue(), ^{ +#if !TARGET_OS_VISION RCTSharedApplication().networkActivityIndicatorVisible = visible; - }); +#endif } - (facebook::react::ModuleConstants)getConstants @@ -167,7 +181,11 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification __block facebook::react::ModuleConstants constants; RCTUnsafeExecuteOnMainQueueSync(^{ constants = facebook::react::typedConstants({ +#if TARGET_OS_VISION + .HEIGHT = RCTUIStatusBarManager().statusBarFrame.size.height, +#else .HEIGHT = RCTSharedApplication().statusBarFrame.size.height, +#endif .DEFAULT_BACKGROUND_COLOR = std::nullopt, }); }); diff --git a/packages/react-native/React/CoreModules/React-CoreModules.podspec b/packages/react-native/React/CoreModules/React-CoreModules.podspec index 0b809773fabc3a..b656832171258e 100644 --- a/packages/react-native/React/CoreModules/React-CoreModules.podspec +++ b/packages/react-native/React/CoreModules/React-CoreModules.podspec @@ -18,7 +18,7 @@ end folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32' folly_version = '2023.08.07.00' -socket_rocket_version = '0.6.1' +socket_rocket_version = '0.6.1.1' header_search_paths = [ "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"", diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm index 454c3ff1ac279d..957c610b89bbfd 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm @@ -67,7 +67,9 @@ - (void)didMoveToWindow if (self.window && !_textInput) { if (self.nativeId) { _textInput = RCTFindTextInputWithNativeId(self.window, self.nativeId); +#if !TARGET_OS_VISION _textInput.inputAccessoryView = _contentView; +#endif } else { _textInput = RCTFindTextInputWithNativeId(_contentView, nil); } @@ -83,10 +85,12 @@ - (BOOL)canBecomeFirstResponder return true; } +#if !TARGET_OS_VISION - (UIView *)inputAccessoryView { return _contentView; } +#endif #pragma mark - RCTComponentViewProtocol diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm index db5b92fb8f48e4..f0881fd9541628 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -44,7 +44,11 @@ - (void)loadView - (UIStatusBarStyle)preferredStatusBarStyle { +#if !TARGET_OS_VISION return [RCTSharedApplication() statusBarStyle]; +#else + return UIStatusBarStyleDefault; +#endif } - (void)viewDidDisappear:(BOOL)animated @@ -55,14 +59,23 @@ - (void)viewDidDisappear:(BOOL)animated - (BOOL)prefersStatusBarHidden { +#if !TARGET_OS_VISION return [RCTSharedApplication() isStatusBarHidden]; +#else + return false; +#endif } #if RCT_DEV - (UIInterfaceOrientationMask)supportedInterfaceOrientations { +#if !TARGET_OS_VISION UIInterfaceOrientationMask appSupportedOrientationsMask = [RCTSharedApplication() supportedInterfaceOrientationsForWindow:[RCTSharedApplication() keyWindow]]; +#else + UIInterfaceOrientationMask appSupportedOrientationsMask = UIInterfaceOrientationMaskPortrait; +#endif + if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) { RCTLogError( @"Modal was presented with 0x%x orientations mask but the application only supports 0x%x." diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 504b0ef147ae0b..3a765dd7c7d02c 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -28,6 +28,7 @@ static const CGFloat kClippingLeeway = 44.0; +#if !TARGET_OS_VISION static UIScrollViewKeyboardDismissMode RCTUIKeyboardDismissModeFromProps(const ScrollViewProps &props) { switch (props.keyboardDismissMode) { @@ -39,6 +40,7 @@ static UIScrollViewKeyboardDismissMode RCTUIKeyboardDismissModeFromProps(const S return UIScrollViewKeyboardDismissModeInteractive; } } +#endif static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(const ScrollViewProps &props) { @@ -299,9 +301,11 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & MAP_SCROLL_VIEW_PROP(disableIntervalMomentum); MAP_SCROLL_VIEW_PROP(snapToInterval); +#if !TARGET_OS_VISION if (oldScrollViewProps.keyboardDismissMode != newScrollViewProps.keyboardDismissMode) { scrollView.keyboardDismissMode = RCTUIKeyboardDismissModeFromProps(newScrollViewProps); } +#endif [super updateProps:props oldProps:oldProps]; } diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index 27f52dd15150dc..b2ae6df61a13d6 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -223,7 +223,7 @@ - (void)disableContextMenu - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture { // TODO: Adopt showMenuFromRect (necessary for UIKitForMac) -#if !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION UIMenuController *menuController = [UIMenuController sharedMenuController]; if (menuController.isMenuVisible) { diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index e7b69bff2f9e68..a1ec3dce785e0d 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -475,6 +475,7 @@ - (void)setTextAndSelection:(NSInteger)eventCount - (void)setDefaultInputAccessoryView { +#if !TARGET_OS_VISION // InputAccessoryView component sets the inputAccessoryView when inputAccessoryViewID exists if (_backedTextInputView.inputAccessoryViewID) { if (_backedTextInputView.isFirstResponder) { @@ -514,6 +515,7 @@ - (void)setDefaultInputAccessoryView if (_backedTextInputView.isFirstResponder) { [_backedTextInputView reloadInputViews]; } +#endif } - (void)handleInputAccessoryDoneButton diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm index d4b91c921b1114..3bc3f3a298e47f 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm @@ -26,7 +26,9 @@ void RCTCopyBackedTextInput( toTextInput.placeholder = fromTextInput.placeholder; toTextInput.placeholderColor = fromTextInput.placeholderColor; toTextInput.textContainerInset = fromTextInput.textContainerInset; +#if !TARGET_OS_VISION toTextInput.inputAccessoryView = fromTextInput.inputAccessoryView; +#endif toTextInput.textInputDelegate = fromTextInput.textInputDelegate; toTextInput.placeholderColor = fromTextInput.placeholderColor; toTextInput.defaultTextAttributes = fromTextInput.defaultTextAttributes; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index d06b0aa8d1c2bf..cb2afd402f0a63 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -252,7 +252,11 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & // `shouldRasterize` if (oldViewProps.shouldRasterize != newViewProps.shouldRasterize) { self.layer.shouldRasterize = newViewProps.shouldRasterize; +#if !TARGET_OS_VISION self.layer.rasterizationScale = newViewProps.shouldRasterize ? [UIScreen mainScreen].scale : 1.0; +#else + self.layer.rasterizationScale = 1.0; +#endif } // `pointerEvents` diff --git a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm index 67a89beac124b2..b70c5f59563cea 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm @@ -281,6 +281,7 @@ static PointerEvent CreatePointerEventFromActivePointer( UIView *rootComponentView) { PointerEvent event = {}; +#if !TARGET_OS_VISION event.pointerId = activePointer.identifier; event.pointerType = PointerTypeCStringFromUITouchType(activePointer.touchType); @@ -329,7 +330,7 @@ static PointerEvent CreatePointerEventFromActivePointer( event.tangentialPressure = 0.0; event.twist = 0; event.isPrimary = activePointer.isPrimary; - +#endif return event; } @@ -369,6 +370,7 @@ static void UpdateActivePointerWithUITouch( UIEvent *uiEvent, UIView *rootComponentView) { +#if !TARGET_OS_VISION CGPoint location = [uiTouch locationInView:rootComponentView]; UIView *hitTestedView = [rootComponentView hitTest:location withEvent:nil]; activePointer.componentView = FindClosestFabricManagedTouchableView(hitTestedView); @@ -394,6 +396,7 @@ static void UpdateActivePointerWithUITouch( activePointer.button = ButtonMaskDiffToButton(activePointer.buttonMask, nextButtonMask); activePointer.buttonMask = nextButtonMask; activePointer.modifierFlags = uiEvent.modifierFlags; +#endif } /** @@ -747,6 +750,7 @@ - (void)hovering:(UIHoverGestureRecognizer *)recognizer pointerId:(int)pointerId pointerType:(std::string)pointerType API_AVAILABLE(ios(13.0)) { +#if !TARGET_OS_VISION UIView *listenerView = recognizer.view; CGPoint clientLocation = [recognizer locationInView:listenerView]; CGPoint screenLocation = [listenerView convertPoint:clientLocation @@ -769,6 +773,7 @@ - (void)hovering:(UIHoverGestureRecognizer *)recognizer if (eventEmitter != nil) { eventEmitter->onPointerMove(event); } +#endif } #pragma mark - Shared pointer handlers diff --git a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm index a793251fc622c3..51e4a14e026f59 100644 --- a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm @@ -54,6 +54,7 @@ static void UpdateActiveTouchWithUITouch( UIView *rootComponentView, CGPoint rootViewOriginOffset) { +#if !TARGET_OS_VISION CGPoint offsetPoint = [uiTouch locationInView:activeTouch.componentView]; CGPoint pagePoint = [uiTouch locationInView:rootComponentView]; CGPoint screenPoint = [rootComponentView convertPoint:pagePoint @@ -69,6 +70,7 @@ static void UpdateActiveTouchWithUITouch( if (RCTForceTouchAvailable()) { activeTouch.touch.force = RCTZeroIfNaN(uiTouch.force / uiTouch.maximumPossibleForce); } +#endif } static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, UIView *rootComponentView, CGPoint rootViewOriginOffset) diff --git a/packages/react-native/React/Modules/RCTUIManager.m b/packages/react-native/React/Modules/RCTUIManager.m index 9fe11430c8b7f0..ffeaca91c06757 100644 --- a/packages/react-native/React/Modules/RCTUIManager.m +++ b/packages/react-native/React/Modules/RCTUIManager.m @@ -185,10 +185,12 @@ - (void)setBridge:(RCTBridge *)bridge object:[self->_bridge moduleForName:@"AccessibilityManager" lazilyLoadIfNecessary:YES]]; }); +#if !TARGET_OS_VISION [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(namedOrientationDidChange) name:UIDeviceOrientationDidChangeNotification object:nil]; +#endif [RCTLayoutAnimation initializeStatics]; } @@ -256,16 +258,19 @@ - (void)didReceiveNewContentSizeMultiplier - (void)namedOrientationDidChange { +#if !TARGET_OS_VISION NSDictionary *orientationEvent = deviceOrientationEventBody([UIDevice currentDevice].orientation); if (!orientationEvent) { return; } - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" [[_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"namedOrientationDidChange" body:orientationEvent]; #pragma clang diagnostic pop +#endif + return; + } - (dispatch_queue_t)methodQueue diff --git a/packages/react-native/React/UIUtils/RCTUIUtils.m b/packages/react-native/React/UIUtils/RCTUIUtils.m index ed2aa676e27a9d..82411abebf7f2d 100644 --- a/packages/react-native/React/UIUtils/RCTUIUtils.m +++ b/packages/react-native/React/UIUtils/RCTUIUtils.m @@ -11,19 +11,28 @@ RCTDimensions RCTGetDimensions(CGFloat fontScale) { +#if TARGET_OS_VISION + CGSize screenSize = RCTForegroundWindow().bounds.size; +#else UIScreen *mainScreen = UIScreen.mainScreen; CGSize screenSize = mainScreen.bounds.size; - +#endif UIView *mainWindow; mainWindow = RCTKeyWindow(); // We fallback to screen size if a key window is not found. CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize; + CGFloat scale; +#if TARGET_OS_VISION + scale = 1; +#else + scale = mainScreen.scale; +#endif RCTDimensions result; typeof(result.screen) dimsScreen = { - .width = screenSize.width, .height = screenSize.height, .scale = mainScreen.scale, .fontScale = fontScale}; + .width = screenSize.width, .height = screenSize.height, .scale = scale, .fontScale = fontScale}; typeof(result.window) dimsWindow = { - .width = windowSize.width, .height = windowSize.height, .scale = mainScreen.scale, .fontScale = fontScale}; + .width = windowSize.width, .height = windowSize.height, .scale = scale, .fontScale = fontScale}; result.screen = dimsScreen; result.window = dimsWindow; diff --git a/packages/react-native/React/Views/RCTModalHostView.m b/packages/react-native/React/Views/RCTModalHostView.m index dfde4ae47ab137..9694d67e8e1d0b 100644 --- a/packages/react-native/React/Views/RCTModalHostView.m +++ b/packages/react-native/React/Views/RCTModalHostView.m @@ -75,8 +75,11 @@ - (void)notifyForOrientationChange if (!_onOrientationChange) { return; } - +#if !TARGET_OS_VISION UIInterfaceOrientation currentOrientation = [RCTSharedApplication() statusBarOrientation]; +#else + UIInterfaceOrientation currentOrientation = UIDeviceOrientationUnknown; +#endif if (currentOrientation == _lastKnownOrientation) { return; } diff --git a/packages/react-native/React/Views/RCTModalHostViewController.m b/packages/react-native/React/Views/RCTModalHostViewController.m index 059b64157f9836..973367c567ed0d 100644 --- a/packages/react-native/React/Views/RCTModalHostViewController.m +++ b/packages/react-native/React/Views/RCTModalHostViewController.m @@ -23,10 +23,11 @@ - (instancetype)init } self.modalInPresentation = YES; - +#if !TARGET_OS_VISION _preferredStatusBarStyle = [RCTSharedApplication() statusBarStyle]; _preferredStatusBarHidden = [RCTSharedApplication() isStatusBarHidden]; - +#endif + return self; } @@ -53,8 +54,12 @@ - (BOOL)prefersStatusBarHidden #if RCT_DEV - (UIInterfaceOrientationMask)supportedInterfaceOrientations { +#if !TARGET_OS_VISION UIInterfaceOrientationMask appSupportedOrientationsMask = [RCTSharedApplication() supportedInterfaceOrientationsForWindow:[RCTSharedApplication() keyWindow]]; +#else + UIInterfaceOrientationMask appSupportedOrientationsMask = UIInterfaceOrientationMaskPortrait; +#endif if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) { RCTLogError( @"Modal was presented with 0x%x orientations mask but the application only supports 0x%x." diff --git a/packages/react-native/React/Views/RCTViewManager.h b/packages/react-native/React/Views/RCTViewManager.h index 1676e69f2aca86..ca76e780b720c5 100644 --- a/packages/react-native/React/Views/RCTViewManager.h +++ b/packages/react-native/React/Views/RCTViewManager.h @@ -79,6 +79,25 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary #import +#if !TARGET_OS_VISION + @interface RCTConvert (UIScrollView) + (UIScrollViewKeyboardDismissMode)UIScrollViewKeyboardDismissMode:(id)json; @end +#endif + @interface RCTScrollViewManager : RCTViewManager @end + + diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m index 03355504e0a1dc..8805a8a8cb9001 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m @@ -12,6 +12,8 @@ #import "RCTShadowView.h" #import "RCTUIManager.h" +#if !TARGET_OS_VISION + @implementation RCTConvert (UIScrollView) RCT_ENUM_CONVERTER( @@ -49,6 +51,8 @@ @implementation RCTConvert (UIScrollView) @end +#endif + @implementation RCTScrollViewManager RCT_EXPORT_MODULE() @@ -70,7 +74,7 @@ - (UIView *)view RCT_EXPORT_VIEW_PROPERTY(decelerationRate, CGFloat) RCT_EXPORT_VIEW_PROPERTY(directionalLockEnabled, BOOL) RCT_EXPORT_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle) -RCT_EXPORT_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) +RCT_EXPORT_NOT_VISIONOS_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) RCT_EXPORT_VIEW_PROPERTY(maximumZoomScale, CGFloat) RCT_EXPORT_VIEW_PROPERTY(minimumZoomScale, CGFloat) RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm index 8a286dcfd33665..593f677ec2f3f1 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm @@ -46,12 +46,15 @@ - (NSDictionary *)getConstants { __block NSDictionary *constants; RCTUnsafeExecuteOnMainQueueSync(^{ - UIScreen *mainScreen = UIScreen.mainScreen; - CGSize screenSize = mainScreen.bounds.size; - +#if TARGET_OS_VISION + CGSize screenSize = CGSizeMake(100, 100); +#else + UIScreen *mainScreen = UIScreen.mainScreen; + CGSize screenSize = mainScreen.bounds.size; +#endif constants = @{ @"const1" : @YES, - @"const2" : @(screenSize.width), + @"const2" : @(screenSize), @"const3" : @"something", }; }); diff --git a/packages/react-native/scripts/cocoapods/jsengine.rb b/packages/react-native/scripts/cocoapods/jsengine.rb index 12f8cd65674943..14c1ae8806e48a 100644 --- a/packages/react-native/scripts/cocoapods/jsengine.rb +++ b/packages/react-native/scripts/cocoapods/jsengine.rb @@ -30,5 +30,5 @@ def setup_hermes!(react_native_path: "../node_modules/react-native") hermestag = File.exist?(hermestag_file) ? File.read(hermestag_file).strip : '' pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes-engine/hermes-engine.podspec", :tag => hermestag pod 'React-hermes', :path => "#{react_native_path}/ReactCommon/hermes" - pod 'libevent', '~> 2.1.12' + pod 'libevent', :podspec => "#{react_native_path}/third-party-podspecs/libevent.podspec", :modular_headers => true end diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 909dd733e60080..ff5d6ba3dab273 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -41,11 +41,15 @@ def min_ios_version_supported return Helpers::Constants.min_ios_version_supported end +def min_visionos_version_supported + return '1.0' +end + # This function returns the min supported OS versions supported by React Native # By using this function, you won't have to manually change your Podfile # when we change the minimum version supported by the framework. def min_supported_versions - return { :ios => min_ios_version_supported } + return { :ios => min_ios_version_supported, :visionos => min_visionos_version_supported } end # This function prepares the project for React Native, before processing @@ -157,6 +161,10 @@ def use_react_native! ( pod 'boost', :podspec => "#{prefix}/third-party-podspecs/boost.podspec" pod 'fmt', :podspec => "#{prefix}/third-party-podspecs/fmt.podspec" pod 'RCT-Folly', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec", :modular_headers => true + pod 'fmt', :podspec => "#{prefix}/third-party-podspecs/fmt.podspec", :modular_headers => true + pod 'SocketRocket', :podspec => "#{prefix}/third-party-podspecs/SocketRocket.podspec", :modular_headers => true + # pod 'YogaKit', :podspec => "#{prefix}/third-party-podspecs/YogaKit.podspec", :modular_headers => true + run_codegen!( app_path, diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 769d8ce0d60afc..6f0e3fc2b5ffba 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |spec| spec.license = package['license'] spec.author = "Facebook" spec.source = source - spec.platforms = { :osx => "10.13", :ios => "13.4" } + spec.platforms = { :osx => "10.13", :ios => "13.4", :visionos => "1.0" } spec.preserve_paths = '**/*.*' spec.source_files = '' @@ -35,6 +35,7 @@ Pod::Spec.new do |spec| } spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework" + spec.visionos.vendored_frameworks = "destroot/Library/Frameworks/visionos/hermes.framework" spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" if HermesEngineSourceType::isPrebuilt(source_type) then @@ -44,6 +45,7 @@ Pod::Spec.new do |spec| ss.source_files = "destroot/include/**/*.h" ss.header_mappings_dir = "destroot/include" ss.ios.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework" + ss.visionos.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework" ss.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" end diff --git a/packages/react-native/third-party-podspecs/SocketRocket.podspec b/packages/react-native/third-party-podspecs/SocketRocket.podspec new file mode 100644 index 00000000000000..a7915f9acce777 --- /dev/null +++ b/packages/react-native/third-party-podspecs/SocketRocket.podspec @@ -0,0 +1,24 @@ +Pod::Spec.new do |s| + s.name = 'SocketRocket' + s.version = '0.6.1.1' + s.summary = 'A conforming WebSocket (RFC 6455) client library for iOS, macOS and tvOS.' + s.homepage = 'https://github.com/facebook/SocketRocket' + s.authors = { 'Nikita Lutsenko' => 'nlutsenko@me.com', 'Dan Federman' => 'federman@squareup.com', 'Mike Lewis' => 'mikelikespie@gmail.com' } + s.license = 'BSD' + s.source = { :git => 'https://github.com/facebook/SocketRocket.git', :tag => '0.6.1' } + s.requires_arc = true + + s.source_files = 'SocketRocket/**/*.{h,m}' + s.public_header_files = 'SocketRocket/*.h' + + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '9.0' + s.visionos.deployment_target = '1.0' + + s.ios.frameworks = 'CFNetwork', 'Security' + s.osx.frameworks = 'CoreServices', 'Security' + s.tvos.frameworks = 'CFNetwork', 'Security' + s.visionos.frameworks = 'CFNetwork', 'Security' + s.libraries = 'icucore' + end \ No newline at end of file diff --git a/packages/react-native/third-party-podspecs/YogaKit.podspec b/packages/react-native/third-party-podspecs/YogaKit.podspec new file mode 100644 index 00000000000000..ec2c5654a351b4 --- /dev/null +++ b/packages/react-native/third-party-podspecs/YogaKit.podspec @@ -0,0 +1,39 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +podspec = Pod::Spec.new do |spec| + spec.name = 'YogaKit' + spec.version = '1.18.1' + spec.license = { :type => 'MIT', :file => "LICENSE" } + spec.homepage = 'https://facebook.github.io/yoga/' + spec.documentation_url = 'https://facebook.github.io/yoga/docs/' + + spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.' + spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.' + + spec.authors = 'Facebook' + spec.source = { + :git => 'https://github.com/facebook/yoga.git', + :tag => "1.18.0", + } + + spec.platforms = { :ios => "9.0", :visionos => "1.0" } + spec.ios.deployment_target = '8.0' + spec.ios.frameworks = 'UIKit' + spec.module_name = 'YogaKit' + spec.dependency 'Yoga' + # Fixes the bug related the xcode 11 not able to find swift related frameworks. + # https://github.com/Carthage/Carthage/issues/2825 + # https://twitter.com/krzyzanowskim/status/1151549874653081601?s=21 + spec.pod_target_xcconfig = {"LD_VERIFY_BITCODE": "NO"} + spec.source_files = 'YogaKit/Source/*.{h,m,swift}' + spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h' + spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h' + spec.swift_version = '5.1' + end + + # See https://github.com/facebook/yoga/pull/366 + podspec.attributes_hash["readme"] = "YogaKit/README.md" + podspec \ No newline at end of file diff --git a/packages/react-native/third-party-podspecs/libevent.podspec b/packages/react-native/third-party-podspecs/libevent.podspec new file mode 100644 index 00000000000000..7051785f86552a --- /dev/null +++ b/packages/react-native/third-party-podspecs/libevent.podspec @@ -0,0 +1,560 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +# Generated with: +# +# $ mkdir build && cd build +# $ cmake -G Ninja .. \ +# -DEVENT__DISABLE_OPENSSL:BOOL=ON \ +# -DEVENT__DISABLE_BENCHMARK:BOOL=ON \ +# -DEVENT__DISABLE_TESTS:BOOL=ON \ +# -DEVENT__DISABLE_REGRESS:BOOL=ON \ +# -DEVENT__DISABLE_SAMPLES:BOOL=ON +# $ cat include/event2/event-config.h +# +CONFIG_WITHOUT_OPENSSL = <<-END_OF_CONFIG +/* event-config.h + * + * This file was generated by cmake when the makefiles were generated. + * + * DO NOT EDIT THIS FILE. + * + * Do not rely on macros in this file existing in later versions. + */ +#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_ +#define EVENT2_EVENT_CONFIG_H_INCLUDED_ + +/* Numeric representation of the version */ +#define EVENT__NUMERIC_VERSION 0x02020001 +#define EVENT__PACKAGE_VERSION "2.2.0" + +#define EVENT__VERSION_MAJOR 2 +#define EVENT__VERSION_MINOR 2 +#define EVENT__VERSION_PATCH 0 + +/* Version number of package */ +#define EVENT__VERSION "2.2.0-alpha-dev" + +/* Name of package */ +#define EVENT__PACKAGE "libevent" + +/* Define to the address where bug reports for this package should be sent. */ +#define EVENT__PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define EVENT__PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define EVENT__PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define EVENT__PACKAGE_TARNAME "" + +/* Define if libevent should build without support for a debug mode */ +/* #undef EVENT__DISABLE_DEBUG_MODE */ + +/* Define if libevent should not allow replacing the mm functions */ +/* #undef EVENT__DISABLE_MM_REPLACEMENT */ + +/* Define if libevent should not be compiled with thread support */ +/* #undef EVENT__DISABLE_THREAD_SUPPORT */ + +/* Define to 1 if you have the `accept4' function. */ +/* #undef EVENT__HAVE_ACCEPT4 */ + +/* Define to 1 if you have the `arc4random' function. */ +#define EVENT__HAVE_ARC4RANDOM 1 + +/* Define to 1 if you have the `arc4random_buf' function. */ +#define EVENT__HAVE_ARC4RANDOM_BUF 1 + +/* Define to 1 if you have the `arc4random_addrandom' function. */ +#define EVENT__HAVE_ARC4RANDOM_ADDRANDOM 1 + +/* Define if clock_gettime is available in libc */ +#define EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1 + +/* Define is no secure id variant is available */ +/* #undef EVENT__DNS_USE_GETTIMEOFDAY_FOR_ID */ +/* #undef EVENT__DNS_USE_FTIME_FOR_ID */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define EVENT__HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the declaration of `CTL_KERN'. */ +#define EVENT__HAVE_DECL_CTL_KERN 1 + +/* Define to 1 if you have the declaration of `KERN_ARND'. */ +#define EVENT__HAVE_DECL_KERN_ARND 0 + +/* Define to 1 if you have `getrandom' function. */ +/* #undef EVENT__HAVE_GETRANDOM */ + +/* Define if /dev/poll is available */ +/* #undef EVENT__HAVE_DEVPOLL */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_NETDB_H 1 + +/* Define to 1 if fd_mask type is defined */ +#define EVENT__HAVE_FD_MASK 1 + +/* Define to 1 if the header file defines TAILQ_FOREACH. */ +#define EVENT__HAVE_TAILQFOREACH 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_DLFCN_H 1 + +/* Define if your system supports the epoll system calls */ +/* #undef EVENT__HAVE_EPOLL */ + +/* Define to 1 if you have the `epoll_create1' function. */ +/* #undef EVENT__HAVE_EPOLL_CREATE1 */ + +/* Define to 1 if you have the `epoll_ctl' function. */ +/* #undef EVENT__HAVE_EPOLL_CTL */ + +/* Define if your system supports the wepoll module */ +/* #undef EVENT__HAVE_WEPOLL */ + +/* Define to 1 if you have the `eventfd' function. */ +/* #undef EVENT__HAVE_EVENTFD */ + +/* Define if your system supports event ports */ +/* #undef EVENT__HAVE_EVENT_PORTS */ + +/* Define to 1 if you have the `fcntl' function. */ +#define EVENT__HAVE_FCNTL 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define EVENT__HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getegid' function. */ +#define EVENT__HAVE_GETEGID 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define EVENT__HAVE_GETEUID 1 + +/* TODO: Check for different gethostname argument counts. CheckPrototypeDefinition.cmake can be used. */ +/* Define this if you have any gethostbyname_r() */ +/* #undef EVENT__HAVE_GETHOSTBYNAME_R */ + +/* Define this if gethostbyname_r takes 3 arguments */ +/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */ + +/* Define this if gethostbyname_r takes 5 arguments */ +/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */ + +/* Define this if gethostbyname_r takes 6 arguments */ +/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */ + +/* Define to 1 if you have the `getifaddrs' function. */ +#define EVENT__HAVE_GETIFADDRS 1 + +/* Define to 1 if you have the `getnameinfo' function. */ +#define EVENT__HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the `getprotobynumber' function. */ +#define EVENT__HAVE_GETPROTOBYNUMBER 1 + +/* Define to 1 if you have the `getservbyname' function. */ +#define EVENT__HAVE_GETSERVBYNAME 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define EVENT__HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_IFADDRS_H 1 + +/* Define to 1 if you have the `inet_ntop' function. */ +#define EVENT__HAVE_INET_NTOP 1 + +/* Define to 1 if you have the `inet_pton' function. */ +#define EVENT__HAVE_INET_PTON 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `issetugid' function. */ +#define EVENT__HAVE_ISSETUGID 1 + +/* Define to 1 if you have the `kqueue' function. */ +#define EVENT__HAVE_KQUEUE 1 + +/* Define if the system has zlib */ +/* #undef EVENT__HAVE_LIBZ */ + +/* Define to 1 if you have the `mach_absolute_time' function. */ +#define EVENT__HAVE_MACH_ABSOLUTE_TIME 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_MACH_MACH_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_MACH_MACH_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define EVENT__HAVE_MMAP 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#define EVENT__HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the `usleep' function. */ +#define EVENT__HAVE_USLEEP 1 + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_NETINET_IN6_H */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_NETINET_TCP_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_UN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_AFUNIX_H */ + +/* Define if the system has openssl */ +/* #undef EVENT__HAVE_OPENSSL */ + +/* Define to 1 if you have the `pipe' function. */ +#define EVENT__HAVE_PIPE 1 + +/* Define to 1 if you have the `pipe2' function. */ +/* #undef EVENT__HAVE_PIPE2 */ + +/* Define to 1 if you have the `poll' function. */ +#define EVENT__HAVE_POLL 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_POLL_H 1 + +/* Define to 1 if you have the `port_create' function. */ +/* #undef EVENT__HAVE_PORT_CREATE */ + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_PORT_H */ + +/* Define if we have pthreads on this system */ +#define EVENT__HAVE_PTHREADS 1 + +/* Define to 1 if you have the `putenv' function. */ +#define EVENT__HAVE_PUTENV 1 + +/* Define to 1 if the system has the type `sa_family_t'. */ +#define EVENT__HAVE_SA_FAMILY_T 1 + +/* Define to 1 if you have the `select' function. */ +#define EVENT__HAVE_SELECT 1 + +/* Define to 1 if you have the `setenv' function. */ +#define EVENT__HAVE_SETENV 1 + +/* Define if F_SETFD is defined in */ +#define EVENT__HAVE_SETFD 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define EVENT__HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `sendfile' function. */ +#define EVENT__HAVE_SENDFILE 1 + +/* Define to 1 if you have the `sigaction' function. */ +#define EVENT__HAVE_SIGACTION 1 + +/* Define to 1 if you have the `signal' function. */ +#define EVENT__HAVE_SIGNAL 1 + +/* Define to 1 if you have the `strsignal' function. */ +#define EVENT__HAVE_STRSIGNAL 1 + +/* Define to 1 if you have the `splice' function. */ +/* #undef EVENT__HAVE_SPLICE */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define EVENT__HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strsep' function. */ +#define EVENT__HAVE_STRSEP 1 + +/* Define to 1 if you have the `strtok_r' function. */ +#define EVENT__HAVE_STRTOK_R 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define EVENT__HAVE_STRTOLL 1 + +/* Define to 1 if you have the `_gmtime64_s' function. */ +/* #undef EVENT__HAVE__GMTIME64_S */ + +/* Define to 1 if you have the `_gmtime64' function. */ +/* #undef EVENT__HAVE__GMTIME64 */ + +/* Define to 1 if the system has the type `struct addrinfo'. */ +#define EVENT__HAVE_STRUCT_ADDRINFO 1 + +/* Define to 1 if the system has the type `struct in6_addr'. */ +#define EVENT__HAVE_STRUCT_IN6_ADDR 1 + +/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */ +/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */ + +/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */ +/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */ + +/* Define to 1 if the system has the type `struct sockaddr_in6'. */ +#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1 + +/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */ +#define EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1 + +/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ +/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ + +/* Define to 1 if the system has the type `struct sockaddr_un'. */ +#define EVENT__HAVE_STRUCT_SOCKADDR_UN 1 + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */ +#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 + +/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */ +/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */ + +/* Define to 1 if the system has the type `struct linger'. */ +#define EVENT__HAVE_STRUCT_LINGER 1 + +/* Define to 1 if you have the `sysctl' function. */ +#define EVENT__HAVE_SYSCTL 1 + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_SYS_EPOLL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_SYS_EVENTFD_H */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_EVENT_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_QUEUE_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_SYS_SENDFILE_H */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_RANDOM_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef EVENT__HAVE_SYS_TIMERFD_H */ + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_ERRNO_H 1 + +/* Define if TAILQ_FOREACH is defined in */ +#define EVENT__HAVE_TAILQFOREACH 1 + +/* Define if timeradd is defined in */ +#define EVENT__HAVE_TIMERADD 1 + +/* Define if timerclear is defined in */ +#define EVENT__HAVE_TIMERCLEAR 1 + +/* Define if timercmp is defined in */ +#define EVENT__HAVE_TIMERCMP 1 + + +/* Define to 1 if you have the `timerfd_create' function. */ +/* #undef EVENT__HAVE_TIMERFD_CREATE */ + +/* Define if timerisset is defined in */ +#define EVENT__HAVE_TIMERISSET 1 + +/* Define to 1 if the system has the type `uint8_t'. */ +#define EVENT__HAVE_UINT8_T 1 + +/* Define to 1 if the system has the type `uint16_t'. */ +#define EVENT__HAVE_UINT16_T 1 + +/* Define to 1 if the system has the type `uint32_t'. */ +#define EVENT__HAVE_UINT32_T 1 + +/* Define to 1 if the system has the type `uint64_t'. */ +#define EVENT__HAVE_UINT64_T 1 + +/* Define to 1 if the system has the type `uintptr_t'. */ +#define EVENT__HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the `umask' function. */ +#define EVENT__HAVE_UMASK 1 + +/* Define to 1 if you have the header file. */ +#define EVENT__HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `unsetenv' function. */ +#define EVENT__HAVE_UNSETENV 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define EVENT__HAVE_VASPRINTF 1 + +/* Define if kqueue works correctly with pipes */ +#define EVENT__HAVE_WORKING_KQUEUE 1 + +#ifdef __USE_UNUSED_DEFINITIONS__ +/* Define to necessary symbol if this constant uses a non-standard name on your system. */ +/* XXX: Hello, this isn't even used, nor is it defined anywhere... - Ellzey */ +#define EVENT__PTHREAD_CREATE_JOINABLE +#endif + +/* The size of `pthread_t', as computed by sizeof. */ +#define EVENT__SIZEOF_PTHREAD_T 8 + +/* The size of a `int', as computed by sizeof. */ +#define EVENT__SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define EVENT__SIZEOF_LONG 8 + +/* The size of a `long long', as computed by sizeof. */ +#define EVENT__SIZEOF_LONG_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define EVENT__SIZEOF_OFF_T 8 + +#define EVENT__SIZEOF_SSIZE_T 8 + + +/* The size of a `short', as computed by sizeof. */ +#define EVENT__SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#define EVENT__SIZEOF_SIZE_T 8 + +/* Define to 1 if you can safely include both and . */ +/* #undef EVENT__TIME_WITH_SYS_TIME */ + +/* The size of `socklen_t', as computed by sizeof. */ +#define EVENT__SIZEOF_SOCKLEN_T 4 + +/* The size of 'void *', as computer by sizeof */ +#define EVENT__SIZEOF_VOID_P 8 + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* why not c++? + * + * and are we really expected to use EVENT__inline everywhere, + * shouldn't we just do: + * ifdef EVENT__inline + * define inline EVENT__inline + * + * - Ellzey + */ + +#define EVENT__inline inline +#endif + +#define EVENT__HAVE___func__ 1 +#define EVENT__HAVE___FUNCTION__ 1 + +/* Define to `unsigned' if does not define. */ +#define EVENT__size_t size_t + +/* Define to unsigned int if you dont have it */ +#define EVENT__socklen_t socklen_t + +/* Define to `int' if does not define. */ +#define EVENT__ssize_t ssize_t + +#endif /* \EVENT2_EVENT_CONFIG_H_INCLUDED_ */ +END_OF_CONFIG + +Pod::Spec.new do |spec| + spec.name = "libevent" + spec.version = "2.1.12.1" + spec.summary = "Event notification library" + spec.description = "The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also support callbacks due to signals or regular timeouts." + spec.homepage = "https://libevent.org" + spec.license = { :type => "BSD 3-Clause", :file => "LICENSE" } + spec.author = "Niels Provos and Nick Mathewson" + spec.platforms = { :osx => "10.13", :ios => "10.0", :tvos => "10.0", :visionos => "1.0" } + spec.source = { :git => "https://github.com/libevent/libevent.git", :tag => "release-2.1.12-stable" } + spec.prepare_command = "echo 'executing libevent prepare command'; touch evconfig-private.h; echo -e #{Shellwords.escape(CONFIG_WITHOUT_OPENSSL)} > include/event2/event-config.h; ls include/event2/" + spec.source_files = + "include/*.h", "*-{internal,private}.h", + "buffer.c", "bufferevent.c", "bufferevent_filter.c", "bufferevent_pair.c", "bufferevent_ratelim.c", "bufferevent_sock.c", + "event.c", "evmap.c", "evthread.c", "evutil.c", "evutil_rand.c", "evutil_time.c", + "kqueue.c", "listener.c", "log.c", "poll.c", "select.c", "signal.c", "strlcpy.c", "watch.c", + "evdns.c", "event_tagging.c", "evrpc.c", "http.c" + spec.private_header_files = "*-{internal,private}.h" + spec.public_header_files = "include/*.h" + spec.preserve_paths = "include/event2/*.h" + spec.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/include/\"" } +end \ No newline at end of file diff --git a/packages/rn-tester/Gemfile b/packages/rn-tester/Gemfile index 4de6c10e5d6df3..10100d3d65d4c1 100644 --- a/packages/rn-tester/Gemfile +++ b/packages/rn-tester/Gemfile @@ -1,6 +1,7 @@ # Gemfile source 'https://rubygems.org' -gem 'cocoapods', '~> 1.12' +gem 'cocoapods', '~> 1.13' + gem 'rexml' gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 36f670df0d5e8d..8e2455bb5ba372 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -1,7 +1,7 @@ require_relative '../react-native/scripts/react_native_pods' source 'https://cdn.cocoapods.org/' -platform :ios, min_ios_version_supported +platform :visionos, min_visionos_version_supported cmake_path = `command -v cmake` @@ -32,7 +32,7 @@ if USE_FRAMEWORKS use_frameworks! :linkage => linkage.to_sym end -$shouldUseFlipper = ENV['USE_FLIPPER'] ? ENV['USE_FLIPPER'] == '1' : !IN_CI && !USE_FRAMEWORKS +$shouldUseFlipper = false # ENV['USE_FLIPPER'] ? ENV['USE_FLIPPER'] == '1' : !IN_CI && !USE_FRAMEWORKS def pods(target_name, options = {}, use_flipper: $shouldUseFlipper) project 'RNTesterPods.xcodeproj' @@ -41,7 +41,8 @@ def pods(target_name, options = {}, use_flipper: $shouldUseFlipper) # Hermes is now enabled by default. # The following line will only disable Hermes if the USE_HERMES envvar is SET to a value other than 1 (e.g. USE_HERMES=0). - hermes_enabled = !ENV.has_key?('USE_HERMES') || ENV['USE_HERMES'] == '1' + # TODO: Make hermes work + hermes_enabled = false # !ENV.has_key?('USE_HERMES') || ENV['USE_HERMES'] == '1' puts "Configuring #{target_name} with Fabric #{fabric_enabled ? "enabled" : "disabled"}.#{hermes_enabled ? " Using Hermes engine." : ""}" use_react_native!( @@ -77,7 +78,8 @@ end target 'RNTesterUnitTests' do pods('RNTesterUnitTests') pod 'React-RCTTest', :path => "./RCTTest" - pod 'OCMock', '~> 3.9.1' + # TODO: Uncomment this once OCMock is released https://cocoapods.org/pods/OCMock + # pod 'OCMock', '~> 3.9.2' end target 'RNTesterIntegrationTests' do diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 24e5f8f1184f4a..35fb42048c3f00 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -1,6 +1,5 @@ PODS: - boost (1.83.0) - - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - FBLazyVector (1000.0.0) - FBReactNativeSpec (1000.0.0): @@ -10,76 +9,8 @@ PODS: - React-Core (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - Flipper (0.201.0): - - Flipper-Folly (~> 2.6) - - Flipper-Boost-iOSX (1.76.0.1.11) - - Flipper-DoubleConversion (3.2.0.1) - - Flipper-Fmt (7.1.7) - - Flipper-Folly (2.6.10): - - Flipper-Boost-iOSX - - Flipper-DoubleConversion - - Flipper-Fmt (= 7.1.7) - - Flipper-Glog - - libevent (~> 2.1.12) - - OpenSSL-Universal (= 1.1.1100) - - Flipper-Glog (0.5.0.5) - - Flipper-PeerTalk (0.0.4) - - FlipperKit (0.201.0): - - FlipperKit/Core (= 0.201.0) - - FlipperKit/Core (0.201.0): - - Flipper (~> 0.201.0) - - FlipperKit/CppBridge - - FlipperKit/FBCxxFollyDynamicConvert - - FlipperKit/FBDefines - - FlipperKit/FKPortForwarding - - SocketRocket (~> 0.6.0) - - FlipperKit/CppBridge (0.201.0): - - Flipper (~> 0.201.0) - - FlipperKit/FBCxxFollyDynamicConvert (0.201.0): - - Flipper-Folly (~> 2.6) - - FlipperKit/FBDefines (0.201.0) - - FlipperKit/FKPortForwarding (0.201.0): - - CocoaAsyncSocket (~> 7.6) - - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.201.0) - - FlipperKit/FlipperKitLayoutHelpers (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitHighlightOverlay - - FlipperKit/FlipperKitLayoutTextSearchable - - FlipperKit/FlipperKitLayoutIOSDescriptors (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitHighlightOverlay - - FlipperKit/FlipperKitLayoutHelpers - - FlipperKit/FlipperKitLayoutPlugin (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitHighlightOverlay - - FlipperKit/FlipperKitLayoutHelpers - - FlipperKit/FlipperKitLayoutIOSDescriptors - - FlipperKit/FlipperKitLayoutTextSearchable - - FlipperKit/FlipperKitLayoutTextSearchable (0.201.0) - - FlipperKit/FlipperKitNetworkPlugin (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.201.0): - - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.201.0): - - FlipperKit/Core - - FlipperKit/FlipperKitNetworkPlugin - fmt (9.1.0) - glog (0.3.5) - - hermes-engine (1000.0.0): - - hermes-engine/Hermes (= 1000.0.0) - - hermes-engine/inspector (= 1000.0.0) - - hermes-engine/inspector_chrome (= 1000.0.0) - - hermes-engine/Public (= 1000.0.0) - - hermes-engine/Hermes (1000.0.0) - - hermes-engine/inspector (1000.0.0) - - hermes-engine/inspector_chrome (1000.0.0) - - hermes-engine/Public (1000.0.0) - - libevent (2.1.12) - - OCMock (3.9.1) - - OpenSSL-Universal (1.1.1100) - RCT-Folly (2023.08.07.00): - boost - DoubleConversion @@ -96,12 +27,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - RCT-Folly/Futures (2023.08.07.00): - - boost - - DoubleConversion - - fmt (= 9.1.0) - - glog - - libevent - RCTRequired (1000.0.0) - RCTTypeSafety (1000.0.0): - FBLazyVector (= 1000.0.0) @@ -125,7 +50,6 @@ PODS: - DoubleConversion - FBReactNativeSpec - glog - - hermes-engine - RCT-Folly - RCTRequired - RCTTypeSafety @@ -133,6 +57,7 @@ PODS: - React-debug - React-Fabric - React-graphics + - React-jsc - React-jsi - React-jsiexecutor - React-NativeModulesApple @@ -143,214 +68,199 @@ PODS: - ReactCommon/turbomodule/core - React-Core (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default (= 1000.0.0) - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/CoreModulesHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/Default (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/DevSupport (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default (= 1000.0.0) - React-Core/RCTWebSocket (= 1000.0.0) - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-jsinspector (= 1000.0.0) - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTActionSheetHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTAnimationHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTBlobHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTImageHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTLinkingHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTNetworkHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTPushNotificationHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTSettingsHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTTextHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTVibrationHeaders (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-Core/RCTWebSocket (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Core/Default (= 1000.0.0) - React-cxxreact - - React-hermes + - React-jsc - React-jsi - React-jsiexecutor - React-perflogger - React-runtimescheduler - React-utils - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - Yoga - React-CoreModules (1000.0.0): - RCT-Folly (= 2023.08.07.00) @@ -361,13 +271,12 @@ PODS: - React-RCTBlob - React-RCTImage (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - SocketRocket (= 0.6.1) + - SocketRocket (= 0.6.1.1) - React-cxxreact (1000.0.0): - boost (= 1.83.0) - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-callinvoker (= 1000.0.0) - React-debug (= 1000.0.0) @@ -381,7 +290,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -403,7 +311,7 @@ PODS: - React-Fabric/textlayoutmanager (= 1000.0.0) - React-Fabric/uimanager (= 1000.0.0) - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -414,7 +322,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -422,7 +329,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -433,7 +340,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -441,7 +347,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -452,7 +358,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -460,7 +365,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -471,7 +376,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -479,7 +383,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -490,7 +394,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -509,7 +412,7 @@ PODS: - React-Fabric/components/unimplementedview (= 1000.0.0) - React-Fabric/components/view (= 1000.0.0) - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -520,7 +423,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -528,7 +430,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -539,7 +441,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -547,7 +448,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -558,7 +459,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -566,7 +466,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -577,7 +477,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -585,7 +484,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -596,7 +495,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -604,7 +502,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -615,7 +513,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -623,7 +520,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -634,7 +531,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -642,7 +538,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -653,7 +549,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -661,7 +556,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -672,7 +567,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -680,7 +574,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -691,7 +585,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -699,7 +592,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -710,7 +603,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -718,7 +610,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -730,7 +622,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -738,7 +629,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -749,7 +640,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -757,7 +647,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -768,7 +658,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -776,7 +665,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -787,7 +676,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -795,7 +683,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -806,7 +694,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -814,7 +701,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -825,7 +712,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -833,7 +719,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -844,7 +730,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -852,7 +737,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -863,7 +748,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -872,7 +756,7 @@ PODS: - React-debug - React-Fabric/uimanager - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -883,7 +767,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) @@ -891,7 +774,7 @@ PODS: - React-cxxreact - React-debug - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -902,14 +785,13 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) - React-Fabric - React-graphics (= 1000.0.0) - React-ImageManager - - React-jsi (= 1000.0.0) + - React-jsi - React-jsiexecutor (= 1000.0.0) - React-logger - React-rendererdebug @@ -921,18 +803,6 @@ PODS: - RCT-Folly/Fabric (= 2023.08.07.00) - React-Core/Default (= 1000.0.0) - React-utils - - React-hermes (1000.0.0): - - DoubleConversion - - fmt (= 9.1.0) - - glog - - hermes-engine - - RCT-Folly (= 2023.08.07.00) - - RCT-Folly/Futures (= 2023.08.07.00) - - React-cxxreact (= 1000.0.0) - - React-jsi - - React-jsiexecutor (= 1000.0.0) - - React-jsinspector (= 1000.0.0) - - React-perflogger (= 1000.0.0) - React-ImageManager (1000.0.0): - glog - RCT-Folly/Fabric @@ -942,6 +812,11 @@ PODS: - React-RCTImage - React-rendererdebug - React-utils + - React-jsc (1000.0.0): + - React-jsc/Fabric (= 1000.0.0) + - React-jsi (= 1000.0.0) + - React-jsc/Fabric (1000.0.0): + - React-jsi (= 1000.0.0) - React-jserrorhandler (1000.0.0): - RCT-Folly/Fabric (= 2023.08.07.00) - React-jsi (= 1000.0.0) @@ -956,7 +831,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-cxxreact (= 1000.0.0) - React-jsi (= 1000.0.0) @@ -970,7 +844,6 @@ PODS: - React-nativeconfig (1000.0.0) - React-NativeModulesApple (1000.0.0): - glog - - hermes-engine - React-callinvoker - React-Core - React-cxxreact @@ -994,7 +867,7 @@ PODS: - RCTTypeSafety - React-Core - React-CoreModules - - React-hermes + - React-jsc - React-nativeconfig - React-NativeModulesApple - React-RCTFabric @@ -1003,7 +876,6 @@ PODS: - React-runtimescheduler - ReactCommon/turbomodule/core - React-RCTBlob (1000.0.0): - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-Codegen (= 1000.0.0) - React-Core/RCTBlobHeaders (= 1000.0.0) @@ -1013,7 +885,6 @@ PODS: - ReactCommon/turbomodule/core (= 1000.0.0) - React-RCTFabric (1000.0.0): - glog - - hermes-engine - RCT-Folly/Fabric (= 2023.08.07.00) - React-Core (= 1000.0.0) - React-debug @@ -1021,6 +892,7 @@ PODS: - React-FabricImage - React-graphics - React-ImageManager + - React-jsi - React-nativeconfig - React-RCTImage (= 1000.0.0) - React-RCTText @@ -1086,7 +958,6 @@ PODS: - React-jsi (= 1000.0.0) - React-runtimescheduler (1000.0.0): - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-callinvoker - React-debug @@ -1101,18 +972,17 @@ PODS: - ReactCommon-Samples (1000.0.0): - DoubleConversion - fmt (= 9.1.0) - - hermes-engine - RCT-Folly - React-Codegen - React-Core - React-cxxreact + - React-jsi - React-NativeModulesApple - ReactCommon/turbomodule/core - ReactCommon/turbomodule/bridging (1000.0.0): - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-callinvoker (= 1000.0.0) - React-cxxreact (= 1000.0.0) @@ -1123,7 +993,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - hermes-engine - RCT-Folly (= 2023.08.07.00) - React-callinvoker (= 1000.0.0) - React-cxxreact (= 1000.0.0) @@ -1134,7 +1003,7 @@ PODS: - glog - RCT-Folly (= 2023.08.07.00) - React-Core - - SocketRocket (0.6.1) + - SocketRocket (0.6.1.1) - Yoga (1.14.0) DEPENDENCIES: @@ -1142,32 +1011,8 @@ DEPENDENCIES: - DoubleConversion (from `../react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../react-native/React/FBReactNativeSpec`) - - Flipper (= 0.201.0) - - Flipper-Boost-iOSX (= 1.76.0.1.11) - - Flipper-DoubleConversion (= 3.2.0.1) - - Flipper-Fmt (= 7.1.7) - - Flipper-Folly (= 2.6.10) - - Flipper-Glog (= 0.5.0.5) - - Flipper-PeerTalk (= 0.0.4) - - FlipperKit (= 0.201.0) - - FlipperKit/Core (= 0.201.0) - - FlipperKit/CppBridge (= 0.201.0) - - FlipperKit/FBCxxFollyDynamicConvert (= 0.201.0) - - FlipperKit/FBDefines (= 0.201.0) - - FlipperKit/FKPortForwarding (= 0.201.0) - - FlipperKit/FlipperKitHighlightOverlay (= 0.201.0) - - FlipperKit/FlipperKitLayoutPlugin (= 0.201.0) - - FlipperKit/FlipperKitLayoutTextSearchable (= 0.201.0) - - FlipperKit/FlipperKitNetworkPlugin (= 0.201.0) - - FlipperKit/FlipperKitReactPlugin (= 0.201.0) - - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.201.0) - - FlipperKit/SKIOSNetworkPlugin (= 0.201.0) - fmt (from `../react-native/third-party-podspecs/fmt.podspec`) - glog (from `../react-native/third-party-podspecs/glog.podspec`) - - hermes-engine (from `../react-native/sdks/hermes-engine/hermes-engine.podspec`) - - libevent (~> 2.1.12) - - OCMock (~> 3.9.1) - - OpenSSL-Universal (= 1.1.1100) - RCT-Folly (from `../react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly/Fabric (from `../react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../react-native/Libraries/Required`) @@ -1176,7 +1021,6 @@ DEPENDENCIES: - React-callinvoker (from `../react-native/ReactCommon/callinvoker`) - React-Codegen (from `build/generated/ios`) - React-Core (from `../react-native/`) - - React-Core/DevSupport (from `../react-native/`) - React-Core/RCTWebSocket (from `../react-native/`) - React-CoreModules (from `../react-native/React/CoreModules`) - React-cxxreact (from `../react-native/ReactCommon/cxxreact`) @@ -1184,8 +1028,9 @@ DEPENDENCIES: - React-Fabric (from `../react-native/ReactCommon`) - React-FabricImage (from `../react-native/ReactCommon`) - React-graphics (from `../react-native/ReactCommon/react/renderer/graphics`) - - React-hermes (from `../react-native/ReactCommon/hermes`) - React-ImageManager (from `../react-native/ReactCommon/react/renderer/imagemanager/platform/ios`) + - React-jsc (from `../react-native/ReactCommon/jsc`) + - React-jsc/Fabric (from `../react-native/ReactCommon/jsc`) - React-jserrorhandler (from `../react-native/ReactCommon/jserrorhandler`) - React-jsi (from `../react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../react-native/ReactCommon/jsiexecutor`) @@ -1216,24 +1061,9 @@ DEPENDENCIES: - ReactCommon-Samples (from `../react-native/ReactCommon/react/nativemodule/samples`) - ReactCommon/turbomodule/core (from `../react-native/ReactCommon`) - ScreenshotManager (from `NativeModuleExample`) + - SocketRocket (from `../react-native/third-party-podspecs/SocketRocket.podspec`) - Yoga (from `../react-native/ReactCommon/yoga`) -SPEC REPOS: - trunk: - - CocoaAsyncSocket - - Flipper - - Flipper-Boost-iOSX - - Flipper-DoubleConversion - - Flipper-Fmt - - Flipper-Folly - - Flipper-Glog - - Flipper-PeerTalk - - FlipperKit - - libevent - - OCMock - - OpenSSL-Universal - - SocketRocket - EXTERNAL SOURCES: boost: :podspec: "../react-native/third-party-podspecs/boost.podspec" @@ -1247,9 +1077,6 @@ EXTERNAL SOURCES: :podspec: "../react-native/third-party-podspecs/fmt.podspec" glog: :podspec: "../react-native/third-party-podspecs/glog.podspec" - hermes-engine: - :podspec: "../react-native/sdks/hermes-engine/hermes-engine.podspec" - :tag: '' RCT-Folly: :podspec: "../react-native/third-party-podspecs/RCT-Folly.podspec" RCTRequired: @@ -1276,10 +1103,10 @@ EXTERNAL SOURCES: :path: "../react-native/ReactCommon" React-graphics: :path: "../react-native/ReactCommon/react/renderer/graphics" - React-hermes: - :path: "../react-native/ReactCommon/hermes" React-ImageManager: :path: "../react-native/ReactCommon/react/renderer/imagemanager/platform/ios" + React-jsc: + :path: "../react-native/ReactCommon/jsc" React-jserrorhandler: :path: "../react-native/ReactCommon/jserrorhandler" React-jsi: @@ -1340,77 +1167,66 @@ EXTERNAL SOURCES: :path: "../react-native/ReactCommon/react/nativemodule/samples" ScreenshotManager: :path: NativeModuleExample + SocketRocket: + :podspec: "../react-native/third-party-podspecs/SocketRocket.podspec" Yoga: :path: "../react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 26fad476bfa736552bbfa698a06cc530475c1505 - CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 - FBLazyVector: 9344e79343bb9f8e848f07172435b85ef3d19ce0 - FBReactNativeSpec: b57ae5dc0746e097c54d773c87e59385fe38bbd4 - Flipper: c7a0093234c4bdd456e363f2f19b2e4b27652d44 - Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c - Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 - Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b - Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 - Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446 - Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - FlipperKit: 37525a5d056ef9b93d1578e04bc3ea1de940094f - fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - hermes-engine: f8283a7dd64126593e2c02496f4d4544cd0c86fa - libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 - OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 3edb9330ce752fe48b85e6c8a65506033f95f4b9 - RCTRequired: 58a606315d9c30ae019583bf89b514adf406a668 - RCTTypeSafety: 22c950ae3b7dc67f7352a4ad5780c1a2d060d823 - React: 684f60570280a1089e2f86c3e897f597b4136025 - React-callinvoker: e98dd17a9f7bd3de3445a95b200e55b8ef0f7b06 - React-Codegen: 05b37234a5252f99c890f3e2544b278827b613ca - React-Core: 01f6d0c4eff384c026b25fb4e33a5b59b8e26118 - React-CoreModules: 11f07cb493a6c55dd01405e3cc36045270ed7482 - React-cxxreact: cefac3ca25145fce1e725383839e052973721fde - React-debug: 375514cca2580909bf360d1f73275b27c1c957bc - React-Fabric: d4f3620fbb1d8f4f2da9c6bb8b7aaa2d2ea5acd2 - React-FabricImage: 8f861bec1a605f024b0ebed856f00ea70364b388 - React-graphics: b714fbc01d60ed07c89f7b652e2fa25b190d349e - React-hermes: e08763cb79c0c67ece3ccb4315951d35d44fa8e5 - React-ImageManager: 06930b55fa0f549c948dc7b366a243848b03f9c8 - React-jserrorhandler: 6e8cffff655dc116533f8350318dbbe3135899b8 - React-jsi: 919e326d0f0825353d82ecd0ffbcbe9cbde72bc9 - React-jsiexecutor: 8c542318b863a526643be3746053bff4b108b80a - React-jsinspector: 93c9591514a5182d88a510d1046459d3890209dd - React-logger: 57b211b4762b788f7db6289444daa57e27625328 - React-Mapbuffer: a1ec6419486cb9ed06f382e63cf8674776ff70d7 - React-nativeconfig: 25f9c31c6b8ae78581584d2a8c6af66e81995fab - React-NativeModulesApple: 5e84eb3fe10c78d7f98dfb38c02604d2f093ce46 - React-perflogger: df9fba73a1517ef8c866659358aef4d348bb01ab - React-RCTActionSheet: e358d63ef1fb3ec601bc6789cf73413960baf882 - React-RCTAnimation: 86801dd93de1a6984886fdbac9d71bbd6e476edd - React-RCTAppDelegate: 54ad7bd64b4e04be81d405b52b957bb6a2fadedc - React-RCTBlob: 0833d07761028aae155a66647d9b012f42b910ab - React-RCTFabric: f9de8a62c2449e8df45d25e5dc50d2d3d8cc6bf2 - React-RCTImage: 047a58cab037ebd13114ff13d590f1cace82a00a - React-RCTLinking: e1790c2a66c217d23b78f962e8ad655a42b46a10 - React-RCTNetwork: 755d036c0c126d50498a6414835e79f6ae18d18f - React-RCTPushNotification: 554d1bb05efd1606690bed157e16f6ac4a467058 - React-RCTSettings: e8fb1dec0674cd63c6b6a89746cbf6f856cf7b77 - React-RCTTest: 8f0a1a37858d199f2a2b348c03f3edcfa530eda4 - React-RCTText: f7538cbba18e2ed79f64ca0bcc7a0613462729da - React-RCTVibration: 732b58335b7a9b478d4d4b3ed0a989e33dbe2c70 - React-rendererdebug: 301cead8aa422940d7682747c937b07b74e52bfc - React-rncore: aa35c5dfed236db84f46f88d7b8a92b24f44bb3a - React-runtimeexecutor: 8550177a1fb48c7febcb51f6b441c5b5c4db38b6 - React-runtimescheduler: 84a32b7669743e9c7aa817e8da0cd1489cf7c727 - React-utils: 4b96ce692bfdde955979a089dd778432f478789f - ReactCommon: a126a55ff0468e20e13bb401f4f7285366dfbafe - ReactCommon-Samples: d232f7617367980798af7dce79b982730ee158a8 - ScreenshotManager: 2b23b74d25f5e307f7b4d21173a61a3934e69475 - SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Yoga: d2bf25ad906aeac2ec8cf054080f291a22bcc3f5 + boost: 3f76a4d6d9d0f232d25b7782f83fcf988f47d517 + DoubleConversion: 71bf0761505a44e4dfddc0aa04afa049fdfb63b5 + FBLazyVector: aca5345f1befd7d934447cfe4047f45bc79edb33 + FBReactNativeSpec: 2b6ec62648ad5730f8fc81eeaf2c4a90cf39f41e + fmt: 5d9ffa7ccba126c08b730252123601d514652320 + glog: 4f05d17aa39a829fee878689fc9a41af587fabba + RCT-Folly: db6a09c8a82ec0c695cb755faed8ddb58bc4e78d + RCTRequired: 9d3bd8c9d02a893c0cd91f60f023ecedc3280422 + RCTTypeSafety: 6029ef97eb38094dde5188895f578d461eb7fd32 + React: c4056cf624912a6bd47034e593cb3a90ce06c0bf + React-callinvoker: e52f59bc29ee16adece30994ff4e9cebe1217691 + React-Codegen: cf0df8a0b283dbc95590d1d523511b1278f0aeaf + React-Core: e92ccc8c83e0af5f03ccfec54a3987dc902835df + React-CoreModules: 756bca9801810647a7fe4b052da8eda56931f6c7 + React-cxxreact: 1f7c52107ccfdc93b1e42f0f4069f00177847f02 + React-debug: e316abad664dd200caa8a8055bfc4adf5db0924b + React-Fabric: 84a4eca71ab96a6816e095dd62e23c31bae77111 + React-FabricImage: 1ba2ff9764574c66c84b18ef888231a5812441fc + React-graphics: 9deec95f696e4042d0caa1c34f6ea46506da1c49 + React-ImageManager: 1b5861173b5fbaeea826ad285c72e4ac7af4a566 + React-jsc: 1540804d5cec59b9355f6b053625527afc8aa6c8 + React-jserrorhandler: b5abd548a36be225f8e25197f84b3f70c35d6b96 + React-jsi: f87675aa80f0b730f3364fd6ee2523b6ed3ac938 + React-jsiexecutor: 14836286ad8b3c126e1ad214f35190fecca3ad4d + React-jsinspector: eb29462b8769862a63bf7716478ec688f6da6d02 + React-logger: acd8c44733209b69bf20c08a6175f8268bcd7d51 + React-Mapbuffer: a741b059661074c10e972b20384fa7cf83b889b7 + React-nativeconfig: 0edcf9447c1f54c81394a18c4cbe4b155ceeb038 + React-NativeModulesApple: a2527b6135c5609eaaf1a4da937e88697c17ef39 + React-perflogger: 107b142b434dbdbb2b193c87c3b18526bef2088a + React-RCTActionSheet: 4492e284edcce7b5439bef67a5c64434b65da29d + React-RCTAnimation: 9b42a606840fb43604d0c7a870f2d28161913f11 + React-RCTAppDelegate: 1f01eed599eabaf42ce21758e5810311709f16ca + React-RCTBlob: a5de5e1dc95e3d2d44066ef969ddeab0d43854f8 + React-RCTFabric: 643225de0af23c078216003aa85870264c36d5d0 + React-RCTImage: 1d311b53e44170a30cc67eef38b71594a0ac55a3 + React-RCTLinking: da74a3dd34cbc2eec26c135e04a5601181f8caf5 + React-RCTNetwork: c1e59f49bbabaa5fbc5a9bb7bc5ae7c1075df693 + React-RCTPushNotification: 655910f2edb1b0a1c6f84ba77ca6bae3093ca239 + React-RCTSettings: a915b09b94793498157997bb9bd31a6b02e7d646 + React-RCTTest: f4013e786a26a253e656a5c0ed17d646a8740d31 + React-RCTText: f834d16033ae9e36d69d4760bd1e27409c762442 + React-RCTVibration: b4912b372a1092b1a27364c86630aa35ca444eed + React-rendererdebug: fa104d250e3a6cd168107fe209e9423275d93bba + React-rncore: c5aaa45ba7157175cd96e21619c3e99dee757227 + React-runtimeexecutor: 46beae1f73f21650f8ddd859b3b3a3eac6ccc45c + React-runtimescheduler: 0d917a4b72de7373c6158edde7b79bab45c6b3d4 + React-utils: 3bb4a15f629a574b345be5ec19cec82b75473c5c + ReactCommon: de0045d576a45f4ac8b40107f86a02a7d4b7768f + ReactCommon-Samples: bbb920da198cd60516b47f1f3eb032215afdd87d + ScreenshotManager: b0e7b89964062d8655305156cd9c7ad0c836099f + SocketRocket: 813e605d6c0029f89681244142365b45d26f210e + Yoga: d4718a5df72b3f68ab01748e6356cbd87d52052f -PODFILE CHECKSUM: 7d1b558e28efc972a185230c56fef43ed86910a1 +PODFILE CHECKSUM: 3be1618bfa116f6b07381f1cacf18bf8d1a7e77f -COCOAPODS: 1.12.1 +COCOAPODS: 1.13.0 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index 1bf36697556148..f9b29247addd7d 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -12,7 +12,7 @@ #import #import -#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION #import #endif @@ -86,7 +86,7 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge return nullptr; } -#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC +#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC && !TARGET_OS_VISION // Required to register for notifications - (void)application:(__unused UIApplication *)application diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 5eb64905c2ed53..c022ceef158ba4 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -377,7 +377,6 @@ 13B07F8E1A680F5B00A75B9A /* Resources */, 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 79E8BE2B119D4C5CCD2F04B3 /* [RN] Copy Hermes Framework */, - 02B6FEF7E86B613B42F31284 /* [CP] Embed Pods Frameworks */, 5625E703156DD564DE9175B0 /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -397,7 +396,6 @@ E7DB209B22B2BA84005AC45F /* Sources */, E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, - A904658C20543C2EDC217D15 /* [CP] Embed Pods Frameworks */, 01934C30687B8C926E4F59CD /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -418,7 +416,6 @@ E7DB214F22B2F332005AC45F /* Sources */, E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, - 4F27ACC9DB890B37D6C267F1 /* [CP] Embed Pods Frameworks */, E446637427ECD101CAACE52B /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -518,40 +515,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 02B6FEF7E86B613B42F31284 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 4F27ACC9DB890B37D6C267F1 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 4F76596957F7356516B534CE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -625,23 +588,6 @@ shellPath = /bin/sh; shellScript = ". ../react-native/sdks/hermes-engine/utils/copy-hermes-xcode.sh\n"; }; - A904658C20543C2EDC217D15 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; ABDE2A52ACD1B95E14790B5E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -815,9 +761,12 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.meta.RNTester.localDevelopment; PRODUCT_NAME = RNTester; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,7"; }; name = Debug; }; @@ -854,8 +803,11 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.meta.RNTester.localDevelopment; PRODUCT_NAME = RNTester; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,7"; }; name = Release; }; @@ -949,12 +901,10 @@ OTHER_LDFLAGS = ( "-ObjC", "-lc++", - "-Wl", - "-ld_classic", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../react-native"; SDKROOT = iphoneos; - USE_HERMES = true; + USE_HERMES = false; WARNING_CFLAGS = ( "-Wextra", "-Wall", @@ -1045,12 +995,10 @@ OTHER_LDFLAGS = ( "-ObjC", "-lc++", - "-Wl", - "-ld_classic", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../react-native"; SDKROOT = iphoneos; - USE_HERMES = true; + USE_HERMES = false; VALIDATE_PRODUCT = YES; WARNING_CFLAGS = ( "-Wextra", From bb2b4386c3cca15e695ddaca55e1a0ba30c0cd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Sun, 8 Oct 2023 11:31:18 +0200 Subject: [PATCH 2/7] fix: address issues with scale, ScrollView prop --- packages/react-native/React/Base/RCTUtils.m | 2 +- packages/react-native/React/Modules/RCTUIManager.m | 2 -- packages/react-native/React/UIUtils/RCTUIUtils.m | 2 +- .../React/Views/ScrollView/RCTScrollViewManager.m | 5 +++-- .../samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm | 5 ++++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/react-native/React/Base/RCTUtils.m b/packages/react-native/React/Base/RCTUtils.m index 49fe1d9985a0f8..19362b6746b6d6 100644 --- a/packages/react-native/React/Base/RCTUtils.m +++ b/packages/react-native/React/Base/RCTUtils.m @@ -317,7 +317,7 @@ CGFloat RCTScreenScale(void) return screenScale; #endif - return 1; + return 2; } CGFloat RCTFontSizeMultiplier(void) diff --git a/packages/react-native/React/Modules/RCTUIManager.m b/packages/react-native/React/Modules/RCTUIManager.m index ffeaca91c06757..e0b4ecfbe29b08 100644 --- a/packages/react-native/React/Modules/RCTUIManager.m +++ b/packages/react-native/React/Modules/RCTUIManager.m @@ -269,8 +269,6 @@ - (void)namedOrientationDidChange body:orientationEvent]; #pragma clang diagnostic pop #endif - return; - } - (dispatch_queue_t)methodQueue diff --git a/packages/react-native/React/UIUtils/RCTUIUtils.m b/packages/react-native/React/UIUtils/RCTUIUtils.m index 82411abebf7f2d..1a0005d90d93e2 100644 --- a/packages/react-native/React/UIUtils/RCTUIUtils.m +++ b/packages/react-native/React/UIUtils/RCTUIUtils.m @@ -23,7 +23,7 @@ RCTDimensions RCTGetDimensions(CGFloat fontScale) CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize; CGFloat scale; #if TARGET_OS_VISION - scale = 1; + scale = 2; #else scale = mainScreen.scale; #endif diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m index 8805a8a8cb9001..a8d017d055774e 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m @@ -12,10 +12,11 @@ #import "RCTShadowView.h" #import "RCTUIManager.h" -#if !TARGET_OS_VISION + @implementation RCTConvert (UIScrollView) +#if !TARGET_OS_VISION RCT_ENUM_CONVERTER( UIScrollViewKeyboardDismissMode, (@{ @@ -27,6 +28,7 @@ @implementation RCTConvert (UIScrollView) }), UIScrollViewKeyboardDismissModeNone, integerValue) +#endif RCT_ENUM_CONVERTER( UIScrollViewIndicatorStyle, @@ -51,7 +53,6 @@ @implementation RCTConvert (UIScrollView) @end -#endif @implementation RCTScrollViewManager diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm index 593f677ec2f3f1..c6650e53f6b356 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm @@ -47,7 +47,10 @@ - (NSDictionary *)getConstants __block NSDictionary *constants; RCTUnsafeExecuteOnMainQueueSync(^{ #if TARGET_OS_VISION - CGSize screenSize = CGSizeMake(100, 100); + UIApplication *app = [[UIApplication class] performSelector:@selector(sharedApplication)]; + UIWindowScene *scene = (UIWindowScene*)[app.connectedScenes anyObject]; + UIWindow *window = [[UIWindow alloc] initWithWindowScene:scene]; + CGSize screenSize = window.bounds.size; #else UIScreen *mainScreen = UIScreen.mainScreen; CGSize screenSize = mainScreen.bounds.size; From 2bdcda860e9c2707f851dd90c89a0313212c0f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Sun, 8 Oct 2023 11:58:36 +0200 Subject: [PATCH 3/7] feat: implement Platform.isVisionOS --- packages/react-native/Libraries/Utilities/Platform.flow.js | 2 ++ packages/react-native/Libraries/Utilities/Platform.ios.js | 5 +++++ packages/react-native/React/CoreModules/RCTPlatform.mm | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/packages/react-native/Libraries/Utilities/Platform.flow.js b/packages/react-native/Libraries/Utilities/Platform.flow.js index b0c23b4fe77cc5..15e7605223cf4c 100644 --- a/packages/react-native/Libraries/Utilities/Platform.flow.js +++ b/packages/react-native/Libraries/Utilities/Platform.flow.js @@ -42,6 +42,8 @@ type IOSPlatform = { // $FlowFixMe[unsafe-getters-setters] get isTV(): boolean, // $FlowFixMe[unsafe-getters-setters] + get isVisionOS(): boolean, + // $FlowFixMe[unsafe-getters-setters] get isTesting(): boolean, // $FlowFixMe[unsafe-getters-setters] get isDisableAnimations(): boolean, diff --git a/packages/react-native/Libraries/Utilities/Platform.ios.js b/packages/react-native/Libraries/Utilities/Platform.ios.js index 4c5377395c0b3b..e556189a835cfe 100644 --- a/packages/react-native/Libraries/Utilities/Platform.ios.js +++ b/packages/react-native/Libraries/Utilities/Platform.ios.js @@ -58,6 +58,11 @@ const Platform: PlatformType = { return this.constants.interfaceIdiom === 'tv'; }, // $FlowFixMe[unsafe-getters-setters] + get isVisionOS(): boolean { + // $FlowFixMe[object-this-reference] + return this.constants.interfaceIdiom === 'vision'; + }, + // $FlowFixMe[unsafe-getters-setters] get isTesting(): boolean { if (__DEV__) { // $FlowFixMe[object-this-reference] diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index d6ceed27dfa320..a908677a3c66c3 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -30,6 +30,10 @@ return @"tv"; case UIUserInterfaceIdiomCarPlay: return @"carplay"; +#if TARGET_OS_VISION + case UIUserInterfaceIdiomVision: + return @"vision"; +#endif default: return @"unknown"; } From 67d81d5842fefc0e77cebe6d7961f29118aeb8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Sun, 8 Oct 2023 13:48:10 +0200 Subject: [PATCH 4/7] feat: move min_visionos_version_supported to Helpers --- packages/react-native/scripts/cocoapods/helpers.rb | 3 +++ packages/react-native/scripts/react_native_pods.rb | 2 +- packages/rn-tester/Podfile | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/helpers.rb b/packages/react-native/scripts/cocoapods/helpers.rb index 4a46189002286b..f8b9e2d0244eba 100644 --- a/packages/react-native/scripts/cocoapods/helpers.rb +++ b/packages/react-native/scripts/cocoapods/helpers.rb @@ -40,5 +40,8 @@ class Constants def self.min_ios_version_supported return '13.4' end + def self.min_visionos_version_supported + return '1.0' + end end end diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index ff5d6ba3dab273..9dd7b77172260a 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -42,7 +42,7 @@ def min_ios_version_supported end def min_visionos_version_supported - return '1.0' + return Helpers::Constants.min_visionos_version_supported end # This function returns the min supported OS versions supported by React Native diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 8e2455bb5ba372..256b8047539378 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -32,7 +32,8 @@ if USE_FRAMEWORKS use_frameworks! :linkage => linkage.to_sym end -$shouldUseFlipper = false # ENV['USE_FLIPPER'] ? ENV['USE_FLIPPER'] == '1' : !IN_CI && !USE_FRAMEWORKS +# Flipper is not supported for VisionOS +$shouldUseFlipper = false def pods(target_name, options = {}, use_flipper: $shouldUseFlipper) project 'RNTesterPods.xcodeproj' From e8b619685872c3306fcc70f2551d3ce1254de4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 11 Oct 2023 16:28:08 +0200 Subject: [PATCH 5/7] feat: implement `visionos_hoverStyle` prop --- .../Components/Pressable/Pressable.js | 17 +++++++++- .../Touchable/TouchableHighlight.js | 7 ++++ .../Touchable/TouchableOpacity.d.ts | 7 +++- .../Components/Touchable/TouchableOpacity.js | 15 +++++++++ .../Components/View/ViewPropTypes.d.ts | 19 +++++++++++ .../Components/View/ViewPropTypes.js | 20 ++++++++++++ packages/react-native/React/Views/RCTView.h | 7 ++++ packages/react-native/React/Views/RCTView.m | 32 +++++++++++++++++++ .../react-native/React/Views/RCTViewManager.m | 1 + 9 files changed, 123 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index 3d7f607b26dce2..4873850d1e3ac4 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -20,6 +20,7 @@ import type { AccessibilityState, AccessibilityValue, } from '../View/ViewAccessibility'; +import type {HoverStyle} from '../View/ViewPropTypes'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import usePressability from '../../Pressability/usePressability'; @@ -32,12 +33,20 @@ import useAndroidRippleForView, { import * as React from 'react'; import {useImperativeHandle, useMemo, useRef, useState} from 'react'; +const defaultHoverStyle: HoverStyle = { + effectType: 'automatic', +}; + type ViewStyleProp = $ElementType, 'style'>; export type StateCallbackType = $ReadOnly<{| pressed: boolean, |}>; +type VisionOSProps = $ReadOnly<{| + visionos_hoverStyle?: ?HoverStyle, +|}>; + type Props = $ReadOnly<{| /** * Accessibility. @@ -193,6 +202,10 @@ type Props = $ReadOnly<{| * https://github.com/facebook/react-native/issues/34424 */ 'aria-label'?: ?string, + /** + * Props needed for VisionOS. + */ + ...VisionOSProps, |}>; /** @@ -232,6 +245,7 @@ function Pressable(props: Props, forwardedRef): React.Node { style, testOnly_pressed, unstable_pressDelay, + visionos_hoverStyle = defaultHoverStyle, ...restProps } = props; @@ -341,7 +355,8 @@ function Pressable(props: Props, forwardedRef): React.Node { {...eventHandlers} ref={mergedRef} style={typeof style === 'function' ? style({pressed}) : style} - collapsable={false}> + collapsable={false} + visionos_hoverStyle={visionos_hoverStyle}> {typeof children === 'function' ? children({pressed}) : children} {__DEV__ ? : null} diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js index 998a7d02f3b45a..ad4a0663a739b8 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js @@ -9,6 +9,7 @@ */ import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {HoverStyle} from '../View/ViewPropTypes'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import View from '../../Components/View/View'; @@ -32,10 +33,15 @@ type IOSProps = $ReadOnly<{| hasTVPreferredFocus?: ?boolean, |}>; +type VisionOSProps = $ReadOnly<{| + hoverStyle?: ?HoverStyle, +|}>; + type Props = $ReadOnly<{| ...React.ElementConfig, ...AndroidProps, ...IOSProps, + ...VisionOSProps, activeOpacity?: ?number, underlayColor?: ?ColorValue, @@ -341,6 +347,7 @@ class TouchableHighlight extends React.Component { nextFocusLeft={this.props.nextFocusLeft} nextFocusRight={this.props.nextFocusRight} nextFocusUp={this.props.nextFocusUp} + visionos_hoverStyle={this.props.hoverStyle} focusable={ this.props.focusable !== false && this.props.onPress !== undefined } diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts index 37c4ce6df43e4c..919e90dbfe9246 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts @@ -11,7 +11,7 @@ import type * as React from 'react'; import {Constructor} from '../../../types/private/Utilities'; import {TimerMixin} from '../../../types/private/TimerMixin'; import {NativeMethods} from '../../../types/public/ReactNativeTypes'; -import {TVParallaxProperties} from '../View/ViewPropTypes'; +import {HoverStyle, TVParallaxProperties} from '../View/ViewPropTypes'; import {TouchableMixin} from './Touchable'; import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; @@ -86,6 +86,11 @@ export interface TouchableOpacityProps * @platform android */ tvParallaxProperties?: TVParallaxProperties | undefined; + + /** + * Hover style to apply to the view. Only supported on VisionOS. + */ + visionos_hoverStyle?: HoverStyle | undefined; } /** diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js index 95b3787905c082..35a3897cd1d305 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js @@ -9,6 +9,7 @@ */ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {HoverStyle} from '../View/ViewPropTypes'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import Animated from '../../Animated/Animated'; @@ -21,6 +22,10 @@ import flattenStyle from '../../StyleSheet/flattenStyle'; import Platform from '../../Utilities/Platform'; import * as React from 'react'; +const defaultHoverStyle: HoverStyle = { + effectType: 'automatic', +}; + type TVProps = $ReadOnly<{| hasTVPreferredFocus?: ?boolean, nextFocusDown?: ?number, @@ -30,9 +35,14 @@ type TVProps = $ReadOnly<{| nextFocusUp?: ?number, |}>; +type VisionOSProps = $ReadOnly<{| + visionos_hoverStyle?: ?HoverStyle, +|}>; + type Props = $ReadOnly<{| ...React.ElementConfig, ...TVProps, + ...VisionOSProps, activeOpacity?: ?number, style?: ?ViewStyleProp, @@ -130,6 +140,10 @@ type State = $ReadOnly<{| * */ class TouchableOpacity extends React.Component { + static defaultProps: {|visionos_hoverStyle: HoverStyle|} = { + visionos_hoverStyle: defaultHoverStyle, + }; + state: State = { anim: new Animated.Value(this._getChildStyleOpacityWithDefault()), pressability: new Pressability(this._createPressabilityConfig()), @@ -286,6 +300,7 @@ class TouchableOpacity extends React.Component { nextFocusUp={this.props.nextFocusUp} hasTVPreferredFocus={this.props.hasTVPreferredFocus} hitSlop={this.props.hitSlop} + visionos_hoverStyle={this.props.visionos_hoverStyle} focusable={ this.props.focusable !== false && this.props.onPress !== undefined } diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts index 53f5e82c34149b..660e6e76a82bf4 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts @@ -16,6 +16,21 @@ import {LayoutChangeEvent, PointerEvents} from '../../Types/CoreEventTypes'; import {Touchable} from '../Touchable/Touchable'; import {AccessibilityProps} from './ViewAccessibility'; +export type HoverStyle = { + /** + * If true the hover effect is enabled. Defaults to true. + */ + enabled: boolean; + /** + * Hover effect type to apply to the view. + */ + effectType: 'automatic' | 'lift' | 'highlight'; + /** + * Corner radius of the hover effect. + */ + cornerRadius?: number | undefined; +}; + export type TVParallaxProperties = { /** * If true, parallax effects are enabled. Defaults to true. @@ -122,6 +137,10 @@ export interface ViewPropsIOS extends TVViewPropsIOS { * Test and measure when using this property. */ shouldRasterizeIOS?: boolean | undefined; + /** + * Hover style to apply to the view. Only supported on VisionOS. + */ + visionos_hoverStyle?: HoverStyle | undefined; } export interface ViewPropsAndroid { diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.js b/packages/react-native/Libraries/Components/View/ViewPropTypes.js index 1ead9ba053a51a..379b469c8af943 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.js +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.js @@ -263,6 +263,21 @@ type AndroidDrawableRipple = $ReadOnly<{| rippleRadius?: ?number, |}>; +export type HoverStyle = $ReadOnly<{| + /** + * If true the hover effect is enabled. Defaults to true. + */ + enabled?: ?boolean, + /** + * Hover effect type to apply to the view. + */ + effectType: 'automatic' | 'lift' | 'highlight', + /** + * Corner radius of the hover effect. + */ + cornerRadius?: ?number, +|}>; + type AndroidDrawable = AndroidDrawableThemeAttr | AndroidDrawableRipple; type AndroidViewProps = $ReadOnly<{| @@ -436,6 +451,11 @@ type IOSViewProps = $ReadOnly<{| * See https://reactnative.dev/docs/view#shouldrasterizeios */ shouldRasterizeIOS?: ?boolean, + + /** + * Hover style to apply to the view. Only supported on VisionOS. + */ + visionos_hoverStyle?: ?HoverStyle, |}>; export type ViewProps = $ReadOnly<{| diff --git a/packages/react-native/React/Views/RCTView.h b/packages/react-native/React/Views/RCTView.h index 200d8b451bf59e..ace9840f5c59d5 100644 --- a/packages/react-native/React/Views/RCTView.h +++ b/packages/react-native/React/Views/RCTView.h @@ -120,6 +120,13 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; */ @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; +#if TARGET_OS_VISION +/** + * The hover style to apply to a view, including an effect and a shape to use for displaying that effect. + */ +@property (nonatomic, copy) NSDictionary *hoverStyleProperties; +#endif + /** * (Experimental and unused for Paper) Pointer event handlers. */ diff --git a/packages/react-native/React/Views/RCTView.m b/packages/react-native/React/Views/RCTView.m index bb8336615a0208..3b4fb6076aab62 100644 --- a/packages/react-native/React/Views/RCTView.m +++ b/packages/react-native/React/Views/RCTView.m @@ -666,6 +666,38 @@ - (UIEdgeInsets)bordersAsInsets }; } + +#if TARGET_OS_VISION +- (void)setHoverStyleProperties:(NSDictionary *)hoverStyleProperties { + _hoverStyleProperties = hoverStyleProperties; + + BOOL enabled = _hoverStyleProperties[@"enabled"] != nil ? [_hoverStyleProperties[@"enabled"] boolValue] : YES; + + if (!enabled || hoverStyleProperties == nil) { + self.hoverStyle = nil; + return; + } + + NSString *effectType = (NSString *)[_hoverStyleProperties objectForKey:@"effectType"]; + NSNumber *cornerRadius = (NSNumber *)[_hoverStyleProperties objectForKey:@"cornerRadius"]; + + float cornerRadiusFloat = [cornerRadius floatValue]; + + UIShape *shape = [UIShape rectShapeWithCornerRadius:cornerRadiusFloat]; + id hoverEffect; + + if ([effectType isEqualToString:@"lift"]) { + hoverEffect = [UIHoverLiftEffect effect]; + } else if ([effectType isEqualToString:@"highlight"]) { + hoverEffect = [UIHoverHighlightEffect effect]; + } else if ([effectType isEqualToString:@"automatic"]) { + hoverEffect = [UIHoverAutomaticEffect effect]; + } + + self.hoverStyle = [UIHoverStyle styleWithEffect:hoverEffect shape:shape]; +} +#endif + - (RCTCornerRadii)cornerRadii { const BOOL isRTL = _reactLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft; diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index a3861f7a2cd669..a0a09439d0e4f9 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -194,6 +194,7 @@ - (RCTShadowView *)shadowView RCT_REMAP_VIEW_PROPERTY(testID, reactAccessibilityElement.accessibilityIdentifier, NSString) RCT_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor) +RCT_REMAP_VISIONOS_VIEW_PROPERTY(visionos_hoverStyle, hoverStyleProperties, NSDictionary) RCT_REMAP_VIEW_PROPERTY(backfaceVisibility, layer.doubleSided, css_backface_visibility_t) RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat) RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor) From 9fd0e8ae83e078ec605d5179258c165d053f4ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 11 Oct 2023 21:47:14 +0200 Subject: [PATCH 6/7] chore: update README.MD --- README.md | 143 +++--------------------------------------------------- 1 file changed, 8 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index a99a5c75c20e3f..3621904b39171b 100644 --- a/README.md +++ b/README.md @@ -1,147 +1,20 @@

- React Native + React Native Vision OS

Learn once, write anywhere:
- Build mobile apps with React. + Build spatial apps with React.

-

- - React Native is released under the MIT license. - - - Current CircleCI build status. - - - Current npm package version. - - - PRs welcome! - - - Follow @reactnative - -

- -

- Getting Started - · - Learn the Basics - · - Showcase - · - Contribute - · - Community - · - Support -

- -React Native brings [**React**'s][r] declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform. - -- **Declarative.** React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug. -- **Component-Based.** Build encapsulated components that manage their state, then compose them to make complex UIs. -- **Developer Velocity.** See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app. -- **Portability.** Reuse code across iOS, Android, and [other platforms][p]. - -React Native is developed and supported by many companies and individual core contributors. Find out more in our [ecosystem overview][e]. - -[r]: https://react.dev/ -[p]: https://reactnative.dev/docs/out-of-tree-platforms -[e]: https://github.com/facebook/react-native/blob/HEAD/ECOSYSTEM.md - -## Contents - -- [Requirements](#-requirements) -- [Building your first React Native app](#-building-your-first-react-native-app) -- [Documentation](#-documentation) -- [Upgrading](#-upgrading) -- [How to Contribute](#-how-to-contribute) -- [Code of Conduct](#code-of-conduct) -- [License](#-license) - - -## 📋 Requirements - -React Native apps may target iOS 13.4 and Android 5.0 (API 21) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this. - -## 🎉 Building your first React Native app - -Follow the [Getting Started guide](https://reactnative.dev/docs/getting-started). The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios: - -- [Trying out React Native][hello-world] -- [Creating a New Application][new-app] -- [Adding React Native to an Existing Application][existing] - -[hello-world]: https://snack.expo.dev/@samples/hello-world -[new-app]: https://reactnative.dev/docs/getting-started -[existing]: https://reactnative.dev/docs/integration-with-existing-apps - -## 📖 Documentation - -The full documentation for React Native can be found on our [website][docs]. - -The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs]. - -The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website]. - -[docs]: https://reactnative.dev/docs/getting-started -[r-docs]: https://react.dev/learn -[repo-website]: https://github.com/facebook/react-native-website - -## 🚀 Upgrading - -Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the [Upgrading Guide][u] for instructions. - -React Native releases are discussed [in this discussion repo](https://github.com/reactwg/react-native-releases/discussions). - -[u]: https://reactnative.dev/docs/upgrading -[repo-releases]: https://github.com/react-native-community/react-native-releases - -## 👏 How to Contribute - -The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving React Native. - -### [Code of Conduct][code] - -Facebook has adopted a Code of Conduct that we expect project participants to adhere to. -Please read the [full text][code] so that you can understand what actions will and will not be tolerated. - -[code]: https://code.fb.com/codeofconduct/ - -### [Contributing Guide][contribute] - -Read our [**Contributing Guide**][contribute] to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native. - -[contribute]: https://reactnative.dev/docs/contributing - -### [Open Source Roadmap][roadmap] - -You can learn more about our vision for React Native in the [**Roadmap**][roadmap]. - -[roadmap]: https://github.com/facebook/react-native/wiki/Roadmap - -### Good First Issues - -We have a list of [good first issues][gfi] that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process. - -[gfi]: https://github.com/facebook/react-native/labels/good%20first%20issue - -### Discussions - -Larger discussions and proposals are discussed in [**@react-native-community/discussions-and-proposals**][repo-meta]. - -[repo-meta]: https://github.com/react-native-community/discussions-and-proposals - -## 📄 License +React Native Vision OS allows you to write VisionOS with full support for platform SDK. This is a full fork of the main repository with changes needed to support VisionOS. -React Native is MIT licensed, as found in the [LICENSE][l] file. +This project is still at an early stage of development and is not ready for production use. -React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file. +## Contributing -[l]: https://github.com/facebook/react-native/blob/main/LICENSE -[ld]: https://github.com/facebook/react-native/blob/main/LICENSE-docs +1. Download latest Xcode beta [here](https://developer.apple.com/xcode/). +2. Install VisionOS Simulator runtime. +3. Follow the same steps as for running iOS defined in `packages/rn-tester/README.md` From 6f8d985279846c0e852e12b43310a51c801491c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Sun, 15 Oct 2023 14:45:44 +0200 Subject: [PATCH 7/7] fix: refactor visionos_hoverStyle to take a string and new arch support --- .../Components/Pressable/Pressable.js | 12 +++---- .../Touchable/TouchableHighlight.js | 6 ++-- .../Touchable/TouchableOpacity.d.ts | 4 +-- .../Components/Touchable/TouchableOpacity.js | 14 ++++----- .../Components/View/ViewPropTypes.d.ts | 17 ++-------- .../Components/View/ViewPropTypes.js | 17 ++-------- .../View/RCTViewComponentView.mm | 28 +++++++++++++++++ packages/react-native/React/Views/RCTView.h | 2 +- packages/react-native/React/Views/RCTView.m | 31 +++++++------------ .../react-native/React/Views/RCTViewManager.m | 2 +- .../components/view/BaseViewProps.cpp | 14 +++++++++ .../renderer/components/view/BaseViewProps.h | 4 +++ 12 files changed, 80 insertions(+), 71 deletions(-) diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index 4873850d1e3ac4..36e095a7347e77 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -20,7 +20,7 @@ import type { AccessibilityState, AccessibilityValue, } from '../View/ViewAccessibility'; -import type {HoverStyle} from '../View/ViewPropTypes'; +import type {HoverEffect} from '../View/ViewPropTypes'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import usePressability from '../../Pressability/usePressability'; @@ -33,9 +33,7 @@ import useAndroidRippleForView, { import * as React from 'react'; import {useImperativeHandle, useMemo, useRef, useState} from 'react'; -const defaultHoverStyle: HoverStyle = { - effectType: 'automatic', -}; +const defaultHoverEffect: HoverEffect = 'highlight'; type ViewStyleProp = $ElementType, 'style'>; @@ -44,7 +42,7 @@ export type StateCallbackType = $ReadOnly<{| |}>; type VisionOSProps = $ReadOnly<{| - visionos_hoverStyle?: ?HoverStyle, + visionos_hoverEffect?: ?HoverEffect, |}>; type Props = $ReadOnly<{| @@ -245,7 +243,7 @@ function Pressable(props: Props, forwardedRef): React.Node { style, testOnly_pressed, unstable_pressDelay, - visionos_hoverStyle = defaultHoverStyle, + visionos_hoverEffect = defaultHoverEffect, ...restProps } = props; @@ -356,7 +354,7 @@ function Pressable(props: Props, forwardedRef): React.Node { ref={mergedRef} style={typeof style === 'function' ? style({pressed}) : style} collapsable={false} - visionos_hoverStyle={visionos_hoverStyle}> + visionos_hoverEffect={visionos_hoverEffect}> {typeof children === 'function' ? children({pressed}) : children} {__DEV__ ? : null} diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js index ad4a0663a739b8..ceebee7470a93b 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js @@ -9,7 +9,7 @@ */ import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {HoverStyle} from '../View/ViewPropTypes'; +import type {HoverEffect} from '../View/ViewPropTypes'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import View from '../../Components/View/View'; @@ -34,7 +34,7 @@ type IOSProps = $ReadOnly<{| |}>; type VisionOSProps = $ReadOnly<{| - hoverStyle?: ?HoverStyle, + hoverEffect?: ?HoverEffect, |}>; type Props = $ReadOnly<{| @@ -347,7 +347,7 @@ class TouchableHighlight extends React.Component { nextFocusLeft={this.props.nextFocusLeft} nextFocusRight={this.props.nextFocusRight} nextFocusUp={this.props.nextFocusUp} - visionos_hoverStyle={this.props.hoverStyle} + visionos_hoverEffect={this.props.hoverEffect} focusable={ this.props.focusable !== false && this.props.onPress !== undefined } diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts index 919e90dbfe9246..ec8485306a8050 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.d.ts @@ -11,7 +11,7 @@ import type * as React from 'react'; import {Constructor} from '../../../types/private/Utilities'; import {TimerMixin} from '../../../types/private/TimerMixin'; import {NativeMethods} from '../../../types/public/ReactNativeTypes'; -import {HoverStyle, TVParallaxProperties} from '../View/ViewPropTypes'; +import {HoverEffect, TVParallaxProperties} from '../View/ViewPropTypes'; import {TouchableMixin} from './Touchable'; import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; @@ -90,7 +90,7 @@ export interface TouchableOpacityProps /** * Hover style to apply to the view. Only supported on VisionOS. */ - visionos_hoverStyle?: HoverStyle | undefined; + visionos_hoverEffect?: HoverEffect | undefined; } /** diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js index 35a3897cd1d305..6fab99b54514b0 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js @@ -9,7 +9,7 @@ */ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {HoverStyle} from '../View/ViewPropTypes'; +import type {HoverEffect} from '../View/ViewPropTypes'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import Animated from '../../Animated/Animated'; @@ -22,9 +22,7 @@ import flattenStyle from '../../StyleSheet/flattenStyle'; import Platform from '../../Utilities/Platform'; import * as React from 'react'; -const defaultHoverStyle: HoverStyle = { - effectType: 'automatic', -}; +const defaultHoverEffect: HoverEffect = 'highlight'; type TVProps = $ReadOnly<{| hasTVPreferredFocus?: ?boolean, @@ -36,7 +34,7 @@ type TVProps = $ReadOnly<{| |}>; type VisionOSProps = $ReadOnly<{| - visionos_hoverStyle?: ?HoverStyle, + visionos_hoverEffect?: ?HoverEffect, |}>; type Props = $ReadOnly<{| @@ -140,8 +138,8 @@ type State = $ReadOnly<{| * */ class TouchableOpacity extends React.Component { - static defaultProps: {|visionos_hoverStyle: HoverStyle|} = { - visionos_hoverStyle: defaultHoverStyle, + static defaultProps: {|visionos_hoverEffect: HoverEffect|} = { + visionos_hoverEffect: defaultHoverEffect, }; state: State = { @@ -300,7 +298,7 @@ class TouchableOpacity extends React.Component { nextFocusUp={this.props.nextFocusUp} hasTVPreferredFocus={this.props.hasTVPreferredFocus} hitSlop={this.props.hitSlop} - visionos_hoverStyle={this.props.visionos_hoverStyle} + visionos_hoverEffect={this.props.visionos_hoverEffect} focusable={ this.props.focusable !== false && this.props.onPress !== undefined } diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts index 660e6e76a82bf4..91de6db091ddc5 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts @@ -16,20 +16,7 @@ import {LayoutChangeEvent, PointerEvents} from '../../Types/CoreEventTypes'; import {Touchable} from '../Touchable/Touchable'; import {AccessibilityProps} from './ViewAccessibility'; -export type HoverStyle = { - /** - * If true the hover effect is enabled. Defaults to true. - */ - enabled: boolean; - /** - * Hover effect type to apply to the view. - */ - effectType: 'automatic' | 'lift' | 'highlight'; - /** - * Corner radius of the hover effect. - */ - cornerRadius?: number | undefined; -}; +export type HoverEffect = 'lift' | 'highlight'; export type TVParallaxProperties = { /** @@ -140,7 +127,7 @@ export interface ViewPropsIOS extends TVViewPropsIOS { /** * Hover style to apply to the view. Only supported on VisionOS. */ - visionos_hoverStyle?: HoverStyle | undefined; + visionos_hoverEffect?: HoverEffect | undefined; } export interface ViewPropsAndroid { diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.js b/packages/react-native/Libraries/Components/View/ViewPropTypes.js index 379b469c8af943..3c51edae052360 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.js +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.js @@ -263,20 +263,7 @@ type AndroidDrawableRipple = $ReadOnly<{| rippleRadius?: ?number, |}>; -export type HoverStyle = $ReadOnly<{| - /** - * If true the hover effect is enabled. Defaults to true. - */ - enabled?: ?boolean, - /** - * Hover effect type to apply to the view. - */ - effectType: 'automatic' | 'lift' | 'highlight', - /** - * Corner radius of the hover effect. - */ - cornerRadius?: ?number, -|}>; +export type HoverEffect = 'lift' | 'highlight'; type AndroidDrawable = AndroidDrawableThemeAttr | AndroidDrawableRipple; @@ -455,7 +442,7 @@ type IOSViewProps = $ReadOnly<{| /** * Hover style to apply to the view. Only supported on VisionOS. */ - visionos_hoverStyle?: ?HoverStyle, + visionos_hoverEffect?: ?HoverEffect, |}>; export type ViewProps = $ReadOnly<{| diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index cb2afd402f0a63..0acb8d5e4af6b4 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -293,6 +293,12 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & oldViewProps.borderColors != newViewProps.borderColors) { needsInvalidateLayer = YES; } + +#if TARGET_OS_VISION + if (oldViewProps.visionos_hoverEffect != newViewProps.visionos_hoverEffect) { + [self updateHoverEffect:[NSString stringWithUTF8String:newViewProps.visionos_hoverEffect.c_str()]]; + } +#endif // `nativeId` if (oldViewProps.nativeId != newViewProps.nativeId) { @@ -513,6 +519,28 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event } } +#if TARGET_OS_VISION +- (void) updateHoverEffect:(NSString*)hoverEffect { + if (hoverEffect == nil || [hoverEffect isEqualToString:@""]) { + self.hoverStyle = nil; + return; + } + + UIShape *shape = [UIShape rectShapeWithCornerRadius:self.layer.cornerRadius]; + id effect; + + if ([hoverEffect isEqualToString:@"lift"]) { + effect = [UIHoverLiftEffect effect]; + } else if ([hoverEffect isEqualToString:@"highlight"]) { + effect = [UIHoverHighlightEffect effect]; + } + + if (hoverEffect != nil) { + self.hoverStyle = [UIHoverStyle styleWithEffect:effect shape:shape]; + } +} +#endif + static RCTCornerRadii RCTCornerRadiiFromBorderRadii(BorderRadii borderRadii) { return RCTCornerRadii{ diff --git a/packages/react-native/React/Views/RCTView.h b/packages/react-native/React/Views/RCTView.h index ace9840f5c59d5..100cde3079f5c9 100644 --- a/packages/react-native/React/Views/RCTView.h +++ b/packages/react-native/React/Views/RCTView.h @@ -124,7 +124,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; /** * The hover style to apply to a view, including an effect and a shape to use for displaying that effect. */ -@property (nonatomic, copy) NSDictionary *hoverStyleProperties; +@property (nonatomic, copy) NSString *hoverEffect; #endif /** diff --git a/packages/react-native/React/Views/RCTView.m b/packages/react-native/React/Views/RCTView.m index 3b4fb6076aab62..821a5b1a1981a4 100644 --- a/packages/react-native/React/Views/RCTView.m +++ b/packages/react-native/React/Views/RCTView.m @@ -668,33 +668,26 @@ - (UIEdgeInsets)bordersAsInsets #if TARGET_OS_VISION -- (void)setHoverStyleProperties:(NSDictionary *)hoverStyleProperties { - _hoverStyleProperties = hoverStyleProperties; +- (void)setHoverEffect:(NSString *)hoverEffect { + _hoverEffect = hoverEffect; - BOOL enabled = _hoverStyleProperties[@"enabled"] != nil ? [_hoverStyleProperties[@"enabled"] boolValue] : YES; - - if (!enabled || hoverStyleProperties == nil) { + if (hoverEffect == nil) { self.hoverStyle = nil; return; } - NSString *effectType = (NSString *)[_hoverStyleProperties objectForKey:@"effectType"]; - NSNumber *cornerRadius = (NSNumber *)[_hoverStyleProperties objectForKey:@"cornerRadius"]; - - float cornerRadiusFloat = [cornerRadius floatValue]; + UIShape *shape = [UIShape rectShapeWithCornerRadius:_borderRadius]; + id effect; - UIShape *shape = [UIShape rectShapeWithCornerRadius:cornerRadiusFloat]; - id hoverEffect; - - if ([effectType isEqualToString:@"lift"]) { - hoverEffect = [UIHoverLiftEffect effect]; - } else if ([effectType isEqualToString:@"highlight"]) { - hoverEffect = [UIHoverHighlightEffect effect]; - } else if ([effectType isEqualToString:@"automatic"]) { - hoverEffect = [UIHoverAutomaticEffect effect]; + if ([hoverEffect isEqualToString:@"lift"]) { + effect = [UIHoverLiftEffect effect]; + } else if ([hoverEffect isEqualToString:@"highlight"]) { + effect = [UIHoverHighlightEffect effect]; } - self.hoverStyle = [UIHoverStyle styleWithEffect:hoverEffect shape:shape]; + if (hoverEffect != nil) { + self.hoverStyle = [UIHoverStyle styleWithEffect:effect shape:shape]; + } } #endif diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index a0a09439d0e4f9..a25c0cd498b4a7 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -194,7 +194,7 @@ - (RCTShadowView *)shadowView RCT_REMAP_VIEW_PROPERTY(testID, reactAccessibilityElement.accessibilityIdentifier, NSString) RCT_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor) -RCT_REMAP_VISIONOS_VIEW_PROPERTY(visionos_hoverStyle, hoverStyleProperties, NSDictionary) +RCT_REMAP_VISIONOS_VIEW_PROPERTY(visionos_hoverEffect, hoverEffect, NSString) RCT_REMAP_VIEW_PROPERTY(backfaceVisibility, layer.doubleSided, css_backface_visibility_t) RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat) RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor) diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp index 58bb38b20385c1..22fa01d7170cae 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp @@ -71,6 +71,17 @@ BaseViewProps::BaseViewProps( "backgroundColor", sourceProps.backgroundColor, {})), +#if TARGET_OS_VISION + visionos_hoverEffect( + CoreFeatures::enablePropIteratorSetter + ? sourceProps.visionos_hoverEffect + : convertRawProp( + context, + rawProps, + "visionos_hoverEffect", + sourceProps.visionos_hoverEffect, + {})), +#endif borderRadii( CoreFeatures::enablePropIteratorSetter ? sourceProps.borderRadii : convertRawProp( @@ -281,6 +292,9 @@ void BaseViewProps::setProp( RAW_SET_PROP_SWITCH_CASE_BASIC(collapsable); RAW_SET_PROP_SWITCH_CASE_BASIC(removeClippedSubviews); RAW_SET_PROP_SWITCH_CASE_BASIC(experimental_layoutConformance); +#if TARGET_OS_VISION + RAW_SET_PROP_SWITCH_CASE_BASIC(visionos_hoverEffect); +#endif // events field VIEW_EVENT_CASE(PointerEnter); VIEW_EVENT_CASE(PointerEnterCapture); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h index b7bdd9afc7eb55..a70e8c578e8b9a 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h @@ -63,6 +63,10 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps { PointerEventsMode pointerEvents{}; EdgeInsets hitSlop{}; bool onLayout{}; + +#if TARGET_OS_VISION + std::string visionos_hoverEffect{}; +#endif ViewEvents events{};