From 76e3d6a344b2955dd83a4c535253d82c76094540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 17 Jan 2024 16:06:38 +0100 Subject: [PATCH] fix: dimensions, use RCTMainWindow() --- .../Libraries/AppDelegate/RCTAppDelegate.h | 2 +- .../Libraries/AppDelegate/RCTAppDelegate.mm | 3 + .../SwiftExtensions/RCTMainWindow.swift | 34 ++++++ .../SwiftExtensions/RCTReactViewController.h | 9 +- .../SwiftExtensions/RCTReactViewController.m | 5 + .../RCTRootViewRepresentable.swift | 27 ++--- .../React-RCTSwiftExtensions.podspec | 2 + .../React/Base/RCTBridgeDelegate.h | 2 +- packages/react-native/template/_gitignore | 1 + .../HelloWorld.xcodeproj/project.pbxproj | 16 +-- .../template/visionos/HelloWorld/App.swift | 4 +- .../visionos/HelloWorld/AppDelegate.swift | 2 +- packages/rn-tester/Podfile.lock | 102 +++++++++--------- .../rn-tester/RNTester-visionOS/App.swift | 4 +- .../RNTester-visionOS/AppDelegate.swift | 2 +- 15 files changed, 133 insertions(+), 82 deletions(-) create mode 100644 packages/react-native/Libraries/SwiftExtensions/RCTMainWindow.swift diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h index f38b36e99e92d9..00e27912ea19f5 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h @@ -159,7 +159,7 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)bridgelessEnabled; /// Return the bundle URL for the main bundle. -- (NSURL *)bundleURL; +- (NSURL *__nullable)bundleURL; /// Don't use this method, it's going to be removed soon. - (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary*)initialProperties launchOptions:(NSDictionary*)launchOptions; diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index c7b7c7ac34f1b0..3c791851ddf7c2 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -312,6 +312,9 @@ - (Class)getModuleClassFromName:(const char *)name - (void)createReactHost { + if (_reactHost != nil) { + return; + } __weak __typeof(self) weakSelf = self; _reactHost = [[RCTHost alloc] initWithBundleURL:[self bundleURL] hostDelegate:nil diff --git a/packages/react-native/Libraries/SwiftExtensions/RCTMainWindow.swift b/packages/react-native/Libraries/SwiftExtensions/RCTMainWindow.swift new file mode 100644 index 00000000000000..1bf0bca5901b63 --- /dev/null +++ b/packages/react-native/Libraries/SwiftExtensions/RCTMainWindow.swift @@ -0,0 +1,34 @@ +import SwiftUI + +/** + This SwiftUI struct returns main React Native scene. It should be used only once as it conains setup code. + + Example: + ```swift + @main + struct YourApp: App { + @UIApplicationDelegateAdaptor var delegate: AppDelegate + + var body: some Scene { + RCTMainWindow(moduleName: "YourApp") + } + } + ``` + + Note: If you want to create additional windows in your app, create a new `WindowGroup {}` and pass it a `RCTRootViewRepresentable`. +*/ +public struct RCTMainWindow: Scene { + var moduleName: String + var initialProps: RCTRootViewRepresentable.InitialPropsType + + public init(moduleName: String, initialProps: RCTRootViewRepresentable.InitialPropsType = nil) { + self.moduleName = moduleName + self.initialProps = initialProps + } + + public var body: some Scene { + WindowGroup { + RCTRootViewRepresentable(moduleName: moduleName, initialProps: initialProps) + } + } +} diff --git a/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.h b/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.h index 49f121175ef28d..13de19c37cf0e2 100644 --- a/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.h +++ b/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.h @@ -1,9 +1,14 @@ #import +/** + A `UIViewController` responsible for embeding `RCTRootView` inside. Uses Factory pattern to retrive new view instances. + + Note: Used to in `RCTRootViewRepresentable` to display React views. + */ @interface RCTReactViewController : UIViewController -@property (nonatomic, strong) NSString *_Nonnull moduleName; -@property (nonatomic, strong) NSDictionary *_Nullable initialProps; +@property (nonatomic, strong, nonnull) NSString *moduleName; +@property (nonatomic, strong, nullable) NSDictionary *initialProps; - (instancetype _Nonnull)initWithModuleName:(NSString *_Nonnull)moduleName initProps:(NSDictionary *_Nullable)initProps; diff --git a/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.m b/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.m index 57492296c61d78..4f0fd95a55bce7 100644 --- a/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.m +++ b/packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.m @@ -1,4 +1,5 @@ #import "RCTReactViewController.h" +#import @protocol RCTRootViewFactoryProtocol @@ -16,6 +17,10 @@ - (instancetype)initWithModuleName:(NSString *)moduleName initProps:(NSDictionar return self; } +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { + [[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self]; +} + // TODO: Temporary solution for creating RCTRootView on demand. This should be done through factory pattern, see here: https://github.com/facebook/react-native/pull/42263 - (void)loadView { id appDelegate = [UIApplication sharedApplication].delegate; diff --git a/packages/react-native/Libraries/SwiftExtensions/RCTRootViewRepresentable.swift b/packages/react-native/Libraries/SwiftExtensions/RCTRootViewRepresentable.swift index 9de42abf0d5317..1d9441975bf81c 100644 --- a/packages/react-native/Libraries/SwiftExtensions/RCTRootViewRepresentable.swift +++ b/packages/react-native/Libraries/SwiftExtensions/RCTRootViewRepresentable.swift @@ -1,20 +1,23 @@ import SwiftUI -/* - * Use this struct in SwiftUI context to present React Native rootView. - * - * Example: - * ``` - * WindowGroup { - * RCTRootViewRepresentable(moduleName: "RNTesterApp", initialProps: [:]) - * } - * ``` - */ +/** + SwiftUI view enclosing `RCTReactViewController`. Its main purpose is to display React Native views inside of SwiftUI lifecycle. + + Use it create new windows in your app: + Example: + ```swift + WindowGroup { + RCTRootViewRepresentable(moduleName: "YourAppName", initialProps: [:]) + } + ``` +*/ public struct RCTRootViewRepresentable: UIViewControllerRepresentable { + public typealias InitialPropsType = [AnyHashable: Any]? + var moduleName: String - var initialProps: [AnyHashable: Any]? + var initialProps: InitialPropsType - public init(moduleName: String, initialProps: [AnyHashable : Any]?) { + public init(moduleName: String, initialProps: InitialPropsType = nil) { self.moduleName = moduleName self.initialProps = initialProps } diff --git a/packages/react-native/Libraries/SwiftExtensions/React-RCTSwiftExtensions.podspec b/packages/react-native/Libraries/SwiftExtensions/React-RCTSwiftExtensions.podspec index 3c603ddd6d8c74..d5dbdafe37ff6d 100644 --- a/packages/react-native/Libraries/SwiftExtensions/React-RCTSwiftExtensions.podspec +++ b/packages/react-native/Libraries/SwiftExtensions/React-RCTSwiftExtensions.podspec @@ -22,4 +22,6 @@ Pod::Spec.new do |s| s.source = source s.source_files = "*.{swift,h,m}" s.frameworks = ["UIKit", "SwiftUI"] + + s.dependency "React-Core" end diff --git a/packages/react-native/React/Base/RCTBridgeDelegate.h b/packages/react-native/React/Base/RCTBridgeDelegate.h index 0d9ec0a2b137bc..1bc3723ea9ed12 100644 --- a/packages/react-native/React/Base/RCTBridgeDelegate.h +++ b/packages/react-native/React/Base/RCTBridgeDelegate.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN * When running from a locally bundled JS file, this should be a `file://` url * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`. */ -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge; +- (NSURL *__nullable)sourceURLForBridge:(RCTBridge *)bridge; @optional diff --git a/packages/react-native/template/_gitignore b/packages/react-native/template/_gitignore index b0dcf472880ef0..794c9344167271 100644 --- a/packages/react-native/template/_gitignore +++ b/packages/react-native/template/_gitignore @@ -65,3 +65,4 @@ yarn-error.log # testing /coverage +.yarn diff --git a/packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj b/packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj index 715f4c231b42c1..41d39acfc43ca3 100644 --- a/packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj +++ b/packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj @@ -10,8 +10,8 @@ 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 767CEB962B56C0F3000139AD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767CEB952B56C0F3000139AD /* AppDelegate.swift */; }; - 767CEB982B56C0FA000139AD /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767CEB972B56C0FA000139AD /* App.swift */; }; + 767CEBBC2B582F6B000139AD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767CEBBB2B582F6B000139AD /* AppDelegate.swift */; }; + 767CEBBE2B582F78000139AD /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767CEBBD2B582F78000139AD /* App.swift */; }; 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; }; /* End PBXBuildFile section */ @@ -37,8 +37,8 @@ 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 767CEB952B56C0F3000139AD /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = VisionAppTestSUI/AppDelegate.swift; sourceTree = ""; }; - 767CEB972B56C0FA000139AD /* App.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = App.swift; path = VisionAppTestSUI/App.swift; sourceTree = ""; }; + 767CEBBB2B582F6B000139AD /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = HelloWorld/AppDelegate.swift; sourceTree = ""; }; + 767CEBBD2B582F78000139AD /* App.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = App.swift; path = HelloWorld/App.swift; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -83,8 +83,8 @@ 13B07FAE1A68108700A75B9A /* HelloWorld */ = { isa = PBXGroup; children = ( - 767CEB952B56C0F3000139AD /* AppDelegate.swift */, - 767CEB972B56C0FA000139AD /* App.swift */, + 767CEBBB2B582F6B000139AD /* AppDelegate.swift */, + 767CEBBD2B582F78000139AD /* App.swift */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, ); @@ -386,8 +386,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 767CEB962B56C0F3000139AD /* AppDelegate.swift in Sources */, - 767CEB982B56C0FA000139AD /* App.swift in Sources */, + 767CEBBC2B582F6B000139AD /* AppDelegate.swift in Sources */, + 767CEBBE2B582F78000139AD /* App.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/packages/react-native/template/visionos/HelloWorld/App.swift b/packages/react-native/template/visionos/HelloWorld/App.swift index 01f008b38ffa7c..c1d601b2201ba9 100644 --- a/packages/react-native/template/visionos/HelloWorld/App.swift +++ b/packages/react-native/template/visionos/HelloWorld/App.swift @@ -7,8 +7,6 @@ struct HelloWorldApp: App { @UIApplicationDelegateAdaptor var delegate: AppDelegate var body: some Scene { - WindowGroup { - RCTRootViewRepresentable(moduleName: "HelloWorld", initialProps: nil) - } + RCTMainWindow(moduleName: "HelloWorld") } } diff --git a/packages/react-native/template/visionos/HelloWorld/AppDelegate.swift b/packages/react-native/template/visionos/HelloWorld/AppDelegate.swift index 4e68fb4c1bd7ab..1583449a06a0ae 100644 --- a/packages/react-native/template/visionos/HelloWorld/AppDelegate.swift +++ b/packages/react-native/template/visionos/HelloWorld/AppDelegate.swift @@ -9,7 +9,7 @@ class AppDelegate: RCTAppDelegate { override func bundleURL() -> URL? { #if DEBUG - RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") + RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index") #else Bundle.main.url(forResource: "main", withExtension: "jsbundle") #endif diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 5a94952a82a7ee..342fd49fbc96fc 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -1069,7 +1069,8 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTSwiftExtensions (1000.0.0) + - React-RCTSwiftExtensions (1000.0.0): + - React-Core - React-RCTTest (1000.0.0): - RCT-Folly (= 2024.01.01.00) - React-Core (= 1000.0.0) @@ -1419,65 +1420,66 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: boost: 8f1e9b214fa11f71081fc8ecd5fad3daf221cf7f DoubleConversion: 71bf0761505a44e4dfddc0aa04afa049fdfb63b5 - FBLazyVector: 5fdead7fff97d43aacf320bcccb748cf8527af07 + FBLazyVector: e34ddc4948ab5a9f857262cf68a46d39d8c61ed1 fmt: 5d9ffa7ccba126c08b730252123601d514652320 glog: 4f05d17aa39a829fee878689fc9a41af587fabba hermes-engine: 3fed7e58e811ae8f795063cc6450714395c0276d MyNativeView: 534e99e9c5dfd0bae242bdb06bb72e11d720c9a2 NativeCxxModuleExample: 107af3af8f5ce8802037937aabf1872ac891ad43 OCMock: 267d92c078398b7ce11d99e811e3a402744c06bc - RCT-Folly: d8c13e288297f63c0db8f083cfedebdd2649a299 + RCT-Folly: 70c792c856324d6a518af75b3a307c14c226343a RCTDeprecation: 3808e36294137f9ee5668f4df2e73dc079cd1dcf - RCTRequired: 6b32de28a5215a5990284d541bbdec8b5e3c78bf - RCTTypeSafety: 0e2bb3047d531a60b28b1d0d63e0c27a742a3019 - React: a6f80cd5ba07887121f8b480991e17041a838f5c - React-callinvoker: d558dab7c4d987f1577838a50d59aeb069130d91 + RCTRequired: 60c97b0b0cc33a209d33b3412eb1a218cbc1b82c + RCTTypeSafety: 2f597b431b910be1e49c6e6f40dd6879f6d1bdfd + React: dc827cd6966c06176ea9664cb4d74d63d1a4fcca + React-callinvoker: 3727946c98d5626aef39ac6a45b9d1be5db35527 React-Codegen: 04a9ac6fd2f392534ed432102c6cbf117dcbf62b - React-Core: 6403b0d9390e408017e82dc7823e059c53186141 - React-CoreModules: 6406001452f46e9234a2fac3861a60786285acc0 - React-cxxreact: f917d87380150aaaf8053fb4280358aad33c9b71 - React-debug: c12ba28faf2c0aace7cbc81d7ac7661075976460 - React-Fabric: 1d2070e13efd26fa34bb67cf484794265402ac06 - React-FabricImage: 238905c6db0cf533d562b52ae936bfd7ed5f00dc - React-graphics: c430227a30690a86be35a8fb8c4c36ff312ff4bc - React-hermes: f6b54c8b4553fc7a8926f3e46459923a834a99d4 - React-ImageManager: 38795ba06968bbcb11343b9e1123557af34c6270 - React-jserrorhandler: fba402f8090b05e29c57c7bb111413e12e89aebe - React-jsi: d5643763df3910249aac671c9b7d634e6e96af7b - React-jsiexecutor: 847a90333a8840846652833aa4e291e433277aec - React-jsinspector: c2abef5095276eeb09c4b871f3024851d2ac3e58 - React-jsitracing: 3f24b1171cc7aa986555a84e1036d3a6ba98bc84 - React-logger: 4b1ded6e5707b276ffd58505987aba8dd1c0c3e4 - React-Mapbuffer: b562329b31a9a5e3f18a8b4632c4fa8945a504e8 - React-nativeconfig: 86b0961752d6a00ccc30418bfb5bfb5ebda84149 - React-NativeModulesApple: eb4d247f32f25df62d1e979721502203db3de17c - React-perflogger: 31792e118e9c4785739c1823a481d64ba3d512b9 - React-RCTActionSheet: a79621f1907340e31a66a4ad5e89175ef13f4215 - React-RCTAnimation: 1f6948befc38688ecd5e78b7afd7d356aafa79b3 - React-RCTAppDelegate: 9b0ecae938c894f4678a5e4726c03a06e92b0d93 - React-RCTBlob: afaf18b4618c4d71095dfae9fca7c548dbcf0da0 - React-RCTFabric: 0e96635634399a9ccf6c3c7fb18d5bac8e2561d5 - React-RCTImage: 280f6f62a88f13253013ab5709e7bc60259cc081 - React-RCTLinking: 9757d922aaa9aea2baa6e6178a8b1f08c1a85add - React-RCTNetwork: 92e96ad358d83b5a809e6222987c77106f44691e - React-RCTPushNotification: 36ec0c6d3ab1195665c49c0cfd689864401cc111 - React-RCTSettings: 758a24aefbee012d903ca4f80532e95edfe2b516 - React-RCTTest: a30b88c8910a259ef769af7654b1812668019b22 - React-RCTText: ff85a26056ca9a34198934774e0f75ac2305c2c0 - React-RCTVibration: 5086b14f98c2255e71cc6a2213b6f67338dcdff4 - React-rendererdebug: 6e0021971efb40a76f807b913fdba6ec3ecabbd0 - React-rncore: 27b4d75d116e9ae44292dc26aecff5bbad9e6996 - React-RuntimeApple: c18cc85bf03a322efd2a76fd48f4c693d6901e67 - React-RuntimeCore: 631803674e2884b5d866aacac96850191a081e1a - React-runtimeexecutor: a6b1c771b522e49e6906c5354b0e8859a64e7b3e - React-RuntimeHermes: 1473abdead583d8ab788ebd31de9c8e81e19d0fc - React-runtimescheduler: 1b905cb65942a3bfdff3f003c9c778b6b46afca6 - React-utils: a5c7207b3bd558fdbfc553ea7a7731fbfc7f3552 - ReactCommon: 2c87b20987de3a37d3993e4c1cab34fb97c28899 - ReactCommon-Samples: e95d8d284b23ed4eda37498eaa460b6468c24699 + React-Core: eb5002d75c263aaa042b97853effd3b6e2f8668c + React-CoreModules: 1eb22960e980f9e0b80542da464c5935260fd180 + React-cxxreact: eb5eb55bffe0ccff4cbf192a04c978e37f137e8f + React-debug: 1d5a869d405ca2410bfc95c7fe340220331696ef + React-Fabric: 555fc115322e9b37b8cc1d4ac0ab8d4a87718077 + React-FabricImage: 657d05951f1a512496713d7c2d534d347915fe3b + React-graphics: 989577b97b4d5e8f3cd3ff86b275eb7e4c7ff657 + React-hermes: 0003c9f0f623ed87224f4415c567f90f0d15737f + React-ImageManager: ec80ccfd373893be8c347a23a693438b41a86e2a + React-jserrorhandler: c4126c1c2fb42540cf64fdc80917214a0c6ca905 + React-jsi: 81558ed18c4e91824280a3298d75d598ef4cf3fa + React-jsiexecutor: 139ad70390e61c6b00779d82c7d5f490cd3eb632 + React-jsinspector: bd27899ffc61660559bfbc8872e8d8de05b2612d + React-jsitracing: 9639d0659449fa9a71f31e28d7dde349bcec3394 + React-logger: 142bc8479d40940294428f652fb016b809335121 + React-Mapbuffer: 2762ea21725665466ea54f09848886f5ba7e97f7 + React-nativeconfig: f984aee5151a69d520ea830756b33c62acc5c269 + React-NativeModulesApple: 5fd38cf3bd4aca4adc9522a7a53681001f98f29d + React-perflogger: b19adeb816c255a04dff9528cf3f6bf209188d17 + React-RCTActionSheet: c07c3924b6a94602f40effc130b776faa8b6bab1 + React-RCTAnimation: 51f5a6be1479336b26d0cb282bd0e8f1feabf593 + React-RCTAppDelegate: 3cac28ed63e10086624a2d965ce2c3359bbe04b0 + React-RCTBlob: 0d6f17d4cacc18b6872b06b232186b176d4a8a18 + React-RCTFabric: 8b955856519621a30a8425ac6c594abb66788839 + React-RCTImage: c69ac72c257475c7860602ac11beaabd7862b99c + React-RCTLinking: c3f99ac575655569f5bc108ff13b816dcdf1dbfd + React-RCTNetwork: 39405b5687d5b16fdcc6466713930e71f8389cde + React-RCTPushNotification: 8b6b936f8e07096db581a446d4f9844ff8b35925 + React-RCTSettings: 96dad99a283d67c573b8ba3709725901e8ac3108 + React-RCTSwiftExtensions: b372ca0daf79796645c691841b470ad5d37bba64 + React-RCTTest: 11be8ba66b91bc914d31f2b7c9abd0c39d47a3d7 + React-RCTText: 8ca2156c782dc33ceb3fa80ce8c20cfcccbcc9d1 + React-RCTVibration: 284a9575d09b5c5517d5d5b8b86d4e2d3c324b5e + React-rendererdebug: d664023e12af482bb3911ce547c522ddbbf01ac5 + React-rncore: 5917d667ddd77e1938a9d1dabf5c503e427f9ec9 + React-RuntimeApple: 31c6a97b53e53ea3e0d071ca45471b9152d22dc3 + React-RuntimeCore: 25febc097f3f7d4043562fcf5c7bf406758ad1ce + React-runtimeexecutor: b66459278d0c6564b5d877107e0bb3ac953a8221 + React-RuntimeHermes: 3f46517238fed32a04b36c6bc41a4ac8508baf6e + React-runtimescheduler: 04123aa94f0fa33398b9e58cd4345cac230eaee7 + React-utils: bdfeb70a54b7b73533de6c8b679143f75c34c86a + ReactCommon: 8f6a345ebd9558892a83e1be6b83bdad4fd99078 + ReactCommon-Samples: 090dcc2659d35c5577955d89efac618595a72e61 ScreenshotManager: a5f596498de38f3cf3377df636ca67355503f190 SocketRocket: 0ba3e799f983d2dfa878777017659ef6c866e5c6 - Yoga: e4691eb7881cae15f847654cf06b0f7962707af0 + Yoga: ac56a983bdf421a579c197143f79aa568f1c74a1 PODFILE CHECKSUM: 7e999b8158f1055609ef4491bc35f1ad658fdd6c diff --git a/packages/rn-tester/RNTester-visionOS/App.swift b/packages/rn-tester/RNTester-visionOS/App.swift index 9c8766e9cfec43..39224b803cce1b 100644 --- a/packages/rn-tester/RNTester-visionOS/App.swift +++ b/packages/rn-tester/RNTester-visionOS/App.swift @@ -7,8 +7,6 @@ struct RNTesterApp: App { @UIApplicationDelegateAdaptor var delegate: AppDelegate var body: some Scene { - WindowGroup { - RCTRootViewRepresentable(moduleName: "RNTesterApp", initialProps: nil) - } + RCTMainWindow(moduleName: "RNTesterApp") } } diff --git a/packages/rn-tester/RNTester-visionOS/AppDelegate.swift b/packages/rn-tester/RNTester-visionOS/AppDelegate.swift index cf164ab3877837..0852368cd4101f 100644 --- a/packages/rn-tester/RNTester-visionOS/AppDelegate.swift +++ b/packages/rn-tester/RNTester-visionOS/AppDelegate.swift @@ -8,6 +8,6 @@ class AppDelegate: RCTAppDelegate { } override func bundleURL() -> URL? { - RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") + RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } }