feat: migrate to SceneDelegate
Summary:
This PR introduces a migration from the now-deprecated iOS AppDelegate to SceneDelegate, as well as the changes to React Native code that will migrate to APIs allowing it to work fine with the SceneDelegate approach. There are two primary goals of this API:
- feature: ability for users to leverage resizable windows feature on iPadOS in RN apps
- stay ahead of the incoming changes, since AppDelegate is scheduled to be deleted in future releases of iOS
The changes are additive to RN and maintain backwards compatibility, but require user-space modifications to RN apps that want to migrate from AppDelegate to the scene lifecycle.
The RFC documenting the details is available here:
Additional information
One capability that can be leveraged with the SceneDelegate on iPadOS is multi-window (multi-instance) support, which would cause all sorts of problems in the current React Native core and 3p libraries' designs. Therefore, enabling this capability is currently unsupported by React Native and to enforce this, a warning message like the one below would be printed provided this capability had been enabled:
Changelog:
[IOS] [ADDED] - SceneDelegate support with backwards compatibility to AppDelegate-only approaches [IOS] [ADDED] - DeviceInfo to update the value returned by getConstants upon frame change [IOS] [ADDED] - additional scheme: RNTester (AppDelegate), allowing to run RNTester with AppDelegate infrastructure [IOS] [ADDED] - print warning from RCTReactNativeFactory if UIApplicationSceneManifest.UIApplicationSupportsMultipleScenes in Info.plist is set to true, which is unsupported by RN to prevent bugs due to simultaneously running multiple instances of an app
Test Plan:
- Evaluate that RNTester works properly
| Warnings | |
|---|---|
| :warning: | :exclamation: JavaScript API change detected - This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. Please include a clear changelog message. This change will be subject to extra review.
This change was flagged as: |
Generated by :no_entry_sign: dangerJS against 5aac7cddec9e7a4a74d4a16c0a0b52b2138353c2