Граф коммитов

109 Коммитов

Автор SHA1 Сообщение Дата
Riccardo Cipolleschi 7eaabfb174 Hardcode concurrentRootEnabled to true when Fabric is enabled (#36106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36106

Having `concurrentRoot` disabled when Fabric is enabled is not recommended.
This simplifies the setup and makes sure that both are either enabled or disabled.

## Changelog:
[iOS] [Breaking] - Hardcode concurrentRootEnabled to `true` when Fabric is enabled

Reviewed By: cortinico

Differential Revision: D43153402

fbshipit-source-id: d67aeb3413dbdf2430381aa44ede47ed00db32c6
2023-02-09 07:02:32 -08:00
sottar 3876368f0c Update Podfile in template (#35931)
Summary:
Added comment on Podfile under template directory.
I'm working with monorepo and didn't realize it easily to specify the path for react_native_post_install, so I thought it would be better to add this comment.

## Changelog

[IOS] [ADDED] - add comments for specifying the path to React Native

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/35931

Reviewed By: cipolleschi

Differential Revision: D42673707

Pulled By: jacdebug

fbshipit-source-id: 39e424a051d238f6dad42cb0b7748d4f4c400787
2023-01-24 02:29:00 -08:00
Jean-Baptiste LARRIVIERE b314e6f147 feat: add initialProps property to RCTAppDelegate (#35848)
Summary:
Hi there,

While upgrading to 0.71 we realised the RCTAppDelegate doesn't offer a way to set custom `initProps` that would depend on `launchOptions`.

This PR adds an `initialProps` property to the RCTAppDelegate. This would let us set this property based on `launchOptions` in our implementation of `didFinishLaunchingWithOptions` before calling `[super didFinishLaunchingWithOptions]`

Thanks !

## Changelog

[IOS] [ADDED] - Add `initialProps` property to `RCTAppDelegate`

Pull Request resolved: https://github.com/facebook/react-native/pull/35848

Reviewed By: rshest

Differential Revision: D42543027

Pulled By: cipolleschi

fbshipit-source-id: 55374914890445f8193c12a06a943b7796edb457
2023-01-18 06:42:39 -08:00
David f47b5b8b5d Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail (#35686)
Summary:
- Flipper issue: https://github.com/facebook/flipper/issues/3995#issuecomment-1333863641

iOS build fail with an error:

```sh
node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9: 'FlipperKit/FlipperConnection.h' file not found

#import <FlipperKit/FlipperConnection.h>
```

## Changelog

[IOS] [FIXED] - Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail

Pull Request resolved: https://github.com/facebook/react-native/pull/35686

Test Plan:
```sh
npx react-native init RN0710RC5 --version 0.71.0-rc.5
cd RN0710RC5
yarn add react-native-flipper
NO_FLIPPER=1 pod install --project-directory=ios
yarn ios # will fail
```

Reviewed By: rshest

Differential Revision: D42368444

Pulled By: cipolleschi

fbshipit-source-id: a8614ccadb98970ebae15d8743136fa60ead318c
2023-01-12 02:53:28 -08:00
David Angulo 032bed45a9 remove hermes note (#35555)
Summary:
This note was added when upgrading from 0.69x to 0.70.x when `hermes_enabled` is explicitly set to `true`.

<img width="669" alt="Screenshot 2022-12-05 at 11 26 15" src="https://user-images.githubusercontent.com/36528176/205543104-b4a72c1c-57c0-422b-881e-8a0cb9d5c2a1.png">

But on 0.71, we are now using  `get_default_flags` again which makes the note obsolete.

## Changelog

[Internal] [Removed] - removed hermes note

Pull Request resolved: https://github.com/facebook/react-native/pull/35555

Test Plan: N/A

Reviewed By: dmytrorykun

Differential Revision: D41731004

Pulled By: cortinico

fbshipit-source-id: d5f377062bf94fa73bc6e73d1f108e37ad68c715
2022-12-05 05:02:39 -08:00
Tommy Nguyen 4df793f75b Don't use the internal `native_modules.rb` script yet (#35531)
Summary:
Revert the template `Podfile` to using `react-native-community/cli-platform-ios/native_modules`. The new internal script currently has a hard-coded path to `react-native-community/cli-platform-ios` which may not work in monorepos. The path in the `Podfile` is also hard-coded, but this is a file that the user has access to and can fix themselves if necessary.

## Changelog

[iOS] [Fixed] - Don't use the internal `native_modules.rb` script yet, as it hides a hard-coded path

Pull Request resolved: https://github.com/facebook/react-native/pull/35531

Test Plan: n/a

Reviewed By: rshest

Differential Revision: D41682119

Pulled By: cortinico

fbshipit-source-id: 1822fcd20a794dc9df6e8d6f36615e90b42c1a94
2022-12-02 04:09:02 -08:00
Riccardo Cipolleschi 4e8526c829 Add CircleCI tests for use frameworks (#35497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35497

In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests.

## Changelog
[iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch

Reviewed By: cortinico

Differential Revision: D41551288

fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
2022-11-29 08:53:50 -08:00
Riccardo Cipolleschi 25132c8490 Fix: Avoid path in the template import (#35394)
Summary:
Investigating [this comment](https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4170008), I made some tests.
It seems like we can simply use `#import <RCTAppDelegate.h>` instead of the `#import <React-RCTAppDelegate/RCTAppDelegate.h>` in both setups:
- default setup
- `use_frameworks! :linkage => :static`

## Changelog

[iOS] [Fixed] - Support `use_framework! :linkage => :static` in template

Pull Request resolved: https://github.com/facebook/react-native/pull/35394

Test Plan:
1. Manually tested with a new app
2. CircleCI
3. Sandcastle

Reviewed By: cortinico

Differential Revision: D41402060

Pulled By: cipolleschi

fbshipit-source-id: e1ed8196ed860b3663a88f5283f2745e39b0e944
2022-11-21 03:55:21 -08:00
Marc Rousavy 3d9a3b7af6 fix: Add missing space in method documentation (#35303)
Summary:
probably the smallest PR I ever submitted, but it was bothering me lol

There was a missing space in the method doc.

## Changelog

Add space to the method doc
<!-- 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] - Add missing space in method documentation comment

Pull Request resolved: https://github.com/facebook/react-native/pull/35303

Reviewed By: jacdebug

Differential Revision: D41182765

Pulled By: cipolleschi

fbshipit-source-id: ebe5d56072137547e543a312c66cc3234142db13
2022-11-10 04:55:37 -08:00
Lorenzo Sciandra 33e140fd05 fix(template, ios): add marketing version to template project (#35012)
Summary:
Recently this PR got merged https://github.com/facebook/react-native/pull/34919 that aligned the info.plist to the current default. Problem: the variable `MARKETING_VERSION` was not set in the template, so generating a new project and testing on iOS would fail accordingly:

<img width="1400" alt="Screenshot 2022-10-18 at 15 27 27" src="https://user-images.githubusercontent.com/16104054/196461640-470079f5-0f64-471f-8221-0d17f2b0114f.png">

This PR takes care of setting the variable so that the app can build successfully.

## 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] - add MARKETING_VERSION to template project

Pull Request resolved: https://github.com/facebook/react-native/pull/35012

Test Plan: Run `yarn test-e2e-local -t RNTestProject`, apps builds correctly and runs on simulator.

Reviewed By: cipolleschi

Differential Revision: D40472420

Pulled By: cortinico

fbshipit-source-id: 18ddd57ce54186a101321583a7a8391e97ca9511
2022-10-18 10:32:59 -07:00
Erfin Badriansyah dcd21143bc Update info.plist (#34919)
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
2022-10-13 04:32:44 -07:00
Riccardo Cipolleschi 34fafb2b88 Simplify furthermore App migration
Summary:
This Diff adds a couple of APIs to the `react_native_pods.rb` file to simplify further the migration to the New Architecture for the iOS app.
Specifically, it aims to simplify [this](https://reactnative.dev/docs/next/new-architecture-app-intro#ios---build-the-project) steps by offering a RN-managed min version and creating the .xcode.env file for the user if it is missing.

## Changelog

[iOS][Added] - Add new API to simplify app migration

Reviewed By: cortinico

Differential Revision: D39469599

fbshipit-source-id: f0323e86c83c2731671fcd5bb4288071304bb43b
2022-09-14 04:21:02 -07:00
Riccardo Cipolleschi bf6a24bd46 Add Matrix tests for Flipper/NoFlipper (#34595)
Summary:
This PR adds some tests to verify that we can build the template in every Debug configuration using Flipper and without Flipper.

## Changelog

[iOS] [Added] - Add CircleCI tests to verify that we can run the Template with and without Flipper

Pull Request resolved: https://github.com/facebook/react-native/pull/34595

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D39262137

Pulled By: cipolleschi

fbshipit-source-id: dae45b106cd13fb69442ea216005cee114d861f4
2022-09-06 03:25:45 -07:00
Riccardo Cipolleschi 4352459781 Add matrix for Debug/Release, New/Legacy Architecture, (No)Hermes (#34469)
Summary:
This PR is the dual of the Matrix Tests we added to the Android Template a couple of weeks ago. It adds the same tests to iOS, to verify that the template builds with both architectures and with both configurations (Debug/Release).. And it tests that the template works with both Hermes and without it.

## Changelog

[iOS] [Added] - Test iOS template with both architectures and configurations

Pull Request resolved: https://github.com/facebook/react-native/pull/34469

Test Plan: CI is green in all the 8 new jobs.

Reviewed By: hramos, cortinico

Differential Revision: D39087876

Pulled By: cipolleschi

fbshipit-source-id: 1205b2339bac87cf11b4f356a2e50e1e93ba52bc
2022-08-31 08:54:06 -07:00
Jérémy Barbet 0a59c284a9 - Typo in AppDelegate.mm (#34462)
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
2022-08-22 03:03:37 -07:00
Riccardo Cipolleschi 7cc2d1a249 Create RCTAppDelegate to simplify New Architecture Setup (#34384)
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
2022-08-15 01:30:55 -07:00
Riccardo Cipolleschi cb02a6e305 Simplify TurboModule setup (#34373)
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
2022-08-10 03:25:45 -07:00
Danilo Bürger af3dfbaa47 Move cocoapods cli native_modules require from template to rn scripts (#34215)
Summary:
This resolves issues where the node_modules structure is not hoisted (like with pnpm). Since the template does not directly depend on the cli, it doesn't exist in the pnpm node_modules root. Moving it to the rn scripts makes sure that the relative require starts in the correct directory for both hoisted and pnpm structures.

## Changelog

[iOS] [Fixed] - Fix cocoapods cli native_modules require for pnpm node_modules

Pull Request resolved: https://github.com/facebook/react-native/pull/34215

Test Plan:
1. react-native init
2. rm -rf node_modules
3. pnpm i
4. bundle install
5. bundle exec pod install --project-directory=ios

This should succeed. Without the patch, it will fail with

```
[!] Invalid `Podfile` file: cannot load such file -- /.../node_modules/react-native-community/cli-platform-ios/native_modules.

 #  from /.../ios/Podfile:2
 #  -------------------------------------------
 #  require_relative '../node_modules/react-native/scripts/react_native_pods'
 >  require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
 #
 #  -------------------------------------------
```

Reviewed By: cortinico

Differential Revision: D37959152

Pulled By: cipolleschi

fbshipit-source-id: 7fa9af4a8c153cfd38360f57eca415a8c252dbd5
2022-07-19 09:11:08 -07:00
Arkkeeper 2fb6a3393d Mac Catalyst patches (#34026)
Summary:
This PR adds a new method called **__apply_mac_catalyst_patches** to **scripts/react_native_pods.rb**. If it is enabled in the Podfile, it will apply three patches necessary for successful building not only for iOS and tvOS targets, but also for macOS using Apple's Mac Catalyst technology.

These 3 patches are:
- Fixing bundle signing issues by altering CODE_SIGN_IDENTITY
- Explicitly setting dead code stripping flag in project.pbxproj
- Modifying library search paths

The details were discussed here https://github.com/reactwg/react-native-releases/discussions/21#discussioncomment-2754289

## Changelog

[iOS] [Added] - Add Mac Catalyst compatibility (can be enabled in Podfile)

Pull Request resolved: https://github.com/facebook/react-native/pull/34026

Test Plan:
1. Go to project settings in Xcode, to General tab. Enable "iPad" and "Mac Catalyst" checkboxes
2. Go to "Signing & Capabilities" tab, ensure that a correct bundle id and development team are set
3. Edit Podfile, uncomment **__apply_mac_catalyst_patches(installer)** line
4. Run `pod install` in ios directory
5. Get back to Xcode, select "My Mac (Mac Catalyst)" as a target device
6. Build & run

Reviewed By: cipolleschi

Differential Revision: D37362054

Pulled By: cortinico

fbshipit-source-id: 74636f716f112289ab40968bbc8e52406c1e9579
2022-06-30 05:20:14 -07:00
Héctor Ramos 1115bc77db Make Hermes the default engine on iOS (#34085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34085

Hermes is now the default engine on iOS.

Apps can choose to continue using JSC by setting `hermes_enabled` to `false` in their Podfile.

The RNTester app now uses Hermes, as well. Use JSC in RNTester by setting `USE_HERMES=0` when running `pod install`.

Changelog:

[iOS][Changed] Hermes is now the default engine on iOS. This setting is controlled via `flags[:hermes_enabled]` in the Podfile.

Reviewed By: cortinico, cipolleschi

Differential Revision: D37361468

fbshipit-source-id: e6dda6a23eea4a824ad157d1a26f17e181db33cd
2022-06-28 10:04:51 -07:00
Franco Meloni 0bd5239553 Move `use_flipper` logic inside `use_react_native` and simplify the Flipper dependencies logic (#33882)
Summary:
This PR tries to simplify the `use_flipper` logic:
- makes `use_flipper` a configuration inside `use_react_native`'s options
- uses the already present `production` flag in the `use_react_native`'s options to decide if add or not the Flipper pods
- Simplifies the logic to download the flipper dependencies

This PR also adds a workaround for https://github.com/facebook/react-native/issues/33764

## 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] - Move `use_flipper` logic inside `use_react_native` and simplify the Flipper dependencies logic

Pull Request resolved: https://github.com/facebook/react-native/pull/33882

Test Plan: Executed a pod install with and without flipper and with isProduction true

Reviewed By: cipolleschi

Differential Revision: D36592338

Pulled By: f-meloni

fbshipit-source-id: 3c3f773151513e27e251f18865986e942a96ffd9
2022-05-24 04:37:46 -07:00
Nicola Corti 11601279b3 Fix comments on how to enable/disable Hermes on iOS
Summary:
This comment on how to enable/disable Hermes went out of sync with the release of the New Architecture. Got reported on the website here: https://github.com/facebook/react-native-website/issues/3105
I'm fixing it.

Changelog:
[Internal] [Changed] - Fix comments on how to enable/disable Hermes on iOS

Reviewed By: cipolleschi

Differential Revision: D36204189

fbshipit-source-id: 5831a9500477115ebe5fa5cb62176ceefc722839
2022-05-06 10:17:25 -07:00
Riccardo Cipolleschi 8ac8439e0d Prepare AppDelegate to enable Concurrent Root on iOS (#33671)
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
2022-04-21 06:59:17 -07:00
Riccardo Cipolleschi 0480f56c5b Introduce .xcode.env configuration file to source `node` (#33546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33546

This Diff does 2 things:
1. Removes all the remnant of the `find-node.sh` script. This allows React Native to stay agnostic from any other node manager
2. Introduces a way for the developers to specify which `node` executable they want to use, through a simple `.env` file.

## Changelog
[iOS][Changed] - This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used.

Reviewed By: cortinico

Differential Revision: D35317070

fbshipit-source-id: 4b400ba56aa2d574db563fa67b2008e1ddde1c59
2022-04-11 02:50:57 -07:00
Phillip Pan c71e6efbcd bump iOS and tvOS from 11.0 to 12.4 in pbxproj
Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

Reviewed By: sammy-SC

Differential Revision: D34548360

fbshipit-source-id: e1a90fd6c1fc6b680ea6e53b7434fd7f5c3d6ee4
2022-03-16 21:08:01 -07:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Danilo Bürger 9e7d91f2fc Re-apply: Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33427)
Summary:
This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger

The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```
## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Pull Request resolved: https://github.com/facebook/react-native/pull/33427

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: cortinico

Differential Revision: D34890926

Pulled By: dmitryrykun

fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea
2022-03-16 05:25:28 -07:00
Oleg Kot 06f504b8b2 Revert D34784966: Consider relative to pwd installation root when looking for files in rn module via cocoapods
Differential Revision:
D34784966 (2f813f873a)

Original commit changeset: d6d5e71bc2fc

Original Phabricator Diff: D34784966 (2f813f873a)

fbshipit-source-id: edaf38cb26187f0bd08e1efb7fc086233cf094c8
2022-03-14 10:31:18 -07:00
Danilo Bürger 2f813f873a Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33399)
Summary:
The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```

## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Pull Request resolved: https://github.com/facebook/react-native/pull/33399

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: ShikaSD

Differential Revision: D34784966

Pulled By: dmitryrykun

fbshipit-source-id: d6d5e71bc2fcd32f2cd60a498f39e6f772fc9005
2022-03-14 09:00:37 -07:00
Dmitry Rykun f595a4e681 Duplicate Xcodeproj UUIDs in iOS app template Podfile fixed
Summary:
Disabled deterministic UUIDs in the Podfile.
Changelog: [iOS][Fixed] - Fixed duplicated UUIDs problem during pod install phase.

Reviewed By: sota000

Differential Revision: D33741572

fbshipit-source-id: 65cdd8a0ae34200e36e5a68849f5d3537c39dda2
2022-01-25 05:07:25 -08:00
Nicola Corti b352aa3691 Do not opt-out fbsource/xplat/js/react-native-github/template from CLANGFORMAT
Summary:
As we're adding C++ code, I'm enabling CLANGFORMAT inside the React
Native template folder.

Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D33238197

fbshipit-source-id: e60c849bc776e8ec130c3baba01490d431d39a67
2021-12-20 10:40:06 -08:00
Phillip Pan aef843bfe6 update jsBundleURLForBundleRoot in template project
Summary: Changelog: [iOS][Changed] - updated `jsBundleURLForBundleRoot:fallbackResource` to `jsBundleURLForBundleRoot:`

Reviewed By: sota000

Differential Revision: D33192280

fbshipit-source-id: 77ed2f2b767811d9f13a33cac77598b425df95c3
2021-12-17 11:46:21 -08:00
Sota Ogo e330eee9c8 Add Other C++ flags when RCT_NEW_ARCH_ENABLE=1 (#32777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32777

Changelog: [iOS][Added] Added the new architecture support to the new app template. To apply this change to your project, you will need to update your Podfile.  You can try it by using "RCT_NEW_ARCH_ENABLE=1 pod instal" command which updates necessary C++ flags and enable the new codegen discovery required for the new architecture. As context, We've modified the iOS template to have code required to enable the new architecture (aka Turbo modules and fabric / renderer) which requires updating AppDelegate. We also added the support in RNTester as well. We will be sharing more documentation about the new architecture.

Reviewed By: dmitryrykun

Differential Revision: D33154825

fbshipit-source-id: a46b98308e9d29780b6a5245e8faa8be1e257802
2021-12-16 23:41:42 -08:00
Sota Ogo 6a046fb9f0 Fix build issue for the new app template (#32772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32772

Changelog: [internal] Fix a build issue for the new app template.

Reviewed By: philIip

Differential Revision: D33154125

fbshipit-source-id: ae696aeae6aac31678fe43a8963aab05c67c05d7
2021-12-16 00:54:24 -08:00
Sota Ogo 1cd8f05ee8 Refactor app template setup util functions
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
2021-12-15 18:14:36 -08:00
Sota Ogo c0c5439959 Rename the new architecture flag to RCT_NEW_ARCH_ENABLED
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
2021-12-15 18:14:36 -08:00
Sota Ogo 2e9a376c84 Add fabric option to the default app template.
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
2021-12-15 18:14:35 -08:00
Sota Ogo 8ec0e6919c Add turbo module support in the default app template (#32752)
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
2021-12-15 18:14:35 -08:00
Sota Ogo 73a04d1452 Refactor the iOS app template to move setups to a helper class
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
2021-12-13 23:13:32 -08:00
Sota Ogo 4fb49cd555 Rename AppDelegate.m to AppDelegate.mm in the app template
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
2021-12-13 11:49:00 -08:00
Luna Wei 03a0907868 Add back Xcode_12_5_M1_post_install_workaround
Summary: Changelog: [Internal] Add back Xcode_12_5_M1_post_install_workaround workaround

Reviewed By: sota000

Differential Revision: D31902449

fbshipit-source-id: 5c9d962d0d1a55a9f14186bd7d6d8fe087101f0d
2021-10-25 11:34:05 -07:00
Gustavo Sverzut Barbieri 51bf557948 Feat/ios m1 improvements (#32296)
Summary:
* Remove left over from a1c445a39c (commitcomment-57240925)
* Add a warning if running with Rosetta2 as per https://github.com/facebook/react-native/pull/32284#issuecomment-929680784

## Changelog

[iOS] [Fixed] - Removed __apply_Xcode_12_5_M1_post_install_workaround
[iOS] [Changed] - Warn if Rosetta2 is being used (x86_64 on arm64)

Pull Request resolved: https://github.com/facebook/react-native/pull/32296

Test Plan: Build on macOS Apple devices without any warnings during `pod install`

Reviewed By: RSNara

Differential Revision: D31291567

Pulled By: fkgozali

fbshipit-source-id: 65e54507dedcdba39c1b441aad85e940eedc8b52
2021-09-29 18:15:25 -07:00
Gustavo Sverzut Barbieri a1c445a39c Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.

This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.

Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see  6985cbf7de). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.

Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`

## Changelog

[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()

Pull Request resolved: https://github.com/facebook/react-native/pull/32284

Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed

## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix ac4ddec542
* Upgrading CocoaPods to 1.11 would bring us 6985cbf7de and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves

Reviewed By: lunaleaps

Differential Revision: D31248460

Pulled By: fkgozali

fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-28 17:05:24 -07:00
Samuel Susla 329b026f3a Switch order of search libraries to fix M1 build error
Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template

Reviewed By: fkgozali

Differential Revision: D30693466

fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e
2021-09-01 08:26:42 -07:00
Kevin Gozali ac4ddec542 OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround
Summary:
Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly.

Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues

Reviewed By: lunaleaps

Differential Revision: D30691291

fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212
2021-09-01 00:27:42 -07:00
Samuel Susla eb93886306 Include Swift lib in LIBRARY_SEARCH_PATHS
Summary:
changelog: Fix Xcode 13 build error in HelloWorld template

Including `usr/lib/swift` fixes error:
{F642876047}

Reviewed By: p-sun

Differential Revision: D30301799

fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf
2021-08-16 05:28:47 -07:00
Samuel Susla ec083f9146 Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13"
Summary:
Changelog: Backout "Fix Xcode 13 build error in HelloWorld template"

Original commit changeset: 59dbde441e61

This change breaks the template for Xcode 12.5:

{F642871165}

Reviewed By: philIip

Differential Revision: D30301800

fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974
2021-08-16 05:28:47 -07:00
Samuel Susla d583c2f154 Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13
Summary:
Changelog: Fix Xcode 13 build error in HelloWorld template

Error:
{F640400959}

Fix:
Embed `libswiftFileProvider.tbd` in app.

Reviewed By: hramos

Differential Revision: D30192423

fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e
2021-08-10 10:44:31 -07:00
Peter Argany f2c6279ca4 iOS/tvOS 10.0 ==> 11.0 in .xcodeproj
Summary:
Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19269953 (829a2237d2) for iOS9 deprecation

Reviewed By: fkgozali

Differential Revision: D25805856

fbshipit-source-id: 328f426a492c563b1632223be2b48c8d3ca04756
2021-01-11 16:46:16 -08:00
Peter Argany a1d626739d Delete iOS10/tvOS10 support from React Native Libraries
Summary:
allow-large-files

Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19265731 (674b591809) for iOS9.

I just ran this command:
`find . -type f -exec sed -i '' 's/{ :ios => "10.0" }/{ :ios => "11.0" }/' {} +`
and then updated pods

Reviewed By: fkgozali

Differential Revision: D25693227

fbshipit-source-id: 0073d57ecbb268c52d21962cef202316857bcbd2
2021-01-11 16:46:16 -08:00