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

25659 Коммитов

Автор SHA1 Сообщение Дата
Nicola Corti 4a336f0637 Move `yoga` to be consumed via prefab
Summary:
This removes the old way of consuming `libyoga.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `yoga` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927496

fbshipit-source-id: f7ab2a3aab3cb42effa648dfeff6711d183260e4
2022-09-29 07:08:21 -07:00
Nicola Corti 8717d2d672 Move `react_renderer_mapbuffer` to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_renderer_mapbuffer.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_renderer_mapbuffer` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927266

fbshipit-source-id: e82c2bda02c85a2a6747b92a3f20f2a5118bda65
2022-09-29 07:08:21 -07:00
Nicola Corti f37b3bc052 Move `fabricjni` to be consumed via prefab
Summary:
This removes the old way of consuming `libfabricjni.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `fabricjni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927210

fbshipit-source-id: dbd8814a6cad38d09484561120df911ab24b5f8a
2022-09-29 07:08:21 -07:00
Nicola Corti 3e5b9d4f5e Move `glog` to be consumed via prefab
Summary:
This removes the old way of consuming `libglog.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `glog` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927147

fbshipit-source-id: 99f0241da1dece0efc8d928c3d25f30f3fa48a09
2022-09-29 07:08:21 -07:00
Nicola Corti 277a64f03e Move `jsi` to be consumed via prefab
Summary:
This removes the old way of consuming `libjsi.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `jsi` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39924434

fbshipit-source-id: cb92d3a4ed6cb87e75462082506f310feb7bec9f
2022-09-29 04:39:37 -07:00
Nicola Corti 7c55e6cd7e Move `rrc_view` to be consumed via prefab
Summary:
This removes the old way of consuming `librrc_view.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `rrc_view` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39924231

fbshipit-source-id: 231809631f807ea2ea40d2581759f391adfba94d
2022-09-29 04:39:37 -07:00
Nicola Corti 93bb05afd4 Move `react_render_graphics` to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_graphics.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_graphics` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39923620

fbshipit-source-id: 9edb6557b4d195e1703b1ae532ca14126930a43a
2022-09-29 04:39:37 -07:00
Nicola Corti 6ebc89f09c Move `react_render_core` to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_core.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_core` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39923551

fbshipit-source-id: b800d4369f0de8edbc68b11d9efecf2cb5ea68c1
2022-09-29 04:39:37 -07:00
Nicola Corti 268a4cb268 Move `react_newarchdefaults` to be consumed via prefab
Summary:
This removes the old way of consuming `react_newarchdefaults.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_newarchdefaults` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39857115

fbshipit-source-id: 194a75b530b21e593b0390565a3b91155e07f17e
2022-09-29 02:53:10 -07:00
Rujin Cao bc1bc36a0c @emails -> @oncall (misc)
Differential Revision: D39905970

fbshipit-source-id: 020901c455628bfbb7163adf0a7b7672fc39123a
2022-09-28 17:04:06 -07:00
Luna Wei 4cdacb1bab Image Background
Summary: Changelog: [Internal] Flow ImageBackground

Reviewed By: christophpurrer

Differential Revision: D39754591

fbshipit-source-id: dfd1386e32186a3f903f7c01f77698a54c58939d
2022-09-28 15:48:40 -07:00
Luna Wei 167965aedd Image
Summary: Changelog: [Internal] Flow Image

Reviewed By: christophpurrer

Differential Revision: D39754592

fbshipit-source-id: 2866bbdbdf7b743a55c58079981765d57bce914a
2022-09-28 14:06:42 -07:00
Luna Wei 5014a39286 FlatList
Summary: Changelog: [Internal] Flow declaration for FlatList

Reviewed By: yungsters

Differential Revision: D39831687

fbshipit-source-id: 35d962b7dfe4b10fc5640320a2d5037a7057a49d
2022-09-28 13:41:29 -07:00
Nicola Corti 527cc34267 Move `react_render_componentregistry` to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_componentregistry.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_componentregistry` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39856487

fbshipit-source-id: 98006054481a5635ee3241e3281455cd934eca08
2022-09-28 12:58:21 -07:00
Nicola Corti 86fcab613f Move `react_debug` to be consumed via prefab
Summary:
This removes the old way of consuming `react_debug.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_debug` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39889945

