Commit Graph

827 Commits

Author SHA1 Message Date
Luna Wei d24f568c6f Update nightly versioning of react-native (#37028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37028

Changelog: [Internal] - Update nightly versions of react-native

Reviewed By: hoxyq

Differential Revision: D45192008

fbshipit-source-id: d3626c676906f996bc38f8cb156261b7ae202c2a
2023-05-05 14:48:29 -07:00
Luna Wei 03a4de9a46 Refactor publish-npm (#37030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37030

Changelog: [Internal] - Refactor publish-npm logic so its easier to follow

Reviewed By: hoxyq

Differential Revision: D45172195

fbshipit-source-id: 23aa109db17d42f43c348e122a3c2a1974aa61e4
2023-04-25 10:13:34 -07:00
Luna Wei 7b62bcbf9d Tests for publish-npm (#37029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37029

Changelog: [Internal] - Add tests to publish-npm

Reviewed By: hoxyq

Differential Revision: D45171640

fbshipit-source-id: b70bb478ae6b08891f1e82088bb0e07d5d68b4e5
2023-04-25 10:13:34 -07:00
Nicola Corti 7d7f48da41 Remove Buck OSS 1 setup. (#36900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36900

This commit effectively removes all the Buck 1 OSS infra code we do have inside
React Native as we'll need to rework most of it once we move to Buck 2

Changelog:
[Internal] [Changed] - Remove Buck OSS 1 setup

Reviewed By: mdvacca, cipolleschi

Differential Revision: D44956134

fbshipit-source-id: c0ad1914286c428480248658c4282df5477bba2b
2023-04-13 13:19:24 -07:00
Lorenzo Sciandra caa3fd83a6 fix(e2e script): fix the script post monorepo & metro-config work (#36836)
Summary:
Just backporting to main a couple of fixes we've done in the 0.72 branch plus removing the old bash script to avoid confusion (since now it's more broken than ever)

## Changelog:

<!-- 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
-->

[INTERNAL] [FIXED] - fix the local e2e script post monorepo & metro-config work

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

Test Plan:
Run `yarn test-e2e-local` successfully, both for RNTester & RNTestProject scenarios.

Here's a screenshot if RNTestProject working successfully:
<img width="1501" alt="Screenshot 2023-04-06 at 14 20 54" src="https://user-images.githubusercontent.com/16104054/230394301-49ea5752-27ad-4800-b56e-004fd88e9c44.png">

Reviewed By: rshest

Differential Revision: D44748037

Pulled By: cipolleschi

fbshipit-source-id: d00438bd766e8f228120f7bbceef2013cf9c966f
2023-04-06 08:01:54 -07:00
Nicola Corti 01100a2fc8 Rename cleanAll to clean and refine it (#36832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36832

We used to use `cleanAll` instead of `clean` to do cleaning of everything due to a bug on AGP on how clean was performed.
The bug is resolved, so we can now use `clean` properly.
Moreover, we have sporadic failures when the codegen/lib/ folder is not cleaned up. This fixes it.

Changelog:
[Internal] [Changed] - Rename cleanAll to clean and refine it

Reviewed By: cipolleschi

Differential Revision: D44745849

fbshipit-source-id: 4da5d34bcb0ee5c9f6b0e0f4e5b919bcc3171270
2023-04-06 05:54:15 -07:00
Zihan Chen (MSFT) 9bb71650c9 Add @react-native/codegen-typescript-test to verify .d.ts files in @react-native/codegen (1) (#36562)
Summary:
- Add a typescript project to test `CodegenSchema.d.ts`. More tests for other .d.ts files will be added in future pull requests.
- The build script scans all snapshots from `react-native/codegen`'s typescript frontend and generates .ts files for each snapshot, but they are .gitignore-ed.
- `npm run build` will build these .ts files against `CodegenSchema.d.ts` after generating them.
- A failed jest case is included to ensure CI catch it, it will be removed before merged.

bypass-github-export-checks

## Changelog:

[General] [Added] - Add react-native/codegen-typescript-test to verify .d.ts files in react-native/codegen (1)

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

Test Plan:
`npm run build` in `packages/react-native-codegen-typescript-test` and see all test files appear in `__generated__`.

## Screenshot

![Untitled](https://user-images.githubusercontent.com/53799235/226757755-cab4cb29-7d22-46a1-9ecb-d6732122ed38.png)

Reviewed By: rshest

Differential Revision: D44292277

Pulled By: cipolleschi

fbshipit-source-id: 8d79fe913f9563d64c92aae7c4f4e97a24ae9a21
2023-04-05 07:38:25 -07:00
Nicola Corti d1174535f7 Remove the update-ruby script as it's now unnecessary (#36802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36802

As we now support a broader range of ruby version, we don't need `update-ruby.sh` anymore
and we also don't need to call it during the set-rn-version script.

Changelog:
[Internal] [Changed] - Remove the update-ruby script as it's now unnecessary

Reviewed By: cipolleschi

Differential Revision: D44670361

fbshipit-source-id: b23abab28ccbd27408e4d76670101faeb463bc6b
2023-04-05 03:50:40 -07:00
Dmitry Rykun fdbc89d10b Re-land "[react-native][PR] [Upstream][Security] Use execFileSync over exec for cases with uncontrolled absolute paths" (#36791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36791

This is a re-land of D44635949. It was reverted as it was a suspected cause of CircleCI fails. It turned out the diff was unrelated, and the cause was something else.

## Changelog
[Internal][Security] - Use execFileSync over exec for cases with uncontrolled absolute paths

Reviewed By: cortinico

Differential Revision: D44663132

fbshipit-source-id: dfb3d09dbfbe3312ef54bcbbc43c8b4062d787a8
2023-04-04 15:17:44 -07:00
Phillip Pan bece6500f7 Back out "Use execFileSync over exec for cases with uncontrolled absolute paths" (#36780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36780

Original commit changeset: 8e0ebb070768

Original Phabricator Diff: D44131032

Changelog: [Internal]

all the circleCI template tests started failing after this commit, revert!

Reviewed By: jacdebug, cortinico

Differential Revision: D44635949

fbshipit-source-id: 429167acdbee3ebf6d81491ac65896c534c18fd0
2023-04-03 14:14:09 -07:00
Saad Najmi dc289737a8 Use execFileSync over exec for cases with uncontrolled absolute paths (#36491)
Summary:
In our fork React Native macOS, we run [Github's CodeQL ](https://codeql.github.com) to analyze for vulnerabilities. One common one that comes up is the use of `exec` with an uncontrolled absolute path (Example: https://github.com/microsoft/react-native-macos/security/code-scanning/14). The very simple fix to this is to replace calls to `exec` with `execFileSync`, which more or less does the same thing (but more securely!).

## Changelog

[INTERNAL] [SECURITY] - Use `execFileSync` over `exec` for cases with uncontrolled absolute paths

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

Test Plan: CI should pass

Reviewed By: cipolleschi

Differential Revision: D44131032

Pulled By: dmytrorykun

fbshipit-source-id: 8e0ebb07076838216f878f802ec937d2df44f33a
2023-04-03 08:32:30 -07:00
Riccardo Cipolleschi cb88e75cf1 Fix Cocoapods for Xcode 14.3.0 (#36759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36759

On Thursday the 30th, Apple Released Xcode 14.3.0.
This Version of Xcode enforce some version checks for which React-Codegen, which supported iOS 11 as minimum supported version, could not be build anymore.

This change ensue that React-Codegen is always aligned to the min version supported by React Native.
Plus, it moves CircleCI's Xcode to 14.3.0, to keep this problem in Check.

While working on this, I figured that, with the monorepo, Ruby tests stopped working because they were in the wrong folder: I moved them in the right one.

## Changelog:
[iOS][Fixed] - Make React Native build with Xcode 14.3.0 and fix tests

Reviewed By: blakef

Differential Revision: D44605617

fbshipit-source-id: 3ec1f5b36858ef07d9f713d74eb411a1edcccd45
2023-04-02 03:32:15 -07:00
fortmarek 0328a8d26b Use packaged react-native in test-e2e-local script (#36703)
Summary:
The current `test-e2e-local` script had two bugs:
- On [this](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L219) line we were initializing a new RN project with the packed `react-native` created [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L211)
- We were updating the local RN version after running `npm pack` [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L214). This meant that the version inside the packaged `react-native-xyz.tgz` was not updated since we ran `pack` before updating it. This was fine since the `init` command was using the local `react-native` repository instead of the packed version.

## Changelog:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script

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

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

Test Plan:
- Run `yarn test-e2e-local -t RNTestProject -p Android`. The command should succeed.

I am not completely sure how to double check that we are using the packed version. Locally, I have a `fsmonitor--daemon.ipc` in my `react-native/.git` that can't be copied. The `.git` folder would be copied only when `cli.js init` was called with the whole repository  – which is how I found out about the issue in the first place.

Reviewed By: hoxyq

Differential Revision: D44504599

Pulled By: cipolleschi

fbshipit-source-id: e57e2858bab46d4f978eed3cbaf3e504138594b8
2023-03-29 10:21:44 -07:00
Alex Hunt 32e836dd8b Fix paths in objc-test.sh, temporarily exclude /IntegrationTests (#36648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36648

Changelog: [Internal]

Blocker for https://github.com/facebook/react-native/pull/36623. The `test-ios` job in CI was misconfigured following the monorepo migration — and this becomes load-bearing with the incoming version of React Native CLI.

- Update `objc-test.sh` to run in `packages/rn-tester`, and exclude tests under `/IntegrationTests` which are outside of a Metro project directory.
    - **This is temporary** — a task has been created to move/split up/otherwise restore tests in `IntegrationTests`, which cipolleschi is following up (thanks!).
- Also fix `yarn start` script in `packages/rn-tester`.

Reviewed By: cipolleschi

Differential Revision: D44416533

fbshipit-source-id: 59c5b743d9d8fda206a12e37d94324ed9bfd703e
2023-03-27 11:21:56 -07:00
Ruslan Lesiutin 04df252aa7 RN [refactor]: bump and realign package versions by running a single script (#36568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36568

Changelog: [Internal]

Okay, so before the monorepo migration we had to use two scripts separately:
1. Bumping every package with `npm run bump-all-updated-packages`
2. Aligning other packages versions with `npm run align-package-versions`

The reason for it is that *before the monorepo* in a release branch cutoff process we had a step, which was removing `workspaces` keyword from `react-native` package. Without this keyword all new versions of packages will be resolved from npm (where they will be not available yet, because we have to publish them prior to it)

This is not the case for our current setup, and we can actually bump packages versions and they will be resolved as a workspaces successfully

Reviewed By: cortinico, cipolleschi

Differential Revision: D44261057

fbshipit-source-id: 31c2157be2d3b33bc073651d6045efcef2e8f5c5
2023-03-27 07:31:45 -07:00
Lorenzo Sciandra b312562f9a chore(e2e local script): fix e2e local script post monorepo refactoring (#36558)
Summary:
A quick fix for the local e2e script, a path needed to be updated.

## Changelog

<!-- 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
-->

[INTERNAL] [FIXED] -  fix e2e local script post monorepo refactoring

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

Test Plan: Run it locally.

Reviewed By: cortinico, cipolleschi

Differential Revision: D44257019

Pulled By: hoxyq

fbshipit-source-id: 29c4d4d103b5a041ef241cd371f31a1fc41d0396
2023-03-22 06:34:20 -07:00
Ruslan Lesiutin 9b6aaa731d RN [fix]: update template location in align-package-versions.js script
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D44218613

fbshipit-source-id: 505962b500821252679084a44e7d92e52c6fbf49
2023-03-20 15:41:42 -07:00
Ruslan Lesiutin 9a711e2fd5 RN [fix]: fixed cwd for in publish-npm script
Summary:
Changelog: [Internal]

Accidentally trying to publish from root folders, was missed in monorepo changes initially

Reviewed By: cortinico

Differential Revision: D44217992

fbshipit-source-id: dc7c5728929429cece0edada55f525f100451d2f
2023-03-20 08:44:43 -07:00
Ruslan Lesiutin 4b6b706680 Update paths in a new setup to fix nightlies (#36535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36535

Changelog: [Internal]

- We should be copying `/packages/react-native/package.json`, not root `package.json`
- Updating CircleCI config's target directory where hermes artifacts should be copied

Reviewed By: cortinico

Differential Revision: D44214309

fbshipit-source-id: af84897df3931c6a2d6a902b33c71b665c3fcefc
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin c35675bbe0 fix[align-package-version]: fixed updating application dependencies for react-native package (#36534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36534

Changelog: [Internal]

- Added option to include react-native package in forEachPackage func
- Used this in align-package-versions.js

Reviewed By: cortinico

Differential Revision: D44152939

fbshipit-source-id: da173e78945d8185ae7e35e29d08926de1700fa4
2023-03-20 07:05:52 -07:00
Rob Hogan 96789004b6 Fix reference to old template/package.json path
Summary:
Nightly builds are broken at the moment - at least in the first instance this looks to be because a reference to `template/package.json` was missed in the monorepo PR. This repairs it.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D44205810

fbshipit-source-id: c810b7a211db7162569a67fca26771fce79d4f9d
2023-03-19 18:06:33 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Riccardo Cipolleschi 21d530208f Extracting Platform Specific TM code to break dependency cycle between ReactCommon and React-Core (#36461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36461

This change breaks a dependency cycle between `ReactCommon` and `React-Core`.

`React-Core` depends on `ReactCommon` to have access to the various `TurboModule` native files.

`ReactCommon` depends on `React-Core` because the content of the `core/platform/ios` folder and the `samples` folder needs to access the `RCTBridge` and other files in Core.

To break the circular dependency, we introduced two new `podspecs`:

* `React-NativeModulesApple` for the content of `core/platform/ios`.
* `ReactCommon-Samples` for the content of the `samples` folder.

In this way, the new dependencies are linear as `React-NativeModulesApple` and `ReactCommon-Samples` depends on `React-Core` and `ReactCommon` and `React-Core` only depends on  `ReactCommon`.

While doing this, we also make sure that all the include path are aligned, to limit the amount of breaking changes.

## Changelog:
[iOS][Breaking] - Split the `ReactCommon/react/nativemodule/core/platform/ios` and `ReactCommon/react/nativemodule/samples` in two separate pods to break circular dependencies.

Reviewed By: mdvacca

Differential Revision: D44023865

fbshipit-source-id: a97569506350db5735ac5534b1592471de196cbe
2023-03-14 05:31:16 -07:00
Ruslan Lesiutin 8d8b44a5e3 Add option to commit with generic message (#36421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36421

Changelog: [Internal]

Adding an extra choice for commit question, user can now choose between three options:
1. Commit with generic message, no further actions needed
2. Commit with custom message, intercative VIM input will open
3. Not committing anything

Reviewed By: cortinico

Differential Revision: D43943526

fbshipit-source-id: 014215105d192961486b7d1c697f491697492812
2023-03-09 09:19:17 -08:00
Riccardo Cipolleschi a055e07c3e Use the new CLI properties for codegen the legacy components
Summary:
This change updates the way in which we consume the list of components from the `react-native.config.js` files so that it is aligned to what Android does.

## Changelog:
[iOS][Changed] - Update how the `react-native.config.js` is consumed to add elements in the interop layer.

Reviewed By: cortinico

Differential Revision: D43875395

fbshipit-source-id: e359c98a9144f4efe62967096d48318491718958
2023-03-08 02:28:32 -08:00
Riccardo Cipolleschi aac71507fa Add tests with more recent Rubies (#36376)
Summary:
This change add more tests for iOS, using different versions of Ruby

## Changelog
[iOS][Added] - Added smoke tests for iOS with Ruby 2.7.7 and 3.2.0

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

Test Plan: CircleCI must be green.

Reviewed By: blakef

Differential Revision: D43825344

Pulled By: cipolleschi

fbshipit-source-id: 8d3f5a2d9688f4d58f0ad5573d7b21e059cab523
2023-03-06 02:56:26 -08:00
Riccardo Cipolleschi e4257a4dfb Attach a script to React-RCTAppDelegate to register Legacy Components in the interop layer (#36335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36335

This change depends on [this PR](https://github.com/react-native-community/cli/pull/1849) of the CLI that introduces the `unstable_reactLegacyComponent` field in the `react-native.config.js` file.

This change introduce a JS script that reads that fields and generated a method in an object to return a list of components to be registered. The `RCTAppDelegate` has been updated to read those components and to automatically register them into the interop layer.

Notice that a user can just update the `react-native.config.js` and rebuild the app to integrate these changes, there is no need to reinstall the pods.

The idea behind this logic is to let the user know which components they are using with the interop layer, rather than rely on some black magic that could leave them blind to the need of actually migrate their apps.

## Changelog:
[iOS][Changed] - Implement mechanism to register legacy components in the iOS Fabric interop layer

Reviewed By: cortinico, dmytrorykun

Differential Revision: D43665973

fbshipit-source-id: b4e8d71fa1bbed7a6130ee4f83a6221394d5306e
2023-03-03 14:44:57 -08:00
Ruslan Lesiutin b72dc7f2c4 fix: update publishing packages tag message prefix (#36348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36348

Changelog: [Internal]

Turns out that Phabricator strips `@` symbol from `@...` tags when exports commits to GitHub. Proposing to use `#` instead.

#publish-packages-to-npm

Reviewed By: cortinico

Differential Revision: D43712415

fbshipit-source-id: 86fc728eb0cb63afb6a9fe592a9ae998da2ce2e4
2023-03-02 03:55:51 -08:00
Riccardo Cipolleschi dce9d8d5de Prepare cocoapods to accept the ENABLE_HERMES_PROFILER flag (#36352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36352

WIP

## Changelog:
[iOS][Changed] - Add support to enable the Hermes Sampling Profiler

Reviewed By: mdvacca

Differential Revision: D43699036

fbshipit-source-id: 9da5aed94541e09c705909fb7166623c36ce2a3e
2023-03-02 03:06:14 -08:00
Riccardo Cipolleschi 0f56cee8e1 Update Gemfile to require Cocoapods 1.12.0 (#36321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36321

This change bumps Cocoapods to 1.12.0. This last release fixes a bug for which cocoapods was not working with Ruby 3.2.0

## Changelog
[iOS][Changed] - Bumbed version of Cocoapods to support Ruby 3.2.0

Reviewed By: blakef

Differential Revision: D43655787

fbshipit-source-id: 6954ac8271daa7894e57f6d6104ed4d549490695
2023-02-28 07:14:02 -08:00
Lorenzo Sciandra 5112bc5dbc chore(dependencies): bump CLI to 11 alpha2 and metro to 0.75.1 (#36271)
Summary:
Ahead of cut of RN 0.72, I'm upgrading CLI and Metro according to https://github.com/react-native-community/cli/releases/tag/v11.0.0-alpha.2

~While working on it, I noticed that run-ios has some changes that make the e2e test script not work super well, so I'll be checking in with the CLI team to figure out what's wrong. Let's not merge it until that's address it. (also, there's already a bump for Metro that we need https://github.com/react-native-community/cli/commit/8d18baef554423904c036cbeaa5a1ea92603ff5d so I'll probably change the version to latest CLI and Metro once more)~ (all addressed)

## Changelog

<!-- 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
-->

[GENERAL] [CHANGED] - bump CLI to 11 alphav2 and metro to 0.75.1

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

Test Plan: Test CI, and locally I've used the e2e test script to ensure everything still works.

Reviewed By: NickGerleman

Differential Revision: D43625952

Pulled By: cipolleschi

fbshipit-source-id: dad940b65c56a586ae82acc2e7c16a918b872ee5
2023-02-28 03:18:06 -08:00
Riccardo Cipolleschi ad686b0ce1 Reduce breaking changes in use_frameworks! (#36305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36305

This change automate settings some search paths for 3rd parties libraries that are not using our `install_modules_dependencies` helper.

This will make the `use_frameworks!` changes less breaking.

## Changelog:
[iOS][Changed] - Automatically update Search Path on pods

Reviewed By: dmytrorykun

Differential Revision: D43596808

fbshipit-source-id: 9c5d7ff60a1e4cf73afbfd70b2499f03825cd764
2023-02-27 06:47:46 -08:00
Riccardo Cipolleschi e57b6d11fa Remove .ruby-version and update Gemfile to support multiple versions of Ruby (#36281)
Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

## Changelog

[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions

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

Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit

Reviewed By: cortinico

Differential Revision: D43567660

Pulled By: cipolleschi

fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
2023-02-26 09:32:28 -08:00
Riccardo Cipolleschi 93fdcbaed0 Drop the requirement to use PRODUCTION=1 to add -NDEBUG
Summary:
The previous fix for -DNDEBUG required to install the pods with PRODUCTION=1 in order to add the flag. The flag was added also to Debug configurations, which is not ideal.

With this change, we remove the requirement of running `PRODUCTION=1 pod install` and we install the -DNDEBUG flag to all the release configurations.

## Changelog:
[iOS][Changed] - Install the -DNDEBUG flag on Release configurations, without requiring PRODUCTION=1 flag

Reviewed By: cortinico

Differential Revision: D43535620

fbshipit-source-id: af97bef06f267dddd5ce13a466bbc8d9a5eb2b0b
2023-02-24 02:05:32 -08:00
Riccardo Cipolleschi dba8cb71bd Bump Flipper to 0.182.0
Summary:
This change bumps Flipper to 0.182.0, mirroring the [Android Commit](https://github.com/facebook/react-native/commit/8fae37eaeab0c75c0be2885ce9198131e4d74c92)

allow-large-files

## Changelog:
[iOS][Changed] - Bump Flipper to 0.182.0

Reviewed By: dmytrorykun

Differential Revision: D43454236

fbshipit-source-id: c852520d1e7f3a386a2fac11318a9fb6e868b520
2023-02-21 09:46:02 -08:00
Riccardo Cipolleschi 3e88fd01ce Install the RuntimeScheduler when the New Architecture is enabled (#36209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36209

ThisChange automatically enable the RuntimeScheduler when the new architecture is enabled, both on RNester and in the Template app.

Note that no migration steps are required.

## Changelog
[iOS][Changed] - Automatically install the RuntimeScheduler

Reviewed By: sammy-SC

Differential Revision: D43392059

fbshipit-source-id: 609ded9bdc3db13a0d54ff44d0d4687dfc8617a5
2023-02-21 04:17:26 -08:00
Ruslan Lesiutin 18b402cbd0 refactor(bump-all-updated-packages): use tag instead of custom commit message (#36220)
Summary:
Having custom commit message script is not an option for `main` branch, because we have internal tooling, which strips `[x]` tags from commit messages before merging them into `main` branch.

Instead of constant commit message, we are now using a tag which will be concatenated with the commit message, which was entered via interactive commit dialog, see demo below.

## Changelog
[Internal] - updated validation in bumping packages script

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

Test Plan: https://user-images.githubusercontent.com/28902667/220163767-015bf37b-6914-4df2-84d9-aa25fb2887d3.mov

Reviewed By: cortinico

Differential Revision: D43443597

Pulled By: hoxyq

fbshipit-source-id: 08e5e08524a1d934fbb35529e025358d7bf3b203
2023-02-21 01:39:51 -08:00
Riccardo Cipolleschi e7becb06c1 Update RCTFabric to generate headers in the React folder when using Frameworks
Summary:
By leveraging the `PUBLIC_HEADERS_FOLDER_PATH` build settings of Xcode, we can instruct cocoapods to generate the frameworks Headers in a specific folder, for example the `React` folder.
This allows us to maintain the `#include`/`#import` structure, even if the framework has a different name.
However, we need to update the search paths to take into account this extra folder.

## Changelog:
[iOS][Changed] - Generate RCTFabric framework's headers in the React folder

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43425677

fbshipit-source-id: 94a4f3a3c7de86341b3ce3457704e6b8fb9a588e
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 5d175c6775 Break Circular Dependency between React-Codegen and React-Fabric (#36210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36210

One of the circular dependencies we have in OSS was between React-Codegen and React-Fabric.

React-Codegen generates component which has to depends on React-Fabric because they need to use the files contained in the `react/renderer/view` folder.

React-Fabric contains some components that depends on RNCore, which was generated inside the React-Codegen folder.

This change generates the RNCore components inside the `ReactCommon/react/renderer/components/rncore` folder, breaking the dependency as `rncore` folder is now contained by React-Fabric itself.

**Fun Fact:** That's how it always should have been. There was already a line in the `.gitignore` to exclude the content of `ReactCommon/react/renderer/components/rncore` folder. I guess that with some of the refactoring/previous projects on Codegen, this requirements has slipped.

## Changelog:
[iOS][Breaking] -  generates RNCore components inside the ReactCommon folder and create a new pod for platform-specific ImageManager classes

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43304641

fbshipit-source-id: ebb5033ce73dbcd03f880c3e204511fdce04b816
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 6d34952420 Update ruby scripts to install the dependencies with use_frameworks.
Summary:
This diff update the Cocoapods scripts to install the proper dependencies and search paths when `use_frameworks!` is declared together with the New Architecture.

Practically, it adds the right search paths to the codegen and the project files and makes sure that third party dependencies that leverage the `install_modules_dependencies` are populated with the right search paths for Frameworks.

It also adds unit tests for the changes and the new methods introduced.

## Changelog:
[iOS][Changed] - Properly install dependencies with `use_frameworks!`

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43089869

fbshipit-source-id: 1981b6853f774fdb3dbe8d17ea37fd5154c54b25
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 421df9ffd5 Enable NDEBUG in production builds (#36194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36194

This change is the iOS equivalent of D43344120 (https://github.com/facebook/react-native/commit/8486e191a170d9eae4d1d628a7539dc9e3d13ea4), but for iOS.

## Changelog:
[iOS][Fixed] - Turn on NDEBUG when pods are installed for production.

Reviewed By: cortinico

Differential Revision: D43388881

fbshipit-source-id: 5c16d3d7b4265e4ee2f265a5f992cffee30f3887
2023-02-19 01:55:16 -08:00
Saad Najmi 7208cd6384 Switch to xcbeautify (#36131)
Summary:
`xcpretty` is no longer maintained. Let's switch to `xcbeautify`, which is faster and is maintained. I'm also biased because `xcpretty` hid an error from me that `xcbeautify` did not.

## Changelog

[INTERNAL] [CHANGED] - Move CI from `xcpretty` to `xcbeautify`

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

Test Plan:
Locally yarn `yarn test-ios` and got output that looks like this:

<img width="1245" alt="Screenshot 2023-02-11 at 9 34 07 PM" src="https://user-images.githubusercontent.com/6722175/218291538-07760f94-7e52-4919-b603-8a35a623fc9a.png">

I also confirmed a junit report that looks like this was generated:
```xml
<testsuites name="Selected tests" tests="193" failures="0">
    <testsuite name="RCTLoggingTests" tests="1" failures="0">
        <testcase classname="RCTLoggingTests" name="testLogging" time="0.175" />
    </testsuite>
    <testsuite name="RCTUIManagerScenarioTests" tests="3" failures="0">
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddRemoveAndMove" time="0.001" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddViews" time="0.000" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToRemoveViews" time="0.001" />
    </testsuite>
    ...
```

Reviewed By: cortinico

Differential Revision: D43232774

Pulled By: cipolleschi

fbshipit-source-id: fda4e217d4df55b5088026d6911d3dc6c8c9e824
2023-02-15 04:20:20 -08:00
Umut Topuzoğlu 0d82b402aa Fix missing node error message not printed correctly (#36140)
Summary:
When the node version could not be found there is an error message shown to help what can be done to fix this issue (for example in the error logs in xcode)

The problem was that the backtick symbol is interpreted as running commands in terminals so the parts that were in backticks were run and the error message was printed incompletely. Also there were other errors added (.xcode.env command not found, for example) which makes it harder to understand what is going on.

In bash / zsh single quotes does not expand commands and variables unlike double quotes which does this.

## Changelog

[IOS] [FIXED] - Fix missing node error message not printed correctly when deprecated `find-node-for-xcode.sh` is used.

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

Test Plan:
I just ran the xcode build again after updating it manually in the node_modules folder.

The log output changed from this
```
[Warning] You need to configure your node path in the  environment.  You can set it up quickly by running:  echo 'export NODE_BINARY=/Users/uloco/Library/Caches/fnm_multishells/78434_1676301546457/bin/node' > .xcode.env  in the ios folder. This is needed by React Native to work correctly.  We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version.  You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
```

to this
```
[Warning] You need to configure your node path in the `".xcode.env" file` environment.  You can set it up quickly by running:  `echo export NODE_BINARY=$(command -v node) > .xcode.env`  in the ios folder. This is needed by React Native to work correctly.  We fallback to the DEPRECATED behavior of finding `node`. This will be REMOVED in a future version.  You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
```

Reviewed By: cortinico, cipolleschi

Differential Revision: D43258623

Pulled By: rshest

fbshipit-source-id: 7db0d983b204e59504666686be78311c4c2fb993
2023-02-14 07:05:03 -08:00
Saad Najmi 90327d9fba Build codegen package while using old architecture (#36098)
Summary:
Fixes https://github.com/facebook/react-native/issues/36097

When building RNTester with the old architecture, we skip a call to `build_codegen`, which will build the JS package at `packages/react-native-codegen`. This is needed for the Xcode Script phase `Generate Specs`. This causes a build with fabric disabled to fail. We can fix this by ensuring we call `build_codegen` in both paper and fabric.

We've had this change in React Native macOS already since 0.68: https://github.com/microsoft/react-native-macos/commit/1175372ffecf6b4e18fa27b75b68f3ec7967a384

## Changelog

[IOS] [FIXED] - Build codegen package while using old architecture

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

Test Plan:
CI should suffice. Locally built RN-Tester without fabric with and without my change to show that disabling fabric will only succeed with this change included.
While running `pod install`, you should now see this extra line with the old architecture:
> [Codegen] building ./../../packages/react-native-codegen.

Reviewed By: cortinico

Differential Revision: D43152692

Pulled By: cipolleschi

fbshipit-source-id: 2cf3002f07eaad442ccb0272831fe2de58ec9c1a
2023-02-09 06:45:31 -08:00
Nicola Corti 9eaf6f5bdb Move test-docker-android from GH Actions to CircleCI (#36093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093

The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.

Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI

Reviewed By: javache

Differential Revision: D43121477

fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
2023-02-08 12:51:09 -08:00
Raouf f6a4e4f20f update asdf-vm setup to use $ASDF_DIR to work if user defined custom directory (#36043)
Summary:
Update setup of sourcing `asdf-vm` in `find-node-for-xcode.sh` in case of user has custom defined of `$ASDF_DIR`
by default `$ASDF_DIR` point to `$HOME/.asdf`, but if user has custom directory (like XDG convention) this script wont work without this change.

## Changelog

<!-- 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
-->
[GENERAL] [CHANGED] - Find node binary when using asdf as the node version manager with custom `$ASDF_DIR`

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

Test Plan: use a defualt/custom `$ASDF_DIR` while using `asdf-vm` as node version manager then make iOS build.

Reviewed By: cortinico

Differential Revision: D42990407

Pulled By: cipolleschi

fbshipit-source-id: 1fe3fdc786bddf741ff422e7bec55a6c9cc8ed83
2023-02-07 07:00:14 -08:00
Lorenzo Sciandra 7adf6b1e63 fix(script): handle patch versions after the .0 for set version (#36020)
Summary:
A small backport to main of a local fix done in 0.71 to account for the logic for releases 0.Y.1,2,3-prerelease (meaning, not just strictly 0).

I could have done like the other logics and just remove the check for patch, but decided to at least make sure it's a digit 😅

## Changelog

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

Pick one each for the category and type tags:

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

[INTERNAL] [FIXED] - handle patch versions after the .0 for set version

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

Test Plan: Tested in 0.71-stable, without it we can't test RNTestProject.

Reviewed By: jacdebug, cortinico

Differential Revision: D42924375

Pulled By: cipolleschi

fbshipit-source-id: b003d884cc45a2602adbc14fa8b66d3f1e0c94a6
2023-02-07 03:45:17 -08:00
Krystof Woldrich 86852f8cb5 Fix displayed name when codegen dependency is not found (#36013)
Summary:
The fixed error guides users toward the right missing dependency. The original error pointed to the old name.

## Changelog

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

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Display correct codegen dependency name when not found

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

[INTERNAL] [FIXED] - Display correct codegen dependency name when not found

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

Test Plan: This is an error message wording change.

Reviewed By: jacdebug

Differential Revision: D42881807

Pulled By: cipolleschi

fbshipit-source-id: d96fb867cfe27ae922d398ab981f5797cb51a269
2023-01-31 02:54:19 -08:00
Ruslan Lesiutin 9856c334bd fix(publishing-bumped-packages): look for status code instaead of stderr (#36004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36004

Changelog: [Internal]

This fixes CircleCI job, which is responsible for publishing bumped packages. We should not check for `stderr`, apparently `npm` uses it to store debug information:
- https://github.com/npm/npm/issues/118#issuecomment-325440

So we've tried to use this on 0.71-stable before and it succesfully published one package, but have exited right after it because `stderr` was not empty

Reviewed By: cortinico, cipolleschi

Differential Revision: D42836212

fbshipit-source-id: 6f2a9a512121683268fe6aae6a187fccb8d9dfbc
2023-01-30 06:22:12 -08:00
Kræn Hansen dc959c9271 Update react-native-xcode.sh to use PROJECT_DIR from Xcode (#35970)
Summary:
In a mono-repo the `react-native` package could be hoisted compared to the app directory, in which case it's not a good strategy for the `react-native-xcode.sh` script to guess the app project root relative to the location of itself. Instead I suggest to relying on a build setting provided by Xcode to derive the default app path.

I could have use the `SRCROOT` instead. According to https://stackoverflow.com/questions/36323031/what-the-different-between-srcroot-and-project-dir this is equivalent and also a bit less ambiguous as I see it. I.e. I would expect most Xcode projects to be located in the `ios` directory of the app.

As a workaround, before this merge, users can add the following to their "Bundle React Native code and images" build phase or `ios/.xcode.env` file:

```shell
export PROJECT_ROOT="$PROJECT_DIR/.."
```

This build phase can also be used for users wanting to revert this default behaviour once merged.

## Changelog

[iOS] [Changed] - Changed default `PROJECT_ROOT` (used in when bundling for iOS) to rely on the `PROJECT_DIR` build setting.

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

Test Plan:
I've updated this locally and verified this does indeed pick up the correct app path - even in a mono-repo.

To verify this:
- Instantiate the template with this patch applied.
- Update the "Run scheme"'s "Build Configuration" to "Release".
- Build the app without errors.

Reviewed By: cortinico

Differential Revision: D42842636

Pulled By: cipolleschi

fbshipit-source-id: 040c31ac59a8abec5f5b38f795c8e74649420bac
2023-01-30 04:03:31 -08:00