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

442 Коммитов

Автор SHA1 Сообщение Дата
Alex Hunt 38e068abac Bump CLI to 10.0.0-alpha.2
Summary:
Quick update (requested by cortinico) ahead of release 0.71. Note that there was not a new release of `react-native-communiity/cli-platform-ios` in f6f23cca4b.

Changelog:
[General][Changed] - Bump CLI to 10.0.0-alpha.2

Reviewed By: robhogan, cortinico

Differential Revision: D40806560

fbshipit-source-id: 5c852a204c3c2d272d0502a34221f24ce7613cb0
2022-10-28 13:10:32 -07:00
Marshall Roch d0f94e6c2d Upgrade to Flow 0.191.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D40768442

fbshipit-source-id: a8e4301d731a8be4ce21d19c6276795d1127bd6d
2022-10-28 08:11:57 -07:00
Lorenzo Sciandra f550606d4c chore(cli, metro): bump cli and metro to latest ahead of 71 (#35107)
Summary:
Small PR with bump to the new versions of CLI and Metro in preparation of the branch cut for 0.71.

While at it, did a cheeky `npx yarn-deduplicate` to clean up a bit the deps.

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

[General] [Changed] - Bump CLI to 10.0.0-alpha.1 and Metro to 0.73.3

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

Test Plan: CI is green

Reviewed By: motiz88

Differential Revision: D40762683

Pulled By: huntie

fbshipit-source-id: e523a49c78588ca80351f44cb02bcd4c0137475e
2022-10-27 14:09:03 -07:00
David 475310dbba Add support `Promise.any` out of box (#35080)
Summary:
`promise` module diff: [`8.2.0...8.3.0`](https://npmfs.com/compare/promise/8.2.0/8.3.0/)
- Hermes issue: https://github.com/facebook/hermes/issues/766

## Changelog

[General] [Added] - Added support `Promise.any`

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

Test Plan:
Release notes [`promise@8.3.0`](https://github.com/then/promise/releases/tag/8.3.0)

```tsx
typeof Promise.any // function
```

Reviewed By: cortinico

Differential Revision: D40681373

Pulled By: jacdebug

fbshipit-source-id: ecd589186483f3aa0f48da28a1f6dfcb1e26c8bc
2022-10-27 05:39:36 -07:00
Rick Hanlon b966d29724 Add back deprecated prop-types
Summary:
In 2017, React published v15.5 which extracted the built-in `prop types` to a separate package to reflect the fact that not everybody uses them. In 2018, React Native started to remove `PropTypes` from React Native for the same reason. In 0.68 React Native introduced a deprecation warning which notified users that the change was coming, and in 0.69 we removed the PropTypes entirely.

The feedback we've received from the community is that there has not been enough time to migrate libraries off of PropTypes. This has resulted in users needing to patch the React Native package `index.js` file directly to add back the PropTypes, instead of migrating off of them. We can empathize with this fix short term (it unblocks the upgrade) but long term this patch will cause users to miss important changes to `index.js`, and add a maintenance cost for users.

Part of the reason there was not enough time is that we didn't do a good job surfacing libraries that were using PropTypes. This means, when you got a deprecation warning, it wasn't clear where the source of the usage was (either in your code or in a library). So even if you wanted to migrate, it was difficult to know where to actually make the change.

In the next release, we've made it easier to find call sites using deprecated types by [fixing the code frame in errors](https://github.com/react-native-community/cli/pull/1699) reporting in LogBox, and ensuring that [the app doesn't crash without a warning](https://github.com/facebook/react-native/pull/34650). This should make it easier to identify exactly where the deprecated usage is, so you can migrate it.

To help users get off of the patch, and allow more time to migrate, we're walking back the removal of PropTypes, and keeping it as a deprecation for a couple more versions. We ask that you either migrate off PropTypes to a type system like TypeScript, or migrate to the `deprecated-react-native-prop-types` package.

Once we feel more confident that the community has migrated and will not need to patch React Native in order to fix this issue, we'll remove the PropTypes again. **If you have any trouble finding the source of the PropType usage, please file an issue so we can help track it down with you.**

Changelog:
[General][Changed] - Add back deprecated PropTypes

Reviewed By: yungsters

Differential Revision: D40725705

fbshipit-source-id: 8ce61be30343827efd6dc89a012eeef0b6676deb
2022-10-26 22:03:19 -07:00
Benny Singer cf5addf423 Revert D40716713: chore(deps): add wanted dependencies to remove yarn warnings
Differential Revision:
D40716713 (8422c5315c)

Original commit changeset: eeb95a91c6cd

Original Phabricator Diff: D40716713 (8422c5315c)

fbshipit-source-id: e85f111e7da0381e09f8a23d3bd0d553b3a7c4a9
2022-10-26 07:22:28 -07:00
Lorenzo Sciandra 8422c5315c chore(deps): add wanted dependencies to remove yarn warnings (#35088)
Summary:
I wanted to start working on a thing but this barrage of warnings was very annoying so ended up doing this instead: a very small PR to take care of some warnings during yarn install.

It doesn't change anything (the versions are the ones already used all around the repo), just makes yarn happier.

Also, while doing that I found a dependency that was lying there unused for 2 years so took care of it.

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

[General] [Fixed] - add wanted dependencies to remove yarn warnings

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

Test Plan:
### Before

<img width="1920" alt="Screenshot 2022-10-26 at 10 53 32" src="https://user-images.githubusercontent.com/16104054/197996489-f463be29-b35b-45cc-9d9c-2d176579fb7d.png">

### After

<img width="947" alt="Screenshot 2022-10-26 at 10 52 19" src="https://user-images.githubusercontent.com/16104054/197996505-3d60b319-006b-45ab-83bf-2f431272fdcd.png">

Reviewed By: jacdebug

Differential Revision: D40716713

Pulled By: robhogan

fbshipit-source-id: eeb95a91c6cdf37edfe868fefe4ba04aebe500ec
2022-10-26 06:42:50 -07:00
Christoph Purrer d0599ac56b Back out "Add enum example to Android/iOS rn-tester TurboModule" (#35089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089

Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"

This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation

Reviewed By: cipolleschi

Differential Revision: D40714320

fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
2022-10-26 06:30:14 -07:00
Christoph Purrer 02e4fcd825 Add enum example to Android/iOS rn-tester TurboModule
Summary:
Add enum example to Android/iOS rn-tester TurboModule

Changelog:
[General][Added] - Add enum example to Android/iOS rn-tester TurboModule

Reviewed By: javache

Differential Revision: D40619020

fbshipit-source-id: a113c5c78bcff3275e80d11bce8d0e6421b0b97d
2022-10-25 14:40:08 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075

This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab

Changelog:
[Android] [Changed] - Update the template to use RNGP

Reviewed By: cipolleschi

Differential Revision: D40673732

fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
2022-10-25 13:13:14 -07:00
Nicola Corti c419b4fa0c Bump react-native-gradle-plugin to 0.71.5
Summary:
Bumping RNGP to make sure all the changes are available for 0.71

I've also removed the caret from react-native's package.json as
I don't want .5 to be used by template tests yet.
The Android template needs to be updated in order to use
that version of the Gradle plugin.

Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.5

Reviewed By: cipolleschi

Differential Revision: D40642114

fbshipit-source-id: 70359efc3d2300e9c04c1b361c45061fd1c2931b
2022-10-25 03:24:38 -07:00
Marshall Roch 6e18f1fab1 upgrade to flow 0.190.1
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D40611965

fbshipit-source-id: 56c6dc10557fdb3a302a862fe80a1227df83850b
2022-10-22 06:38:54 -07:00
Rob Hogan 45db65be7e Update Jest to ^29.2.1 (#35014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35014

X-link: https://github.com/facebook/metro/pull/881

Following on from https://github.com/facebook/react-native/pull/34724 and https://github.com/facebook/react-native/pull/34972, this updates Jest to the latest version 29.2.1 across projects and in the OSS React Native new app template.

Importantly this version includes the [new `jest.now()` API](https://github.com/facebook/jest/pull/13245), which will be useful for exposing internally consistent fake timer mocks of `requestAnimationFrame`, etc., in the new React Native Jest environment.

Changelog:
[General] [Changed] - Upgrade Jest in React Native template to ^29.2.1

Reviewed By: jacdebug

Differential Revision: D40386349

fbshipit-source-id: 43f5a69cf546df09e2f02542ebf50130d65f0436
2022-10-19 12:17:39 -07:00
Lorenzo Sciandra a24c8946e0 chore: bump CLI to 9.2.1 (#35022)
Summary:
A super small PR to bump CLI to latest available of the 9.x stream, to make available in main the asset image fix (https://github.com/react-native-community/cli/pull/1290) and to be able to cherry pick it back in 0.70 branch.

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

[General] [Changed] - bump CLI to 9.2.1

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

Test Plan: CI is green

Reviewed By: dmytrorykun

Differential Revision: D40507344

Pulled By: huntie

fbshipit-source-id: 7c3753e9df154eb5835f021cdfe1b476499afb9a
2022-10-19 05:17:31 -07:00
Tianyu Yao 48263b8daf Upgrade React DevTools deps to 4.26.1
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.1

Reviewed By: lunaruan

Differential Revision: D40394563

fbshipit-source-id: 70a841c7478d8944dc8a57dd7711953d6bd7958a
2022-10-18 10:43:18 -07:00
Sam Zhou 3e58a9c531 Deploy 0.190.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D40393734

fbshipit-source-id: cc7a5e1fd28512c8141a0f705580a447efcd5575
2022-10-14 14:07:54 -07:00
Jiamin Zhu 4631cf933e Revert D40374535: Deploy 0.190.0 to xplat
Differential Revision:
D40374535 (5359f1de12)

Original commit changeset: 92788a21a4f2

Original Phabricator Diff: D40374535 (5359f1de12)

fbshipit-source-id: a0115dc24590bc50fa1aee2770dbb13b2edaf580
2022-10-14 10:45:04 -07:00
Sam Zhou 5359f1de12 Deploy 0.190.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D40374535

fbshipit-source-id: 92788a21a4f22628782735dfb60d51661d6b27fa
2022-10-14 09:01:51 -07:00
Pieter Vanderwerff 5e9ac1fa13 Deploy 0.189.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D40320927

fbshipit-source-id: 05c74ddf966ab25308237e265113d1cbb920d3c6
2022-10-12 15:29:17 -07:00
Gabriel Donadel Dall'Agnol fa22a6e2d7 build: Bump ws to 6.2.2 due to ReDoS vulnerability (#34759)
Summary:
A moderate vulnerability was found in all versions of `ws` below 7.4.6 June last year. React native current uses v6.1.4 which is susceptible to it, fortunately this security fix has been backported to v6.X.X and we don't need to upgrade any major versions/worry about breaking changes. This PR bumps `ws` to 6.2.2 ([CHANGELOG](https://github.com/websockets/ws/releases/tag/6.2.2)) due to this ReDoS vulnerability

More information about this vulnerability can be found here -> https://github.com/advisories/GHSA-6fc8-4gx4-v693

Closes https://github.com/facebook/react-native/issues/31646

## Changelog

[Internal] [Security] - Bump ws to 6.2.2 due to ReDoS vulnerability

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

Test Plan:
Ensure WebSocket tests are working as expected

Tested HMR working on Twilight
| iOS | Android |
| https://pxl.cl/2g70M | https://pxl.cl/2g70V |

Reviewed By: hramos, cortinico

Differential Revision: D39722905

fbshipit-source-id: 12088ab5ea26d904675de484e2014949d6696465
2022-10-10 02:58:40 -07:00
Gabriel Donadel Dall'Agnol 530dae8a45 chore: rename hermes-inspector-msggen to @react-native/hermes-inspector-msggen (#34850)
Summary:
This PR renames ` hermes-inspector-msggen` to `react-native/hermes-inspector-msggen`, moves it to  `packages/hermes-inspector-msggen` and makes the package private  as part of RFC480.

Related to https://github.com/facebook/react-native/issues/34692

## Changelog

[General] [Changed] - Move and rename `hermes-inspector-msggen` to `react-native/hermes-inspector-msggen`

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

Test Plan: run `sh ReactCommon/hermes/inspector/tools/run_msggen`

Reviewed By: mattbfb

Differential Revision: D40060406

Pulled By: cortinico

fbshipit-source-id: e018fd88e8374a69fbd8737fbb9abe7565d4a003
2022-10-05 03:57:08 -07:00
Lorenzo Sciandra f164556037 chore(deps): bump CLI to 9.1.3 and Metro to 0.72.3 (#34803)
Summary:
This PR bumps the dep version of Metro and the RN CLI to latest, and realigns them to avoid the issue we currently have in 0.70: https://github.com/facebook/react-native/issues/34714 (this commit will be cherry-picked there)

Also, it pins it all down to precise version. See comments for reasoning.

While at it, I gave a cleanup pass to the yarn.lock with [`yarn deduplicate`](https://github.com/scinos/yarn-deduplicate#readme).

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

[General] [Changed] - bump CLI to 9.1.3 and Metro to 0.72.3

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

Test Plan: CI is green

Reviewed By: dmytrorykun

Differential Revision: D39967392

Pulled By: dmytrorykun

fbshipit-source-id: 799dd745834c9ba349362f70afb4bdbd1a48260e
2022-09-30 06:22:21 -07:00
Sam Zhou 8340794c5e Deploy 0.188.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: vdjeric, evanyeung

Differential Revision: D39960121

fbshipit-source-id: c0606675f2897a9514520e577017e23ca1430049
2022-09-29 23:11:09 -07:00
Evan Yeung 8a7f7af753 Deploy 0.188.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39919034

fbshipit-source-id: a8329aab9bf8f8da93a1c8d414518705048f0d8f
2022-09-29 14:31:12 -07:00
Tim Yung 5f5d6b786c RN: Upgrade Dependencies w/ Security Vulnerabilities
Summary:
Upgrades all (indirect) dependencies that had security vulnerabilities.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D39934079

fbshipit-source-id: 6e19c1c691ca2045c0ab6e3e4ac12cf2802ea060
2022-09-29 10:51:37 -07:00
Tim Yung 80b8cefb26 RN: Lint for Internal Package Imports
Summary:
Creates an ESLint rule that prohibits (and autofixes) imports from `react-native` or `react-native/path/to/file`, within the React Native repository.

The ESLint rule is configured using the `eslint-plugin-lint` package instead of `react-native/eslint-plugin` because the rule is only applicable to the React Native repository. The rule does not (and should not) be publicly facing, and changes to the rule should not require publishing new versions of `react-native/eslint-plugin`. (As a follow-up, the `no-haste-imports` rule should be migrated over from `react-native/eslint-plugin`.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D39831222

fbshipit-source-id: 566330e6df77fdff5ce755324b9f592b9365019e
2022-09-27 09:22:58 -07:00
Tianyu Yao 1d7080264e Upgrade React DevTools deps to 4.26.0
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.0

Reviewed By: lunaruan

Differential Revision: D39587418

fbshipit-source-id: 1b1841b72329fd3ef4ae8a08095a30a26a0b6455
2022-09-23 12:46:33 -07:00
Rob Hogan c27501bb87 Update to Jest 29 (#34724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34724

Following on from the recent upgrade from Jest 26->27, this brings us up to present day Jest 29 for tests of React Native itself, Metro, and Meta-internal code. An update to the template for RN apps will follow.

Changelog:
[Internal][Fixed] Update to Jest 29

Reviewed By: huntie

Differential Revision: D39543504

fbshipit-source-id: b47fdb678212b475881ec19085f6cd45a4530333
2022-09-20 14:15:50 -07:00
Marshall Roch 059e41e217 upgrade to flow 0.187.1
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39643297

fbshipit-source-id: efdd6b41a79cc715b12ea442b6b57e400dbb6cac
2022-09-19 22:19:14 -07:00
Luna Wei 6b2a511cbb Move TypeScript declarations into react-native (#34614)
Summary:
## Changelog
[General] [Added] - Add `types` folder to house TypeScript types.

Release TypesScript types with react-native and eventually deprecate [types/react-native](https://www.npmjs.com/package/types/react-native).

The current plan is to release types/react-native for 0.70 and 0.71 while also maintaining types here. This will result in some double maintenance until 0.72 but will give community time to move off of types/react-native.

After this lands, there have been changes on `main` of types that we need to update. Then, when we release 0.71 from DefinitelyTyped, we can simply copy over the `types` folder from this repo.

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

Test Plan:
`yarn run test-typescript` for linting types

* Created a new project using the TS template and my local clone of `react-native` on this branch.
`npx react-native init MyTSApp --version <path-to-my-local-rn-repo> --template react-native-template-typescript`
* Updated the `package.json` to remove `types/react-native`
* Deleted my node_modules and re-ran yarn
* Opened MyTSApp in VSCode and verified the type suggestions appeared and cmd+click to defnitions took me to the node_module dependency `react-native/types`

## Danger is failing on this PR and it's expected
 as it runs off the changes on `main`.  [This is expected](https://docs.github.com/en/github-ae@latest/actions/using-workflows/events-that-trigger-workflows?fbclid=IwAR2_AE0Jwndt8Gu-iTQnxGxLJq7nakbi7sz8jwZ6U62JWLSdcZuvjcQ6WvE#pull_request_target). However testing it locally passes. Once merged, and these changes are on `main`, danger will pass again.

```
$ react-native/packages/react-native-bots
❯ yarn danger pr https://github.com/facebook/react-native/pull/34614
yarn run v1.22.19
$ ..react-native/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34614
Starting Danger PR on facebook/react-native#34614

Danger: ✓ found only warnings, not failing the build
## Warnings
🔒 package.json - <i>Changes were made to package.json. This will require a manual import by a Facebook employee.</i>

  Done in 13.24s.
```

Reviewed By: mdvacca

Differential Revision: D39479137

Pulled By: lunaleaps

fbshipit-source-id: 1d506f812d566b783b6e79104cd6339b077a42a7
2022-09-19 12:26:00 -07:00
Tim Yung 527ac2f2c5 JS: Upgrade to `yargs@^17.5.1`
Summary:
Upgrades all of our JavaScript tooling to use `yargs@^17.5.1`.

Of all [release notes](https://github.com/yargs/yargs/releases), these are the major version notes:

- [v17.0.0](https://github.com/yargs/yargs/releases/tag/v17.0.0)
- [v16.0.0](https://github.com/yargs/yargs/releases/tag/v16.0.0)

A cursory inspection suggests that these breaking changes are unlikely to seriously impact our use cases (or can be fixed forward).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D39550338

fbshipit-source-id: 5b2c5265f8c7a95ab0cc9bab62873f9e4355f32f
2022-09-16 08:25:34 -07:00
Marshall Roch a8ece43a50 upgrade to flow 0.187.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39542847

fbshipit-source-id: 2eeb8740dd0a142b7e411fbee4765a8f38685c76
2022-09-15 12:24:13 -07:00
Rob Hogan ff20062174 Update Jest to 27.5.1
Summary:
Update our internal tests to use Jest 27. If this sticks, we should follow up with updating the RN template.

Changelog:
[Internal][Fixed] Update Jest setup to v27.5.1

Reviewed By: motiz88

Differential Revision: D39383717

fbshipit-source-id: 0fbb5a7b1ab70ccbfaed22b2de92f445f756afe0
2022-09-15 07:37:40 -07:00
Luna Wei 767f8e0249 Add bots as a yarn workspace and update danger action (#34652)
Summary:
allow-large-files

When working on https://github.com/facebook/react-native/pull/34614, danger is failing because it doesn't share `node_modules` with the root directory where `typescript` is installed as we added it as a parser in our eslint config.

By setting `bots` as a yarn workspace, dependencies are all installed under the root `node_modules` folder and in local testing (detailed in test section) we no longer have the `typescript module not found` error. However, danger will continue to fail on https://github.com/facebook/react-native/pull/34614 as the `danger_pr` Github action runs from what's defined on `main`.

Once these changes land, I can rebase https://github.com/facebook/react-native/pull/34614 on it and danger's eslint should pass.

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

[Internal][Fixed] - Add `bots` directory as a yarn workspace and update `danger_pr` Github action

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

Test Plan:
To verify this fix I had to run:
```
react-native $ yarn && cd bots
react-native/bots$ yarn run danger pr https://github.com/facebook/react-native/pull/34614
```

which resulted in
```
❯ yarn run danger pr https://github.com/facebook/react-native/pull/34614
yarn run v1.22.19
$ lunaleaps/react-native/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34614
Starting Danger PR on facebook/react-native#34614

Danger: ✓ found only warnings, not failing the build
## Warnings
🔒 package.json - <i>Changes were made to package.json. This will require a manual import by a Facebook employee.</i>

  Done in 12.78s.
```
Verified this also on another PR:
```
yarn run danger pr https://github.com/facebook/react-native/pull/34650
```

Reviewed By: NickGerleman

Differential Revision: D39435286

Pulled By: lunaleaps

fbshipit-source-id: 8c82f49facf162f4fc0918e3abd95eb7e4ad1e37
2022-09-12 22:03:34 -07:00
Satyajit Sahoo a5622165c1 feat: support custom library paths in `react-native.config.js` for codegen on iOS (#34580)
Summary:
Currently for codegen to work for a library on iOS, it needs to be located
inside `node_modules`. This patch adds support for libraries defined in
`react-native.config.js`.

This is useful when developing libraries as well as monorepos where the library
may exist outside of the `node_modules`.

Example:

```js
// react-native.config.js
const path = require('path');

module.exports = {
  dependencies: {
    'react-native-library-name': {
      root: path.join(__dirname, '..'),
    },
  },
};
```

## Changelog

[Internal] [Added] - Support custom library paths in `react-native.config.js` for codegen on iOS

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

Test Plan:
Tested on a test application and ensured that codegen finds the library specified in `react-native.config.js`

https://user-images.githubusercontent.com/1174278/188141056-bce03730-2a13-4648-8889-9727aaf2c3c4.mp4

I have also added a basic test case for this scenario.

Reviewed By: jacdebug, cortinico

Differential Revision: D39257919

Pulled By: cipolleschi

fbshipit-source-id: 131189f1941128a59b9b1e28af61a9038eb4536b
2022-09-08 03:09:16 -07:00
David 951538c080 Add support `Promise.allSettled` out of box (#34544)
Summary:
Issue: https://github.com/facebook/react-native/issues/30236

## Changelog

[General] [Added] - Added support `Promise.allSettled`

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

Test Plan:
Release notes [`promise@8.2.0`](https://github.com/then/promise/releases/tag/8.2.0)

```tsx
typeof Promise.allSettled // function
```

Reviewed By: motiz88

Differential Revision: D39170057

Pulled By: jacdebug

fbshipit-source-id: 72467285e1ad82510ca8fe3d5f347ec8ae286823
2022-09-07 12:17:55 -07:00
Pieter Vanderwerff 3db19b464d Deploy 0.186.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39185318

fbshipit-source-id: ca154a5c43eef3e30d5eab382947eedf30e9e850
2022-08-31 16:05:55 -07:00
Marshall Roch f3def13a92 Deploy 0.185.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: bradzacher

Differential Revision: D38886330

fbshipit-source-id: 7b3fa0c4c4ccfffa54770dac0ccd686d4e4753d5
2022-08-24 06:13:47 -07:00
Michał Pierzchała 0c2fe96998 Upgrade RN CLI to v9.0.0 and Metro to 0.72.1 (#34447)
Summary:
Stable v9 of the CLI, no major changes compared to previous alpha releases.

Metro release notes: https://github.com/facebook/metro/releases/tag/v0.72.1

cc kelset huntie

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

[General] [Changed] - Upgrade RN CLI to v9.0.0, Metro to 0.72.1

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

Test Plan: CI

Reviewed By: huntie

Differential Revision: D38838499

Pulled By: robhogan

fbshipit-source-id: 552e2e708270557e2b74c1a3b8d3325774fb0c48
2022-08-19 09:13:55 -07:00
Christoph Purrer 776046b89b Update flow-parser for react-native-codegen and eslint-plugin-spec
Summary:
Updating flow-parser to a more recent version which also supports parsing enums

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D38832380

fbshipit-source-id: e3ef477abf85939ce3c9d92844e28dc59d8231c1
2022-08-18 11:32:01 -07:00
Evan Yeung 5f8808a4f8 Deploy 0.185.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D38810908

fbshipit-source-id: a397d899ce436a65d187eee8369b6e5bfa405539
2022-08-17 21:59:58 -07:00
Tim Yung be8fe7a9c1 Configure `@react-native-community/eslint-config` as a yarn workspace (#34423)
Summary:
Changes the React Native base ESLint configuration to consume `react-native-community/eslint-config` as a [yarn workspace](https://classic.yarnpkg.com/lang/en/docs/workspaces/), so that any dependencies of `react-native-community/eslint-config` can also be resolved from the root directory of `react-native`.

Previously, `~/.eslintrc.js` extended `react-native-community/eslint-config` using a relative file path. This is problematic because if any dependencies (notably, optional peer dependencies such as some of the TypeScript dependencies) are not already installed at the root directory of `react-native`, running ESLint could fail to resolve any required dependencies. In other words, there was an implicit dependency that `react-native/yarn.lock` would also contain any dependencies required by `react-native/packages/eslint-config-react-native-community/yarn.lock`.

With this change, running `yarn` from the root directory of `react-native` will also install any dependencies of `react-native-community/eslint-config`, and it will also symlink `react-native/node_modules/react-native-community/eslint-config` to `../../packages/eslint-config-react-native-community` (meaning any local changes to the config will still be reflected during active development).

## Changelog

[Internal]

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

Test Plan:
Successfully install dependencies and run ESLint.

```
$ cd react-native
$ yarn
$ yarn lint
```

Successfully run Danger on https://github.com/facebook/react-native/pull/34401 (which would previously fail because `typescript-eslint/eslint-plugin` could not be resolved from the root directory of `react-native`):

```
$ cd react-native/bots
$ yarn
$ node ./node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34401
```

Reviewed By: NickGerleman

Differential Revision: D38710285

Pulled By: yungsters

fbshipit-source-id: a06ceea0884a90be60f6f5db9a5d42be52a951d5
2022-08-15 18:48:01 -07:00
Lorenzo Sciandra 7e580b97bf chore(deps): bump CLI to latest v9 alpha (#34385)
Summary:
Bump CLI to latest v9 alpha so that I can then chery-pick in 0.70-stable branch for next RC

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

[General] [Changed] -  bump CLI to latest v9-alpha11

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

Test Plan: N/A

Reviewed By: robhogan

Differential Revision: D38615615

Pulled By: dmitryrykun

fbshipit-source-id: ea5dd7b93f4ed3bb82347fd730b8e65e8a89a6ca
2022-08-11 07:24:53 -07:00
Samuel Susla 434adbdb00 React Native sync for revisions d300ceb...9e3b772
Summary:
Sync goes to v18.2 release.

I had to manually trigger CircleCI builds because TTL for build artefacts is 30 days.

This sync includes the following changes:
- **[060505e9d](https://github.com/facebook/react/commit/060505e9d )**: Fix misapplying prod error opt-out ([#24688](https://github.com/facebook/react/pull/24688)) //<Josh Story>//
- **[47944142f](https://github.com/facebook/react/commit/47944142f )**: `now` isn't part of the react-reconciler config anymore ([#24689](https://github.com/facebook/react/pull/24689)) //<Mathieu Dutour>//
- **[b34552352](https://github.com/facebook/react/commit/b34552352 )**: [Fizz] Support abort reasons ([#24680](https://github.com/facebook/react/pull/24680)) //<Josh Story>//
- **[79f54c16d](https://github.com/facebook/react/commit/79f54c16d )**: Bugfix: Revealing a hidden update ([#24685](https://github.com/facebook/react/pull/24685)) //<Andrew Clark>//
- **[7e8a020a4](https://github.com/facebook/react/commit/7e8a020a4 )**: Remove extra Server Context argument ([#24683](https://github.com/facebook/react/pull/24683)) //<Sebastian Markbåge>//
- **[4f29ba1cc](https://github.com/facebook/react/commit/4f29ba1cc )**: support errorInfo in onRecoverableError ([#24591](https://github.com/facebook/react/pull/24591)) //<Josh Story>//
- **[1cd90d2cc](https://github.com/facebook/react/commit/1cd90d2cc )**: Refactor of interleaved ("concurrent") update queue ([#24663](https://github.com/facebook/react/pull/24663)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions d300ceb...9e3b772

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D38496392

fbshipit-source-id: 3ecffc2b3354104562eb23a2643fe0a37a01a7e6
2022-08-08 16:44:55 -07:00
Christoph Purrer 377aa7a30f Make clang-format work in M1 (Apple Silicon)
Summary:
- Current version of clang-format does not work on Apple M1/M2/... chipsets https://github.com/angular/clang-format/issues/78

Changelog:
[General][Fixed] - Make clang-format work in M1 (Apple Silicon)

Reviewed By: cortinico

Differential Revision: D38505844

fbshipit-source-id: c94a71dea82217e725a3609d72692a15a8fe22e0
2022-08-08 13:40:38 -07:00
Nicola Corti 9a80bb7197 Update caniuse-lite with `npx browserslist@latest --update-db`
Summary:
We have a older version of caniuselite in the yarn.lock.
This is causing several warnings on console which I'm resolving with:
`npx browserslist@latest --update-db`

Changelog:
[Internal] [Changed] - Update caniuse-lite with `npx browserslist@latest --update-db`

Reviewed By: cipolleschi

Differential Revision: D38459471

fbshipit-source-id: 4476e2f925f693e4aff457b80906faa51247772c
2022-08-08 04:02:06 -07:00
Marshall Roch 39b48b1c1d Upgrade to Flow 0.184.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D38415143

fbshipit-source-id: f5c672dc7fca7e0e81a65963cbd148bfca5deaf3
2022-08-03 21:07:47 -07:00
Michał Pierzchała c504d038c4 chore: upgrade RN CLI to v9.0.0-alpha.9 (#34322)
Summary:
Upgrades the React Native CLI to v9.0.0-alpha.9 with Metro 0.72 and package size improvements

cc kelset cortinico huntie

## Changelog

[General] [Changed] - Upgrade RN CLI to v9.0.0-alpha.9

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

Test Plan: CI

Reviewed By: huntie

Differential Revision: D38318313

Pulled By: robhogan

fbshipit-source-id: 1a038ba90ae648307c9acb7c0c631511d344689e
2022-08-01 12:37:09 -07:00
Alex Hunt 44ded6bcc6 Upgrade Metro dependencies to 0.72.0
Summary:
Metro release notes:  https://github.com/facebook/metro/releases/tag/v0.72.0

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D38245699

fbshipit-source-id: d14cfda8c694f11ffacfb959cf81aa8906923648
2022-07-29 04:11:53 -07:00
Marshall Roch 1af2beaaa3 Upgrade to Flow 0.183.1
Summary: Changelog: [Internal]

Reviewed By: evanyeung

Differential Revision: D38264284

fbshipit-source-id: 8e2d6f99914b282ab1ef8ede60e5ac236747faf4
2022-07-28 18:21:07 -07:00