fbshipit-source-id: e31f3c3027718a54c0a7228db00d145c1f3f7873
2022-09-28 12:18:18 -07:00
Luna Wei 628db1fcd3 PixelRatio
Summary: Changelog: [Internal] Flow typing PixelRatio

Reviewed By: yungsters

Differential Revision: D39588444

fbshipit-source-id: c1c358799e8012398b0b66f46bb58964a5d6c77f
2022-09-28 11:47:44 -07:00
Tim Yung 1a28058ac3 RN: Switch to `Choco-Install` from Windows Hermes CI (#34811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34811

Switches the Windows Hermes CI step to use `Choco-Install` which implicitly supports retries for more reliable builds.

See: https://github.com/actions/runner-images/pull/721

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D39890407

fbshipit-source-id: 69c03845d2f2160fb39219dd4a5fff90a00de278
2022-09-28 10:57:07 -07:00
Tim Yung 833661452d RN: Make `retry3` Portable in CI Scripts
Summary:
Moves the `retry3` utility function into its own file so that it can be reused in other steps that are not related to Android.

Changelog:
[Internal]

Reviewed By: rickhanlonii, cipolleschi

Differential Revision: D39889996

fbshipit-source-id: bf79cc19ad6178af0a0d8117a81116e0c32f4333
2022-09-28 10:57:07 -07:00
Vic 7f061f8651 Refactor: removed duplicated words in comments (#34807)
Summary:
Found and removed duplicates of the word "the" in comments.

## Changelog

[Internal] [Removed] – Removed duplicates of the word "the" in comments.

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

Test Plan: Not applicable.

Reviewed By: yungsters, cipolleschi

Differential Revision: D39880587

fbshipit-source-id: b7277aa70604902929903c31ab69d4c532f2667a
2022-09-28 09:08:27 -07:00
Nicola Corti 278dad6438 Move `react_codegen_rncore` to be consumed via prefab
Summary:
This removes the old way of consuming `react_codegen_rncore` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_codegen_rncore` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39855726

fbshipit-source-id: a8ee00ea31422a20832909b9d7e5a8123cf88c84
2022-09-28 08:32:03 -07:00
Nicola Corti 83048da5b8 Move `runtimeexecutor` to be consumed via prefab
Summary:
This removes the old way of consuming `runtimeexecutor` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `runtimeexecutor` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39852978

fbshipit-source-id: 87795118f1bcf496a3c50791f920d8b230932555
2022-09-28 08:32:03 -07:00
Nicola Corti 4bcb0ab762 Move `turbomodulejsijni` to be consumed via prefab
Summary:
This removes the old way of consuming `turbomodulejsijni.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `turbomodulejsijni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39851647

fbshipit-source-id: 6201546ad47a53b366a54b022457fce7b744f064
2022-09-28 08:32:03 -07:00
Tim Yung 85f3e2416f RN: Fix `no-react-native-imports` for Windows
Summary:
This lint rule (and the associated Jest test) fails because `path` on Windows outputs backslashes. This diff fixes the rule.

Changelog:
[Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D39887464

fbshipit-source-id: b75480ccf4dcc384e2f7b91d8dcaf3af5f341434
2022-09-28 08:16:49 -07:00
Cedric van Putten c5a2d571ab Update Expo domain to expo.dev (#34799)
Summary:
Some time ago, we moved the Expo domain over to `expo.dev` ([see this PR for example](c5e091a015)). This does the same thing here :)

## 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 - Update Expo domain to expo.dev

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

Test Plan: Just a minor change, unrelated to React Native code.

Reviewed By: lunaleaps

Differential Revision: D39867749

Pulled By: lunaleaps

fbshipit-source-id: f6ad6350d991ffe1ef8310415e28ae49ed776afc
2022-09-28 07:17:47 -07:00
Tim Yung 4f83498462 RN: Replace `error-subclass-name` with `require-extends-error` ESLint Rule
Summary:
Removes the `error-subclass-name` ESLint rule from `react-native/eslint-plugin`, and implements a new `require-extends-error` ESLint rule inside the React Native repository. This rule was only intended to be used for internal development of React Native.

This will change `react-native/eslint-plugin` to no longer provide the `error-subclass-name` rule.

NOTE: One behavior difference here is that I also implemented the desired behavior of checking classes that extend `Library.SomeError`.

Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `error-subclass-name` rule.

Reviewed By: lunaleaps

Differential Revision: D39858882

fbshipit-source-id: 27b53216d77a15b3425bd9669dbc9d954c1c61da
2022-09-27 14:37:29 -07:00
Tim Yung 1ec69b1823 RN: Move `no-haste-imports` ESLint Rule into Repository
Summary:
Moves the `no-haste-imports` ESLint rule into the React Native repository because it was only intended to be used for internal development of React Native.

This will change `react-native/eslint-plugin` to no longer provide the `no-haste-imports` rule.

Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `no-haste-imports` rule.

Reviewed By: lunaleaps

Differential Revision: D39858883

fbshipit-source-id: b8d91ce5996b615341cf60c6f839afac1e26dac9
2022-09-27 14:37:29 -07:00
Nicola Corti 49b14cc603 Move `react_render_debug` to be consumed via prefab (#34802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34802

This removes the old way of consuming `libreact_render_debug.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_debug` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39849622

fbshipit-source-id: 45451dfe92ecce94d1b466094baae05a75ed803f
2022-09-27 09:30:50 -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
Tim Yung 7c08d07115 RN: Change Internal Imports to Relative Paths
Summary:
Fixes all internal import statements directly referencing the `react-native` package to instead use relative paths.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D39831223

fbshipit-source-id: 510123e5fc8f6845f96d1b55c67e0e59cb401beb
2022-09-27 09:22:58 -07:00
Tim Yung 908571de2f RN: Fix Existing Lint Warnings
Summary:
Fixes all existing lint warnings in React Native.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D39831224

fbshipit-source-id: 6ad3fc3fc7dbb9c24cdb4ff4a99639bad27c1901
2022-09-27 09:22:58 -07:00
Nick Gerleman bf05df1723 Remove flexlayout from react-native
Summary: We have decided not to go forward yet with using flexlayout in react-native. This change removes it for now.

Reviewed By: JTYim

Differential Revision: D39822037

fbshipit-source-id: 726e8657b62e6b4e55e5f72be3ca5539d317348e
2022-09-27 07:46:55 -07:00
Nick Gerleman b788b6e1c9 Fix `analyze_code` CircleCI Job (#34801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34801

D39796598 (8cdc9e7f04) broke this CircleCI job, causing failures for `dtslint` and `prettier`. This fixes both issues, by upating formatting, and removing types from `legacy-properties.d.ts` that we no longer export.

These were not flagged by sandcastle. It looks like this is because:
1. We run eslint, but not dtslint internally
2. Arcanist will ignore anything under a "vendor" directory, while we do not exlude anything from the prettier check in OSS.

I also updated the eslint config to lint any TypeScript that appears outside the types directory, since typings are now spread out.

Changelog:
[Internal][Fixed] - Fix `analyze_code` CircleCI Job

Reviewed By: cipolleschi

Differential Revision: D39848604

fbshipit-source-id: 844dfe26e4b618059542b29df163402079c39322
2022-09-27 07:11:10 -07:00
Zihan Chen (MSFT) 8dc6bec719 Fix interface support in turbo module TypeScript codegen (component only) (#34778)
Summary:
Interface was supported in component, but it only allows interfaces in limited cases.

In this change, I extended interface support to all places where object literal type is supported.

I also refactor the code so that properties and events are able to share the same implementation.

In order not to mess up the diff, I noticed that implementations are repeated in processing array properties and non-array properties. But I leave it without refactoring. I will do it in future PRs.

I also commented potential problems I found in the code.

## Changelog

[General] [Changed] - Fix interface support in turbo module TypeScript codegen (component only)

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

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

Reviewed By: cortinico

Differential Revision: D39809230

Pulled By: cipolleschi

fbshipit-source-id: cfb51ce915249b5abceafee1c08b7e5762d03519
2022-09-27 06:59:57 -07:00
Thibault Malbranche e78a495900 add 0.69.6 changelog (#34798)
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.69.6

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D39848387

Pulled By: dmytrorykun

fbshipit-source-id: a8448f5bb1d3c65337038b9ac270416d34d88cfc
2022-09-27 06:34:10 -07:00
Nicola Corti 6125f1f866 Fix crash on release versions after AGP 7.3 bump (#34797)
Summary:
Release versions are currently broken on `main`. This happened once we bumped the AGP version to 7.3. It seems like that the path we used to use for assets has changed.

The app build successfully but it fails to start as it can't load the bundle.

This is also causing the hermes e2e test to fail: https://github.com/facebook/hermes/pull/821

## Changelog

[Android] [Fixed] - Fix crash on release versions after AGP 7.3 bump

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

Test Plan:
Tested this locally and it works fine with RN Tester (can run a release version of it).

Plus, inspecting the zip:

### Before

```
$ unzip -l packages/rn-tester/android/app/build/outputs/apk/hermes/release/app-hermes-arm64-v8a-release.apk | grep android.bundle
  1248608  01-01-1981 01:01   assets/mergeHermesReleaseAssets/RNTesterApp.android.bundle
```

### After

```
$ unzip -l packages/rn-tester/android/app/build/outputs/apk/hermes/release/app-hermes-arm64-v8a-release.apk | grep android.bundle
  1248608  01-01-1981 01:01   assets/RNTesterApp.android.bundle
```

Reviewed By: cipolleschi

Differential Revision: D39847369

Pulled By: cortinico

fbshipit-source-id: 0e21c0b6e58b49ac097c59223649b74b2879b5e5
2022-09-27 06:19:47 -07:00
evanbacon 5933b6a3ba Use monospace font for RCTRedBox.mm message (#34780)
Summary:
The format is crunching spaces:

![Simulator Screen Shot - iPhone 14 Pro Max - 2022-09-24 at 16 25 33](https://user-images.githubusercontent.com/9664363/192119593-30d5c82f-9f8c-465d-af29-6914d4111351.png)

Now it preserves the space and makes the error look a little less scary:

![Simulator Screen Shot - iPhone 14 Pro Max - 2022-09-24 at 16 25 02](https://user-images.githubusercontent.com/9664363/192119603-8214a38b-6511-413b-b999-5d2739cd0293.png)

## 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] - RedBox title font by using a monospace font on iOS +13.

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

Test Plan: See pictures. You can repro by applying changes and starting a project with a misc `>` character. The first load triggers the error message.

Reviewed By: cipolleschi

Differential Revision: D39798262

Pulled By: robhogan

fbshipit-source-id: d836e50f3e95865a6482accf4aea5b0e6cf24995
2022-09-27 04:51:52 -07:00
Gabriel Donadel Dall'Agnol 14c91cdf59 feat: Add string support for aspectRatio (#34629)
Summary:
This updates `aspectRatio` to support string values and ratio formats, i.e., `'16 / 9'`, thus aligning it with the [CSS Box Sizing Module Level 4](https://drafts.csswg.org/css-sizing-4/#aspect-ratio) specification as requested on https://github.com/facebook/react-native/issues/34425. This also adds unit tests to the `processAspectRatio` function ensuring the style processing works as expected.

## Changelog

[General] [Added] - Add string support for aspectRatio

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

Test Plan:
This can be tested either through `processAspectRatio-tests` or by using the following code:

```js
 <View
   style={{
     backgroundColor: '#527FE4',
     aspectRatio: '16 / 9',
  }} />
```

https://user-images.githubusercontent.com/11707729/189029904-da1dc0a6-85de-46aa-8ec2-3567802c8719.mov

Reviewed By: jacdebug

Differential Revision: D39423304

Pulled By: cipolleschi

fbshipit-source-id: d323de93d6524e411e7ab9943335a8ca323b6e61
2022-09-27 04:05:52 -07:00
Gabriel Donadel Dall'Agnol 71fda5e0c2 feat: Add alt prop to Image component (#34550)
Summary:
This adds the `alt` prop to the `Image` component as requested on https://github.com/facebook/react-native/issues/34424. Using this new `alt` prop enables the `accessibility` prop and passes down the alt text to `accessibilityLabel`. This PR also updates RNTester ImageExample in order to facilitate the manual QA.

#### Open questions
 - ~~On web `alt` text is displayed on the page if the image can't be loaded for some reason, should we implement this same behavior if the `Image` component fails to load `source`?~~ Not for now

## Changelog

[General] [Added] - Add alt prop to Image component

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

Test Plan:
1. Open the RNTester app and navigate to the Image page
2. Test the `alt` prop through the `Accessibility Label via alt prop` section, this can be tested either by enabling Voice Over if you're using a real device or through the Accessibility Inspector if you're using a simulator

https://user-images.githubusercontent.com/11707729/187790249-0d851363-c30e-41b6-8c24-73e72467f4ba.mov

Reviewed By: lunaleaps

Differential Revision: D39618453

Pulled By: cipolleschi

fbshipit-source-id: 0e26b2574514e76ce7e98ddb578f587a9cc30ee9
2022-09-27 04:05:15 -07:00
Pavol Fulop f85e2ecc40 Include existing height when calculating new one for KeyboardAvoidingView (#34749)
Summary:
Currently, height is sometimes the only valid option for pushing `TextInput` up in the layout on Android. The problem is when switching keyboards. For instance, switching from ABC to emojis. This will trigger keyboard show events and recalculate the height for the `KeyboardAvoidingView`. Since the keyboard is still showing, the view has the height that was previously calculated and thus `frame` represents that. This means the `frame.height` has adjustments for the keyboard calculated in it, but it is used the same way as if the keyboard was not showing. This results in wrong calculation and the input showing at the incorrect place in the layout (mostly hidden under the keyboard)

This fix simply uses the previous calculation to offset `frame.height`, resulting in the correct height and smooth switching between keyboards. It's also scoped only to height mode since that's where the problem shows.

_Note: I mention android here, but it fixes it for both platforms. It's just that iOS usually works best with different behaviour so it's rarely used there._

## Changelog

[General] [Added] - Include `this.state.bottom` when calculating new keyboard height to fix android keyboard switching

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

Test Plan:
With simple code:

```jsx
import { StatusBar } from "expo-status-bar";
import React from "react";
import {
  KeyboardAvoidingView,
  StyleSheet,
  Text,
  TextInput,
  View,
} from "react-native";

export default function App() {
  return (
    <KeyboardAvoidingView style={styles.container} behavior="height">
      <Text>Open up App.js to start working on your app!</Text>
      <StatusBar style="auto" />
      <TextInput style={{ backgroundColor: "red", width: "100%" }} />
    </KeyboardAvoidingView>
  );
}

const styles = StyleSheet.create({
  container: {
    padding: 32,
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "space-between",
  },
});
```

Notice the consistency of the TextInput after the changes, while before it would just move around more you switch the keyboards.

|  Before  | After  |
|---|---|
| ![2022-09-21 13-59-09 2022-09-21 14_01_44](https://user-images.githubusercontent.com/3984319/191499509-b41280a0-2969-4fe6-8796-c5695b999f27.gif)  | ![2022-09-21 14-03-33 2022-09-21 14_04_30](https://user-images.githubusercontent.com/3984319/191499628-a5832b88-e511-448d-8081-ac48d3a3690a.gif)  |

Reviewed By: cipolleschi

Differential Revision: D39718812

Pulled By: NickGerleman

fbshipit-source-id: 2550182e846f3f8e719d727fa8e6d87165faebf6
2022-09-26 15:10:27 -07:00
Luna 70d86e7647 Updates to ecosystem.md do clarify community roles (#34341)
Summary:
Changelog: [Internal] - Update Ecosystem.md to clarify community roles

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

Reviewed By: cortinico

Differential Revision: D39774550

Pulled By: lunaleaps

fbshipit-source-id: 00f8f58e901f1e35be6f395053fccfb6d841ce55
2022-09-26 14:27:11 -07:00
Nicola Corti 5fb0639e0b Bump react-native-gradle-plugin to 0.71.2
Summary:
We need to bump & publish a new version of the Gradle Plugin.
This is needed otherwise the template will break as I start to remove
entries from the `Android-prebuilt.cmake` file

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

Reviewed By: lunaleaps, mdvacca

Differential Revision: D39815785

fbshipit-source-id: b140187971e2f963ef459e9c83ce9a76e67c89bd
2022-09-26 13:35:48 -07:00
Rachit Mishra 3f3394a566 fix: handle webview provider missing exception (#34456)
Summary:
The [existing fix](fb936dfffb/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java (L151)) to handle missing WebView provider uses string comparison based checks to handle the exception gracefully, or otherwise simply throw the exception. This ends up crashing the app for the end user.

<img width="1319" alt="Screenshot 2022-08-19 at 4 33 31 PM" src="https://user-images.githubusercontent.com/933314/185605137-24757dad-806e-4cca-b000-7d6ce2d191e1.png">

Fatal exceptions are bad in any case and not good user experience, we can gracefully handle this by [returning](https://github.com/facebook/react-native/compare/main...rachitmishra:react-native-1:patch-2#diff-f7ca1976002c4612051e4949395e64511b6f769e347c488e9a0d15cb5331fe76R141) `null` for all cases when WebView provider is not found.

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

[Android] [Fixed] - Gracefully handle crash if no WebView provider is found on the device

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

Test Plan: IMO no testing is required as we were already returning null in certain cases after handling the exception message, also `ForwardingCookieManager::getCookieManager` is already marked `Nullable` so we are safe there.

Reviewed By: lunaleaps

Differential Revision: D39809020

Pulled By: cortinico

fbshipit-source-id: 54b290ad7740859bdc84401904236c32761a4631
2022-09-26 13:30:14 -07:00
Nick Gerleman 8cdc9e7f04 Place TypeScript Declarations Alongside Source Files
Summary:
React Native's TS definitions are currently mostly stored in one monolithic file. This change splits the definitions up to correspond to the source files they came from, and are placed next to the source files. I think this should help inform, and make it easy to update the TS declarations when touching the Flow file.

I noticed as part of the change that the typings have not yet removed many APIs that were removed from RN. This is bad, since it means using the removed/non-functional API doesn't cause typechecker errors. Locating typings next to source should prevent that from being able to happen.

The organization here means individual TS declarations can declare what will be in the RN entrypoint, which is a little confusing. Seems like a good potential next refactor, beyond the literal translation I did.

Changelog:
[General][Changed] - Place TS Declarations Alongside Source Files

Reviewed By: lunaleaps, rshest

Differential Revision: D39796598

fbshipit-source-id: b36366466fd1976bdd2d4c8f7a4104a33c457a07
2022-09-26 12:09:45 -07:00
Sharon Zheng 77e79d6308 Animated.ScrollView with RefreshControl applying Animated transform twice
Summary:
There was a bug on Android when an Animated.ScrollView had a RefreshControl while an Animated style was applied, ie `transform`:
```
<Animated.ScrollView
  refreshControl={<RefreshControl />}
  style={{
    transform: [{
      translateY: new Animated.Value(200, {useNativeDriver: true})
    }]
  }}
/>
```

The transform value was being incorrectly applied twice. Since the styles were applied once on RefreshControl and once on NativeScrollView, the transform style is effectively applied twice:

**1. ScrollView.js**
- RefreshControl gets the transform through Fabric commit
- [The RefreshControl gets wrapped around ScrollView](https://fburl.com/code/k60krxbj) while on iOS there is no change in the parent/child relationship. [Outer/inner styles are split and applied to RefreshControl/ScrollView](https://fburl.com/code/b2to75er), and transform styles are applied on the parent (RefreshControl)

**2. createAnimatedComponent.js**
- NativeScrollView gets the transform through Animated
- [ScrollView forwards its ref to NativeScrollView](https://fburl.com/code/w1whtl5f), which means AnimatedComponent is setting the transform styles on NativeScrollView and not RefreshControl as ScrollView.js did

This diff fixes this bug by using the `useAnimatedProps` hook which makes both RefreshControl and ScrollView components into animated components. Otherwise, the components don't know what to do with Animated values.
 ---
Changelog:
[Internal][Fixed] - Animated transform style properties were being applied twice when used on an Animated.ScrollView with RefreshControl on Android

Reviewed By: javache

Differential Revision: D38815633

fbshipit-source-id: 2b76639d2237176b6aae4fb1e22cf1a1ec70a69a
2022-09-26 11:28:56 -07:00
Tim Yung 8edf4e9e3a Pressability: Eliminate Unit Test Timing Flakiness
Summary:
Currently, it is possible in one of the "minimum press duration" unit tests for certain instructions to take longer than expected, skewing the return value of `Date.now()` by at least 10ms.

This changes the unit test to mock `Date.now()` more accurately so that the test is no longer flakey.

Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D39804152

fbshipit-source-id: ab62fd1921bd015d969da9595bd3267c38c6e59c
2022-09-26 08:49:51 -07:00
Nicola Corti bf55a3a392 Make sure ccache is considered as part of the CMake build
Summary:
I've just realized that CMake is ignoring `ccache`, even if you have it
installed. This is the necessary change needed to verify if the user
has `ccache` installed and eventually use it.

While not a necessary change for Prefab supprot, this is a nice to have
that I've discovered while working on it.

Changelog:
[Internal] [Changed] - Make sure ccache is considered as part of the CMake build

Reviewed By: cipolleschi

Differential Revision: D39815089

fbshipit-source-id: be62e5fe98954593fd907ec21c41950a967cff04
2022-09-26 08:48:04 -07:00
Nicola Corti 61e82aa462 Add the PreparePrefabHeadersTask.kt inside the Gradle Plugin
Summary:
This is part of the preparatory work for Prefab support for React Native.
I've added a task that will help us copy, filter and prepare the headers to
be consumed by Prefab.

It's not used at the moment. I will use it in the next commit.

Changelog:
[Internal] [Changed] - Add the PreparePrefabHeadersTask.kt inside the Gradle Plugin

Reviewed By: cipolleschi

Differential Revision: D39815101

fbshipit-source-id: 73e48666efa372a1647d08a7586083434d9ebbbb
2022-09-26 08:47:28 -07:00
Tim Yung 63903af1f1 msggen: Dependencies Cleanup (#34782)
Summary:
Cleans up the dependencies in `ReactCommon/hermes/inspector/tools/msggen` by

- Analyzing and removing any dependencies that are never referenced.
- Upgrading all dependencies to their latest versions (by deleting `yarn.lock` and re-running `yarn`).
  - I only upgraded Babel dependencies to the same version used by the rest of `react-native`.

Notably, this resolves 13 vulnerabilities reported by Dependabot.

## Changelog

[Internal]

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

Test Plan:
Ran the following successfully:

```
$ cd ReactCommon/hermes/inspector/tools/msggen
$ yarn
$ yarn test
$ yarn build
```

Reviewed By: cortinico, cipolleschi

Differential Revision: D39804478

fbshipit-source-id: c673e80b64fcf49c3f903c5d7f0a68c77d63a4bd
2022-09-26 07:43:13 -07:00
Riccardo Cipolleschi bbb2fb212d Parse custom NativeState in TypeScript (#34786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34786

This diff is the TS equivalent of D39686251.
It introduces the possibility to parse a custom Native State in Typescript.

The parsing follows the exact same rules as props, as initial heuristic. This should allow enough customization for the developers who needs a custom state.

Currently, we only support using `interface` for the state and the interface must contain the `NativeState` string in its name.

This diff introduces also tests for the TypeScript parser and it aligns the tests between Flow and TS.

## Changelog

[General][Added] - Implement custom Native State parsing in TypeScript

Reviewed By: cortinico

Differential Revision: D39811476

fbshipit-source-id: 1e1b86b50b9632c13157ff6c8115f5ebcbada643
2022-09-26 07:33:07 -07:00
Riccardo Cipolleschi 925b15351f Parse custom NativeState in Flow (#34753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34753

This Diff introduce a the capability to parse custom NativeStates in Flow. To achieve this I also had to define the CodegenSchema.

The parsing follows the exact same rules as props, as initial heuristic. This should allow enough customization for the developers who needs a custom state.

There is only a case I was not able to make it work that is STATE_ALIASED_LOCALLY, from the fixtures. I don't know how diffuse it is and I think we can live with some workarounds for the time being.

This diff also adds tests for the custom Native State Flow Parser.

## Changelog
[General][Added] - Implement custom Native State parsing in Flow

Reviewed By: cortinico

Differential Revision: D39686251

fbshipit-source-id: 446997a39b33b7e9351d5ba12cecaeff33df4d16
2022-09-26 07:33:07 -07:00