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

474 Коммитов

Автор SHA1 Сообщение Дата
Brent Kelly 25a2c608f7 Addressing various issues with the Appearance API (#28823) (#29106)
Summary:
This PR fixes a few issues with the Appearance API (as noted here https://github.com/facebook/react-native/issues/28823).

1. For the Appearance API to work correctly on Android you need to call `AppearanceModule.onConfigurationChanged` when the current Activity goes through a configuration change. This was being called in the RNTester app but not in `ReactActivity` so it meant the Appearance API wouldn't work for Android in newly generated RN projects (or ones upgraded to the latest version of RN).

2. The Appearance API wasn't working correctly for brownfield scenarios on Android. It's possible to force an app light or dark natively on Android by calling `AppCompatDelegate.setDefaultNightMode()`. The Appearance API wasn't picking up changes from this function because it was using the Application context instead of the current Activity context.

3. The Appearance API wasn't working correctly for brownfield scenarios on iOS. Just like on Android its possible to force an app light or dark natively by setting `window.overrideUserInterfaceStyle`. The Appearance API didn't work with this override because we were overwriting `_currentColorScheme` back to default as soon as we set it.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

### Fixed

https://github.com/facebook/react-native/issues/28823

* [Android] [Fixed] - Appearance API now works on Android
* [Android] [Fixed] - Appearance API now works correctly when calling `AppCompatDelegate.setDefaultNightMode()`
* [iOS] [Fixed] - Appearance API now works correctly when setting `window.overrideUserInterfaceStyle`

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

Test Plan: Ran RNTester on iOS and Android and verified the Appearance examples still worked [correctly.](url)

Reviewed By: hramos

Differential Revision: D31284331

Pulled By: sota000

fbshipit-source-id: 45bbe33983e506eb177d596d33ddf15f846708fd
2021-10-05 20:23:48 -07:00
Luna Wei 52809688d2 Remove ProgressBar from examples and fix XHRDownloadExample
Summary:
Changelog: [Internal] - Remove usage of ProgressViewIOS and ProgressBarAndroid from RNTester

Note: Android example doesn't properly update progress. Filing an issue here: TODO

Reviewed By: yungsters

Differential Revision: D31328094

fbshipit-source-id: 5afa3bb1079b91bb98fa51587e96402fb1565f82
2021-10-05 17:24:45 -07:00
fabriziobertoglio1987 254493e1fb Fix - TextInput Drawable to avoid Null Pointer Exception RuntimeError #17530 (#29452)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/17530 fixes https://github.com/expo/expo/issues/9905 with the help of sunnylqm https://github.com/sunnylqm

Re-rendering a large number of TextInputs with key prop on the screen will trigger the below Null Pointer Exception Runtime Error

NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'

The error is caused by null.newDrawable(mSourceRes) at

20b012282e/graphics/java/android/graphics/drawable/DrawableContainer.java (L919)

More info https://github.com/facebook/react-native/pull/29452#issuecomment-662616018 https://github.com/facebook/react-native/issues/17530#issuecomment-662000718

The Theme Theme.AppCompat.Light.NoActionBar defines the Drawables for AppCompatEditText in drawable/abc_edit_text_material.xml

https://chromium.googlesource.com/android_tools/+/7200281446186c7192cb02f54dc2b38e02d705e5/sdk/extras/android/support/v7/appcompat/res/drawable/abc_edit_text_material.xml

Removing the following line from the above xml file drawable/abc_edit_text_material.xml fixes the error https://github.com/facebook/react-native/issues/17530#issuecomment-662000718

`<item android:state_pressed="false" android:state_focused="false" android:drawable="drawable/abc_textfield_default_mtrl_alpha"/>`

The Theme default EditText background is replaced with a custom background, which is a copy of the original background without the above item which triggers the Runtime Error. The changes are implemented in RNTester with commit (more info in the commit) 0858d4120d. The new custom drawable used as default background for the TextInput is named edit_text.

`<item name="android:editTextBackground">drawable/edit_text</item>`

The same changes have been added to react-native default template for creating new applications with commit (more info) f3493083df, lean core moved the cli tools to https://github.com/react-native-community/cli, but the default template for creating a new application is stored in facebook/react-native/template.

New applications will be generated with this configurations and will not experience the error, existing react-native applications will fix the error by upgrading with the [upgrade-helper](https://github.com/react-native-community/upgrade-helper).

A Minimum Reproducible Example to reproduce this error is included in commit (more info in the commit) 4a414e2cc7 and https://github.com/facebook/react-native/issues/17530#issuecomment-660017858

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - TextInput Drawable to avoid Null Pointer Exception RuntimeError https://github.com/facebook/react-native/issues/17530

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

Test Plan:
Works in all scenarios on Android.

**<details><summary>CLICK TO OPEN TESTS RESULTS - React Native</summary>**
<p>

Test Results from the Testing in RNTester.

Minimum Reproducible Example added with commit (more info in the commit) 4a414e2cc7

The example included in commit 4a414e2cc7 will cause a [NPE Runtime Error on Master Branch](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/runtime.mp4), while no error is experienced in the [feature branch](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/no_runtime.mp4). The links are video hosted on s3 of this tests (playable by google chrome).

| **[BEFORE](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/runtime.mp4)** | **[AFTER](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/no_runtime.mp4)** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88069187-6edde400-cb71-11ea-81f2-1846144cc6c1.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88069503-d5630200-cb71-11ea-9b87-c5c49845c96d.png" width="300" height="" /> |

The below screenshots were taken to detect any issues with the EditText Background. There is no difference between master and feature branch.

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88071948-c0d43900-cb74-11ea-9a86-522b13e79f04.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074345-90da6500-cb77-11ea-8ced-8b34a3c5a299.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88071966-c598ed00-cb74-11ea-8db8-c07dce3a99b6.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074654-fcbccd80-cb77-11ea-961c-f39a60a1aa62.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88071989-cc276480-cb74-11ea-9eab-9ad4f858d0fb.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074673-00505480-cb78-11ea-8ff5-ea5fc9ef1b8e.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072003-d0ec1880-cb74-11ea-9285-792b2dc08187.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074685-03e3db80-cb78-11ea-86a5-da2700826eea.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072080-e7926f80-cb74-11ea-9f08-bb26eabbd5a0.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074866-4a393a80-cb78-11ea-9b37-80c019909d7d.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072100-ed885080-cb74-11ea-8450-bafa2b7a9989.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074976-7359cb00-cb78-11ea-8bf3-d50566cbb3ba.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072113-f1b46e00-cb74-11ea-9143-7e74872f2670.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074880-502f1b80-cb78-11ea-8bfc-f67efec283d3.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072118-f547f500-cb74-11ea-8ba3-8a245fdf0bc3.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074883-52917580-cb78-11ea-9230-71aeb5c35582.png" width="300" height="" /> |

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88072139-fb3dd600-cb74-11ea-9212-485f788648f1.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88075031-85d40480-cb78-11ea-8068-50f04ebbff54.png" width="300" height="" /> |

| **AFTER** |
|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/88071330-f75d8400-cb73-11ea-800d-359336c8d51e.png"  width="300" height="" />|

</p>
</details>

**<details><summary>CLICK TO OPEN TESTS RESULTS - React Native Cli</summary>**
<p>

As lean core move cli tools to https://github.com/react-native-community/cli, I tested the changes to the template in a separate repository https://github.com/fabriziobertoglio1987/react-native-template and generated the template with the following command

```
npx react-native init ProjectName --template file:///home/fabrizio/Documents/sourcecode/opensource/react-native-template/template
```

The generated app did not experience any issues and includes all the changes in [rn_edit_text_material.xml](https://github.com/fabriziobertoglio1987/react-native-template/blob/master/ProjectName/android/app/src/main/res/drawable/rn_edit_text_material.xml) and [styles.xml](https://github.com/fabriziobertoglio1987/react-native-template/blob/master/ProjectName/android/app/src/main/res/values/styles.xml)

</p>
</details>

Reviewed By: cortinico

Differential Revision: D30684030

Pulled By: lunaleaps

fbshipit-source-id: 7404da0a7259a4bc0405e57e5ed908649d180524
2021-10-01 16:44:02 -07:00
Su Min Kim c9c14ef687 Add switch example (#30611)
Summary:
Add examples for Switch component in RN Tester app for:
- ios_backgroundColor
- onChange

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Added] - Added examples to Switch component

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

Test Plan: ![SwitchExample](http://g.recordit.co/FvniuL2yLl.gif)

Reviewed By: lunaleaps

Differential Revision: D25680480

Pulled By: sota000

fbshipit-source-id: 91202a0d8699554b0535f1a91875fd9fc664d54d
2021-09-29 14:50:14 -07:00
Cristiano Coelho 900210cacc Fix Image defaultSource not showing on iOS (#32172)
Summary:
Fix Image defaultSource not showing on iOS.

This bug was introduced somewhere between RN 0.63 and 0.65. On iOS, defaultSource does not show while the image is being downloaded, only if it fails or there's no internet.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Fix Image defaultSource not showing on iOS

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

Test Plan: Ran both debug and release builds on an iPhone 12 pro (iOS 14.6)

Reviewed By: sammy-SC

Differential Revision: D30822805

Pulled By: lunaleaps

fbshipit-source-id: c4ef18723a8311ef3be1d7ae25ff3c205e8fff62
2021-09-29 01:56:56 -07:00
David Vacca b12256394e Implement SnapToAlignment in ReactHorizontalScrollView
Summary:
This diff implements the SnapToAlignment functionality in ReactHorizontalScrollView for RN Android.

In order to use SnapToAlignment, the pagingEnabled prop should be set

Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)

I still need to verify how different RNiOS and RN Android behaviors are

changelog: [Android][Added] Implement SnapToAlignment in ReactHorizontalScrollView

Reviewed By: JoshuaGross

Differential Revision: D31174544

fbshipit-source-id: 204a82f55e3b7598124ce2528d8ad7d854c0ac77
2021-09-29 01:47:45 -07:00
Héctor Ramos c6907ee488 Bump Xcode to 13.0.0 and CocoaPods to 1.11.2
Summary:
Bump the version of Xcode used in internal and external iOS tests, as well as the CocoaPods version used in RNTester (and therefore, the internal CocoaPods offline mirror).

New versions used:
* Xcode 13.0.0
* CocoaPods 1.11.2

See Circle CI Xcode 13.0.0 macOS Container Software manifest: https://circle-macos-docs.s3.amazonaws.com/image-manifest/v6052/index.html
* Xcode 13.0 Build version 13A233
* CocoaPods	1.11.2

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31253170

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

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

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

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

## Changelog

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

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

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

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

Reviewed By: lunaleaps

Differential Revision: D31248460

Pulled By: fkgozali

fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-28 17:05:24 -07:00
Sota Ogo 499274b99d Add a quick documentation about how to disable Fabric in RNTester
Summary:
OSS uses old architecture and being able to use RNTester as a test ground for non-fabric components.

Changelog: [internal]

Reviewed By: hramos

Differential Revision: D31186468

fbshipit-source-id: d5e7fb679b8ce28ba3050f83cd2d61d42cb4a122
2021-09-24 17:08:52 -07:00
Muhammad Numan 01856633a1 feat: add cancelButtonTintColor props in ActionSheetIOS for change cancel button tint color (#31972)
Summary:
we need to change the text color of the cancel button in `ActionSheetIOS` but `tintColor` changes the all button text color except `destructiveButtonIndex`

so I have added `cancelButtonTintColor` prop to change only the text color of the cancel button

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - added `cancelButtonTintColor` prop for `ActionSheetIOS` to change only the text color of the cancel button

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

Test Plan:
With this PR you can change the cancel text button of `ActionSheetIOS` by this `cancelButtonTintColor` prop

| <img src="https://user-images.githubusercontent.com/36044436/128414537-c4454786-a5cf-49d2-8225-1ff26c9c5058.png"  /> | <img src="https://user-images.githubusercontent.com/36044436/128414549-74a21509-711e-48e0-baf1-3718beae1598.png"  /> | <img src="https://user-images.githubusercontent.com/36044436/128414559-4bee9d1a-ac9f-4cd2-b158-5c4c441158ec.png"  /> |
|-|-|-|

Reviewed By: lunaleaps

Differential Revision: D30878022

Pulled By: yungsters

fbshipit-source-id: c70204f9f2510c75d8e9bed4e0fba79f1c941a1f
2021-09-22 10:44:17 -07:00
Kevin Gozali b0c8a4eee8 Link RCT-Folly against libc++abi
Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

```
Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

See https://github.com/react-native-community/releases/issues/251

Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`.

Changelog: [Fixed][iOS] Unbreak Folly linker error

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
2021-09-16 22:24:10 -07:00
Kevin Gozali 060ea7d94b OSS: use js_glob() for :rn-tester target
Summary:
Use `js_glob()` to guarantee that we're only processing JS related files, not iOS/Android files.

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D30982575

fbshipit-source-id: 9a5466fd16f41558f2bfb294aaed2a551ec4334b
2021-09-16 22:24:10 -07:00
Héctor Ramos fa768df2a3 Codegen: convert spec name to camel case
Summary:
Replace dashes and underscores, use camel case for spec name.

Changelog:
[Internal]

Reviewed By: RSNara

Differential Revision: D30882610

fbshipit-source-id: b66a626296cb709f04c740eae714e89be13abf2c
2021-09-16 14:11:19 -07:00
Nicola Corti 85031d0166 Rename extension to just ReactExtension
Summary:
I'm cleaning up the extension to be just ReactExtension and not ReactAppExtension.
Similarly the name of the extension will be just `react` and not `reactApp`.

Changelog:
[Internal] [Changed] - Rename extension to just ReactExtension

Reviewed By: ShikaSD

Differential Revision: D30964793

fbshipit-source-id: 8a4207825d424e133e51495c34c21284c50363ae
2021-09-16 05:38:51 -07:00
Héctor Ramos ead19e13e1 Use Fabric by default in RNTester
Summary:
It is no longer necessary to specify USE_FABRIC=1 when running `pod install` in order to enable Fabric in RNTester.

Changelog: [INTERNAL]

Reviewed By: fkgozali

Differential Revision: D30977549

fbshipit-source-id: fccc3e433041a710b02ddc516cdff07ce7af2409
2021-09-15 18:34:30 -07:00
Nicola Corti 022f188750 Merge CodegenPluginExtension inside ReactAppExtension
Summary:
This Diff is merging over all the properties from `CodegenPluginExtension` to
`ReactAppExtension`. Some of the properties were duplicate and generally having two
extensions is creating a lot of confusion for the users (e.g. don't know where to place a
specific property).

Therefore I'm merging the two to have only one. I've also updated the property to use the
Gradle Lazy Configuration API.

Changelog:
[Android] [Changed] - Gradle: Merge CodegenPluginExtension inside ReactAppExtension

Reviewed By: ShikaSD

Differential Revision: D30961343

fbshipit-source-id: 66be3157efef356392c0701aaef2283d058d3161
2021-09-15 09:23:23 -07:00
Nicola Corti c3ff336326 Merge the two Gradle Plugins (#32177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32177

This diff merges the `react-native-gradle-plugin` and the `react-codegen/android` into a single plugin.
This will allow us to iterate faster on a single plugin, will create less confusion for our users (`react` vs `reactApp`)
and will help us avoid race conditions when the two plugins are applied together (as we will control the whole lifecycle of it).

Changelog:
[Internal] [Changed] - Merged the two Gradle Plugins

allow-large-files

Reviewed By: ShikaSD

Differential Revision: D30765147

fbshipit-source-id: fcb02a181c7d900daa514107c637d0ee0225976c
2021-09-15 03:21:23 -07:00
Nicola Corti 99bad7015a Fix Broken RN-Tester due to wrong `cliPath` (#32206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32206

After we backported the cliPath fix, I forgot to update the `cliPath` specified for RN-Tester.
See D30899057 (8d4fe826c3). This Diff is fixing it.

Changelog:
[Internal] [Fixed] - Fix Broken RN-Tester due to wrong `cliPath`

Reviewed By: ShikaSD

Differential Revision: D30929640

fbshipit-source-id: 9fd1eaa5985c21e2d04319c4111db5e0a1b4b4ba
2021-09-14 07:20:45 -07:00
Héctor Ramos ef6ad1f2d6 Codegen: Remove generate-specs.sh
Summary:
First part of the codegen script cleanup effort. Everything that was done in generate-specs.sh is now part of the CocoaPods recipe (e.g. codegen method in `react_native_pods.rb`).

Now that `generate-specs.sh` has been removed, the codegen may still be invoked manually for test purposes like so:

```
cd react-native

# Generate Schema - do this whenever your JS specs change
node packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js <output_file_schema_json> <javascript_sources_dir>

# Generate native interfaces for iOS (use schema.json generated by previous step)
node scripts/generate-specs-cli.js ios <output_file_schema_json> <output_dir> <library_name>
```

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30648067

fbshipit-source-id: 29688e0aac5496886657db82becb05bc8da076c9
2021-09-10 17:28:55 -07:00
Luna Wei 14ecf84a9c Add testID to movingBox example
Summary:
Changelog:
[Internal] - Add testID to moving box example for testing

Reviewed By: yungsters

Differential Revision: D30824961

fbshipit-source-id: 1e25f25a49d064eee6e17aebc2d981648a0559bc
2021-09-10 17:28:55 -07:00
Luna Wei 0b3d28f8f1 Move multicolumn out to separate example
Summary: Changelog: [Internal] Refactor FlatList examples, move multi-column under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816719

fbshipit-source-id: 3fb9a30ddb58ca302a1b1b5a23ea964f3793b836
2021-09-10 17:28:55 -07:00
Luna Wei 30630472fd Move FlatList separators example under FlatList index
Summary: Changelog: [Internal] Refactor FlatList examples, move separators example under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816723

fbshipit-source-id: 741e4d97b18458fcedd9175309ff68c987d211b1
2021-09-10 17:28:54 -07:00
Luna Wei 5fd19835fe Move onViewableItemsChanged under FLatListExampleIndex
Summary: Changelog: [Internal] Refactor FlatList examples, move onViewableItemsChanged under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816718

fbshipit-source-id: 87c0500f0852fa6608a133cca008347f62b7010b
2021-09-10 17:28:54 -07:00
Luna Wei 4603e76777 Fix styling
Summary: Changelog: [Internal] Fix styling for FlatList test output

Reviewed By: charlesbdudley

Differential Revision: D30816724

fbshipit-source-id: 3e756311c31a38dd4beb27ed16f8aaa206ddb7e8
2021-09-10 17:28:54 -07:00
Luna Wei a7b0943aa9 Move out inverted example
Summary: Changelog: [Internal] Refactor FlatList examples, move invert example under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816725

fbshipit-source-id: 6eb4d3133206117646e4738cefdfdbf8f51127fe
2021-09-10 17:28:54 -07:00
Luna Wei 062cd4b2e7 Move Flatlist-contentInset
Summary: Changelog: [Internal] Refactor FlatList examples, move contentInset under FlatList index

Reviewed By: yungsters

Differential Revision: D30816720

fbshipit-source-id: 9b35c575be6819e31ff9ef768f9acfd721a876e8
2021-09-10 17:28:54 -07:00
Luna Wei bde0be26d9 Move out FlatList-onEndReached
Summary: Changelog: [Internal] Refactor FlatList examples, move onEndReached under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816722

fbshipit-source-id: 4ee233c7674ed0f5707d9d98388b8c36af900641
2021-09-10 17:28:54 -07:00
Luna Wei 3c3ff30774 Create FlatListExampleIndex
Summary: Changelog: [Internal] Create FlatList example index for 3 levels of navigation

Reviewed By: charlesbdudley

Differential Revision: D30816721

fbshipit-source-id: a3bdae7f385bab3695a9c2dc6fe3148ebdbd12b4
2021-09-10 17:28:54 -07:00
Nick Gerleman ffcaef64e4 Fix BorderExample Crash on Out of Tree Platforms (#32120)
Summary:
9b4f8e0144 (diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818) added examples to the border test page using PlatformColor. An iOS specific instance was later conditioned to only iOS in f6d0f9deac (diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818) but one example remains that has values for Android, and iOS only. This causes a crash on at least RNW, since none of the PlatformColors are valid.

This change addsa a fallback to black for unsupported platforms, and also adds a Windows PlatformColor for kicks (and marginal extra usefuleness).

## Changelog

[Internal] [Fixed] - Fix BorderExample Crash on Out of Tree Platforms

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

Test Plan: Validated on RNTester on Windows.

Reviewed By: yungsters

Differential Revision: D30822765

Pulled By: lunaleaps

fbshipit-source-id: 6b3e65204259205bb2f3c9153a2361d1decebe98
2021-09-10 00:58:03 -07:00
Michał Osadnik 21b2d6c8e7 Fix "Running on device" in RNTester README (#32169)
Summary:
Fix broken link
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[CATEGORY] [TYPE] - Message

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

Reviewed By: yungsters

Differential Revision: D30809096

Pulled By: GijsWeterings

fbshipit-source-id: b600e411c7292ba840e076d68f66cb3043887335
2021-09-08 10:27:20 -07:00
Ramanpreet Nara cf561b4052 Remove rootView.bridge access in RCTRootViewIntegrationTests
Summary:
RCTRootView exposes the RCTEventDispatcher directly via the .eventDispatcher property. So, there's no need to access the bridge to access the eventDispatcher.

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D30753792

fbshipit-source-id: 5820d65c061e9b88382692dfc2791ed4a4841c0f
2021-09-06 04:57:38 -07:00
Xuan Huang 8e66f0b35b Bump Hermes pod to 0.9.0
Summary:
Changelog:
[General][Changed] - Bump Hermes to 0.9.0

(Note: this ignores all push blocking failures!)

Reviewed By: lunaleaps

Differential Revision: D30726473

fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80
2021-09-02 18:42:44 -07:00
fabriziobertoglio1987 c360b1d92b Fix non selectable Text in FlatList (#28952)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/26264 fixes https://github.com/facebook/react-native/issues/27107
Text is not selectable inside a FlatList on Android. The solution is to invalidate the ReactTextView after a change of the selectable prop. If the view is visible, onDraw(android.graphics.Canvas) will be called at some point in the future and make the Text selectable.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix non selectable Text in FlatList

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

The issue was demonstrated in the following [snack](https://snack.expo.io/fabrizio.bertoglio/selectable-bug-in-flatlist) (more info in issue https://github.com/facebook/react-native/issues/26264).

The solution is:

1) Calling `invalidate()` from [setSelectableText][1] after changing the `selectable` prop and `mSelectableText` value. [`invalidate()`](https://developer.android.com/reference/android/view/View#invalidate()) triggers the `onDraw` callback.

[1]: 8027524947/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java (L427-L430)

2) calling `setTextIsSelectable(mSelectableText);` from the [`onDraw`][2] callback

[2]: 8027524947/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java (L456-L460)

The example below is availabe in RNTester FlatList example. Two options (`onPressDisabled` and `textSelectable`) have been added to test the functionality inside a FlatList.

<p align="center">
<img src="https://user-images.githubusercontent.com/24992535/82672536-c2e74d80-9c40-11ea-8fd8-156bfacfac8a.gif" width="200" height="" />
</p>

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D30000870

Pulled By: lunaleaps

fbshipit-source-id: 4851a294960df0af057d006793aa9ba97c51e3f9
2021-09-01 15:28:30 -07:00
Samuel Susla 329b026f3a Switch order of search libraries to fix M1 build error
Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template

Reviewed By: fkgozali

Differential Revision: D30693466

fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e
2021-09-01 08:26:42 -07:00
Utkarsh b26f277262 Add Linking examples in rn-tester (#30547)
Summary:
Added examples to RNTester for the Linking API.

## Changelog
[General] [Added] - Added example for openSettings() for Linking API.
[General] [Added] - Added [LSApplicationQueriesSchemes](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW14) in info.plist with entries tel, telprompt, http, fb, geo

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

Test Plan: ![Screen Recording 2020-12-07 at 11 19 13 PM (1)](https://user-images.githubusercontent.com/16796008/102250807-05001580-3f2a-11eb-9ce0-58de4d6fca54.gif)

Reviewed By: yungsters

Differential Revision: D30559457

Pulled By: lunaleaps

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

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

Reviewed By: lunaleaps

Differential Revision: D30691291

fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212
2021-09-01 00:27:42 -07:00
Kevin Gozali 945c5f714d OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds
Summary:
The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy.

The 2nd PR had multiple issues:
* It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535
* RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption

It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var.

So this diff does 2 things:
* Undid https://github.com/facebook/react-native/pull/29263
* Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly

{F659123377}

Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling

Reviewed By: lunaleaps

Differential Revision: D30690900

fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27
2021-09-01 00:27:42 -07:00
Héctor Ramos 6651d8c346 Enable codegen in RNTester's NativeModuleExample
Summary:
Create a ScreenshotManager.podspec (codegen recipe included) and add ScreenshotManager Pod to the Podfile.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D30623054

fbshipit-source-id: be20880a53ba8a08f8b42b8d81c868c8a21960e1
2021-08-31 16:26:52 -07:00
Nicola Corti 85249cafe8 Update project to build on Gradle 7.0.2 (#32073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32073

This Diff bumps the version of Gradle used to build the project to
7.0.2. Ideally we could bump to 7.2.x directly, but I'll do one minor version
at a time to exclude potential build problems.

This diff is addressing all the extra build warnings that got raised by the new version.

Changelog:
[Android][Changed] - Bumped Gradle project version to 7.0.2

Reviewed By: ShikaSD

Differential Revision: D30486612

fbshipit-source-id: 70e0f7d18e547013ca7b1d12f8dd64a633df5870
2021-08-31 13:27:27 -07:00
Héctor Ramos b51a99c73c rn-demo-app: Implement getModuleInstanceFromClass:
Summary:
While not strictly necessary for rn-demo-app at this point, we do need to provide the `getModuleInstanceFromClass:` implementation to simplify the TurboModule migration process later on.

Also, removed some issues in the Xcode project that must have been introduced during a recent rebase (duplicate Embed Pods build phases).

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30618992

fbshipit-source-id: a9b496cfa0cd34fca6389ddf829613aa13ea409d
2021-08-28 11:32:51 -07:00
Adlai Holler 4ac42d88ef Optimize font handling on iOS (#31764)
Summary:
Few issues I saw when profiling RNTester:
- Repeatedly calling `-lowercaseString` during `weightOfFont` causes a TON of extra memory traffic, for no reason.
- `NSCache` is thread-safe, so no need for a mutex.
- Using `stringWithFormat:` for the cache key is slow. Use `NSValue` to store the data directly instead.
- Calling `-fontDescriptor` in `isItalicFont` and `isCondensedFont` is overly expensive and unnecessary.
- `+fontNamesForFamilyName:` is insanely expensive. Wrap it in a cache.

Unscientific test on RNTester iPhone 11 Pro, memory & time. Before:
<img width="1656" alt="Screen Shot 2021-06-23 at 7 40 06 AM" src="https://user-images.githubusercontent.com/2466893/123092882-f4f55100-d3f8-11eb-906f-d25086049a18.png">
<img width="1656" alt="Screen Shot 2021-06-23 at 7 41 30 AM" src="https://user-images.githubusercontent.com/2466893/123092886-f6267e00-d3f8-11eb-89f6-cfd2cae9f7b6.png">

After:
<img width="1455" alt="Screen Shot 2021-06-23 at 9 02 54 AM" src="https://user-images.githubusercontent.com/2466893/123101899-7d2c2400-d402-11eb-97f8-2ee97ee69ec4.png">
<img width="1455" alt="Screen Shot 2021-06-23 at 8 59 44 AM" src="https://user-images.githubusercontent.com/2466893/123101892-7bfaf700-d402-11eb-9a10-def46b37b87f.png">

Changelog:
[iOS][Changed] - Optimized font handling

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

Reviewed By: appden

Differential Revision: D30241725

Pulled By: yungsters

fbshipit-source-id: 342e4f6e5492926acd2afc7d645e6878846369fc
2021-08-26 22:47:41 -07:00
Valentin Shergin 1acf334614 Fixed `alignItems: baseline` for <Text> elements on Android (#31575)
Summary:
This fixes https://github.com/facebook/react-native/issues/20666 and https://github.com/facebook/react-native/issues/21918.

This is pretty much the same as 51b3529f6c but implemented for Android.
Now <Text> exposes the actual base-line offset value that allows Yoga to position it properly when `alignItems: baseline` is requested.

## Changelog
[Android][Fixed] - Fixed `alignItems: baseline` for <Text> elements on Android

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

Test Plan:
The same test case that we have for iOS.
Before:
<img width="487" alt="Screen Shot 2021-05-22 at 7 03 18 PM" src="https://user-images.githubusercontent.com/22032/119277516-d62b5100-bbe5-11eb-9141-3abe56e1a476.png">

After:
<img width="487" alt="Screen Shot 2021-05-22 at 7 01 51 PM" src="https://user-images.githubusercontent.com/22032/119277518-d75c7e00-bbe5-11eb-9139-4c6b5fcd9157.png">

Reviewed By: JoshuaGross

Differential Revision: D28631468

Pulled By: yungsters

fbshipit-source-id: 7c259e469d19d8344298319f066b8437dfdedad0
2021-08-26 21:46:37 -07:00
Genki Kondo a0d30b848a Remove unsupported values for android_hyphenationFrequency
Summary:
hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int))

Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy

Changelog:
[Android][Changed] - Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text`

Reviewed By: JoshuaGross

Differential Revision: D30531096

fbshipit-source-id: 1a0b6e733bb21ce6b2f104a2025a79c16de3cfea
2021-08-26 10:40:11 -07:00
Luna Wei ad9030ca9a Include Swift lib in LIBRARY_SEARCH_PATHS
Summary:
changelog: Fix Xcode 13 build error in RNTester

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

Reviewed By: fkgozali

Differential Revision: D30559838

fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329
2021-08-25 16:49:33 -07:00
Matthew Gray 2abacace54 Adding Accessibility Display Options Enabled to RNTester (#29231)
Summary:
Currently there isn't any way to test if the Accessibility Display Options or the event listeners for them were working properly within RNTester. It turns out that because of changes to the accessibility API Apple made when they added Smart Invert AccessibilityInfo.isInvertColorsEnabled() and the associated event listener are working incorrectly. You can see this if you take a look at how RNTester (with this PR incorporated) responds to toggling Invert Colors. I've submitted a bug report to Apple, but this might have been caught earlier if this had been implemented.

## Changelog

[General] [Added] - Adding Accessibility Display Options Enabled to RNTester

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

Test Plan:
1. Build iOS app
2. Navigate to the Accessibility page
3. Switch over to settings and change any of the settings at
  - Settings>Accessibility>Display and Text Size>Bold Text
  - Settings>Accessibility>Display and Text Size>Color Filters>Grayscale
  - Settings>Accessibility>Display and Text Size>Smart Invert (or Classic Invert)
  - Settings>Accessibility>Motion>Reduce Motion
  - Settings>Accessibility>VoiceOver>VoiceOver
4. Switch back to the app and see the results

![Simulator Screen Shot - iPhone 11 - 2020-06-26 at 21 13 16](https://user-images.githubusercontent.com/65255457/85914380-f09c5500-b7f1-11ea-98db-b83fb4ab5305.png)
![Simulator Screen Shot - iPhone 11 - 2020-06-26 at 21 13 39](https://user-images.githubusercontent.com/65255457/85914382-f2feaf00-b7f1-11ea-8ebf-cdb2b703c731.png)

Modified it a bit to only show relevant statuses for the Platform

| {F656951547} | {F656951643} |

Reviewed By: TheSavior

Differential Revision: D29531642

Pulled By: lunaleaps

fbshipit-source-id: f54fb3216ef663428c23b613f0a3b10b01d7f24d
2021-08-25 16:29:07 -07:00
Xuan Huang ee868091b1 Add instructions to test RNTester with Hermes on Android (#32085)
Summary:
Title said it all.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal]

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

Reviewed By: TheSavior

Differential Revision: D30555218

Pulled By: Huxpro

fbshipit-source-id: 857ee81d4f402209bb2db2e1f4a2956d46ea3a54
2021-08-25 14:36:25 -07:00
pietro909 1d0fb08556 Fix typo and grammar (#31916)
Summary:
> Always leave the campground cleaner than you found it.

Fixing:
* typo in _dismissed_
* make the subject agree with the verb

## Changelog

[Internal] [Fixed] - A typo in a comment

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

Test Plan: Grammarly says it's better now.

Reviewed By: lunaleaps

Differential Revision: D29967403

Pulled By: yungsters

fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc
2021-08-22 22:51:29 -07:00
Jimmy Zhang f085e09be5 Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http
Reviewed By: lunaleaps

Differential Revision: D30218490

fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48
2021-08-19 10:28:49 -07:00
Sota Ogo b29a78732d Emit soft error for warning
Summary:
This diff adds a default behavior for the unified logger on Android.

Added the call site in the CXXNativeModule.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30377767

fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536
2021-08-18 23:38:01 -07:00
Sota Ogo 3e0d77834a Move react_native_log out of utils (#32042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32042

This diff moves react_native_log out of utils to make it easier/possible to import from modules.
Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30411247

fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230
2021-08-18 20:14:47 -07:00
Paige Sun d3345f5720 JS: Fix "Modal | Basic" Test's Layout
Summary:
Fix the CSS on the main Modal test

Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning.

Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style.

Reviewed By: lunaleaps

Differential Revision: D30323087

fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49
2021-08-17 13:41:21 -07:00
Luna Wei f6d0f9deac Fix BorderExample for DynamicColorIOS
Summary:
Changelog:
[Internal] - Fix border example for RNTester

Reviewed By: charlesbdudley

Differential Revision: D30262957

fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60
2021-08-12 12:05:40 -07:00
Phillip Pan df65dbb37f introduce RCTPlatformColorUtils
Summary:
Changelog: [Internal]

in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors.

functionality not covered yet:
- customColor
- iOS Dynamic Colors
- Variant Colors

Reviewed By: sammy-SC

Differential Revision: D30103451

fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574
2021-08-10 11:30:58 -07:00
Jordan Becker 9b4f8e0144 Feat/dynamic color borders (#31140)
Summary:
Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute.

On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates.
When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change.

Fixes https://github.com/facebook/react-native/issues/30377

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester

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

Test Plan:
I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes:

https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov

https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov

Reviewed By: lunaleaps

Differential Revision: D30073335

Pulled By: charlesbdudley

fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da
2021-08-09 17:21:09 -07:00
Harry Yu e35a963bfb Fix to make taps on views outside parent bounds work on Android (#29039)
Summary:
By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour.

- Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register
- Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register

Related issues:

- fixes https://github.com/facebook/react-native/issues/21455
- fixes https://github.com/facebook/react-native/issues/27061
- fixes https://github.com/facebook/react-native/issues/27232

### Fix

- Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead
  - Check that the touch is in its own bounds when returning itself
  - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set
- Modified related code to adjust to this change
- Added RNTesterApp test

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden`

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

Test Plan:
This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp:

| Before | After |
| --- | --- |
| ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) |

Reviewed By: ShikaSD

Differential Revision: D30104853

Pulled By: JoshuaGross

fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23
2021-08-06 12:33:08 -07:00
Ramanpreet Nara 55f504a0be Make So loading inside generated TMM delegates less confusing
Summary:
## Rationale
Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D30082675

fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60
2021-08-05 17:38:49 -07:00
Moti Zilberman 260c5a393f Move RCTTestApple into packages/rn-tester
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30056021

fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9
2021-08-04 13:03:21 -07:00
Moti Zilberman 30d37cfd39 Move RNTester unit/integration test Buck targets to GitHub
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032476

fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6
2021-08-04 13:03:21 -07:00
Moti Zilberman df9cd05621 Update OSS Buck definitions (#31948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31948

Changelog: [Internal]

Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by d4ee734f32.

Reviewed By: sammy-SC

Differential Revision: D30072866

fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279
2021-08-04 03:13:19 -07:00
Moti Zilberman 228b8e5529 Fix Buck package boundary violation in core components schema
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D29996246

fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e
2021-08-03 05:42:03 -07:00
Moti Zilberman 8efbb2e71e Move react-native Buck library to GitHub
Summary:
Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942687

fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348
2021-08-02 16:01:07 -07:00
Moti Zilberman 4f2c6d02af Move RNTester Buck library to GitHub (#31435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31435

Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942209

fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8
2021-08-02 16:01:07 -07:00
fabriziobertoglio1987 cb0e1d603a Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099)
Summary:
This issue:

fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475  fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes  https://github.com/facebook/react-native/issues/18285  fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695

Allows to set individual (left,top,right,bottom) dotted/dashed borders.

If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png"  width="300" height="" /> |

</p>
</details>

Reviewed By: mdvacca

Differential Revision: D28688914

Pulled By: RSNara

fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd
2021-08-02 04:06:07 -07:00
Jesse Katsumata 1c21a112a8 docs: Fix dead links in README for rn-tester (#31901)
Summary:
Part of https://github.com/facebook/react-native/issues/31788

~Updated link in README that was pointing to master branch to main branch~

Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[INTERNAL] [FIXED] - Fix dead links in README

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

Test Plan: - [ ] Updated link directs you to appropriate page

Reviewed By: PeteTheHeat

Differential Revision: D29933044

Pulled By: GijsWeterings

fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319
2021-07-27 11:01:47 -07:00
Charles Dudley 5b77dfd69f Add "Use Native Driver" control to RNTester Animated Composing example
Summary: Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D29832704

fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b
2021-07-27 09:13:53 -07:00
Luna Wei 893aff2e20 Animated Transform Styles Example
Summary: Changelog: [Internal] - Add an example to demo all the transform properties.

Reviewed By: charlesbdudley

Differential Revision: D29865790

fbshipit-source-id: 79174457071de8fca9b0aab8bf8dcc543ea9a0a3
2021-07-26 17:17:58 -07:00
Charles Dudley b440ab9784 Add RNTester cases for Animated Easing API
Summary:
- Update `RNTesterNavBar` to be positioned relatively to allow for scroll views to not be clipped
- Add EasingExample with example animations taken from https://reactnative.dev/docs/easing

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D29744160

fbshipit-source-id: d0e2112769d74dd34e11477f1d3b1f8f0ffebc03
2021-07-26 16:43:19 -07:00
Jesse Katsumata 3c5d3bce00 add persistentScrollbar option example for ScrollView (#31895)
Summary:
There was an unused example in ScrollView example, so I've added the example to RNTester App

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Added] - Added persistentScrollbar option example for ScrollView in RNTester App

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

Test Plan: - RNTester App builds and shows example properly on Android

Reviewed By: sshic

Differential Revision: D29881126

Pulled By: mdvacca

fbshipit-source-id: 9e7e61c9d3f712cb767a78e729469fc95cb9953e
2021-07-26 10:58:36 -07:00
Stefan Wrobel 41f45a77ad Bump Flipper to 0.99.0 (#31896)
Summary:
Includes fix included in a Flipper Pod for incorrect timestamps in the Network viewer with iOS apps
1cf7456133

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[general][changed] - Update Flipper to 0.99.0

[CATEGORY] [TYPE] - Message

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

Reviewed By: fkgozali

Differential Revision: D29881218

Pulled By: mdvacca

fbshipit-source-id: a206faa3d7b969a708d286884cff83bed5453d22
2021-07-23 12:06:27 -07:00
Luna Wei 63e0f7d767 Add useNativeDriver toggle UI
Summary:
Changelog: [Internal] - Update Animation examples to toggle useNativeDriver

There are issues when we toggle the native driver on and off. Where once off, the animations don't seem to update anymore, until we turn nativeDriver back on. See videos in testplan

Reviewed By: yungsters

Differential Revision: D29774939

fbshipit-source-id: cf6d70c1b574a87bb803510196dfb273b36de5e1
2021-07-22 17:24:02 -07:00
Luna Wei 04b1ef5155 Add flow, flowfixmes to RNTesterModuleContainer and Animation examples
Summary: Changelog: [Internal] - RNTester: Add flow to RNTesterModuleContainer, render example as component, remove flowfixmes from Animation examples

Reviewed By: yungsters

Differential Revision: D29783772

fbshipit-source-id: 64ec6f247822b25c8cc6f64b192d17081be9c1f9
2021-07-22 17:24:02 -07:00
Evan Yeung afe0c1daea Remove existential types from xplat/js
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29724915

fbshipit-source-id: 97cbeefbba2ddc2e1088dfe19db14fa545213549
2021-07-21 16:52:22 -07:00
Evan Yeung 24ba0db275 Manually some remove existential types from xplat/js
Summary:
Manually remove some existential types.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D29724881

fbshipit-source-id: e21558dc033fa07d0b8a188eb64e14ddcf7df2ac
2021-07-21 16:52:21 -07:00
Charles Dudley a8e0438db2 Add RNTester cases for Composing Animations in Animated API
Summary:
- Add Composing example page with examples for `parallel`, `sequence`, `stagger`, and `delay`
Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D29781410

fbshipit-source-id: c478e5f45015e0f0b5360460e1988a61396b1e3b
2021-07-20 13:48:51 -07:00
Kudo Chien b77948e33b Upgrade folly to 2021.06.28.00 and boost to 1.76.0 (#31840)
Summary:
1. [ios] upgrade folly to 2021.06.28.00 which aligned to android.
2. folly compile setting from c++14 -> c++17: _this folly requires c++17 for `std::unordered_map::insert_or_assign`._
3. boost 1.63.0 -> 1.76.0:  _the old boost does not support c++17._
4. deprecating react-native-community/boost-for-react-native: _by cocoapods installer, we could download the official target._

## Changelog

[iOS] [Changed] - Upgrade folly to 2021.06.28.00 and boost to 1.76.0

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

Test Plan: CI passed

Reviewed By: fkgozali

Differential Revision: D29668480

Pulled By: yungsters

fbshipit-source-id: 98eae9ca47f489dcea91974e6f5e9dcb4d66c40c
2021-07-16 15:13:12 -07:00
Luna Wei 08ba8663f8 Show test/expect information about an example or description
Summary: Changelog: [Internal] - Allow for examples to define test steps and expectation

Reviewed By: charlesbdudley

Differential Revision: D29674189

fbshipit-source-id: ac62a634d0139d179408104479f88009237503e3
2021-07-15 23:26:28 -07:00
Luna Wei 9825a62088 Animated to render individual examples
Summary: Changelog: [Internal] - Allow animated examples to be rendered individually

Reviewed By: charlesbdudley

Differential Revision: D29668739

fbshipit-source-id: 537f21174e256bc5a5a8827f112c102970b27c5f
2021-07-15 23:26:28 -07:00
Luna Wei e48e63709c Use example or module description
Summary: Changelog: [Internal] RNTester to only show the module description. Example descriptions to follow

Reviewed By: yungsters

Differential Revision: D29571326

fbshipit-source-id: 973e0031fedee805e75c010fbf59833205801640
2021-07-15 23:26:28 -07:00
Tim Yung 92c13f0d1d RN: Replace `master` with `main` in Documentation
Summary:
Updates documentation in React Native to reference `main` (or `HEAD` for URLs) instead of `master`.

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

Changelog:
[General][Changed] - Update documentation reference from `master` to `main` or `HEAD`.

Reviewed By: JoshuaGross

Differential Revision: D29717128

fbshipit-source-id: 0b0babd8407c6fd3d0e5431f6eaf976059731d6f
2021-07-15 15:22:57 -07:00
Tomek Zawadzki f00e348ca7 Fix support for blobs larger than 64 KB on Android (#31789)
Summary:
Fixes https://github.com/facebook/react-native/issues/31774.

This pull request resolves a problem related to accessing blobs greater than 64 KB on Android. When an object URL for such blob is passed as source of `<Image />` component, the image does not load.

This issue was related to the fact that pipe buffer has a limited capacity of 65536 bytes (https://man7.org/linux/man-pages/man7/pipe.7.html, section "Pipe capacity"). If there is more bytes to be written than free space in the buffer left, the write operation blocks and waits until the content is read from the pipe.

The current implementation of `BlobProvider.openFile` first creates a pipe, then writes the blob data to the pipe and finally returns the read side descriptor of the pipe. For blobs larger than 64 KB, the write operation will block forever, because there are no readers to empty the buffer.

41ecccefcf/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.java (L86-L95)

This pull request moves the write operation to a separate thread. The read side descriptor is returned immediately so that both writer and reader can work simultaneously. Reading from the pipe empties the buffer and allows the next chunks to be written.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix support for blobs larger than 64 KB

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

Test Plan:
A new example has been added to RN Tester app to verify if the new implementation properly loads the image of size 455 KB from a blob via object URL passed as image source.

<img src="https://user-images.githubusercontent.com/20516055/123859163-9eba6d80-d924-11eb-8a09-2b1f353bb968.png" alt="Screenshot_1624996413" width="300" />

Reviewed By: ShikaSD

Differential Revision: D29674273

Pulled By: yungsters

fbshipit-source-id: e0ac3ec0a23690b05ab843061803f95f7666c0db
2021-07-14 11:11:31 -07:00
Héctor Ramos 73ae12bc24 Update rn-tester project settings
Summary:
Adjustments to ensure RNTester compiles successfully.

[Internal] - RNTester Xcode project adjustments

Reviewed By: RSNara

Differential Revision: D29525295

fbshipit-source-id: df532bd66d50471c4baf63629eb90b4ca4105127
2021-07-13 14:10:03 -07:00
Tim Yung 9d2fedc6e2 RN: Unify Typeface Logic (Android)
Summary:
Refactors how `Typeface` style and weight are applied in React Native on Android.

- Unifies all style and weight normalization logic into a new `TypefaceStyle` class.
  - Fixes font weight support for the Fabric renderer.
  - De-duplicates code with `TextAttributeProps`.
  - Simplified normalization logic.
- Fixes a rare crash due to `Typeface.sDefaultTypeface` (Android SDK) being `null`.
- Adds a new example to test font weights in `TextInput`.
- Adds missing `Nullsafe` and `Nullable` annotations.
- Clean up a bunch of obsolete inline comments.

Changelog:
[Android][Fixed] - Fixed a rare crash due to `Typeface.sDefaultTypeface` (Android SDK) being `null`.
[Android][Fixed] - Fixed font weight support for the Fabric renderer.
[Android][Added] - Added a new example to test font weights in `TextInput`.

Reviewed By: JoshuaGross

Differential Revision: D29631134

fbshipit-source-id: 3f227d84253104fa828a5561b77ba7a9cbc030c4
2021-07-12 22:17:12 -07:00
Janic Duplessis d6ed1ff58b Allow configuring ndk build architectures (#31232)
Summary:
Building from source in debug takes a very long time because native builds need to run for all supported architectures. It is possible to check which architecture the devices for which we are about to launch the app on are and build only for those. For most cases we can reduce the number of architectures we build for to 1 instead of 4, resulting in a large speedup of the build.

This is inspired by iOS which has a "Build for active architecture only" option. Since android doesn't really support this natively we can implement it here and also in react-native by reading the build properties that we pass and alter the abi we build for.

With fabric / codegen coming up I suspect that we might want to default to building c++ soon. This should ease the transition as builds won't be orders of magnitude slower.

See https://github.com/react-native-community/cli/pull/1388 for more context and how we use this new config to automatically detect running emulator architectures.

## Changelog

[Android] [Added] - Allow configuring ndk build architectures

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

Test Plan:
Tested by setting reactNativeDebugArchitectures with different values in gradle.properties.  Checked the build logs to see which architectures are being built. Also made sure release builds are not affected by this value.

Clean build

reactNativeDebugArchitectures not set
824.41s

reactNativeDebugArchitectures=x86
299.77s

Reviewed By: mdvacca

Differential Revision: D29613939

Pulled By: ShikaSD

fbshipit-source-id: d20a23d1d9bbf33f5afaaf3475f208a2e48c0e1a
2021-07-12 09:53:30 -07:00
Anas Khurshid 25a16123a6 Added Support for Entrance/exit from collection by Flatlist (#31630)
Summary:
Issue https://github.com/facebook/react-native/issues/30964 .When using a screen reader, flatlist does not announce entrance/ exit from the flat list.

## Changelog

[Android] [Changed] - Added support for accessibility role of "list" for flatlist and sectioned list

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

Test Plan: I have added accessibility role prop in flatlist and sectioned list in rntester app, that will announce entrance/ exit from flatlist and sectioned list.

Reviewed By: kacieb

Differential Revision: D29599351

Pulled By: blavalla

fbshipit-source-id: e16ec69a694780d12f15f88a1e6bb5d7d77ac15f
2021-07-09 19:25:36 -07:00
Luna Wei cddb97ad18 Remove Picker from OSS (#31772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31772

Changelog:[General][Removed] - Remove Picker iOS code

Reviewed By: p-sun

Differential Revision: D29124724

fbshipit-source-id: d3b3a409961cf04e2cd079a91986d30e3166dcda
2021-07-08 13:23:49 -07:00
Andrei Shikov 0b40fea60c Fix NDK path propagation
Summary:
Latest Android Gradle plugin doesn't respond to ANDROID_NDK env variable, so I propagated it explicitly and included with recommended `ndkPath` clause.

Changelog: [Internal]

allow-large-files

Reviewed By: fkgozali

Differential Revision: D29593132

fbshipit-source-id: 0785fe92385037d2d4cf290c2462b299800b6928
2021-07-08 13:23:48 -07:00
Justin Huntington bc1e602e0c Add ScrollView.automaticallyAdjustsScrollIndicatorInsets prop (on iOS) (#29809)
Summary:
iOS 13 added a new property to `UIScrollView`: `automaticallyAdjustsScrollIndicatorInsets`, which is `YES` by default.  The property changes the meaning of the `scrollIndicatorInsets` property.  When `YES`, any such insets are **in addition to** whatever insets would be applied by the device's safe area.  When `NO`, the iOS <13 behavior is restored, which is for such insets to not account for safe area.

In other words, this effects ScrollViews that underlay the device's safe area (i.e. under the notch).  When `YES`, the OS "automatically" insets the scroll indicators, when `NO` it does not.

There are two problems with the default `YES` setting:

1. It means applying `scrollIndicatorInsets` to a `ScrollView` has a different effect on iOS 13 versus iOS 12.
2. It limits developers' control over `scrollIndicatorInsets`.  Since negative insets are not supported, if the insets the OS chooses are too large for your app, you cannot fix it.

Further explanation & sample code is available in issue https://github.com/facebook/react-native/issues/28140 .

This change sets the default for this property to `NO`, making the behavior consistent across iOS versions, and allowing developers full control.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Changed] - ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+

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

Test Plan:
Updated the RNTester example to explain what to expect. Also removed the `pageScreen` modal example for now as mentioned in my Github comment.

{F628636466}

Here are screenshots of the demo app (from the original bug) before (with safe area applied to insets) & after (without safe area applied to insets):

![before](https://user-images.githubusercontent.com/428831/91644197-ea03a700-ea07-11ea-9489-be27820930eb.png)

![after](https://user-images.githubusercontent.com/428831/91644200-eff98800-ea07-11ea-8788-daf1e783639d.png)

Reviewed By: p-sun

Differential Revision: D28229603

Pulled By: lunaleaps

fbshipit-source-id: 2e774ae150b1dc41680b8b7886c7ceac8808136a
2021-07-07 20:23:36 -07:00
Luna Wei 28e8c6a716 Styling updates and typo fixes
Summary:
Changelog: [Internal] Fix things in RNTester
* Make SectionList-contentInset example iOS only and update styling
* Fix a typo in SectionList-onEndReached example
* Fix module example styling and pressed state styling for Android

Reviewed By: kacieb

Differential Revision: D29571327

fbshipit-source-id: 5cbb68781536e21ca73ca22b01343379306babd4
2021-07-07 13:58:28 -07:00
Luna Wei 1ad6e6096a Rename header to titlebar
Summary: Changelog: [Internal] - Rename RNTesterHeader to RNTTitleBar

Reviewed By: kacieb

Differential Revision: D29571325

fbshipit-source-id: 192b73af63f2e924c8beb55e96855ebfe9afa6fb
2021-07-07 13:58:28 -07:00
Luna Wei cf2cc9e285 Update title to example
Summary: Changelog: [Internal] Update title when navigating to an example

Reviewed By: kacieb

Differential Revision: D29545092

fbshipit-source-id: 7ce2f7d978601a5e11e2d60a8fd17be0249ce122
2021-07-07 13:58:28 -07:00
Luna Wei b62a40afde Fix jump in title for iOS
Summary: Changelog: [Internal] - iOS title jumps currently due to SafeAreaView re-mounting because of the layout structure we use. Simplified the layout tree

Reviewed By: kacieb

Differential Revision: D29545113

fbshipit-source-id: 9ed764c1c9f3da7c58baf8028454859bd50ded60
2021-07-07 13:58:28 -07:00
Luna Wei c06d8d01ca Support 3 levels of navigation
Summary: Changelog: [Internal] RNTester to support 3 levels of navigation

Reviewed By: kacieb

Differential Revision: D29481463

fbshipit-source-id: e48281cce7fccd7096446c5f0f5583f2588b5028
2021-07-01 14:35:30 -07:00
Luna Wei 8765b93bae Generalize RNTPressableRow
Summary: Changelog: [Internal] - Extract ExampleModuleRow and use Pressable

Reviewed By: kacieb

Differential Revision: D29480756

fbshipit-source-id: d256513bec497feeb429e9484ffe367b52e5b2ad
2021-07-01 14:35:30 -07:00
Luna Wei 9fb2659f56 Move SectionList examples together
Summary: Changelog: [Internal] - Move SectionList examples together. An interim state for next diff to add a 3rd level of navigation so each example is rendered in separate surface.

Reviewed By: kacieb

Differential Revision: D29480143

fbshipit-source-id: f7f10920bd4ab938665f17f0a80debaff55b9788
2021-07-01 14:35:30 -07:00
Luna Wei fd08255b0b Refactor SectionListExample
Summary: Changelog: [Internal] - Refactor SectionListExample

Reviewed By: kacieb

Differential Revision: D29480050

fbshipit-source-id: edaa21e12d4be0fbe3d6cf147c74b8144eb7c3de
2021-07-01 14:35:30 -07:00
Luna Wei fa3243ad33 Rename things in RNTester
Summary:
Changelog:
[Internal] - Rename some types and components in RNTester to support work for tertiary levels of navigation.

module = component | api
moduleExample = an example of a certain feature a module

Reviewed By: kacieb

Differential Revision: D29381875

fbshipit-source-id: c348bcbb73aaf95e85928bb14080a097e685cc78
2021-07-01 14:35:30 -07:00
Kacie Bawiec 40a93914c6 Move Pressable Sticky Header Example to RNTester
Summary:
Add a test case showing off a pressable sticky header to RNTester.

Note that this test case does not follow the styling of the other ScrollView Examples. I chose not to make it follow the styling because the existing examples need to be refactored later to not use custom buttons.

Changelog:
[General][Added] Add Pressable Sticky Header example to ScrollViewExamples in RNTester

Reviewed By: lunaleaps

Differential Revision: D29437827

fbshipit-source-id: 3ccee5df99bc6f00a04e1ecbd47fbe86b1eda4dc
2021-06-30 15:44:31 -07:00
Danilo Bürger c974cbff04 Allow PlatformColor to work with RCTView border colors (#29728)
Summary:
# See PR
https://github.com/facebook/react-native/pull/29728

# From PR Author
Using `PlatformColor` with border colors doesn't work currently when switching dark mode as the information is lost when converting to `CGColor`. This change keeps the border colors around as `UIColor` so switching to dark mode works.

```ts
<View
  style={{
    borderColor: DynamicColorIOS({ dark: "yellow", light: "red" }),
    borderWidth: 1,
  }}
>
...
</View>
```
This view will start with a red border (assuming light mode when started), but will not change to a yellow border when switching to dark mode. With this PR, the border color will be correctly set to yellow.

## Changelog

[iOS] [Fixed] - Allow PlatformColor to work with border colors

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

Test Plan:
1. Assign a `PlatformColor` or `DynamicColorIOS` to a view border color.
2. Toggle between dark / light mode. See the colors change.

Reviewed By: lunaleaps

Differential Revision: D29268376

Pulled By: p-sun

fbshipit-source-id: 586545b05be0beb0e6e5ace6e3f74b304620ad94
2021-06-23 13:37:22 -07:00
Luna Wei fafd2903f1 Update Moving Box Example
Summary: Changelog: [Internal] - Update expectations on RNTester's Animated Moving Box example. We don't restore defaults for the animated value on unmount. Also adds a Reset option to the example.

Reviewed By: kacieb

Differential Revision: D29143505

fbshipit-source-id: abb1e87530313cfbfe9c4985e651667d28589a67
2021-06-21 10:51:56 -07:00
Michel Weststrate 848d59947c Bump Flipper to 0.93 (#31708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31708

Changelog:
[general][changed] - [iOS] Update Flipper to 0.93.0

Reviewed By: PeteTheHeat

Differential Revision: D29060305

fbshipit-source-id: 2ff109930437bfc90e8ce441fa681de867206397
2021-06-18 07:08:31 -07:00
Kacie Bawiec 685ac9a792 Fix screenshot test failures for E2E tests in ScrollViewExamples
Summary:
Adding a minHeight property messed up some screenshot tests. T93437971

I'm honestly not sure why this happened since that ScrollView container has a fixed height set of 300, so it shouldn't have changed heights... It didn't change heights in RNTester.

We should probably take the full example (including title etc.) from RNTester for our E2E tests to avoid these types of weird layout breakages in the future.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D29201224

fbshipit-source-id: 30b98fa43d06eec1da345becc473690a3b075fb7
2021-06-17 13:36:31 -07:00
Kacie Bawiec 61f538ae95 Add minHeight to buttons in in ScrollViewExamples
Summary:
Quick fix to fix a few test cases that had very small height buttons. (buttons became like this after flex: 1 was added to them in D29082450 (f12f0e679d))

Added a minHeight to the buttons and added Views around groups of buttons.

Eventually we should update these examples to not use a custom button.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D29145288

fbshipit-source-id: 238c298a25b33da662b4897399f82ad0aa29b9cd
2021-06-16 12:01:30 -07:00
Peter Argany d208e7d6ad Workaround failing fmt compilation by locking to v6.2.1
Summary: Updating pods attempts to bump fmt to 7.1.3, which causes CircleCI to fail. [Sample failure](https://app.circleci.com/pipelines/github/facebook/react-native/9422/workflows/f4c9076a-9649-490c-b565-555fecc60957/jobs/205827). Let's temporarily lock to an older version until the [fmt fix](355be4b13f) gets tagged for release.

Reviewed By: JoshuaGross

Differential Revision: D29147585

fbshipit-source-id: b1aca9618586a9d6e4c6d0c2c37b258745e008ee
2021-06-16 08:15:24 -07:00
Luna Wei 65740723d9 Remove Picker from XHR example
Summary: Changelog: [Internal] Remove Picker from XHR examples

Reviewed By: kacieb

Differential Revision: D29082825

fbshipit-source-id: 7616847ff5f0da59a5e38898df78c911103699ba
2021-06-15 12:23:11 -07:00
Luna Wei 993d022d4b Fix XHR multipart form upload example
Summary: Changelog: [Internal] - Update XHR upload example to new post test server. Created new toilet here: http://ptsv2.com/t/react-native and configured to return the link to the post data

Reviewed By: kacieb

Differential Revision: D29082824

fbshipit-source-id: 0cb502286addf1de3d5053f73173551ddd180a96
2021-06-15 12:23:11 -07:00
Luna Wei f12f0e679d Remove Picker from ScrollView examples
Summary: Changelog: [Internal] - Remove Picker from ScrollView examples

Reviewed By: kacieb

Differential Revision: D29082450

fbshipit-source-id: 6c186e565b70eac9023b87f52f6174f9a0e993f2
2021-06-14 21:54:16 -07:00
Luna Wei c780366eee Remove Picker from Android Permissions example
Summary: Changelog: [Internal] - Remove Picker from Permissions example

Reviewed By: kacieb

Differential Revision: D29082451

fbshipit-source-id: fbbac6db0f39b83843e5d4e1a205200760330e51
2021-06-14 21:54:16 -07:00
Luna Wei 70727a5d44 Remove Picker from TextLegend example
Summary: Changelog: [Internal] - Remove Picker from TextLegend examples in RNTester in prep for deprecating Picker

Reviewed By: kacieb

Differential Revision: D29082454

fbshipit-source-id: 3ea30a75891ad2e517b124512a9a83b0eee5f9a9
2021-06-14 21:54:16 -07:00
Luna Wei b22a6d6e9d Remove Picker from Modal example
Summary: Changelog: [Internal] - Remove picker from Modal example in RNTester in prep for deprecating Picker from RN

Reviewed By: kacieb

Differential Revision: D29082452

fbshipit-source-id: 01ee5ae2d0978721f7229d824f23cfbccfaf2813
2021-06-14 21:54:16 -07:00
Luna Wei 572deaebd9 Remove usage of Picker from Accessibility Example
Summary: Changelog: [Internal] - Remove Picker from accessibility example as a first step to deprecate Picker from react-native

Reviewed By: kacieb

Differential Revision: D29082453

fbshipit-source-id: d1d6eb0514453126351b41c2ca5d72d2c81f5dc9
2021-06-14 21:54:16 -07:00
Daniel Sainati 974f0a3281 pre-suppress this typing errors ahead of 154
Summary:
This pre-suppresses the 154 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D29065246

fbshipit-source-id: f418041305a46df410dcbe3d9a4db81a61ac7014
2021-06-11 14:31:41 -07:00
Michel Weststrate 06c33e9abe Bump Android deps to 0.93 (#31675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31675

As requested in parent diff, moved the Android dep bumps into a separate diff.

## Changelog

[general][changed] - [Android] Update Flipper to 0.93.0

Reviewed By: mdvacca, ShikaSD

Differential Revision: D28688486

fbshipit-source-id: c3a8e0edeebdabd490b2885497e261f64bdab4bd
2021-06-11 04:30:49 -07:00
Joel Arvidsson 36c0a7dec1 Support user-defined PlatformColors on iOS (#31258)
Summary:
Original PR: https://github.com/facebook/react-native/pull/31258

## Imported PR from Github:

This is a continuation of https://github.com/facebook/react-native/pull/29683. I've talked to danilobuerger who does not intend on continue work on it and is OK with me picking up where he left. This PR is identical besides adding a test case in the RN Tester app as requested in the original PR.

In summary it gives iOS feature parity with Android in the sense that one can use user-defined native colors, something even the docs claim is possible. It's useful as it enables accessibility features such as high contrast colors and makes implementing dark mode simple. For an example on how it can be used, see https://github.com/klarna-incubator/platform-colors

## Changelog

[iOS] [Added] - Allow PlatformColor to return user-defined named asset color

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

Test Plan: Test case added to RN Tester.

Reviewed By: sammy-SC

Differential Revision: D28803206

Pulled By: p-sun

fbshipit-source-id: e0f0690274799bd2d09c9f9d1a6a95ac0f979498
2021-06-10 12:15:12 -07:00
Nishan Bende 0823f299e5 Foreground ripple support in Pressable (#31632)
Summary:
This PR aims to enable support for foreground ripple in Pressable. This makes it possible to show ripple on top of custom child components like Image as shown in the below example.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Added] - Support for foreground ripple in Pressable

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

Test Plan:
- Pass property useForeground: true in android_ripple config to verify the changes.

https://user-images.githubusercontent.com/23293248/120111371-4cecbf00-c18f-11eb-8acb-d10718d5483c.mov

Reviewed By: kacieb

Differential Revision: D28926493

Pulled By: yungsters

fbshipit-source-id: 12a6ba71a7dc6ed60fbaeb651f015cace38e03b1
2021-06-07 17:07:58 -07:00
Andrei Shikov 1cc2229380 Multiple swipeable cards
Summary:
Completes example with the swipeable card with swipe-out animation.
The example also tries to reuse the underlying views by ensuring the card reuses the same React node and changes position based on zIndex.

Changelog:
[General][Added] - Added swipeable cards example to RNTester to validate JSResponderHandler

Reviewed By: lunaleaps

Differential Revision: D28492604

fbshipit-source-id: c9fe757100bea9dc787cd754af81e37dc4f084d4
2021-06-07 15:33:07 -07:00
Michel Weststrate 4246c75d0d Bump flipper deps to 0.91 to support XCode 12.5 out of the box (#31562)
Summary:
allow-large-files

This bumps the flipper dependencies to 0.91.

Fresco deps are not in mavenCentral jet, so picked those from bintray, but pinged the team and they'll follow up on it. See also: https://github.com/facebook/fresco/issues/2603

This primarily bumps to the latest pods we have everywhere, which solves several build issues, like reported in https://github.com/facebook/react-native/issues/31480

After this change it should no longer be needed to pass custom version overrides to `use_flipper`, as the defaults will be up to date.

In the template project, I changed the version rangers to exact numbers, so that results of `react-native init` are more consistent / predictable over time, as suggested in the discord channel by Brent

In the long term we are investigating whether we can remove most of the transitive deps by not using RSocket, which is a bigger project plan that should help reduce build issues and times, especially on iOS.

cc priteshrnandgaonkar  passy kelset

## Changelog

[general][changed] - [iOS] Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5

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

Test Plan:
_N.B. Locally tested in XCode 12.4 only, but bumped versions have been confirmed to work on 12.5 before by others_

* React Native CI
* Flipper CI with same versions of deps: https://github.com/facebook/flipper/actions/runs/863607686
* Was able to connect from both Android and iOS to Flipper. Couldn't really test further due to a bundling error I didn't understand, suggestions welcome

![Screenshot 2021-05-21 at 11 32 52](https://user-images.githubusercontent.com/1820292/119133806-3d090880-ba34-11eb-8c0b-1ede7bc13751.png)
![Screenshot 2021-05-21 at 12 59 13](https://user-images.githubusercontent.com/1820292/119133892-5c079a80-ba34-11eb-9e72-278c427fdeb0.png)

Reviewed By: fkgozali

Differential Revision: D28623601

Pulled By: mweststrate

fbshipit-source-id: 22130d07821569851956453c4ee6a594b6b83928
2021-06-07 03:20:14 -07:00
fabriziobertoglio1987 3827ca6171 Fix font weight numeric values (#29117)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/25696 fixes https://github.com/facebook/react-native/issues/28854 fixes https://github.com/facebook/react-native/issues/26193
Since Android API 28 it is possible to specify fontWeight with numerical values ranging from 100 to 900

This pr uses the new Typeface.create() method available on Android API 28+ to set font weight value ranging from 100 to 900, while still keeping existing functionalities (custom fonts, bold/italic and other styles).
https://developer.android.com/reference/android/graphics/Typeface#create(android.graphics.Typeface,%20int,%20boolean)

## Changelog

[Android] [Fixed] - Fix font weight numeric values

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

Test Plan:
Works in all scenarios.

**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/84420949-1daa0e80-ac1b-11ea-9a2e-eaac03dc4533.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/84490766-edf31900-aca3-11ea-90d8-7c52d2e2be59.png" width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/84490768-ee8baf80-aca3-11ea-8d3e-937d87b3c56a.png"  width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/84490769-ef244600-aca3-11ea-9dec-5eb70358834b.png" width="300" height="" /> |

| **AFTER** |
|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/84490772-f0557300-aca3-11ea-851a-5befc900192c.png"  width="300" height="" />|

</p>
</details>

Reviewed By: lunaleaps

Differential Revision: D28917328

Pulled By: yungsters

fbshipit-source-id: 8b84e855b3a8b87960cb79b9237d452b26974c36
2021-06-05 00:47:40 -07:00
Andrei Shikov 7463f6d0fd Create swipeable card demo
Summary:
Verifies interaction between PanResponder and ScrollView with JSResponderHandler.
Also showcases how to create a swipeable card with scrollable content.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D28093313

fbshipit-source-id: 8ffbe734119912326c471412f4f5e096f64e87cc
2021-06-03 15:08:53 -07:00
Andrew 47b0be5f55 Fix a couple of places RNTester is using non-theme values (#31479)
Summary:
A few places in RNTester where using hard coded color values, which meant the UI looks broken in dark themes.

The area behind the bookmark button was using a solid color png file, which I've replaced with a color from the theme object.

## Changelog

[Internal] [Fixed] - Fix a couple of places RNTester is using non-theme values

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

Test Plan: Verified in RNTester in react-native-windows in light+dark theme.

Reviewed By: TheSavior

Differential Revision: D28290192

Pulled By: rozele

fbshipit-source-id: 78192200ac2dc8629759c10f8e8b3ec2f6699acd
2021-06-03 07:46:28 -07:00
Tim Yung f3ac981c46 RNTester: Remove Excess Example Spacing
Summary:
Removes an extra amount of 10dp margin on the top of each example.

Changelog:
[General][Fixed] - Remove excess spacing in RNTester examples.

Reviewed By: kacieb

Differential Revision: D28799736

fbshipit-source-id: 40c8db203f8119359ccc8c40fc0a6424de5afc5e
2021-06-02 22:41:09 -07:00
Tim Yung 77beb42499 RNTester: Modernize Animated Examples Index
Summary:
Minor changes to the `Animated` examples index module to make the static typing a bit more intuitive.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799742

fbshipit-source-id: f798631081538e79fc58377105db4e47b9728843
2021-06-02 22:41:09 -07:00
Tim Yung 0c38c44b7c RNTester: Reorganize `AnimatedGratuitousApp`
Summary:
Minor reorganization of `AnimatedGratuitousApp` to be a separate top-level directory in `examples/`, like `Animated`.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799737

fbshipit-source-id: b0329e420d6eae912e91d0d74b68ac299c9bd9f3
2021-06-02 22:41:09 -07:00
Dulmandakh 70da640946 remove jcenter (#31609)
Summary:
jcenter is read-only now, and newer versions of dependencies will be published to either MavenCentral or Jitpack. This PR removes jcenter to avoid future issues, then uses MavenCentral and Jitpack as replacement. Current flipper depends on Stetho version that is not available on MavenCentral, so had to exclude and bump the version.

Both Gradle and Buck successfully download all the dependencies.

## Changelog

[Android] [Changed] - Remove jcenter

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

Test Plan: rn-tester builds and runs as expected.

Reviewed By: mdvacca

Differential Revision: D28802444

Pulled By: ShikaSD

fbshipit-source-id: 043ef079d0cda77a1f8dd732678452ed712741a4
2021-06-02 09:57:28 -07:00
Tim Yung 78caaca768 RNTester: Text Adjusts Dynamic Layout Example
Summary:
Creates a new RNTester example to verify facebook/react-native#31538 (D28631465).

Changelog:
[Android][Added] - RNTester example for adjusting text with dynamic layout.

Reviewed By: kacieb

Differential Revision: D28779870

fbshipit-source-id: 5297a823645d1e9e35d4c86b491f3c225ecc9543
2021-06-01 16:00:10 -07:00
Dulmandakh 547b4c92e4 Gradle 6.9, Android Gradle Plugin 4.2.1 (#31593)
Summary:
Bump Gradle to 6.9 which supports Apple Silicon, also Android Gradle Plugin 4.2.1 which defaults to Java 1.8 so no additional config required.

## Changelog

[Android] [Changed] - Bump Gradle to 6.9, Android Gradle Plugin to 4.2.1

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

Test Plan: rn-tester builds and runs as expected

Reviewed By: mdvacca

Differential Revision: D28711942

Pulled By: ShikaSD

fbshipit-source-id: 2a4616cd0f17db7616ab29dea1652717f2cd0f6d
2021-06-01 11:29:51 -07:00
Daniel Sainati 74d5d03dbd pre-suppress Flow errors in xplat ahead of 153 release
Summary:
This pre-suppresses the 153 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D28754374

fbshipit-source-id: 1806f53bc7d804644d434583a2dcd6da63d00328
2021-06-01 09:01:26 -07:00
Dennis Urtubia 44717152ca Adds accessiblity actions on core components (#31532)
Summary:
Android: Adding custom actions (https://github.com/facebook/react-native/issues/30854).
Adds accessiblity actions on core components (Button, TextInput, Text, and Picker).

## Changelog
[General] [Added] - Adds accessiblity actions on core components

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

Test Plan:
- `npm test`
- Rendering of components on `RNTesterApp` using talkback:
    - Check if accessibility actions were available;
    ![image](https://user-images.githubusercontent.com/33161939/118381843-a668c180-b5c5-11eb-9ce4-016a49157dc5.png)
    - Trigger `activate` action for all components;
    ![image](https://user-images.githubusercontent.com/33161939/118381736-7bca3900-b5c4-11eb-82fb-32e824e1b38c.png)

## Notes
- For `TextInput` an unexpected error is raised:
![image](https://user-images.githubusercontent.com/33161939/118381603-d1054b00-b5c2-11eb-93f2-1d5730ee2d24.png)

Reviewed By: kacieb

Differential Revision: D28654294

Pulled By: lunaleaps

fbshipit-source-id: 80dd3f3c7aa27bbaf16ef12997e8f55952a02eb2
2021-05-26 16:49:11 -07:00
Paige Sun 2c4eba7b9c iOS: 7/7 Test Modal onDismiss with Jest
Summary:
Changelog: [Internal]

Add onDismiss tests for Modal

Reviewed By: fkgozali, sammy-SC, nadiia

Differential Revision: D28074384

fbshipit-source-id: 464c63cc9fe2d3e1709687369eea8cefd78d8356
2021-05-25 10:07:10 -07:00
Eric Rozell 917f83c940 Use transform prop in PanResponderExample
Summary:
Replaces deprecated `translateX` and `translateY` props with `transform` prop in PanResponderExample. This fixes the RNTester example for react-native-windows, which doesn't support the deprecated props.

Changelog:
[General][Fixed] - [RNTester] Use transform prop in PanResponderExample

Reviewed By: kacieb

Differential Revision: D28676164

fbshipit-source-id: 437912b5abf6ca74f0043ded7a902a5938bcf93a
2021-05-25 09:10:53 -07:00
Samuel Susla 285406103d Introduce EventQueueProcessor
Summary:
Changelog: [internal]

Pulling out event queue processing to its separate class. We will be adding more logic there so it makes sense to separate it for simplicity and testability purposes.

Alternative names that came to mind: `EventsProcessor`, `EventsDispatcher`.

Reviewed By: JoshuaGross

Differential Revision: D28572283

fbshipit-source-id: 1cb2459f616b9995f66da80d50c401e68002da7f
2021-05-25 01:16:04 -07:00
Ramanpreet Nara ed86891d01 Migrate NativeModules to initialize
Summary:
This migrates all ObjC NativeModule setBridge: calls to the bridge compatible initialize: call. I filtered out ViewManagers.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28595520

fbshipit-source-id: b0e5dd681fb3563894f1aa3da1728f0c694f04bb
2021-05-21 14:49:51 -07:00
Sladyn Nunes 35dd86180b Fix/30842 - Add accessibilityState prop in slider (#31145)
Summary:
Accessibility service does not announce "selected" on accessibilityState = {selected: true} of the Button Component.
Issue link - https://github.com/facebook/react-native/issues/30956

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Added] - Add accessibilityState prop to Slider component

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

Test Plan:
Verified accessibility states are read by voiceover and talkback. Some state values aren't handled by iOS and have been identified.

Added snapshot tests to test accessibilityState.disabled = disabled values

`js1 test Slider-test`

Reviewed By: yungsters

Differential Revision: D28337723

Pulled By: lunaleaps

fbshipit-source-id: 72a54d8d9dcf1fafb9785c81da99f32a21f3df00
2021-05-21 13:35:56 -07:00
Thibault Malbranche 59abb5f378 fix(hermes): fixed hermes build on iOS (#31559)
Summary:
While testing 0.65, we noticed issues with hermes on iOS in the template projects
These changes create a subspec to the react-core pod so that it can access hermes header correctly.

## Changelog

Not applicable

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

Test Plan: I've ran e2e manual test. Tested RNTester manually also. Then tested a project inited with hermes and the default template

Reviewed By: mhorowitz

Differential Revision: D28564642

Pulled By: Huxpro

fbshipit-source-id: cfcb3363254f62a0e514ec99159b32f841ee4463
2021-05-20 15:23:07 -07:00
Luna Wei ec2dc9e4f2 Fix TextInput-cursorPlacement test
Summary:
Changelog:
[Internal] -  In internal e2e testing, json.stringify is unstable and will occasionally re-order keys. Fix so it's consistent across tests

Reviewed By: kacieb

Differential Revision: D28397174

fbshipit-source-id: 0f2db697d245654c88c3dff3d083bc82890d4bc1
2021-05-18 18:19:24 -07:00
Subramanya Chakravarthy ea609defe8 Disable TouchableOpacity when accessibility disabled is set (#31108)
Summary:
When using a screen reader the TouchableOpacity component disables click functionality.
Fixes Issue https://github.com/facebook/react-native/issues/30951

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Changed] - Message

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

Test Plan: Added Exmple to Accessibility

Reviewed By: yungsters

Differential Revision: D28334356

Pulled By: kacieb

fbshipit-source-id: 3a3e8efaf57272d2091392f6d7d3e0ba0f2a9adc
2021-05-18 13:35:21 -07:00
Ramanpreet Nara 6c5ac8036e Bridgeless Mode: Migrate modules away from invokeJS
Summary:
This diff removes all synthesize invokeJS = _invokeJS calls, and instead funnels them through synthesize callableJSModules = _callableJSModules. Now, all these NativeModules shouldn't have different branching in bridgeless mode vs bridge mode.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28395445

fbshipit-source-id: 41a58d54c60be55e6bf5031e5417728f5eb6285c
2021-05-14 09:22:58 -07:00
Tim Yung 7c6993d9f9 RNTester: Add Animated Loop Example
Summary:
Creates a new `Animated.loop` example in RNTester that uses the native driver.

This example shows the precise problem fixed by facebook/react-native#29585 (D28383538 (129180c77b)).

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28406914

fbshipit-source-id: 63ea7799d4b8bef8b0c1caaa3daf514ca04b7ab1
2021-05-13 16:31:10 -07:00
Siddharth Verma 903eae4915 Add @flow types in AccessibilityAndroidExample.android.js (#31428)
Summary:
[AccessibilityAndroidExample.android.js](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.android.js) does not have proper Flow types. Without Flow typing enforced, it is easy for bugs to be introduced when making changes to this file.

### Changelog

[General] [Added] - Added the flow annotation to `AccessibilityAndroidExample.android.js `
[General] [Added] - Updated the file to use [flow strict-local](https://flow.org/en/docs/strict/#toc-strict-local)

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

Test Plan: Run `flow-check-android` with No Errors in code.

Reviewed By: lunaleaps

Differential Revision: D28334312

Pulled By: kacieb

fbshipit-source-id: 5a1a34da684cb34ded01d9368faae02916cca3bb
2021-05-12 16:13:09 -07:00
Peter Argany b9243e00e3 Fix Hermes + no Flipper build on Xcode 12.5
Summary:
This is a follow up to my diffs from a couple weeks ago bumping folly version to 2021.04.26. Unfortunately, those diffs did not work when Hermes was enabled, and Flipper was disabled, this fixes that.

I've tested the matrix of Hermes enabled/disabled and Flipper enabled/disabled.

Changelog: [iOS]  Fix Hermes + no Flipper build on Xcode 12.5

Reviewed By: yungsters

Differential Revision: D28325790

fbshipit-source-id: e58e1ba4730e7989c48dfd2aae06d91c1d3687db
2021-05-11 15:00:58 -07:00
fabriziobertoglio1987 333b46c4b0 Fix Image does not announce "disabled" (#31252)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/30935 screenreader does not announce Image disabled accessibilityState.

As stated in AOSP View.java, the framework will handle routine focus movement, views indicate their willingness to take focus through the `isFocusable` method https://bit.ly/3dCnyHb

```
* <p>The framework will handle routine focus movement in response to user input. This includes
* changing the focus as views are removed or hidden, or as new views become available. Views
* indicate their willingness to take focus through the {link #isFocusable} method. To change
* whether a view can take focus, call {link #setFocusable(boolean)}.
```

The property is updated through its shadow node `ReactImageManager` method `setAccessible` https://bit.ly/3dDuK5L

```java
 * <p>Instances of this class receive property updates from JS via @{link UIManagerModule}.
 * Subclasses may use {link #updateShadowNode} to persist some of the updated fields in the node
 * instance that corresponds to a particular view type.
```

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - adding setAccessible to ReactImageManager to allow screenreader announce Image accessibilityState of "disabled"

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

Enable audio to hear the screenreader

TEST SCENARIO
- The user moves the screenreader focus to an image and the screenreader reads the Image accessibilityLabel "plain network image"

RESULT
- The screenreader announces the accessibilityState disabled after reading the Image accessibilityLabel "plain network image"

```javascript
<Image
  accessible={true}
  accessibilityLabel="plain network image"
  accessibilityState={{disabled: true}}
  source={fullImage}
  style={styles.base}
/>
```

<video src="https://user-images.githubusercontent.com/24992535/112670432-2f366d00-8e61-11eb-843f-4b56f4a06a91.mp4" width="700" />

</p>
</details>

Reviewed By: kacieb

Differential Revision: D28194597

Pulled By: lunaleaps

fbshipit-source-id: 5f89ce5c714405506261885ac6fea2c15c2e1f23
2021-05-04 14:29:58 -07:00
Paige Sun 9ea2950b6e iOS: 4/7 Add back Modal examples in internal settings
Summary:
Changelog:
[Internal][Changed] - Fix Picker's item value in the ModalCustomizable example

This surface was removed a few days ago in D27926745 (23ae702d97). Add it back to be able to test Modals manually.

There's no e2e test associated with this surface at the moment.

Reviewed By: nadiia, kacieb

Differential Revision: D28074150

fbshipit-source-id: dbcceed75e982d211b5c74cdf5f80aee59f54678
2021-05-02 15:42:49 -07:00
David Vacca 494bab399e RN][JS][static view configs] Use unstable_hasStaticViewConfig to detect if a component is registered in the native app
Summary:
This diff and stack migratest Migrate UIManager.getViewManagerConfig -> UIManager.hasViewManagerConfig
This is necessary to avoid initializing UIManagerModule to detect if a component is registered into the native platform
changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D27983716

fbshipit-source-id: 504180d8883959835e736f8081610b8c49810803
2021-04-30 17:41:25 -07:00
Peter Argany 8eceee744e Fix Hermes build on folly 2021.04.26.00
Summary:
This fixes multiple compile errors when building RNTester with Hermes enabled:
- `Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')`
- `'event2/event-config.h' file not found`
- tons of missing files (all added to RCT-Folly/Futures)

Changelog: [iOS] Fix Hermes build on folly version 2021.04.26.00
allow-large-files

Reviewed By: RSNara

Differential Revision: D28128087

fbshipit-source-id: ee7cb6fda72d00d22f6182d958aa8ba55939f158
2021-04-30 15:05:22 -07:00
Peter Argany 36b58a824e Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00
Summary:
This fixes an error where folly fails to build on Xcode 12.5, by bumping the various folly deps in RN to builds with a fix.

Next step is to commit this to 0.64 release branch

allow-large-files

Changelog: [iOS] Fix builds on Xcode 12.5

Reviewed By: fkgozali

Differential Revision: D28071808

fbshipit-source-id: 236b66bf8294db0c76ff25b11632c1bf89525921
2021-04-29 10:39:25 -07:00
ananta 2b49664cb8 Add flow types to AccessibilityExample.js (#31384)
Summary:
[AccessibilityExample.js](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js) does not have proper Flow types. Without Flow typing enforced, it is easy for bugs to be introduced when making changes to this file. This pull request enforces Flow typing in this file.

## Changelog
[General] [Fixed] - Fixed return type of `AccessibilityRoleAndStateExample`
[General] [Added] - Added Flow Types to AccessibilityExample.js

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

Test Plan:
Before:
![Screen Shot 2021-04-19 at 7 39 58 PM](https://user-images.githubusercontent.com/12180395/115248265-42c6b200-a147-11eb-8dad-058f646a1550.png)

After:
![Screen Shot 2021-04-19 at 7 40 10 PM](https://user-images.githubusercontent.com/12180395/115248284-465a3900-a147-11eb-8bff-4050ce6bd806.png)

Reviewed By: yungsters, nadiia

Differential Revision: D28004170

Pulled By: kacieb

fbshipit-source-id: 77bc44bbaf7a19c034a92a2daef302d5dc6078fa
2021-04-28 15:29:54 -07:00
Ramanpreet Nara 4c5182c1cc RCTNetworking: Use RCTModuleRegistry to load handlers
Summary:
## Context
A React Native application can configure its RCTNetworking by initializing it with id<RCTURLRequestHandler> objects.

Therefore, RCTNetworking supports this initializer:
```
- (instancetype)initWithHandlersProvider:(NSArray<id<RCTURLRequestHandler>> * (^)(void))getHandlers
```

Right now, all id<RCTURLRequestHandler> are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager.

## Problem
The method [that constructs RCTNetworking](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1471) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the request handlers: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean.

## Changes
In this refactor, RCTNetworking gives its _handlersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows the _handlersProvider to load id<RCTURLRequestHandler> from correct infra, in both contexts.

Changelog: [iOS][Changed] - Give RCTNetworking handler provider block RCTModuleRegistry

Reviewed By: PeteTheHeat

Differential Revision: D28013000

fbshipit-source-id: 956d660771ab18f5e7f24fcc28792f9a217146e7
2021-04-27 15:03:05 -07:00
Ramanpreet Nara af6bcfa3ab RCTImageLoader: Use RCTModuleRegistry to load loaders/decoders
Summary:
## Context
A React Native application can configure its RCTImageLoader by initializing it with two different sets of objects:
- id<RCTImageURLLoader>
- id<RCTImageDataDecoder>

Therefore, RCTImageLoader supports this initializer:
```
- (instancetype)initWithRedirectDelegate:(id<RCTImageRedirectProtocol>)redirectDelegate
                         loadersProvider:(NSArray<id<RCTImageURLLoader>> * (^)(void))getLoaders
                        decodersProvider:(NSArray<id<RCTImageDataDecoder>> * (^)(void))getHandlers
```

Right now, both the id<RCTImageURLLoader>s and id<RCTImageDataDecoder>s are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager.

## Problem
The method [that constructs RCTImageLoader](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1462-1469) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the loaders/decoders: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean.

## Changes
In this refactor, RCTImageLoader gives its loadersProvider and decodersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows these two blocks to load the RCTImageURLLoaders and RCTImageDataDecoder from correct infra, in both contexts.

Changelog: [iOS][Changed] - Give RCTImageURLLoader's loader/decoder provider blocks RCTModuleRegistry

Reviewed By: PeteTheHeat

Differential Revision: D28012999

fbshipit-source-id: 09c787923b57bbf72aff95b504f88ee1f2f44283
2021-04-27 15:03:05 -07:00
Nadiia D 9d489354ae Stabilize RootTagContext
Summary:
Changelog:
[General][Added] - Stabilize RootTagContext. And temporarily export both `unstable_RootTagContext` and `RootTagContext`

Reviewed By: TheSavior

Differential Revision: D27951427

fbshipit-source-id: dff8d4ca07c89edeeb517a42a3922e4e23899d8e
2021-04-26 22:57:55 -07:00
Nadiia D 23ae702d97 Add e2e test for a Modal component
Summary:
Changelog:
[General][Added] - [RNTester] Added a modal component example with onShow/onDismiss callbacks

Reviewed By: lunaleaps

Differential Revision: D27926745

fbshipit-source-id: c2f2b8a15154a090bb747bb02cdf428e90861824
2021-04-23 10:12:59 -07:00
Luna Wei ca8a75536e Add scrollToEnd ability to viewability tests
Summary:
Changelog:
[Internal] - RNTester FlatList and SectionList examples to add prop for scrolling to end of list.

Reviewed By: kacieb

Differential Revision: D27816830

fbshipit-source-id: 6b4bd4cb9a651f4a4e9045d600cc219a6ba2e39b
2021-04-21 15:09:33 -07:00
Paige Sun d90253da36 iOS: Fix InputAccessoryView disappearing when inputAccessoryViewID exists
Summary:
InputAccessoryView disappears on Fabric (not Paper) when the text prop changes.

Changelog: [Fabric] [iOS] Fix InputAccessoryView disappearing when inputAccessoryViewID exists

Differential Revision: D27721549

fbshipit-source-id: 163dfcf0a8d5226453f4de356650a6ba82bee10b
2021-04-20 12:50:25 -07:00
Héctor Ramos ae07c53d0b Resolve "fatal: not a git repository" error outside of git repositories
Summary:
CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash.

In these cases, the podspec is being consumed locally and the commit hash is unnecessary.

The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories).

Changelog:
[Internal] [iOS] - Remove CocoaPods error within Facebook's repository

Reviewed By: fkgozali

Differential Revision: D27750974

fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
2021-04-15 13:30:31 -07:00
Ramanpreet Nara c4c34a1237 Delete RCTTurboModuleManagerDelegate getTurboModule:initParams
Summary:
D27316129 made it mandatory for all RCTTurboModules to have a getTurboModule: method. So, there's no need to keep the getTurboModule:initParams method in RCTTurboModuleManagerDelegate. So, to simplify the TurboModule infra, this diff gets rid of that TurboModuleManager delegate method.

Changelog: [iOS][Removed] - Delete RCTTurboModuleManagerDelegate getTurboModule:initParams

Reviewed By: fkgozali

Differential Revision: D27316873

fbshipit-source-id: c0b8449c6088bf08f17ba9a8d1c2cb644e5a242d
2021-04-08 21:15:53 -07:00
Tim Yung ebdf36c198 RN: Upgrade `AccessibilityInfo.removeEventListener` Call Sites
Summary:
Upgrades all users of `AccessibilityInfo.removeEventListener` to instead use the return value of `AccessibilityInfo.addEventListener`. This will avoid soft errors from being fired for Facebook products.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D27595097

fbshipit-source-id: 7133db83c6313ae04e43fc0cc8667f562ba1af2b
2021-04-08 17:37:08 -07:00
Samuel Susla eb13baf2a6 Introducing RuntimeScheduler module
Summary:
Changelog: [internal[

Introducing RuntimeScheduler. A coordinator of work between native and React.

Reviewed By: mdvacca

Differential Revision: D27616818

fbshipit-source-id: e90d3d9ca8907be99e61f69e62e83cece8155050
2021-04-08 04:07:34 -07:00
Kacie Bawiec 2785ce7e61 React Native sync for revisions 6d3ecb7...c9aab1c
Summary:
This sync includes the following changes:
- **[c9aab1c9d](https://github.com/facebook/react/commit/c9aab1c9d )**: react-refresh@0.10.0 //<Dan Abramov>//
- **[516b76b9a](https://github.com/facebook/react/commit/516b76b9a )**: [Fast Refresh] Support callthrough HOCs ([#21104](https://github.com/facebook/react/pull/21104)) //<Dan Abramov>//
- **[0853aab74](https://github.com/facebook/react/commit/0853aab74 )**: Log all errors to console.error by default ([#21130](https://github.com/facebook/react/pull/21130)) //<Sebastian Markbåge>//
- **[d1294c9d4](https://github.com/facebook/react/commit/d1294c9d4 )**: Add global onError handler ([#21129](https://github.com/facebook/react/pull/21129)) //<Sebastian Markbåge>//
- **[64983aab5](https://github.com/facebook/react/commit/64983aab5 )**: Remove redundant setUpdatePriority call ([#21127](https://github.com/facebook/react/pull/21127)) //<Andrew Clark>//
- **[634cc52e6](https://github.com/facebook/react/commit/634cc52e6 )**: Delete dead variable: currentEventWipLanes ([#21123](https://github.com/facebook/react/pull/21123)) //<Andrew Clark>//
- **[1102224bb](https://github.com/facebook/react/commit/1102224bb )**: Fix: flushSync changes priority inside effect ([#21122](https://github.com/facebook/react/pull/21122)) //<Andrew Clark>//
- **[dbe98a5aa](https://github.com/facebook/react/commit/dbe98a5aa )**: Move sync task queue to its own module ([#21109](https://github.com/facebook/react/pull/21109)) //<Andrew Clark>//
- **[3ba5c8737](https://github.com/facebook/react/commit/3ba5c8737 )**: Remove Scheduler indirection ([#21107](https://github.com/facebook/react/pull/21107)) //<Andrew Clark>//
- **[46b68eaf6](https://github.com/facebook/react/commit/46b68eaf6 )**: Delete LanePriority type ([#21090](https://github.com/facebook/react/pull/21090)) //<Andrew Clark>//
- **[dcd13045e](https://github.com/facebook/react/commit/dcd13045e )**: Use Lane to track root callback priority ([#21089](https://github.com/facebook/react/pull/21089)) //<Andrew Clark>//
- **[5f21a9fca](https://github.com/facebook/react/commit/5f21a9fca )**: Clean up host pointers in level 2 of clean-up flag ([#21112](https://github.com/facebook/react/pull/21112)) //<Andrew Clark>//
- **[32d6f39ed](https://github.com/facebook/react/commit/32d6f39ed )**: [Fizz] Support special HTML/SVG/MathML tags to suspend ([#21113](https://github.com/facebook/react/pull/21113)) //<Sebastian Markbåge>//
- **[a77dd13ed](https://github.com/facebook/react/commit/a77dd13ed )**: Delete enableDiscreteEventFlushingChange ([#21110](https://github.com/facebook/react/pull/21110)) //<Andrew Clark>//
- **[048ee4c0c](https://github.com/facebook/react/commit/048ee4c0c )**: Use `act` in fuzz tester to flush expired work ([#21108](https://github.com/facebook/react/pull/21108)) //<Andrew Clark>//
- **[556644e23](https://github.com/facebook/react/commit/556644e23 )**: Fix plurals ([#21106](https://github.com/facebook/react/pull/21106)) //<Sebastian Markbåge>//
- **[8b741437b](https://github.com/facebook/react/commit/8b741437b )**: Rename SuspendedWork to Task ([#21105](https://github.com/facebook/react/pull/21105)) //<Sebastian Markbåge>//
- **[38a1aedb4](https://github.com/facebook/react/commit/38a1aedb4 )**: [Fizz] Add FormatContext and Refactor Work ([#21103](https://github.com/facebook/react/pull/21103)) //<Sebastian Markbåge>//
- **[1b7e471b9](https://github.com/facebook/react/commit/1b7e471b9 )**: React Native New Architecture: Support passing nativeViewTag to getInspectorDataForViewAtPoint callback, for React DevTools compat ([#21080](https://github.com/facebook/react/pull/21080)) //<Joshua Gross>//
- **[4a99c5c3a](https://github.com/facebook/react/commit/4a99c5c3a )**: Use highest priority lane to detect interruptions ([#21088](https://github.com/facebook/react/pull/21088)) //<Andrew Clark>//
- **[77be52729](https://github.com/facebook/react/commit/77be52729 )**: Remove LanePriority from computeExpirationTime ([#21087](https://github.com/facebook/react/pull/21087)) //<Andrew Clark>//
- **[3221e8fba](https://github.com/facebook/react/commit/3221e8fba )**: Remove LanePriority from getBumpedLaneForHydration ([#21086](https://github.com/facebook/react/pull/21086)) //<Andrew Clark>//
- **[05ec0d764](https://github.com/facebook/react/commit/05ec0d764 )**: Entangled expired lanes with SyncLane ([#21083](https://github.com/facebook/react/pull/21083)) //<Andrew Clark>//
- **[03ede83d2](https://github.com/facebook/react/commit/03ede83d2 )**: Use EventPriority to track update priority ([#21082](https://github.com/facebook/react/pull/21082)) //<Andrew Clark>//
- **[a63f0953b](https://github.com/facebook/react/commit/a63f0953b )**: Delete SyncBatchedLane ([#21061](https://github.com/facebook/react/pull/21061)) //<Ricky>//
- **[fa868d6be](https://github.com/facebook/react/commit/fa868d6be )**: Make opaque EventPriority type a Lane internally ([#21065](https://github.com/facebook/react/pull/21065)) //<Andrew Clark>//
- **[eb58c3909](https://github.com/facebook/react/commit/eb58c3909 )**: react-hooks/exhaustive-deps: Handle optional chained methods as dependency ([#20204](https://github.com/facebook/react/pull/20204)) ([#20247](https://github.com/facebook/react/pull/20247)) //<Ari Perkkiö>//
- **[7b84dbd16](https://github.com/facebook/react/commit/7b84dbd16 )**: Fail build on deep requires in npm packages ([#21063](https://github.com/facebook/react/pull/21063)) //<Dan Abramov>//
- **[2c9d8efc8](https://github.com/facebook/react/commit/2c9d8efc8 )**: Add react-reconciler/constants entry point ([#21062](https://github.com/facebook/react/pull/21062)) //<Dan Abramov>//
- **[d0eaf7829](https://github.com/facebook/react/commit/d0eaf7829 )**: Move priorities to separate import to break cycle ([#21060](https://github.com/facebook/react/pull/21060)) //<Andrew Clark>//
- **[435cff986](https://github.com/facebook/react/commit/435cff986 )**: [Fizz] Expose callbacks in options for when various stages of the content is done ([#21056](https://github.com/facebook/react/pull/21056)) //<Sebastian Markbåge>//
- **[25bfa287f](https://github.com/facebook/react/commit/25bfa287f )**: [Experiment] Add feature flag for more aggressive memory clean-up of deleted fiber trees ([#21039](https://github.com/facebook/react/pull/21039)) //<Benoit Girard>//
- **[8fe7810e7](https://github.com/facebook/react/commit/8fe7810e7 )**: Remove already completed comment ([#21054](https://github.com/facebook/react/pull/21054)) //<Sebastian Markbåge>//
- **[6c3202b1e](https://github.com/facebook/react/commit/6c3202b1e )**: [Fizz] Use identifierPrefix to avoid conflicts within the same response ([#21037](https://github.com/facebook/react/pull/21037)) //<Sebastian Markbåge>//
- **[dcdf8de7e](https://github.com/facebook/react/commit/dcdf8de7e )**: Remove discrete lanes and priorities ([#21040](https://github.com/facebook/react/pull/21040)) //<Andrew Clark>//
- **[ca99ae97b](https://github.com/facebook/react/commit/ca99ae97b )**: Replace some flushExpired callsites ([#20975](https://github.com/facebook/react/pull/20975)) //<Ricky>//
- **[1fafac002](https://github.com/facebook/react/commit/1fafac002 )**: Use SyncLane for discrete event hydration ([#21038](https://github.com/facebook/react/pull/21038)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 6d3ecb7...c9aab1c

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D27436763

fbshipit-source-id: da79a41e26bffdcdacd293178062edf098e9b58a
2021-04-06 12:42:37 -07:00
fabriziobertoglio1987 7ee2acc6c8 Selected State does not annonce when TextInput Component selected (#31144)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/30955 and is a follow up to pr https://github.com/facebook/react-native/pull/24608 which added the basic Accessibility functionalities to React Native.

TextInput should announce "selected" to the user when screenreader focused.
The focus is moved to the TextInput by navigating with the screenreader to the TextInput.

This PR adds call to View#setSelected in BaseViewManager https://developer.android.com/reference/android/view/View#setSelected(boolean)
The View#setSelected method definition https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/view/View.java
```java
/**
 * Changes the selection state of this view. A view can be selected or not.
 * Note that selection is not the same as focus. Views are typically
 * selected in the context of an AdapterView like ListView or GridView;
 * the selected view is the view that is highlighted.
 *
 * param selected true if the view must be selected, false otherwise
 */
public void setSelected(boolean selected) {
  if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) {
    // ... hidden logic
    if (selected) {
      sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
    } // ... hidden logic
  }
}
```

VoiceOver and TalkBack was tested with video samples included below.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix Selected State does not announce when TextInput Component selected on Android

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

**ENABLE THE AUDIO** to hear the TalkBack announcing **SELECTED** when the user taps on the TextInput

```javascript
        <TextInput
          accessibilityLabel="element 20"
          accessibilityState={{
            selected: true,
          }} />
```

| selected is true |
|:-------------------------:|
| <video src="https://user-images.githubusercontent.com/24992535/111652826-afc4f000-8807-11eb-9c79-8c51d7bf455b.mp4" width="700" height="" /> |

```javascript
        <TextInput
          accessibilityLabel="element 20"
          accessibilityState={{
            selected: false,
          }} />
```

| selected is false |
|:-------------------------:|
| <video src="https://user-images.githubusercontent.com/24992535/111652919-c10dfc80-8807-11eb-8244-83db6c327bcd.mp4" width="700" height="" /> |

The functionality does not present issues on iOS

| iOS testing |
|:-------------------------:|
| <video src="https://user-images.githubusercontent.com/24992535/111647656-f401c180-8802-11eb-9fa9-a4c211cf1665.mp4" width="400" height="" /> |

</p>
</details>

</p>
</details>

Reviewed By: blavalla

Differential Revision: D27306166

Pulled By: kacieb

fbshipit-source-id: 1b3cb37b2d0875cf53f6f1bff4bf095a877b2f0e
2021-04-05 11:51:12 -07:00
Luna Wei cb028ee69c Add e2e tests for RNTester examples and relevant testIDs
Summary:
Changelog:
[Internal] - Add testIDs to RNTester examples

Reviewed By: nadiia

Differential Revision: D27374322

fbshipit-source-id: 62a63f6f454c21bf98b328275d35776d677a9962
2021-04-02 16:57:10 -07:00
Nadiia D a782b6f5a1 Remove unsafe lifecycles usage
Summary:
Changelog:
[General][Changed] - [Modal] removed UNSAFE_componentWillReceiveProps lifecycle usage

Reviewed By: lunaleaps

Differential Revision: D27523213

fbshipit-source-id: 288b91bc6c479c62313ba17047069893cd19588c
2021-04-02 13:07:35 -07:00
Samuel Susla 9ef995a14a Enable C++ 17 in React Native
Summary:
Changelog: [Internal] enable support for C++ 17.

C++ 17 in React Native targets.

Short and comprehensive list of C++ features:
https://github.com/AnthonyCalandra/modern-cpp-features#c17-language-features

Reviewed By: JoshuaGross

Differential Revision: D27431145

fbshipit-source-id: e8da6fe9d70e9b7343a8caec21cdbeb043478575
2021-04-01 04:50:59 -07:00
Luna Wei bac2c2c801 Update FlowFixMes to use error codes in react-native-github
Summary:
Changelog:
[Internal] - Add error codes to existing FlowFixMe's

Reviewed By: kacieb

Differential Revision: D27445689

fbshipit-source-id: 2b19692e1cb822ab6785efcc5f93ee33e7dce1e5
2021-03-31 18:21:47 -07:00
Luna Wei 321de15803 Delete unused FlowFixMes in xplat/js/react-native-github
Summary:
Changelog:
[Internal] - Remove unused FlowFixMes

Reviewed By: kacieb

Differential Revision: D27445690

fbshipit-source-id: c1fbf4495ae020b30a458c2ef4870547fd5d5c6e
2021-03-31 18:21:47 -07:00
Luna Wei d1f09f7390 Add Switch Test Component and more testIDs
Summary:
Changelog:
[Internal] - Add more testIDs to SwitchExample

Reviewed By: kacieb

Differential Revision: D27371058

fbshipit-source-id: d2d90923c2c07cd86fd9aa965339dadf43f8fb5f
2021-03-29 18:34:30 -07:00
Samuel Susla 79090c4802 Fabric: Decoupling Telemetry aggregation classes into a separate module
Summary:
We need to do this to break a dependency cycle that would happen if we try to have `view` depend on `mounting` just to add some telemetry to `view`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26827446

fbshipit-source-id: 4c415ebf5be3a02c18c80ea8a4a77068cae0f0fe
2021-03-29 05:12:42 -07:00
David Vacca 07d527f9c5 Use unstable_hasStaticViewConfig to detect if a component is registered in the native app
Summary:
This diff is a revert of the stack D27276533. the native fix will be included as part of another diff

changelog: [internal] internal

Reviewed By: JoshuaGross, ShikaSD

Differential Revision: D27332513

fbshipit-source-id: 203051ea8fec3f508d79c329c9b61399fbbc3d1b
2021-03-25 12:45:27 -07:00
David Vacca a15a46c78e Migrate UIManager.getViewManagerConfig -> UIManager.hasViewManagerConfig in SnapshotViewIOS
Summary:
This diff and stack migratest Migrate UIManager.getViewManagerConfig -> UIManager.hasViewManagerConfig
This is necessary to avoid initializing UIManagerModule to detect if a component is registered into the native platform

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D27276525

fbshipit-source-id: a9b6ad05e6d3e47df9efad75e42411a441f7a779
2021-03-24 00:30:05 -07:00
Luna Wei 4cc3aa851c Move out rest of examples
Summary:
Changelog:
[Internal][Changed] - RNTester: Move rest of Animated examples to separate modules

Reviewed By: nadiia

Differential Revision: D27245469

fbshipit-source-id: e533bde396cc9f3cb0453eaf1639ad69dbd117e8
2021-03-23 18:39:48 -07:00
Luna Wei 98f565c317 Move out FadeInView
Summary:
Changelog:
[Internal][Changed] - Move FadeInView example to separate module in RNTester and refactor to use functional component

Reviewed By: nadiia

Differential Revision: D27245473

fbshipit-source-id: bd9aacc17203dadcee134eee1bae54a5daa16cde
2021-03-23 18:39:47 -07:00
Luna Wei 22107c6f9f Move out RotatingImages example
Summary:
Changelog:
[Internal][Changed] - Move RNTester Animated example, RotatingImages to a separate module

Reviewed By: nadiia, kacieb

Differential Revision: D27245468

fbshipit-source-id: df4c5cb0b1f5b6cea7a4c5457d8c419e1f39c475
2021-03-23 18:39:47 -07:00
Joshua Gross ee539cb280 Don't use setLayoutAnimationEnabledExperimental in RNTester AnimatedGratuitousApp
Summary:
Context: in non-Fabric (classic) RN, LayoutAnimations is disabled by default on Android; and this is needed to enable LayoutAnimations globally for Android.

Reasoning: in Fabric this noops, because LayoutAnimations are unconditionally enabled in Android+Fabric; and to support StaticViewConfig and Bridgeless RN, we need to remove direct UIManager calls.

Potential impact: On Android and for non-Fabric users only, some transitions will not be animated. Given that LayoutAnimations in non-Fabric RN on Android are not stable and have lots of known un-fixable crashes, this will probably increase stability for non-Fabric Android users. For iOS or Fabric users there's no impact.

Changelog: [Changed][Android] LayoutAnimations in AnimatedGratuitousApp disabled for non-Fabric Android devices

Reviewed By: mdvacca

Differential Revision: D27273392

fbshipit-source-id: 786d5d2f2b05591ca747aab134fb3f321500fece
2021-03-23 18:22:52 -07:00
Kacie Bawiec cfb5b5e20a Add test with Multiple Sticky Headers for ScrollView
Summary:
Changelog:
[Added] Add a test with multiple sticky headers for ScrollView

Reviewed By: nadiia

Differential Revision: D27131325

fbshipit-source-id: 8793a246ee5433aa2f97d3f05cdb5c86412f8168
2021-03-18 16:50:59 -07:00
Kacie Bawiec feebfe1ef6 Fix typo in sendAccessibilityEvent in AccessibilityExample.js
Summary:
Changelog:
[Fixed] Fix typo in sendAccessibilityEvent in AccessibilityExample.js

Reviewed By: mdvacca

Differential Revision: D27160274

fbshipit-source-id: eee0a6cefa559b29ed73890abff3a44dacb19b62
2021-03-18 12:23:35 -07:00
Luna Wei bbf571cf11 Adapt SectionListExamples
Summary:
# Changelog:
[General][Added] - Added more RNTester examples for FlatList as similar to SectionListExamples.

Reviewed By: kacieb

Differential Revision: D27104601

fbshipit-source-id: 0a2cb24382d42956bacf455fd0a699adb61c7c83
2021-03-18 11:36:29 -07:00
Luna Wei c357cb4bbf Viewability examples
Summary:
# Changelog:
[Internal][Added] - Provide more props to SectionList examples

Reviewed By: kacieb

Differential Revision: D27100891

fbshipit-source-id: 10e83ca16badf18e8218557aff1ee8a7a86e8c54
2021-03-18 11:36:29 -07:00
Luna Wei 8f2c51bde3 Example update to flex 1 and and make visibilityConfig as prop
Summary:
Changelog:
[General][Changed] - Updated SectionList example in RNTester

Lists need an explicit height set, otherwise their intrinsic height is the height of the root view. This causes rendering issues as shown in the test plan.

Additionally, refactored to allow visibilityConfig to be passed as prop for future tests.

Reviewed By: kacieb

Differential Revision: D27098086

fbshipit-source-id: b19155de79d00dddc287a1e2f9cdb240f2f31e27
2021-03-18 11:36:28 -07:00
Kacie Bawiec 54f754b390 Add LTR and RTL Horizontal ScrollViews for E2E Tests
Summary:
This diff splits up the LTR and RTL examples in RNTester for Horizontal ScrollView into two examples for ease of E2E testing.

Changelog:
[Changed] Split RTL and LTR Horizontal ScrollView tests in RNTester into two tests

Reviewed By: lunaleaps

Differential Revision: D27139885

fbshipit-source-id: aae8aa06f4827507d1bc26a6b173d39cc92e20fe
2021-03-18 08:15:14 -07:00
Samuel Susla 34d189ae09 Introducing Leak Checker
Summary:
Changelog: [internal]

Introducing LeakChecker. A tool that checks if all native components have been cleaned up when surface is stopped.

**Known shortcomings**:
- LeakChecker is only enabled in debug builds and the existence of leaks is logged to console.
- For now, Leak Checker looks at N-1 screen. This is intentional as there is a known limitation of React that doesn't free up all shadow nodes when surface is stopped. Because of this, the use of LeakChecker is not intuitive and I'll work with React team to try to work around this.
- It doesn't help locating the leak, it only informs that leak is present. I'll be looking into ways to help locate the leak.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D26727461

fbshipit-source-id: 8350190b99f24642f8e15a3c2e1d79cfaa810d3d
2021-03-17 02:57:37 -07:00
Nadiia D 6333c15fa2 Back out "Remove deprecated lifecycles usage"
Summary:
Changelog:
[General][Changed] REVERT: createAnimatedComponent: removed deprecated lifecycles usage

Original commit changeset: 04d016b30ae0

Reviewed By: JoshuaGross

Differential Revision: D27053061

fbshipit-source-id: 6bb50da0a773070a979e7c52957a375b20c7c609
2021-03-15 15:11:48 -07:00
Samuel Susla 23cf99544c Introduce RCTInstallNativeComponentRegistryBinding
Summary:
Changelog: [internal]

Creates new function `RCTInstallNativeComponentRegistryBinding` which can be called during JS setup to register JS function `__nativeComponentRegistry__hasComponent`.

Note: This diff doesn't call `RCTInstallNativeComponentRegistryBinding`.

Reviewed By: shergin

Differential Revision: D26946176

fbshipit-source-id: 0625b8dd6090bc9e08baa38ba60b9cbe48268184
2021-03-15 03:39:13 -07:00
Nadiia D ba61267015 Remove deprecated lifecycles usage
Summary:
Changelog:
[General][Changed] createAnimatedComponent: removed deprecated lifecycles usage

Reviewed By: lunaleaps

Differential Revision: D26734209

fbshipit-source-id: 04d016b30ae0d989890a4b3d8602d47a399dcd11
2021-03-11 16:43:10 -08:00
Huzaifa Khan 5889cbebe3 Added talkback support for button accessibility: disabled prop (#31001)
Summary:
Issue # https://github.com/facebook/react-native/issues/30934 .When using a screen reader disabled buttons do not announce that they are disabled.

## Changelog

[Android] [Changed] - Passing accessibility state in button so it can announce disabled in talkback

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

Test Plan:
I have added Button in Button Example with accessibiltyState prop that will announce button is disabled when testing with talkback.

## Ios test
I am unable to run ios project on my machine. RNTesterPods.xcworkspace gives workspace integrity error :/

Reviewed By: kacieb

Differential Revision: D26492483

Pulled By: lunaleaps

fbshipit-source-id: c4bbe8ca896b0d303976591c300ccac67a96ac73
2021-03-11 12:02:40 -08:00
Tim Yung c47a03563d RN: Change Dimensions to Return EventSubscription
Summary:
Changes `Dimensions.addEventListener` to return an `EventSubscription` object that has a `remove()` method on it.

In an upcoming commit, calling `Dimensions.removeEventListener` will lead to a deprecation warning.

Changelog:
[General][Change] - `Dimensions.addEventListener` now returns an `EventSubscription`.

Reviewed By: kacieb

Differential Revision: D26808827

fbshipit-source-id: 0cfdc65b83c177f60937c1aa3a4cf633592f73d7
2021-03-10 16:06:26 -08:00
Hans Halverson d477f80113 Deploy Flow v0.146.0
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D26835439

fbshipit-source-id: 2607c3185485c8bd2c7e868dd2e3e0c06866f1f9
2021-03-06 11:37:57 -08:00
Tim Yung 305b4253c2 RN: Change Appearance to Return EventSubscription
Summary:
Changes `Appearance.addChangeListener` to return an `EventSubscription` object that has a `remove()` method on it.

In an upcoming commit, calling `Appearance.removeChangeListener` will lead to a deprecation warning.

Changelog:
[General][Change] - `Appearance.addChangeListener` now returns an `EventSubscription`.

Reviewed By: kacieb

Differential Revision: D26696388

fbshipit-source-id: d0bdeffff3a2a366b3c11b6dc1417dfb2f1455c2
2021-03-03 21:43:48 -08:00
Kacie Bawiec fb0a7edd6c Add scroll buttons to invertStickyHeaders ScrollView test
Summary:
This diff adds buttons to scroll to top and scroll to end to the invertStickyHeaders ScrollView test. This will allow programmatic scrolling to test sticky header behavior in end-to-end tests.

NOTE: This prop doesn't seem to work at all to invert the sticky header.

NOTE: There is also a bug where on first render, the sticky header does not "stick" correctly. My diff has not changed this and it seems to be a JS issue - I will investigate in another diff.

Changelog:
[General][Added] Added scroll buttons to invertStickyHeaders ScrollView test

Reviewed By: nadiia

Differential Revision: D26735461

fbshipit-source-id: 66db39ab9c9dbc9c62f50c5ff56db67a829f6db8
2021-03-03 15:34:36 -08:00
Luna Wei ede065c8b0 SectionList example add updateProps to example
Summary:
# Changelog
[General][Added] - Expand example in RNTester for separators on VirtualizedSectionList to showcase updating props on separator ("has not been pressed" -> "has been pressed")

Reviewed By: nadiia, kacieb

Differential Revision: D26713429

fbshipit-source-id: 21034fab5a80d46c46462c41b0989cc9e4c45d03
2021-03-03 01:10:50 -08:00
Joshua Gross ee98e6a493 ReactCommon/nativemodule: Migrate uses of NDEBUG to REACT_NATIVE_DEBUG + react_native_assert
Summary:
For better cross-platform consistency, migrate usages of NDEBUG to REACT_NATIVE_DEBUG. See flags.h for explanation.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D26695016

fbshipit-source-id: 63e6f6fc919076d94f04416f6821f21e0b3707a3
2021-02-26 21:20:25 -08:00
Janic Duplessis 3399896ae7 Update flipper in RNTester and template (#31010)
Summary:
allow-large-files

RN Tester is using an old version of Flipper. This will help testing regressions in the latest version (which is installed when starting a new project). This also fixes an issue where libevent is incompatible between the one in flipper and when using hermes on iOS. To fix it I changed to use the version published on cocoapods instead of using a local podspec (see https://github.com/facebook/flipper/issues/1916).

## Changelog

[General] [Changed] - Update flipper

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

Test Plan:
- Tested that RN tester builds and flipper works with hermes enabled / disabled and fabric on iOS
- Tested that RN tester builds and flipper works on Android

Reviewed By: fkgozali

Differential Revision: D26592317

Pulled By: PeteTheHeat

fbshipit-source-id: 2cd278c7a51b1859dab0465846b061221f07d3f6
2021-02-24 12:23:27 -08:00
Andrei Shikov 36ca57ee25 Mark rn tester flavours as debuggable
Summary:
Changelog: [Internal]

Debuggable flag defines multiple things for flavours including `NDEBUG` flag in native builds. We need to explicitly state this from build.gradle to use it.

Reviewed By: JoshuaGross

Differential Revision: D26610482

fbshipit-source-id: e0c8095e239241c57a119e561b125cab16bf299f
2021-02-23 13:23:31 -08:00
Luna Wei 174372c178 SectionList Separators Example
Summary:
Changelog:
[General][Added] - Added an example showcasing how separator callbacks work in SectionList for RNTester

Reviewed By: nadiia

Differential Revision: D26575122

fbshipit-source-id: 46710e2647c84bdf083265ce04ba330bd70eb2a7
2021-02-22 17:06:22 -08:00
Andrei Shikov dbbc1c1624 Add react build app plugin and extension
Summary:
Changelog:
[Android][Added] - Basic definition for react gradle plugin

Adds plugin and build configuration + copies config from react.gradle to extension.
Copies internals of react.gradle to the plugin. Will be refactored in the next commits.

Reviewed By: mdvacca

Differential Revision: D25693008

fbshipit-source-id: b0feaa02cee8a1ee94d032426d19c501ff3b2534
2021-02-22 08:16:51 -08:00
Peter Argany f0faa7843c Remove iOS10/tvOS10 support from remaining podfiles
Summary: Changelog: [iOS] Remove iOS10/tvOS10 support from remaining podfiles

Reviewed By: shergin

Differential Revision: D26410811

fbshipit-source-id: 9050346def5070338e709ff102a284a828821586
2021-02-19 13:47:25 -08:00
Kacie Bawiec 28fb41a0ab Add an example showing the prop contentInset in SectionList
Summary:
This prop is iOS only.

Changelog:
[iOS][Added] Add an example showing the prop contentInset in SectionList

Reviewed By: lunaleaps

Differential Revision: D26491787

fbshipit-source-id: 31398388081a22ccd17cc256aa174ffe7764e7a9
2021-02-17 20:40:20 -08:00
Joshua Gross ec4833f06d Introduce RN_DEBUG flag and rn_assert for Cxx
Summary:
BUCK always defines NDEBUG on Android builds. This is a longstanding issue and it's tricky to work around.

Previous attempts to fix this within React Native were difficult because disabling NDEBUG caused lots of issues that were difficult to track down.

Instead, I am (1) introducing a new RN_DEBUG flag that can be used cross-platform, (2) whenever NDEBUG is *not* enabled, RN_DEBUG will automatically be defined, (3) enables debug-only code to be compiled on Android, (4) enables us to selectively, slowly migrate `assert` to `rn_assert` in a way that doesn't impact non-Android platforms, but allows us to maintain stability of Android debug builds.

Actually enabling the RN_DEBUG flag in debug builds is done in FB-internal code. I assume the NDEBUG issue is not a problem when compiling in open-source without BUCK.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26409355

fbshipit-source-id: 285b8073bba3756834925727bfa28d3c6bc06335
2021-02-17 18:00:47 -08:00
Joshua Gross fb1833eede Consolidate various debug-only flags into flags.h (#30988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30988

We have a bunch of flags scattered throughout the codebase with poor hygiene and commenting. Consolidate.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26392518

fbshipit-source-id: 2823de123a5009d6b8c358e8a3f451b9fa0e05b7
2021-02-17 18:00:47 -08:00
Igor Klemenski c37d49492b Work around max path length during source build of RN Android (#30776)
Summary:
Building ReactAndroid from source on Windows has recently hit the limitation of maximum path lengths.
At build time, during the `:ReactAndroid:buildReactNdkLib` task, the linker tries to access several of the intermediate binaries located deep in the tmp folder hierarchy, eg.
```
D:\r\ReactAndroid\build\tmp\buildReactNdkLib/local/armeabi-v7a/objs/react_render_components_progressbar/D_/r/ReactAndroid/__/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.o
```
**Suggested fix:** for modules such as `react_render_components_progressbar` and `react_render_components_picker`, rename them to `rrc_progressbar` etc.

**NOTE**: this assumes that the fix from https://github.com/facebook/react-native/issues/30535 is in place. This regression happened while https://github.com/facebook/react-native/issues/30535 has been pending checkin.

**Other mitigations I've tried:**
- setting [`LOCAL_SHORT_COMMANDS`](https://developer.android.com/ndk/guides/android_mk#local_short_commands) for the problematic modules or `APP_SHORT_COMMANDS` for the root project. Turns out those commands don't work on the NDK version RN requires, but even after manually applying a [patch ](https://android-review.googlesource.com/c/platform/ndk/+/1126440) to my local copy of the NDK, these flags had no effect.
- moving the repo directory higher in the file system tree, and using short directory names `D:\r\...` was not enough
- creating virtual drive letters for specific long paths with the [`sust`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst#examples) command is not workable, since they depend on the source folder structure, and get partly generated by the build system, which I can't plug into
- just enabling long path support on Windows is not enough, since the compiler toolchain doesn't support them.
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix source build on Windows machines vol. 2

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

Test Plan:
Run `.\gradlew installArchives`

Before:
![image](https://user-images.githubusercontent.com/12816515/105435667-a1e15d00-5c12-11eb-9fcd-d0c278aaf477.png)
Now:
![image](https://user-images.githubusercontent.com/12816515/105435741-c2a9b280-5c12-11eb-88d5-a69ae56bbf50.png)

Differential Revision: D26194286

Pulled By: mdvacca

fbshipit-source-id: 778b5a0515148e2ace19e7902f74301831ebed94
2021-02-11 12:32:33 -08:00
Luna Wei 49f5d148a7 Add inverted test case
Summary:
Changelog:
[General][Added] - Add inverted example for SectionList in RNTester

Reviewed By: kacieb

Differential Revision: D26333023

fbshipit-source-id: 43ca139a725b7b5d269150d2d56b7b57124a69e0
2021-02-10 19:18:24 -08:00
Luna Wei 575e23eb2a Add stickyHeadersEnabled example
Summary:
Changelog:
[General][Added] - [RNTester] Add stickyHeadersEnabled example

Reviewed By: kacieb

Differential Revision: D26333022

fbshipit-source-id: 37c869bbd25e4d6a090b53b1cffdf236ac27a8f3
2021-02-10 19:18:24 -08:00
Luna Wei 2e8b5df7b7 Refactor SectionList examples
Summary:
Changelog:
[General][Changed] Refactor how we create test cases for SectionList and update some styling

Reviewed By: kacieb

Differential Revision: D26326600

fbshipit-source-id: d6f62f60fec9a5890db9d00c264b62123d3c723e
2021-02-10 19:18:23 -08:00
Nadiia D 7d4612b076 Add testIDs and names to Animated examples
Summary:
Changelog:
[General][Internal] - Add testIDs to the Animated examples.

Reviewed By: kacieb

Differential Revision: D26312729

fbshipit-source-id: c9131bb0fda1533d78dd6cf61d8c604053c7884f
2021-02-09 21:07:52 -08:00