Summary:
Change version of rn apps following xcode settings.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[iOS][Fixed] - Automatically following version on xcode.
Pull Request resolved: https://github.com/facebook/react-native/pull/34919
Reviewed By: cipolleschi
Differential Revision: D40340271
Pulled By: motiz88
fbshipit-source-id: a2263a8c7a70847fe6fcedcd82c5109100aafde6
Summary:
- Fix a typo in the word "feture" (-> "feature")
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[iOS] [Fixed] - Typo in AppDelegate.mm
Pull Request resolved: https://github.com/facebook/react-native/pull/34462
Test Plan: - Read the diff change
Reviewed By: dmitryrykun
Differential Revision: D38900680
Pulled By: cipolleschi
fbshipit-source-id: cdc5fb183cb7f5485a553dde7ea381f27f83e903
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34384
This Diff aims to create a RCTAppDelegate library to offer a subclass which automates some operations required to set up the new architecture.
## Changelog
[iOS][Added] - Added the RCTAppDelegate library
Reviewed By: cortinico
Differential Revision: D38580424
fbshipit-source-id: 38f6c4b8ff2790a2ce9e23d385b36307701cffb7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34373
By introducing a RCTAppDelegate base class, we can simplify the migration step to supports TM
## Changelog
[iOS][Changed] - Simplified migration steps for TM
Reviewed By: cortinico
Differential Revision: D38509891
fbshipit-source-id: 716c1e668a05ecbd9c679558889564780816e491
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33671
With React 18, we now need to allow users on Fabric to opt-in for Concurrent Root.
This commit adds a new method that can be customized in the AppDelegate to turn the feature on and off.
The flag is passed as an initialProps to the rootView.
## Changelog:
[iOS][Added] - Prepare a method in the AppDelegate to control the concurrentRoot.
Reviewed By: cortinico, dmitryrykun
Differential Revision: D35757833
fbshipit-source-id: 192cf74c796554cba39366aa90c53c191f960c20
Summary:
Changelog: [internal] Refactor RCTAppSetupUtils to c functions.
Since RCTAppSetupUtils doesn't retain any states, we don't need it to be a class.
Reviewed By: philIip
Differential Revision: D33084352
fbshipit-source-id: 1372a2737eafffa46ee6e5164a970dd12699c71c
Summary: Changelog: [internal] Changed teh new architecture flag in the new app template to RCT_NEW_ARCH_ENABLED
Reviewed By: philIip
Differential Revision: D33083694
fbshipit-source-id: f2cc6c564c724b4ebed7b465a533464b6717ac27
Summary:
Changelog: [internal] Added fabric option to the default app template.
Use RCT_TM_FABRIC_ENABLED C++ flag to enable fabric.
Reviewed By: sammy-SC
Differential Revision: D33052956
fbshipit-source-id: 28313829c80abcf02baa521bdb0b70213c94a97f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32752
Changelog: [internal] Add an optional support for Turbomodule. Define RCT_TM_FABRIC_ENABLED to enable the new architecture.
Reviewed By: philIip
Differential Revision: D33052777
fbshipit-source-id: 6d32790586bb51f9c9244344522c95245c912114
Summary:
Changelog: [internal] Move initital setups in AppDelegate to util classes.
This will make it easy to apply the new architecture changes in the future.
Reviewed By: cortinico
Differential Revision: D33051517
fbshipit-source-id: 16e326b7816fae83df65450c545e7dce1a93b9d0
Summary:
Changelog: [Internal] changing the extention from AppDelegate.m to AppDelegate.mm in the app template to support the new architecture.
Most changes were generated when opening the xcworkspace.
Reviewed By: cortinico
Differential Revision: D33051442
fbshipit-source-id: f472a9df26db11a02fc9f7d0544f0207e7c3e7ca
Summary:
~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~
Fixes 17f025bc26 (commitcomment-38831234)
Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to:
* specify build settings (through the `xcconfig` property);
* and selectively include certain pods only in certain build configurations (e.g. debug).
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive.
Pull Request resolved: https://github.com/facebook/react-native/pull/28796
Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`.
Reviewed By: priteshrnandgaonkar
Differential Revision: D21449754
Pulled By: passy
fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625
Summary:
This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`.
Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds.
Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed.
~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~
> I have updated the Android splash screen and tested this change on the Android emulator.
If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template).
## Changelog
[Internal] [Added] - Add dark mode support to the default app template
Pull Request resolved: https://github.com/facebook/react-native/pull/28711
Test Plan:
I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`.
Screen recording on iOS (demonstarates both modes, both splash screens and transition):
![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif)
Screenshot of iOS app in Dark Mode:
![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG)
Screenshot of iOS app splash screen in Dark Mode:
![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG)
Screenshot of Android app in the emulator:
![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png)
Differential Revision: D21236148
Pulled By: shergin
fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda
Summary:
> Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens.
Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b).
Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209
## Changelog
Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required.
[iOS] [Deleted] - Deleted LaunchScreen.xib
[iOS] [Added] - Added LaunchScreen.storyboard
Pull Request resolved: https://github.com/facebook/react-native/pull/28239
Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one.
Reviewed By: cpojer
Differential Revision: D20408892
Pulled By: hramos
fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a
Summary:
{emoji:26a0} This is a follow up to https://github.com/facebook/react-native/issues/25425 -- which isn't merged yet… See 2a286257a6..125aedbedc for actual diff
Currently, StatusBar native module manages the status bar on iOS globally, using `UIApplication.` APIs. This is bad because:
- those APIs have been deprecated for 4 years
- Apple really, really wants you to have an explicitly defined view controller, and control the status bar there
- it [breaks external native components](https://github.com/facebook/react-native/issues/25181#issuecomment-506792819)
- it's [not compatible with iPadOS 13 multi window support](https://github.com/facebook/react-native/issues/25181#issuecomment-506690818)
for those reasons I we should transition towards view controller-based status bar management.
With that, there is a need to introduce a default React Native root view controller, so I added `RCTRootViewController`. Using it is completely opt-in and there is no breaking change here. However I believe this should be a part of the template for new RN iOS apps.
Additionally, I added `RCTRootViewControllerProtocol` with hooks needed for RCTStatusBarManager to control the status bar. This means apps that want to have total control over their view controller can still opt in to react native VC-based status bar by conforming their root view controller to this protocol.
## Changelog
[iOS] [Added] - Added `RCTRootViewController` and `RCTRootViewControllerProtocol`
[iOS] [Fixed] - `UIViewControllerBasedStatusBarAppearance=YES` no longer triggers an error as long as you use `RCTRootViewController`
[iOS] [Fixed] - Status bar style is now correctly changed in multi-window iPadOS 13 apps if you use `RCTRootViewController` and set `UIViewControllerBasedStatusBarAppearance=YES`
Pull Request resolved: https://github.com/facebook/react-native/pull/25919
Test Plan: - Open RNTester → StatusBar → and check that no features broke
Reviewed By: fkgozali
Differential Revision: D16957766
Pulled By: hramos
fbshipit-source-id: 9ae1384ee20a06933053c4404b8237810f1e7c2c
Summary:
Issue: https://github.com/facebook/react-native/issues/27565
initalizeFlipper should be set in template app by default.
## Changelog
[iOS] [Changed] - Added Flipper to template app
[Android] [Changed] - Added Flipper to template app
Pull Request resolved: https://github.com/facebook/react-native/pull/27569
Test Plan:
Connect Flipper to the iOS application
Connect Flipper to the Android application
Reviewed By: passy
Differential Revision: D19344704
Pulled By: rickhanlonii
fbshipit-source-id: ca126fd2caab13751ddc2ce6d195bd0c644c704e
Summary:
Files that are to be part of the user’s project shouldn’t have FB copyright notices.
There’s [one notice left](66601e755f/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java (L2)) in the `android` template, which is in a file that doesn’t seem to be intended to be changed by the user and so that seems fine to me.
## Changelog
[iOS] [Removed] - Remove copyright notices from iOS application template
Pull Request resolved: https://github.com/facebook/react-native/pull/27725
Test Plan:
```bash
npx react-native init TestTemplateUpdates --template ~/Code/ReactNative/react-native
cd ios
xcodebuild -workspace TestTemplateUpdates.xcworkspace \
-scheme TestTemplateUpdates \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 8' build
[…]
** BUILD SUCCEEDED **
```
Differential Revision: D19343386
Pulled By: TheSavior
fbshipit-source-id: a78be5e5d2fdc2477adedb51d6bb3ff19845b75f
Summary:
The integration of Flipper on iOS was crashing the template, and `test_ios_e2e` were failing because of it.
Flipper integration must be wrapped inside `FB_SONARKIT_ENABLED`.
Flipper's issues with Yoga and YogaKit were solved in Flipper 0.28.0, so let's update our integration to it, and we'll need to use Swift.
We will be able to ship this in 0.62 (cc grabbou, axe-fb, priteshrnandgaonkar), and it should fix `test_ios_e2e` (cc hramos) � .
## Changelog
[iOS] [Fixed] - Fix Flipper integration on and update Flipper to 0.30.0
Pull Request resolved: https://github.com/facebook/react-native/pull/27426
Test Plan:
- Initialized an app with my branch as source.
- Added `[AppDelegate initializeFlipper:application];` to `didFinishLaunchingWithOptions`.
- Launched Flipper.
- Ran the app (debug).
![image](https://user-images.githubusercontent.com/7189823/70277734-ef85d680-1780-11ea-876c-1c08e6ed5804.png)
- Ran the app (release).
- Everything succeeds, no Flipper connection available in release.
Reviewed By: hramos
Differential Revision: D18841468
Pulled By: axe-fb
fbshipit-source-id: 73bb4810d1fbb6a96102848f8700ebb7c23a615b
Summary:
I ran into a build error when `xcodebuild` would invoke a custom script (in my case `sentry-cli`):
```
error: Could not parse Info.plist file
caused by: invalid data
```
Upon further investigation it turned out the parse error was **caused by a comment**, and I found some other oddities with the default `Info.plist` template files:
- The problematic comment is a **dead link** (website does not exist)
- The main Info.plist contains a **duplicate entry** for `NSLocationWhenInUseUsageDescription`
- Some entries are _reordered_ and the comment is removed when modifying/saving the file in Xcode
This PR fixes these inconsistencies, unnecessary customizations, and potential sources of errors.
[iOS] [Fixed] - Fix Info.plist templates to prevent parse error
Pull Request resolved: https://github.com/facebook/react-native/pull/23924
Differential Revision: D14477557
Pulled By: cpojer
fbshipit-source-id: 6d734c5aa3b800f05394db189e8d8db63be8e353
Summary:
Fixes#23314 , the change came from #20945 , its purpose is to fix orientation change issue in HelloWord template, but I think it's just a trick, to make rootView's backgroundColor the same as window backgroundColor, the orientation issue seems related to [UIManager setAvailableSize:forRootView:](d2fc19f4aa/React/Modules/RCTUIManager.m (L343)) async layout things.
[iOS] [Fixed] - Revert RCTRootView's backgroundColor to white.
Pull Request resolved: https://github.com/facebook/react-native/pull/23358
Differential Revision: D14030666
Pulled By: cpojer
fbshipit-source-id: 7c9a45f03b87c3be0f2b7c64a3c837c6ae14af3e
Summary:
The main goal of this change is to fix an issue that happens on iOS when the native app starts before the packager server is available which causes app reloads to fail continually until the app is restarted.
What happens is that with the current setup we call `RCTBundleURLProvider#jsBundleURLForBundleRoot` once in `AppDelegate#didFinishLaunchingWithOptions`. If at that point the packager server is not running yet it will return nil (expected behaviour) and that will be passed to the bridge constructor. Subsequent reloads will keep trying to load this nil bundle url since it has no way to ask `RCTBundleURLProvider` for a new url now that the packager is actually running.
We can fix this by using `RCTBridgeDelegate` instead which is a lot more flexible. Instead of passing the bundle url at construction time it will call the `sourceURLForBridge` method each time the bridge is reloaded. This means that even if the packager is not running yet and that `RCTBundleURLProvider` returns nil for the first invocation, subsequent reloads will call `RCTBundleURLProvider` again for a new value.
Changelog:
----------
[iOS] [Added] - Use RCTBridgeDelegate in the new project template
Pull Request resolved: https://github.com/facebook/react-native/pull/23031
Differential Revision: D13710048
Pulled By: cpojer
fbshipit-source-id: 0059c5c962d508737ae410a82315c11ad305efe8
Summary: This diff moves the React Native template from `local-cli/templates/HelloWorld` to `template`. Keeping it in the react-native repo will allow us to make changes to the template and version it together with react-native, instead of moving it out into a separate repo and trying to keep the template in sync with RN.
Reviewed By: TheSavior
Differential Revision: D13372949
fbshipit-source-id: e68e267b4dcf6384535d7b48fc11e297a12e9676