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

25730 Коммитов

Автор SHA1 Сообщение Дата
Moti Zilberman 19715cf4fb Add .metro-health-check to .gitignore
Summary:
Changelog:
[General][Changed] - Add Metro health check files to the template's `.gitignore`

We're adding an opt-in watcher health check to Metro, which can occasionally leave files named `.metro-health-check*` in the project. To ensure this doesn't clutter people's repos accidentally if enabled, we preemptively add this as a pattern to `.gitignore` in the new project template. We also add it to the React Native repo's `.gitignore` file just in case.

Reviewed By: arushikesarwani94

Differential Revision: D40352040

fbshipit-source-id: 261803b684d79292c014205084e61d5e4f7aeb3d
2022-10-14 06:51:52 -07:00
generatedunixname89002005287564 0fcce547dc supermodule:xplat/default/public.react_native.core
Reviewed By: GijsWeterings

Differential Revision: D40376221

fbshipit-source-id: fa5ff5ed3f053ce6958d7dd03d4f86cd88d86a11
2022-10-14 03:56:06 -07:00
mohitcharkha f645404f5c Extracted UnsupportedModulePropertyParserError into throwIfModuleTypeIsUnsupported function in error-utils.js file (#34966)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts `UnsupportedModulePropertyParserError` exception to `throwIfModuleTypeIsUnsupported` function inside `error-utils.js` file

## 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] [Changed] - Extract `UnsupportedModulePropertyParserError` to `throwIfModuleTypeIsUnsupported` function inside `error-utils.js`

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

Test Plan:
`yarn jest react-native-codegen`
Added unit case in `error-utils-test.js` file

<img width="939" alt="Screenshot 2022-10-13 at 12 14 19 PM" src="https://user-images.githubusercontent.com/86604753/195521643-6a197b51-7038-48f1-8b92-2c8c2786d66b.png">

Reviewed By: christophpurrer

Differential Revision: D40337936

Pulled By: cipolleschi

fbshipit-source-id: 74fb116b48634c5e3b6c11f8b71ad59f290d959e
2022-10-14 03:09:51 -07:00
dhruvtailor7 1e15e21348 extracted `UntypedModuleRegistryCallParserError` to a throwing function in error-utils.js (#34953)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872.
As a part of this PR, `UntypedModuleRegistryCallParserError` is separated into its own throwing function in `error-utils.js` file and is used in both Flow and TypeScript parsers

## Changelog

[Internal] [Changed] - Extract `UntypedModuleRegistryCallParserError` to a separate function inside `error-utils.js` file.

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

Test Plan:
Added unit case in error-utils-test.js file to test the new function.
Output of `yarn jest react-native-codegen` ensures all passed test cases.

<img width="450" alt="Screenshot 2022-10-12 at 12 44 36 PM" src="https://user-images.githubusercontent.com/32268377/195277708-97340db3-f3d8-48a3-9a59-95d2747c67b0.png">

Reviewed By: christophpurrer

Differential Revision: D40297017

Pulled By: cipolleschi

fbshipit-source-id: b02dcf0e110ab903a0d1831783194ae4a543075b
2022-10-14 03:09:51 -07:00
Tarun Chauhan b87d371a38 extract emitMixedTypeAnnotation to parsers-commons (#34954)
Summary:
Create a function emitMixedTypeAnnotation into the parsers-commons.js file to put together this code from [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L400-L404) and [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L435-L440).

Part of https://github.com/facebook/react-native/issues/34872

## 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] [Changed] - Extract emitMixedTypeAnnotation into the parsers-commons

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

Test Plan:
run ```yarn jest react-native-codegen```

<img width="781" alt="image" src="https://user-images.githubusercontent.com/34857453/195291603-f138c64c-1b49-41af-a133-ee366d02706a.png">

Reviewed By: NickGerleman

Differential Revision: D40297103

Pulled By: cipolleschi

fbshipit-source-id: 3ee3569fbfa850ac50df18b74ecc3eefbeb267c9
2022-10-14 03:09:51 -07:00
mohitcharkha c403cd4f11 Extracted content of the case FunctionTypeAnnotation into emitFunction in parsers-primitives file (#34950)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts the content of the case `FunctionTypeAnnotation` into a single `emitFunction` function inside the parsers-primitives.js file and uses it in both Flow and TypeScript parsers

## 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] [Changed] - Extract the content of the case `FunctionTypeAnnotation` into a single `emitFunction` function

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

Test Plan:
Run yarn jest react-native-codegen and ensure CI is green
<img width="984" alt="Screenshot 2022-10-12 at 11 18 54 AM" src="https://user-images.githubusercontent.com/86604753/195260414-136f918f-e4b7-4fcf-b0b9-9142872f3cf9.png">

Reviewed By: christophpurrer

Differential Revision: D40296823

Pulled By: cipolleschi

fbshipit-source-id: 3cac407d260481bd6ae7c3e46642e4c16bba3376
2022-10-14 03:09:51 -07:00
dakshbhardwaj 1eaa092daf extracted `nullguard` function to `parsers-util.js` file (#34952)
Summary:
This PR is a part of https://github.com/facebook/react-native/issues/34872
This PR extracts Extract the `nullGuard` function ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L74-L76), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L74-L76)) into a function in the `parsers-utils.js` file

## Changelog
[Internal] [Changed] - Extracted `nullGuard` function from flow and typescript to a file `parsers-utils.js`.

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

Test Plan:
yarn jest react-native-codegen
<img width="1042" alt="Screenshot 2022-10-12 at 12 52 02 PM" src="https://user-images.githubusercontent.com/22423684/195277414-dc0122f4-603a-4e93-aef1-2ac0c33a960d.png">

Reviewed By: NickGerleman

Differential Revision: D40296951

Pulled By: cipolleschi

fbshipit-source-id: 4fb305fff2e28025496b65ec697d2a59cff77bde
2022-10-14 03:09:51 -07:00
MaeIg c388e6c689 Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function (#34948)
Summary:
This PR aims to extract translateArrayTypeAnnotation logic into a separate function as it is done in typescript folder. This will enable us to extract translateArrayTypeAnnotation function into a shared folder in a later step. It is a task of https://github.com/facebook/react-native/issues/34872:
> Wrap the content of the case Array: and case ReadOnlyArray in [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L106-L107) into a separate function, as it is for the [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L218-L234) parser. This will enable us to unify the two parsers in a later step.

## 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] [Changed] - Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function

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

Test Plan:
yarn flow:
<img width="645" alt="image" src="https://user-images.githubusercontent.com/40902940/195200715-7f60d927-e262-4a94-ad91-a884d37726b8.png">

yarn lint:
<img width="502" alt="image" src="https://user-images.githubusercontent.com/40902940/195200799-7959e068-b5b7-4242-a7b1-7afd80866d7f.png">

yarn jest react-native-codegen:
<img width="381" alt="image" src="https://user-images.githubusercontent.com/40902940/195200775-76957c19-d06d-431c-8555-889a4205374e.png">

Reviewed By: dmytrorykun

Differential Revision: D40296730

Pulled By: cipolleschi

fbshipit-source-id: ad2d965046e25ee000ae6e07075976e5a0c78f1a
2022-10-14 03:09:51 -07:00
harshsiriah bb519ecccb Extracted IncorrectModuleRegistryCallTypeParameterParserError to throwIfIncorrectModuleRegistryCallTypeParameterParserError (#34941)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872.
This PR extracts `IncorrectModuleRegistryCallTypeParameterParserError` exception to a separate function inside an `error-utils.js` file

## Changelog

[Internal] [Changed] - Extract `IncorrectModuleRegistryCallTypeParameterParserError` to a seperate function inside `error-utils.js`

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

Test Plan:
```sh
yarn jest react-native-codegen
```
Added unit case in `error-utils-test.js` file

<img width="940" alt="Screenshot 2022-10-11 at 4 42 03 PM" src="https://user-images.githubusercontent.com/86605635/195076564-3b023c17-661c-4330-805c-0216c4391d59.png">

Reviewed By: dmytrorykun

Differential Revision: D40296642

Pulled By: cipolleschi

fbshipit-source-id: 7c7bba6a4f68e9b8fa4729a7651f22cce6d7ca6e
2022-10-14 03:09:51 -07:00
dakshbhardwaj 76c5b6f7bf Extracted IncorrectModuleRegistryCallArityParserError as a seperate function in error-utils.js (#34940)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts `IncorrectModuleRegistryCallArityParserError` exception to `throwIfIncorrectModuleRegistryCallArityParserError` inside an `error-utils.js` file.

## Changelog
[Internal] [Changed] - Extracted IncorrectModuleRegistryCallArityParserError exception to throwIfIncorrectModuleRegistryCallArityParserError function

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

Test Plan:
Added unit case in error-utils-test.js file

 yarn jest react-native-codegen

<img width="1144" alt="Screenshot 2022-10-11 at 4 04 55 PM" src="https://user-images.githubusercontent.com/22423684/195070498-627d1bb8-53b1-43d3-b410-462e4f0da23a.png">

Reviewed By: dmytrorykun

Differential Revision: D40296626

Pulled By: cipolleschi

fbshipit-source-id: 33a299b1adf6334753c2390a81a54832c9096ec5
2022-10-14 03:09:51 -07:00
Vinay Harwani a33f672625 Extracted UnusedModuleInterfaceParserError to throwIfUnusedModuleInterfaceParserError in error-utils.js (#34939)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts UnusedModuleInterfaceParserError exception to throwIfUnusedModuleInterfaceParserError inside an error-utils.js file.

## 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] [Changed] - Extracted UnusedModuleInterfaceParserError exception to throwIfUnusedModuleInterfaceParserError function

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

Test Plan:
yarn jest react-native-codegen
Added unit case in error-utils-test.js file
<img width="1173" alt="Screenshot 2022-10-11 at 1 56 50 PM" src="https://user-images.githubusercontent.com/87412080/195039924-5a73283b-a8cf-41a5-bcc4-9f619d381240.png">

Reviewed By: dmytrorykun

Differential Revision: D40296568

Pulled By: cipolleschi

fbshipit-source-id: b5ee4520db9c70a57c0c666d26ff3f63f17e9a59
2022-10-14 03:09:51 -07:00
Mohit Charkha ab22e3a834 Extracted MoreThanOneModuleRegistryCallsParserError exception to throwIfMoreThanOneModuleRegistryCalls inside error-utils.js (#34921)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts MoreThanOneModuleRegistryCallsParserError exception to throwIfMoreThanOneModuleRegistryCalls inside an error-utils.js file

## 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] [Changed] - Extracted MoreThanOneModuleRegistryCallsParserError exception to throwIfMoreThanOneModuleRegistryCalls function

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

Test Plan:
yarn jest react-native-codegen
Added unit case in the `error-utils-test.js` file

<img width="936" alt="Extracted MoreThanOneModuleRegistryCallsParserError Test" src="https://user-images.githubusercontent.com/86604753/194876724-8beec16d-4b88-4685-b8a7-a2c89208378a.png">

Reviewed By: NickGerleman

Differential Revision: D40296527

Pulled By: cipolleschi

fbshipit-source-id: 8c0d2854f42918b61ce8569cbfbaee5e90b21398
2022-10-14 03:09:51 -07:00
Gabriel Donadel Dall'Agnol c9338c4597 chore: Extract codegen ModuleInterfaceNotFoundParserError in a separate function (#34922)
Summary:
This PR extracts the codegen `ModuleInterfaceNotFoundParserError` exception into a separate function inside `error-utils.js` so that it can be used by both Flow and Typescript parsers as requested on https://github.com/facebook/react-native/issues/34872. This also adds unit tests to the new `throwIfModuleInterfaceNotFound` function.

## Changelog

[Internal] [Changed] - Extract codegen `ModuleInterfaceNotFoundParserError` in a separate function that can de used by Flow and TypeScript parsers

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

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/194876017-8e98e3d2-4518-4cbe-b7f0-b77a54060b1e.png)

Reviewed By: dmytrorykun

Differential Revision: D40296533

Pulled By: cipolleschi

fbshipit-source-id: 205469b15337f6c3847936a6ef5427b5a9e08665
2022-10-14 03:09:51 -07:00
Paige Sun 84225573c1 1/n Add new JsErrorHandler buck target to parse JS errors in C++
Summary:
Changelog: [Internal][Added] 1/n Add new JsErrorHandler buck target to parse JS errors in C++

This JsErrorHandler.cpp class uses the same regex logic as [stack-trace-parser.js](https://github.com/errwischt/stacktrace-parser/blob/master/src/stack-trace-parser.js#L121) in order to parse JS errors into an array of stack frames.

In RN, stacktrace-parser is called from [Devtools/parseErrorStack.js](8bd3edec88/Libraries/Core/Devtools/parseErrorStack.js (L46)).

Reviewed By: sammy-SC

Differential Revision: D40296024

fbshipit-source-id: 8e1b034e8a1ee1a8cc808bfc36c7104a8f40f9cc
2022-10-13 21:40:08 -07:00
Oleksandr Melnykov a5754720f6 Back out "Set isPressable for onPressIn/Out"
Summary:
Original commit changeset: 583b210127d8

Original Phabricator Diff: D40264432 (f1f7824203)

Changelog: [Internal]

Reviewed By: tomscallon

Differential Revision: D40367340

fbshipit-source-id: 01b9f49b6d12d87d23ea37080ca38902bd26a302
2022-10-13 20:02:03 -07:00
Luna Wei 68f3fb275f Add many pointers example
Summary: Changelog: [Internal] - Add a display example for offset of many pointers

Reviewed By: mdvacca

Differential Revision: D39736111

fbshipit-source-id: 1fb3f1037d7e743ae1a383a4f4ee876e32da4a6a
2022-10-13 18:05:55 -07:00
Héctor Ramos 7f1729a94f Circle CI: Replace string parameters with enums where applicable (#34962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34962

For jobs that take a string parameter, where that string parameter is expected to be one of a set of accepted values, use an enum instead.

If an unexpected value is passed to a enum parameter, then `circleci config validate` will flag the issue.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D40310118

fbshipit-source-id: b8416c415705ff6eba80cc5f0d9bfe670569f732
2022-10-13 13:03:45 -07:00
Luna Wei 3d64d0916d Track state per pointer
Summary:
Changelog: [Internal] - Add more state to PointerEventState per pointer such that `offset` coordinates and `hitPath` accurately reflect each pointer.

This change eagerly calculates the hitPath of every pointer under a MotionEvent.

Reviewed By: mdvacca

Differential Revision: D39736109

fbshipit-source-id: ef76dc19a86eaf9b26f35c6a55781ece6e43eecc
2022-10-13 11:58:16 -07:00
Samuel Susla 26da3ae8c6 Delete feature flag remember_views_on_mount_android
Summary: changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D40303795

fbshipit-source-id: 6337dedab4338a4eac9d081f5274aa1d967d7787
2022-10-13 10:19:28 -07:00
Samuel Susla d6f9adeaec Remove enable_delayed_view_state_deletion_android feature flag
Summary: changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D40299970

fbshipit-source-id: 2569b55450cdb06952316c97a8f77b97ead6ebf4
2022-10-13 10:19:28 -07:00
Nicola Corti 60869d0885 Setup gradle-nexus to automate closing and releasing staging repositories (#34970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34970

I'm setting up `gradle-nexus` on our build to simplify the closing and releasing of staging repositories.
As of now, you'll have to go to Sonatype UI and manually click the release button.

With this plugin, we can instruct CircleCI to do the publishing automatically for us as
part of the nightly/stable release process.

Changelog:
[Internal] [Changed] - Setup gradle-nexus to automate closing and releasing staging repositories

Reviewed By: cipolleschi

Differential Revision: D40342759

fbshipit-source-id: 72e80f4bcc80058d5a6ea562ae136a91b2aeedbb
2022-10-13 09:45:11 -07:00
Nick Gerleman 803a2978e5 Implement method bindings for gap/row-gap/column-gap
Summary:
This adds method bindings for `YGNodeStyleSetGap` and `YGNodeStyleGetGap`.

Changelog:
[Genral][Added] - Implement method bindings for yoga gap/row-gap/column-gap

Reviewed By: yungsters

Differential Revision: D39922411

fbshipit-source-id: 6cbb4d352203d2ec92df162c3f2f2efd02bd9568
2022-10-13 08:18:49 -07:00
Nick Gerleman 1373a7057b Implement gap/row-gap/column-gap (within the C ABI)
Summary:
This extracts the core changes from https://github.com/facebook/yoga/pull/1116, to support gap/row-gap/column-gap, mostly identical, apart from the rename of gaps -> gutters.

The core functionality in this PR looks to be well tested from the fixtures added. I am not an expert in the internals of Yoga, but I am seeing everything that I would expect to. The space for the gap is accounted for in line-breaking, and the accumulated gaps limit the available line-length, before sizing flexible children, so items are sized correctly as to accommodate the gap. Then the gap is used for spacing during main axis and cross-axis justification.

Changelog:
[Genral][Added] - Implement gap/row-gap/column-gap (within the yoga C ABI)

Reviewed By: javache

Differential Revision: D39922410

fbshipit-source-id: 5850f22032169028bd8383b49dd240b335c11d3d
2022-10-13 08:18:49 -07:00
Samuel Susla 51af7cdcde Use nested namespace name
Summary:
changelog: [internal]

Enable two new clang tidy checks:
- modernize-concat-nested-namespaces
- google-build-using-namespace

jest_e2e[run_all_tests]

Reviewed By: rshest

Differential Revision: D40020646

fbshipit-source-id: f3be80b5f829dd0ba376bdd70ed13332e114d48a
2022-10-13 05:07:59 -07:00
Nick Gerleman 971599317b Ship VirtualizedList_EXPERIMENTAL
Summary:
`VirtualizedList_EXPERIMENTAL` is a fork of VirtualizedList. It was originally created for the purpose of keyboard/a11y fixes, which required the list to allow rendering discontiguous regions of cells. So, the large part of the refactor is in the data structure used to represent state (now a sparse bitmask), and building out the render function to operate off the bitmask.

This structure allows pre-rendering areas where we know focus must be able to be synchronously be moved to. This is exercised on platforms like Windows and macOS which fire view level focus events. The new implementation otherwise aims to preserve near-exact list behavior as previously.

Apart from the structure change, the refactor has made the code (subjectively) a lot easier to reason about, and there are now stronger internal invariants than before. The bitmask structure also enables new approaches for nested list stability, and implementing OffScreen.

**Why ship it now?**

Having two implementations has multiple times prevented other changes to VirtualizedList, so it is incurring a constant engineer cost.

At this point, we have a lot of reason to be confident in the maturity of the new list implementation (see the test plan below). So, reconciling the implementations not only unlocks the enhancements of the new list, but unblocks future changes to VirtualizedList.

## Test Plan

1. **Unit tests:** A few dozen unit tests were added to VirtualizedList, validating the regions it renders in response to injected input, across its API surface. Both VirtualizedList implementations must pass the same tests, around expected behavior.
2. **RNTester:** Scenarios in RNTester were manually validated, and all worked as before
3. **New invariants:** I added a lot of internal logic checks and bounds checks as invariant violations, to try to produce signal if any part of the refactor went unexpected in the wild.
4. **MSFT Rollout:** I rolled out the changes as a fork of VirtualizedList at MSFT to a couple of high-usage surfaces using Android, iOS, and Windows on Paper. Some invariant violations were surfaced and fixed, but telemetry showed solid system and scenario health with the change.
5. **Meta import:** Fixed all land-blocking test failures when using the new list. These were confined to updating snapshots, and adding additional checks for invalid input.
6. **Panel apps:** Manually validated top-level surfaces of panel apps in debug/release modes. Fixed a couple of invariant violations and novel usages. Profiled new JS structures against an expensive list with Hermes profiler.
7. **Facebook App Rollout:** After some manual validation of top-level surfaces, the change was rolled out to Facebook for Android and iOS as an experiment. New invariant violations were fixed, and the change has sat in production for several weeks at this point, while measuring impact to metrics like error rate, responsiveness, and impressions.

This is the first introduction to all of OSS, and some Meta internal apps. This means there may still be novel usages of VirtualizedList that were not picked up during testing, but I think there has been enough diligence to roll out what has been tested, and forward fix anything unexpected that might still come up.

Changelog:
[General][Changed] - Ship VirtualizedList_EXPERIMENTAL

Reviewed By: javache

Differential Revision: D40259791

fbshipit-source-id: 63eee9381d197a1e38ae663b2158436ff135c0e1
2022-10-13 05:04:40 -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
Nicola Corti 0e2f090631 Setup publishing for Snapshot and Stable on Maven (#34967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34967

This diff is a preparatory work for publishing artifacts on Maven Central.
What it does is:
1. It sets up all the 3 modules (react-native, hermes-engine, external-artifacts) for publishg
2. Adds coordinates to publish on the Snapshot repository
3. Adds support for appendign -SNAPSHOT version if invoked with `-PisNightly=true`
4. Configures GPG signing of artifacts.

I haven't touched the CircleCI and JS code yet. I'll do it in another diff.

Changelog:
[General] [Changed] - Setup publishing for Snapshot and Stable on Maven

Reviewed By: mdvacca, cipolleschi

Differential Revision: D40146212

fbshipit-source-id: 9321e16f6c18b35bc3ae785749d613085c56e7bc
2022-10-13 03:08:22 -07:00
Vinay Harwani 2934399edd Extracted TypeDeclarationMap from flow and typescript to a common file parsers/utils.js (#34951)
Summary:
This PR is a part of https://github.com/facebook/react-native/issues/34872.
This PR extracts TypeDeclarationMap type from flow and typescript to a common file parsers/utils.js and updates all imports.

## 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] [Changed] - Extracted TypeDeclarationMap from flow and typescript to a common file parsers/utils.js.

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

Test Plan:
yarn jest react-native-codegen
<img width="1129" alt="Screenshot 2022-10-12 at 12 13 48 PM" src="https://user-images.githubusercontent.com/87412080/195270569-fc077863-7e51-49e8-92ef-f3991f838d6a.png">

Reviewed By: NickGerleman

Differential Revision: D40296917

Pulled By: cipolleschi

fbshipit-source-id: d073daf0aadc291d5f9d00c003f0161af9e11319
2022-10-13 02:41:28 -07:00
Nick Gerleman 96027f787a Remove clang-format opt-out for Libraries
Summary:
D31464478 enabled clang-format by default across projects, but opted out directories with a lot of formatting errors. This removes the opt-out, so clang-format is run in that directory as well.

Changelog:
[Internal][Changed] - Remove clang-format opt-out for Libraries

Reviewed By: lunaleaps

Differential Revision: D40310275

fbshipit-source-id: abe154ab466798fbfa010364a3627f40ca18b179
2022-10-13 02:23:13 -07:00
generatedunixname89002005287564 c42d82441a supermodule:ios/isolation/infra.react_native
Reviewed By: jkeljo

Differential Revision: D40294645

fbshipit-source-id: 2a80c40954a4bdf9962efc2dfeaa9913d52b5540
2022-10-12 23:18:43 -07:00
Héctor Ramos 2f5adbb192 Circle CI: Fix release workflow (#34960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34960

Due to a missing cmake dependency, the prepare_package_for_release job will fail.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D40310829

fbshipit-source-id: b8d33397f012a9366bb44634877e6033b4d01caf
2022-10-12 16:19:28 -07:00
Héctor Ramos 1b30df10c6 Remove old __offline_mirrors__ from gitignore
Summary:
Remove old `__offline_mirrors__` from `.gitignore`.
This directory is not synced to GitHub.

Changelog: [Internal]

Reviewed By: fbmal7

Differential Revision: D40245262

fbshipit-source-id: ccc93ea4cb5729432f590f78e463b14ba6e78b22
2022-10-12 15:34:55 -07:00
Héctor Ramos ba1a8bcada Update Podfile.lock with Hermes
Summary:
Update RNTester Podfile.lock after running `pod install` with Hermes enabled, which is the default in open source.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D40197412

fbshipit-source-id: ce57d204b704fda85cae7f2966e479e80db25e1b
2022-10-12 15:34:55 -07:00
Héctor Ramos 041ccf31df Add offline mirrors to .gitignore
Summary:
Add internal CocoaPods offline mirrors paths to .gitignore.

Changelog: [Internal]

Reviewed By: fbmal7

Differential Revision: D40241900

fbshipit-source-id: 712059f6d8f16bbd1964e13d49b257adad8aa8a2
2022-10-12 15:34:55 -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
Héctor Ramos 8950837e7d Circle CI: Test both Hermes and JSC on iOS (#34963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34963

Run iOS tests with JSC and Hermes.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D40310674

fbshipit-source-id: 0ccb45b2334b6c8993f897c60e72572972791290
2022-10-12 15:23:55 -07:00
David 5dd2f2e4b7 fix: Update incorrect `SwitchChangeEvent` type (#34931)
Summary:
I noticed that typescript type for `onChange`  event of `<Switch/>` was incorrect

```tsx
<Switch
  onChange={(event) => {
    // TS
    event.value; // boolean
    event.nativeEvent.value; //TS2339: Property 'value' does not exist on type 'Event'.
    // JS
    console.log(event.nativeEvent); // {value:false,target:87}
    console.log(event.value); // undefined
  }}
/>
```

## Changelog

[General] [Changed] - Typescript: update incorrect `SwitchChangeEvent` type

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

Test Plan: ...

Reviewed By: lunaleaps

Differential Revision: D40240552

Pulled By: skinsshark

fbshipit-source-id: 4d39d547778de4ac4dc6c94471f05bfbe157d0e5
2022-10-12 13:05:35 -07:00
fwcd 0c5ef573fe Add destructuredArrayIgnorePattern to eslint config (#33552)
Summary:
This adds the `destructuredArrayIgnorePattern` rule [recently introduced in `typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint/issues/4691), making underscored identifiers in array destructurings no longer an error, e.g.

```js
const [state, _dispatch] = useContext(MyContext);
```

would be acceptable if `state` is used.

## Changelog

[General] [Added] - Add destructuredArrayIgnorePattern to eslint config

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

Test Plan: Install the `react-native-community/eslint-config` package and test the example.

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D40166101

Pulled By: ryancat

fbshipit-source-id: 1e30297bf40d65e09682c4f9f3b3dd432ba5310e
2022-10-12 11:41:50 -07:00
Héctor Ramos 51f2027922 Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886

## Reduced cache size

The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.

This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:

```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
  * /Users/distiller/react-native/sdks/hermes/build_host_hermesc
  * /Users/distiller/react-native/sdks/hermes/build_iphoneos
  * /Users/distiller/react-native/sdks/hermes/build_catalyst
  * /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
  * /Users/distiller/react-native/sdks/hermes/build_macosx
  * /Users/distiller/react-native/sdks/hermes/destroot

Downloading cache archive...
Unarchiving cache...
```

Size: 5.2 GiB
Time to restore cache: 183s

This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:

```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
  * /Users/distiller/react-native/sdks/hermes/build_macosx
  * /Users/distiller/react-native/sdks/hermes/destroot

Downloading cache archive...
Unarchiving cache...
```

Size: 1.3 GiB
Time to restore cache: 42s

**This is a size reduction of 75%, and execution time reduction of 77%.**

This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.

## Added `export_hermesc`

As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts

## Refactoring of magic strings into reusable yaml references

Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D40153737

fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 09:55:31 -07:00
Eric Rozell f1f7824203 Set isPressable for onPressIn/Out (#34944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34944

In react-native-windows, the ability to detect a press event on a virtual span is dependent on setting a native only `isPressable` prop.

This modifies the Text component to include `onPressIn` and `onPressOut`. As a side-effect, this will also lazily initialize the pressability config when `onPressIn` or `onPressOut` only is set.

Changelog:
[General][Fixed] - Pressability for text with only `onPressIn` / `onPressOut` props

Reviewed By: yungsters

Differential Revision: D40264432

fbshipit-source-id: 583b210127d8f020ad98030d4a5381c302e88d2a
2022-10-12 09:35:43 -07:00
Lorenzo Sciandra 4a786d6b0d add 0.70.3 changelog (#34958)
Summary:
Adds changelog for new patch.

## 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] [Changed] - add changelog entry for 0.70.3

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

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D40302608

Pulled By: dmytrorykun

fbshipit-source-id: eebc98e0fccd61260fac6ff5ea9a83b0d81abfbf
2022-10-12 09:07:22 -07:00
Nicola Corti 90faf0f254 Move configureDevPorts inside AgpConfiguratorUtils and use finalizeDsl
Summary:
This moves configureDevPorts inside AgpConfiguratorUtils, and makes it use
finalizeDsl. This removes a deprecated API `BaseVariant` which is causing a
build warning for all the users + it's a step towards making RNGP fully variant aware.

Changelog:
[Internal] [Changed] - Move configureDevPorts inside AgpConfiguratorUtils and use finalizeDsl

Reviewed By: cipolleschi

Differential Revision: D40139558

fbshipit-source-id: 1e5b8661b8d223a603f8ab5d160edd2133304d92
2022-10-12 04:34:28 -07:00
Nicola Corti 20a8dcdd93 Suppress deprecation on reactRoot passed as deprecatedReactRoot
Summary:
I'm suppressing this deprecation on `reactRoot` as it's unnecessary.
It creates noise and the usage is actually legit.

Changelog:
[Internal] [Changed] - Suppress deprecation on reactRoot passed as deprecatedReactRoot

Reviewed By: cipolleschi

Differential Revision: D40139555

fbshipit-source-id: f3755f020ab1dceb17d0fdd18c6c8e374c87c60c
2022-10-12 04:26:35 -07:00
Riccardo Cipolleschi dd607a8f2d Add more customization points in RCTAppDelegate (#34943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34943

The RCTAppDelegate class is the new way we have to encapsulate logic we don't want to leak to the average user.

However, some advanced users, like Expo users, may need more options to customize their setup.

This Diff provides more methods to extend the AppDelegate.

## Changelog
[iOS][Added] - Add more extension points for RCTAppDelegate

Reviewed By: cortinico

Differential Revision: D40262513

fbshipit-source-id: 9365a51d938a586b1508233bfa63693cf9aebf7a
2022-10-12 04:11:08 -07:00
Christoph Purrer 9f465ea0ff Make react-native-codegen work on Windows within BUCK
Summary:
Changelog
[General][Internal] - Make react-native-codegen work on Windows within BUCK

This makes react-native code-gen work on Windows - by basically filling in some necessary windows commands for the existing bash/shell ones

Reviewed By: cortinico, cipolleschi

Differential Revision: D40268750

fbshipit-source-id: 0db7597999ec8108babf56abed436f6dc7789cce
2022-10-12 03:48:36 -07:00
Nicola Corti 32fc551c55 Cleanup Buck usages from New App Template (#34881)
Summary:
I'm cleaning up the Buck setup in the New App template. It hasn't been touched since 2018 and is currently not working, but will end up being propagated in user space.
This is also affecting the Gradle setup as there is a need to have an extra task just for Buck.

I doubt anyone is using this at this stage. We can get back to it or have a dedicated guide for users that are willing to use it.

## Changelog

[Android] [Remove] - Cleanup Buck usages from New App Template

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

Test Plan: Testing was missing on this API so there is nothing to test here

Reviewed By: cipolleschi

Differential Revision: D40142064

Pulled By: cortinico

fbshipit-source-id: 6c65e1030bf3fe1603bfb7d486f8f3fd7d254126
2022-10-12 03:21:12 -07:00
Gabriel Donadel Dall'Agnol 305f7c3352 chore: Extract codegen case 'Stringish' into a single emitStringish function (#34936)
Summary:
This PR extracts the content of the codegen case `'Stringish'` into a single `emitStringish` function inside the `parsers-primitives.js` file and uses it in both Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872. This also adds unit tests to the new `emitStringish` function.

## Changelog

[Internal] [Changed] - Extract the content of the case 'Stringish' into a single emitStringish function

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

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/194987664-b588b82b-a9e0-49a9-a3cc-a03cb0a230e6.png)

Reviewed By: cipolleschi

Differential Revision: D40255921

Pulled By: rshest

fbshipit-source-id: 9c08f81f12c93995bb6ba032fabcd6451b8dc7c1
2022-10-12 03:06:04 -07:00
youedd b3219fe345 Extract contents of the case 'VoidTypeAnnotation' into a single emitVoid function (#34932)
Summary:
Part of https://github.com/facebook/react-native/issues/34872

This PR:
- extracts the content of the case 'VoidTypeAnnotation' ([Flow](b444f0e44e/packages/react-native-codegen/src/parsers/flow/modules/index.js (L375-L377)), [TypeScript](00b795642a/packages/react-native-codegen/src/parsers/typescript/modules/index.js (L410-L412))) into a single emitVoid function in the parsers-primitives.js file. Use the new function in the parsers.
- unit tests emitVoid function

## Changelog

[Internal] [Changed] - Extract contents of the case 'VoidTypeAnnotation' into a single emitVoid function

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

Test Plan:
` yarn jest react-native-codegen`

<img width="957" alt="image" src="https://user-images.githubusercontent.com/19575877/194931977-d5cfc5f5-c9db-498d-9e5c-ae40a38d3623.png">

Reviewed By: cipolleschi

Differential Revision: D40239730

Pulled By: rshest

fbshipit-source-id: 16a9555223cacbb3b9916fd469bd63f83db33f18
2022-10-12 03:06:04 -07:00
Chenglin Liu a885b1fcfd Add link group label to talkios deps (#34949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34949

Changelog: [Internal]

Currently, link groups depend on supermodules to generate. To continue supporting link groups while allowing us to migrate off supermodules, we'll add a talkios_link_group label on all talkios targets to persist the current hierarchical information.

Reviewed By: jkeljo

Differential Revision: D40268275

fbshipit-source-id: a82e969e7cb8ec167489be73dc9bc71cf8ec37e1
2022-10-11 20:05:05 -07:00
Héctor Ramos 21c8837c12 Bump Circle CI macOS container to Xcode 14.0.1, Ruby to 2.7.6, CocoaPods 1.11.3 (#34884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34884

Xcode 14 is now stable. Updating CI to use latest Xcode command line tools.

The Circle CI 14.0.1 container ships with Ruby 2.7.6 and CocoaPods 1.11.3, see full manifest here: https://circle-macos-docs.s3.amazonaws.com/image-manifest/v8824/index.html

Changelog: [iOS][Changed] Bump to Ruby 2.7.6 and CocoaPods 1.11.3

Reviewed By: mdvacca

Differential Revision: D40148796

fbshipit-source-id: b1eab68e159ec3237ff2ef596163b73fc1e511e4
2022-10-11 18:27:25 -07:00