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

474 Коммитов

Автор SHA1 Сообщение Дата
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
Nadiia D 2c19d85285 TextInput: test cursor placement
Summary:
Changelog:
[General][Internal] Added some test IDs for the TextIput examples.

Reviewed By: lunaleaps

Differential Revision: D26265361

fbshipit-source-id: 26d7a69f74f283daed2ddabaaf31113cd3089bf3
2021-02-09 21:07:52 -08:00
Nadiia D 05b54cbee9 TextInput: create shared test utils
Summary:
Changelog:
[General][Internal] Added some test IDs and names for the TextIput examples.

Reviewed By: lunaleaps

Differential Revision: D26263554

fbshipit-source-id: 958a030eafbbed9076f49ab05585f30ddef3ef23
2021-02-09 21:07:51 -08:00
Luna Wei 16efb8dd52 Render test titles and standardize on output
Summary:
Changelog:
[General][Added] - Show a test title if set and standardize the output

Note this will break existing screenshot tests so will need to re-run these

Reviewed By: nadiia

Differential Revision: D26318844

fbshipit-source-id: cef48d72a524ccc6f32b9d930c68fe4171270365
2021-02-09 11:59:52 -08:00
Luna Wei 7f5ec15009 Update RNTester example headers
Summary:
Changelog:
[General][Changed] - Update RNTester example headers
* Removed platform availability on a example page
* Add the title of the example module since we aren't updating the native title bar

Since we already show platform information on the list of examples, it's redundant to show it again on the example page and this would give us more clearance for our examples below.

Where we already show platform information
| Android | iOS |
| {F370209520} | {F370209763} |

Reviewed By: nadiia, kacieb

Differential Revision: D26293966

fbshipit-source-id: a503db3703fc0c56a64c91880a83d222fe38faf4
2021-02-08 17:08:43 -08:00
Luna Wei 4ed54c6411 Move SectionList examples to RNTester
Summary:
Changelog:
[General][Added] - Add more SectionList examples to RNTester

Move the examples we're using for e2e tests to RNTester as well

Reviewed By: nadiia, kacieb

Differential Revision: D26290719

fbshipit-source-id: c61ccd3034ac21c779c3a94e5c0febcfbf9897f7
2021-02-08 17:08:43 -08:00
Kacie Bawiec f0ed1e8201 Add to an RNTester ScrollView example a TextInput and a Button to test keyboardShouldPersistTaps
Summary:
This is an example from RNTester. I added a button in the ScrollView which can eat taps. This allows us to test the `keyboardShouldPersistTap` prop values for `ScrollView`, since there was no way to differentiate between "handled" and "always".

Expected behavior for each value of `keyboardShouldPersistTaps`:
* `"handled"` - The keyboard should dismiss if the ScrollView is tapped, but pressable components like buttons can eat taps (and not dismiss the keyboard)

* `"never"` - The keyboard should always dismiss when anything in the ScrollView is tapped. Buttons won't be pressed - the keyboard will dismiss instead.

* `"always"` - The keyboard should never dismiss. Buttons and other content in the ScrollView can be tapped.

Reviewed By: lunaleaps, nadiia

Differential Revision: D26228852

fbshipit-source-id: 1df78f0be10e2f2cc81e95548a6a6f7cab07894f
2021-02-04 12:48:13 -08:00
Tim Yung 6f22989e92 RN: Simplify `AppState`
Summary:
Simplifies `AppState` by removing redundant methods and changing `addEventListener` to return an `EventSubscription`.

Changelog:
[General][Changed] - `AppState.addEventListener` now returns an `EventSubscription` object.
[General][Removed] - Removed `AppState.removeEventListener`. Instead, use the `remove()` method on the object returned by `AppState.addEventListener`.
[General][Removed] - `AppState` no longer inherits from `NativeEventEmitter`, so it no longer implements `addListener`, `removeAllListeners`, and `removeSubscription`.

Reviewed By: wtfil

Differential Revision: D26161343

fbshipit-source-id: b3cff76bf0f8f7d79cd954fdef551d0654c682ca
2021-02-04 12:48:13 -08:00
Ramanpreet Nara 13f100f788 Move TurboModuleManager creation into ReactInstanceManager
Summary:
See title.

Changelog: [Android][Changed] - Move TurboModuleManager creation into ReactInstanceManager

Reviewed By: mdvacca

Differential Revision: D26193053

fbshipit-source-id: fe92636f0cb3dca65fa919ac5df8931b693f76c5
2021-02-02 20:50:31 -08:00
Ramanpreet Nara 48e4e34107 Give RNTesterTurboModuleManagerDelegate a Builder
Summary:
We'll pass these ReactPackageTurboModuleManagerDelegate.Builders to ReactInstanceManager. ReactInstanceManager will then use these builders to initialize the TurboModule system. To allow TurboModules to work with RNTester, we have to switch RNTester over to using these Builders.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26193054

fbshipit-source-id: d98b857226be3ebaa22b1b734a4e76c0f4be6608
2021-02-02 20:50:30 -08:00
Ramanpreet Nara 2a1b5193f7 Allow ReactInstanceManager to create TurboModuleManager
Summary:
Previously, owner(TurboModuleManager) used to depend on owner(ReactInstanceManager). Now, owner(ReactInstanceManager) depends on owner(TurboModuleManager).

**Rationale:** This allows ReactInstanceManager to create TurboModuleManager.

## Changes
We moved ReactPackageTurboModuleManagerDelegate to com.facebook.react.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26163661

fbshipit-source-id: 3ebff16ef2aa77e20bb55500ed44c9214acb91dd
2021-02-02 20:50:30 -08:00
Micha Reiser 93377ff508 Remove "use strict" directive from ES Modules
Summary:
ES Modules implicitly enable strict mode. Adding the "use strict" directive is, therefore, not required.

This diff removes all "use strict" directives from ES modules.

Changelog:

[Internal]

Reviewed By: motiz88

Differential Revision: D26172715

fbshipit-source-id: 57957bcbb672c4c3e62b1db633cf425c1c9d6430
2021-02-02 11:12:56 -08:00
Janic Duplessis 12fccdeea3 Make codegen more reliable on iOS (#30792)
Summary:
This addesses a few issues I noticed while migrating my app to the new build-time codegen on iOS.

1. I noticed random failures because of codegen on iOS. This is mostly due to the fact the codegen output files are not specified in the xcode script. The only reason it works relatively fine currently is because the codegen output is inside the input files directory. This has the side effect of causing files to be regenerated every build, then causes all core modules to be recompiled which adds up a significant amount of time to rebuilds. To fix this I added the generated files to the script phase output and moved the FBReactNativeSpec dir outside of the codegen source (Libraries). I moved it to the React directory as this seemed to make sense and is where a lot of iOS files are as well as the core modules. Note this might require internal changes. This removes the circular dependency between our build phase input and output so consecutive builds can be cached properly.

2. Add `set -o pipefail` to the xcode script, this helped propagate errors properly to xcode because of the `| tee` pipe so it fails at the script phase and not later with a header not found error. Also add `2>&1` to pipe stderr to stdout so errors are also captured in the log file.

3. Add the `-l` flag to the bash invocation to help finding the yarn binary. With my setup yarn is added to the system PATH in my user .profile. Adding this file will cause bash to source the user environment which xcode scripts does not by default. I think this will help with most setups.

4. If yarn is not found the `command -v yarn` would make the script exit without any output because of the -e flag. I made a change to ignore the return code and check later if YARN_BINARY is set and have an explicit error message if not.

## Changelog

[iOS] [Fixed] - Make codegen more reliable on iOS

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

Test Plan:
Tested various project states to make sure the build always succeeds in RN tester:

- Simulate fresh clone, remove all ignored files, install pods, build
- Build, delete FBReactNativeSpec generated files, build again
- Build, build again, make sure FBReactNativeSpec is cached and not rebuilt
- Make the script fail and check that xcode shows the script error logs properly

![image](https://user-images.githubusercontent.com/2677334/105891571-c8badd00-5fde-11eb-839c-259d8e448523.png)

Note: Did not test fabric

Reviewed By: fkgozali

Differential Revision: D26104213

Pulled By: hramos

fbshipit-source-id: e18d9a0b9ada7c0c2e608d29ffe88087f04605b4
2021-02-01 14:39:25 -08:00
Nadiia D f5f69af87f Change test file names to align with the set convention
Summary:
Changelog:
[General][Changed] Change RNTester example name

Reviewed By: lunaleaps

Differential Revision: D26129706

fbshipit-source-id: 53e906f26dd18ef8bceca2e3700e3403e3d0421a
2021-01-29 10:15:42 -08:00
Valentin Shergin 7a290d1596 Fabric: Introducing `SurfaceHandler`
Summary:
This implements `SurfaceHandler`, a new primitive for controlling the Surface life-cycle that ensures ownership, preserves state, maintains internal invariants, and simplifies surface manipulation from the application side.

For now, all this is an unused code. The coming diff will introduce an experiment that will route all surfaceId-based APIs to SurfaceHandler-based ones.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24290777

fbshipit-source-id: f2ff2b58e6d46e971a548f9f02113a1c783c4940
2021-01-29 07:54:19 -08:00
Samuel Susla fc1f0df465 Introducing: Props forwarding whe cloning shadow node
Summary:
Changelog: [internal]

If ShadowNode has not been mounted, forward rawProps from `sourceShadowNode` to newly cloned shadow node.
This is Android specific change, on iOS the logic should remain unchanged.

Reviewed By: JoshuaGross

Differential Revision: D26049264

fbshipit-source-id: 7c201bc2d4e99eec024065714d2172c5c817153c
2021-01-28 11:21:21 -08:00
Joshua Gross 99b7052248 Implement sendAccessibilityEvent in the React(Fabric/non-Fabric) renderer
Summary:
`sendAccessibilityEvent_unstable` is a cross-platform, Fabric/non-Fabric replacement for previous APIs (which went through UIManager directly on Android, and a native module on iOS).

Changelog: [Added] sendAccessibilityEvent_unstable API in AccessibilityInfo and sendAccessibilityEvent in React renderer

Reviewed By: kacieb

Differential Revision: D25821052

fbshipit-source-id: 03f7a9878c95e8395f9102b3e596bfc9f03730e0
2021-01-27 17:37:38 -08:00
Kacie Bawiec 2840e8abf9 Add testIDs to first example in ScrollViewExample
Summary: Changelog: Internal

Reviewed By: nadiia

Differential Revision: D26075302

fbshipit-source-id: 921700c185e9ca9c2608fa18af83b7dca2d18346
2021-01-27 11:46:28 -08:00
Nadiia D 6661517162 add optional name prop to RNTester example
Summary:
Use the name prop to render test cases.

Changelog:
[General][Changed] - Add optional name prop to RNTester examples

Reviewed By: lunaleaps

Differential Revision: D26078614

fbshipit-source-id: 82b13184aefee461c72b49c505f8848dd639eef0
2021-01-27 03:11:26 -08:00
Luna Wei 1a8d641469 Refactor SectionListExample
Summary:
Changelog:
[General][Changed] - Refactor SectionListExample in RNTester to functional component

Reviewed By: nadiia

Differential Revision: D25986316

fbshipit-source-id: b448316d1563cb1433cc36fe150ad8b4c0e45f54
2021-01-22 13:47:50 -08:00
Luna Wei d0a455b3c3 Refactor pressItem
Summary:
Changelog:
[General][Changed] - Refactor pressItem, a RNTester util for list based components to not pass state around.

Reviewed By: nadiia

Differential Revision: D25986318

fbshipit-source-id: d0dd85f783a83f73f83cfb1bd19d144c37af9ef9
2021-01-22 13:47:49 -08:00
Luna Wei 335f6de00a Refactor renderSmallSwitchOption
Summary:
Changelog:
[General][Changed] - Refactor `renderSmallSwitchOption`, a RNTester util for list based components to not pass state around.

Reviewed By: nadiia

Differential Revision: D25986317

fbshipit-source-id: cbbd71cc1b1bab71ecd007980f2813f7a066b3f2
2021-01-22 13:47:49 -08:00
David Vacca 34351fd0b1 Refactor initialization of Fabric to avoid loading UIManagerModule
Summary:
This diff refactors the intialization of Fabric in order to avoid loading UIManagerModule as part of the creation of FabricJSIModuleProvider.
One caveat is that now we are not taking into consideration the flag mLazyViewManagersEnabled
master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java177

if (mLazyViewManagersEnabled) {
As a side effect of this diff view managers will be initialized twice if the user has fabric and paper enabled
This diff was originally backed out in D25739854 (4984c1e525) because it produced a couple of bugs:
https://fb.workplace.com/groups/rn.support/permalink/4917641074951135/
https://fb.workplace.com/groups/rn.support/permalink/4918163014898941/
These bugs are fixed by D25667987 (2e63147109).

This diff was reverted a couple of times because of the change in the registration of eventDispatcher. That's why I'm gating that behavior change as part of the "StaticViewConfig" QE.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D25858934

fbshipit-source-id: a632799ccac728d4efca44ee685519713b4a7cbb
2021-01-14 17:27:50 -08:00
Moti Zilberman 05e380f26c Type AsyncStorage
Summary:
Types the AsyncStorage module with Flow.

Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D25884607

fbshipit-source-id: 7762ebfc68b87e6c5a0d8100fcc564f002061f5c
2021-01-12 11:14:27 -08:00
Peter Argany f2c6279ca4 iOS/tvOS 10.0 ==> 11.0 in .xcodeproj
Summary:
Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19269953 (829a2237d2) for iOS9 deprecation

Reviewed By: fkgozali

Differential Revision: D25805856

fbshipit-source-id: 328f426a492c563b1632223be2b48c8d3ca04756
2021-01-11 16:46:16 -08:00
Peter Argany a1d626739d Delete iOS10/tvOS10 support from React Native Libraries
Summary:
allow-large-files

Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19265731 (674b591809) for iOS9.

I just ran this command:
`find . -type f -exec sed -i '' 's/{ :ios => "10.0" }/{ :ios => "11.0" }/' {} +`
and then updated pods

Reviewed By: fkgozali

Differential Revision: D25693227

fbshipit-source-id: 0073d57ecbb268c52d21962cef202316857bcbd2
2021-01-11 16:46:16 -08:00
David Vacca 2d64dde3e6 Prevent creating non visibile view in RNTester
Summary:
Small refactor to prevent creating non visibile view in RNTester

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D25869868

fbshipit-source-id: 4873bf5f9de99612806df2d02adb73d21d3185db
2021-01-11 09:45:27 -08:00
Valentin Shergin e37e56b042 Back out "Add onFocus and onBlur to Pressable."
Summary:
I suspect it's causing T82781515.

Changelog:
[Category][Type] - Backout of "[react-native][PR] Add onFocus and onBlur to Pressable."

Reviewed By: p-sun

Differential Revision: D25864414

fbshipit-source-id: efba9136edba97d5bd2a0de15f9ddae7dfd24e51
2021-01-10 13:56:27 -08:00
Igor Klemenski cab4da7288 Add onFocus and onBlur to Pressable. (#30405)
Summary:
Starting to upstream keyboard-related features from React Native Windows - this is the Android implementation.
Exposing onFocus and onBlur callbacks on Pressable; they're already declared for View in ViewPropTypes.js, which Pressable wraps.

Registering event listeners in ReactViewManager to listen for native focus events.
## 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] - Add onFocus/onBlur for Pressable on Android.

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

Test Plan:
Tested on v63-stable, since building master on Windows is now broken. Screenshots from RNTester running on the emulator:
![image](https://user-images.githubusercontent.com/12816515/99320373-59777e80-2820-11eb-91a8-704fff4aa13d.png)
![image](https://user-images.githubusercontent.com/12816515/99320412-6f853f00-2820-11eb-98f2-f9cd29e8aa0d.png)

Reviewed By: mdvacca

Differential Revision: D25444566

Pulled By: appden

fbshipit-source-id: ce0efd3e3b199a508df0ba1ce484b4de17471432
2021-01-08 13:59:48 -08:00
Kshitij Kotasthane 835117aba3 Added sharedAction example to Share API (#30333)
Summary:
* Added an example for `sharedAction` and `dismissedAction` in Share API examples

**Motivation** - Missing example for `sharedAction` in examples

## 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 an example in ShareExample.js

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

Test Plan:
* Tested on Android

![sharedAction](https://user-images.githubusercontent.com/26821140/98447958-ed758600-214e-11eb-8a50-67ad5dcebea5.png)

Reviewed By: cpojer

Differential Revision: D25246375

Pulled By: rickhanlonii

fbshipit-source-id: f0d25a04c77ba02c9bea07aceccbfb65b2aa67e9
2021-01-08 12:41:32 -08:00
Su Min Kim a724c8d95e Add keyboard avoiding view examples (#30380)
Summary:
Added examples to keyboard avoiding view in RNTester for:
1. contentContainerStyle
2. enabled

## 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 keyboard avoiding view examples

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

Test Plan: ![Example](http://g.recordit.co/At5k7cF4kA.gif)

Reviewed By: PeteTheHeat

Differential Revision: D25399114

Pulled By: rickhanlonii

fbshipit-source-id: 4b893b5be02770eb582807add5f8d7dbb7941549
2021-01-08 12:16:08 -08:00
Kshitij Kotasthane b64ffd70cd Added missing examples for TouchableHighlight and TouchableWithoutFeedback (#30364)
Summary:
Added example for the following missing props in TouchableHighlight
   * onHideUnderlay
   * onShowUnderlay

**Motivation** - Missing examples for these props in the 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
-->

[General] [Added] - Added example to ToucableHighlight

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

Test Plan:
* Tested on an Android device
![under_2](https://user-images.githubusercontent.com/26821140/98783116-0a47dd00-241f-11eb-95a1-feffb5c8a00b.png)
![under_1](https://user-images.githubusercontent.com/26821140/98783118-0c11a080-241f-11eb-907a-498cdfceee13.png)
![Screenshot_1605441612](https://user-images.githubusercontent.com/26821140/99184542-946aab00-2769-11eb-847c-e5f71ff5093a.png)

Reviewed By: TheSavior

Differential Revision: D25563070

Pulled By: rickhanlonii

fbshipit-source-id: c8a10601cda28f4884e1444039a208d0b70cbdf1
2021-01-08 12:11:20 -08:00
Joseph Semrai 2aeb6545bc Add remaining prop examples for the Image component (#30554)
Summary:
Adds missing prop examples for the Image component in rn-tester.

## Changelog
[Internal] [Added] New examples for LoadingIndicatorSource, Accessibility, AccessibilityLabel, fadeDuration, onLayout, onPartialLoad, accessibilityLabel, etc.

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

Test Plan:
- [x] Build rn-tester and verify that it runs
- [x] Interact with each component
- [x] Verify that the examples function as intended

Reviewed By: shergin

Differential Revision: D25680504

Pulled By: rickhanlonii

fbshipit-source-id: bf797c92f8d0b4e66cdede2e32445ea4941b19fe
2021-01-08 12:07:33 -08:00
David Vacca 2027d6236a Revert D25746024: Refactor initialization of Fabric to avoid loading UIManagerModule
Differential Revision:
D25746024 (d3a3ce857e)

Original commit changeset: 3d12d29973a1

fbshipit-source-id: 67a7f045e5c6b1bc0201ad58b569fc870c3a89f9
2021-01-06 21:37:24 -08:00
David Vacca d3a3ce857e Refactor initialization of Fabric to avoid loading UIManagerModule
Summary:
This diff refactors the intialization of Fabric in order to avoid loading UIManagerModule as part of the creation of FabricJSIModuleProvider.

One caveat is that now we are not taking into consideration the flag mLazyViewManagersEnabled
```
master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java177

if (mLazyViewManagersEnabled) {
```
As a side effect of this diff view managers will be initialized twice if the user has fabric and paper enabled

This diff was originally backed out in D25739854 (4984c1e525) because it produced a couple of bugs:
- https://fb.workplace.com/groups/rn.support/permalink/4917641074951135/
- https://fb.workplace.com/groups/rn.support/permalink/4918163014898941/

These bugs are fixed by D25667987 (2e63147109).

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D25746024

fbshipit-source-id: 3d12d29973a12b1edfea75f4dd954790f835e9bd
2021-01-06 00:49:50 -08:00
Héctor Ramos 7a9e4ba4e9 Optionally override codegen script defaults via envvars
Summary:
The codegen helper script, `generate-specs.sh`, is being used to generate code for the FBReactNativeSpec and React-Fabric/rncore pods. The script now supports overriding several defaults by setting the following environment variables:

- SRCS_DIR: Path to JavaScript sources, defaults to $RN_DIR/Libraries/
- LIBRARY_NAME: Defaults to FBReactNativeSpec
- MODULES_OUTPUT_DIR: Defaults to Libraries/$LIBRARY_NAME/$LIBRARY_NAME
- COMPONENTS_LIBRARY_NAME: Defaults to rncore
- COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$COMPONENTS_LIBRARY_NAME

The CocoaPods codegen integration has been updated to take advantage of these.

**Example CocoaPods usage:**

```
# packages/rn-tester/NativeModuleExample/RNTesterSpecs.podspec
Pod::Spec.new do |s|
  s.name = "RNTesterSpec"
  # ...
  use_react_native_codegen!(s, { :srcs_dir => __dir__, :modules_output_dir => __dir__ })
end
```

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25738466

fbshipit-source-id: c68f5a3cd0996283a7af287e992e2f973024f44c
2021-01-04 13:34:16 -08:00
Agastya Darma 5b34c98fa2 WIP: Add an explicit NDK version to RNTester and ReactAndroid (#29987)
Summary:
When I try to run RNTester with Gradle the RNTester Required me to use **NDK 20.0.5594570**. I can't seem to find an explicit NDK version anywhere in ReactAndroid and RNTester. This PR Aims to add an explicit NDK version to RNTester and ReactAndroid.

![Screenshot from 2020-09-19 21-13-17](https://user-images.githubusercontent.com/8868908/93669563-444fcf00-fabf-11ea-8822-93264c5bb736.png)

## Changelog
[Android] [Added] - Add an explicit NDK version to RNTester and ReactAndroid.

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

Test Plan: Build manually from RNTester

Reviewed By: fkgozali

Differential Revision: D23911371

Pulled By: ShikaSD

fbshipit-source-id: 2f297c73890c0eb0bfec0e2ba7ec5755b4d84243
2021-01-04 09:15:08 -08:00
Rubén Norte e088a4fe9c Add support for UnsafeObject to allow using Flow strict in native modules
Summary:
This new type will be valid in Flow strict mode and can be used by native modules and components to replace `Object`, with the same semantics.

This unblocks the migration of the most modules in the React Native package to Flow strict.

Changelog: [Internal] Add UnsafeObject type compatible with Flow strict mode to use in native modules and components

Reviewed By: RSNara

Differential Revision: D25540631

fbshipit-source-id: 60b80bbc84a53aecc747e3a1799cdf551e1859cd
2021-01-04 03:56:57 -08:00
Kacie Bawiec 4984c1e525 Back out "Refactor initialization of Fabric to avoid loading UIManagerModule"
Summary:
This diff D25468183 (c776f09e5f) is causing TetraFormTextInput's onChange not to fire.

See https://fb.workplace.com/groups/rn.support/permalink/4918163014898941/

I confirmed this was the bad diff via mobile bisect.

changelog: [internal] internal

Reviewed By: rickhanlonii, mdvacca, nadiia

Differential Revision: D25739854

fbshipit-source-id: efdfb1e464dd5d990d5c9ea291dde9895736817a
2020-12-30 19:34:22 -08:00
Héctor Ramos 811ccec74e Add use_react_native_codegen!
Summary:
Consolidate CocoaPods codegen scripts under a single `use_react_native_codegen!` method in `react_native_pods.rb`.

This is the first step towards making the codegen scripts library-agnostic. There are still a handful of hardcoded assumptions in place (e.g. the output directory structure, the use of a separate directory for components), but with some work one would be able to add codegen support to arbitrary CocoaPods podspecs.

The codegen script no longer takes a CODEGEN_PATH argument, and will instead attempt to use the local react-native-codegen package if available, and fallback to using the node_modules/react-native-codegen package if not.

## Usage

The `use_react_native_codegen!` method has two arguments:

- `spec`, a pod [Specification](https://www.rubydoc.info/github/CocoaPods/Core/Pod/Specification) object.
- `options`, an optional object. Supported keys:
  - `:srcs_dir`, the path to your JavaScript sources. Your native module or component specs should be located somewhere in this directory.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25728053

fbshipit-source-id: feec587b656d5b220598ce6196ea6bb34a9580a9
2020-12-29 16:10:34 -08:00
David Vacca c776f09e5f Refactor initialization of Fabric to avoid loading UIManagerModule
Summary:
This diff refactors the intialization of Fabric in order to avoid loading UIManagerModule as part of the creation of FabricJSIModuleProvider.

One caveat is that now we are not taking into consideration the flag mLazyViewManagersEnabled

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java?commit=4fb6c5ae79bb8e78e852a811128f03cf6fbed9aa&lines=177

As a side effect of this diff view managers will be initialized twice if the user has fabric and paper enabled

changelog: [internal] internal

Reviewed By: shergin

Differential Revision: D25468183

fbshipit-source-id: 78d8069007c5a98f9a6825eaa0c174603c8b9b4f
2020-12-29 10:42:18 -08:00
Héctor Ramos f45cb60e56 Use Fabric builds in iOS tests (#30639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30639

# Changelog:
[Internal] Enable Fabric builds in iOS tests on Circle CI and Sandcastle.

Reviewed By: fkgozali

Differential Revision: D25700257

fbshipit-source-id: a250dbc9904efec9ded130912a993638f0992373
2020-12-23 22:26:11 -08:00
empyrical f312e5ba84 Update iOS Fabric-related files to compile on OSS (#29810)
Summary:
Original PR contents:

This pull request updates the Podspecs and associated build scripts, and some source files so they build on OSS. RNTester now compiles with `fabric_enabled` again.

The following changes have been made:

 * Various spots that were pointing to the old `ReactCommon/fabric` location have now been updated to `ReactCommon/react/renderer`
 * Files that were attempting to use internal FB header `FBRCTFabricComponentsPlugins.h` were changed to use `RCTFabricComponentsPlugins.h`
 * `RCTFabricComponentsPlugins` in OSS was updated to include the `Image` fabric component (thanks tsapeta)
 * Replaced old `generate-rncore.sh` build script with new `generate-rncore.js` script which does not require `flow-node` and uses the `react-native-codegen` API directly, so there is no longer any need for an interim `schema-rncore.json` file.
 * Updated Yoga podspec which wasn't fully synced with changes from the main Yoga repo
 * Updated Fabric podspec with additional needed subspecs

Additions to PR by hramos:
* Replaced use of generate-rncore scripts with the original generate-native-modules-specs.sh script, which is now generate-specs.sh and supports both codegen for Native Modules and Components now (TurboModules/Fabric).
* Codegen now runs at build time as part of the Xcode build pipeline instead of as part of `pod install`. The build script is injected by the FBReactNativeSpec pod, as the pod is part of both Fabric and non-Fabric builds.

## Changelog

[General] [Fixed] - RNTester compiles with `fabric_enabled` again

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

Test Plan:
RNTester now compiles and runs in the simulator again when `fabric_enabled` is set to `true`.

```
cd xplat/js/react-native-github/packages/rn-tester
USE_FABRIC=1 pod install
open RNTesterPods.xcworkspace
# Build and run
```

Reviewed By: fkgozali

Differential Revision: D24058507

Pulled By: hramos

fbshipit-source-id: 8b2ea3694e6cb9aa23f83f087e2995fd4320e2bb
2020-12-22 08:36:22 -08:00
Kevin Gozali 86ffbd0a27 RNTester Android: always compile Fabric files
Summary:
This commit makes both `:ReactAndroid` and `:rn-tester:android:app` always compile in Fabric codegen outputs. However, one may still enable/disable Fabric at runtime by setting `USE_FABRIC` env var (set to 1 or 0, default is 0).

Note that we can't register custom components specific to the app, yet, so only the components in react-native github repo is covered by this commit.

RNTester doesn't enable Fabric by default yet due to known UI bugs that haven't been addressed yet.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25674311

fbshipit-source-id: 8db660c959319250ebc683c84076677cf6489e94
2020-12-21 22:43:36 -08:00
Kevin Gozali 8db181abfc RNTester Android: generate Fabric JNI files during build time
Summary:
Generate Fabric C++ files along side TM spec files for RNTester. The combined .so then has both TM and Fabric files.

This commit also removed the checked-in JNI files.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25674313

fbshipit-source-id: 8091d5a00f42849a74cab50e8d24f4010d500e5b
2020-12-21 22:43:35 -08:00
Kevin Gozali 1ce53e86ed Codegen Android: rename "ReactAndroidSpec" to "rncore" for parity with Fabric
Summary:
The TM specs and Fabric files should be combined into the same .so. For short term parity with Fabric components and iOS, let's rename ReactAndroidSpec (default name based on project path) to "rncore".

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25674312

fbshipit-source-id: 3d71aa0cc945affecb06dcfc15e807dd48c76468
2020-12-21 22:43:35 -08:00
Valentin Shergin e3d8a6b222 Fabric: Stacking Context test covering a sequence of changes
Summary:
This diff adds another complexity level for Stacking Context and zIndex tests: Now we test not only "noting-to-something" cases but also cases where we apply changes to an already non-empty tree, validating our assumption of each step.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25623176

fbshipit-source-id: 29a447d93522a2a4e7912351f907c46ac7b218bb
2020-12-21 08:33:31 -08:00
Ramanpreet Nara 40115d87d4 Roll out package info validation
Summary:
## Context
Every time we require a NativeModule in Java, we [first try to create it with the TurboModuleManager](https://fburl.com/diffusion/3nkjwea2). In the TurboModule infra, when a NativeModule is requested, [we first create it](https://fburl.com/diffusion/d2c6iout), then [if it's not a TurboModule, we discard the newly created object](https://fburl.com/diffusion/44gjlo6y). This is extremely wasteful, especially when a NativeModule is requested frequently and periodically, like UIManagerModule.

Therefore, in D24811838 (803a26cb00) fkgozali launched a fix to the infra that would avoid creating the non-TurboModule object in the first place. Today, we're launching this optimization.

Reviewed By: fkgozali

Differential Revision: D25621570

fbshipit-source-id: dedba4d5ac6fcf2ec3c31e7163a6a226065c708b
2020-12-17 17:27:09 -08:00
Ramanpreet Nara 74fd6fb1da Codemod: Migrate from bridge.eventDispatcher to RCTModuleRegistry
Summary:
All NativeModules that use the bridge to require the eventDispatcher are now instead using the RCTModuleRegistry I introduced in D25412847 (0ed81b28d3).

## What does this codemod do?
For all ObjC files that contain `synthesize bridge = _bridge`, migrate calls that access the React Native bridge from `self`, and use it to load the event dispatcher.

**Thoughts on Codemod Safety:** If we can access the bridge from self, then that means that if we synthesize the module registry, we can access the module registry from self. Therefore, this codemod is safe.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25449795

fbshipit-source-id: 2f7235d14659e73d673ae08763dc2cccdde55a19
2020-12-11 10:42:28 -08:00
Ramanpreet Nara 0ed81b28d3 Introduce RCTModuleRegistry
Summary:
## Problem
Many of our NativeModules are TurboModule-compatible. All our TurboModules currently use the bridge to require other NativeModules/TurboModules. As we migrate more surfaces to Venice, this lookup in many of these TurboModules will break, because the bridge will be nil.

## Initial Solution
We migrate all these TurboModules over to the turboModuleRegistry. In FBiOS, this will work because all NativeModules are TurboModule-compatible, and should [have the turboModuleRegistry attached to them by the TurboModuleManager](https://fburl.com/diffusion/d747fbc3). However, this solution has a few problems:
- If the TurboModule is used within a TurboModule-disabled app, it will break, because turboModuleRegistry will be nil on the module. Therefore, this solution isn't portable/flexible across apps.
- Longer term, we should deprecate synthesize bridge inside NativeModules. With this approach, we can't remove the synthesize bridge = bridge call from the NativeModule.

## Suggested Solution
Both NativeModules and TurboModules will be given access to an `RCTModuleRegistry` object. The RCTModuleRegistry object will use the TurboModuleManager when available and the Bridge when available to query for NativeModules and TurboModules. Otherwise, it'll just return nil.

When we do a lookup via this RCTModuleRegistry:
- In Venice, the bridge will be nil, so we won't search the bridge.
- In FBiOS, the bridge and the TurboModuleManager will be non-nil, so we'll first search the bridge, and then the TurboModuleManager.
- In standalone apps, the TurboModuleManager will be nil, so we'll only do a lookup on the bridge.

Long story short, RCTModuleRegistry will do the right thing in all scenarios.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25412847

fbshipit-source-id: 13f41276158d90c68ab4925e518d71a2f369c210
2020-12-10 20:23:16 -08:00
Su Min Kim 8dddaa85f0 Add modal example (#30406)
Summary:
Add examples for Modal component in RNTester for:
- onDismiss (iOS)
  - Note: there may be an issue with onDismiss (https://github.com/facebook/react-native/issues/29455 )
- onShow
- hardwareAccelerated (Android)
- statusBarTranslucent (Android)

## 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] [Add] - Added examples for Modal component in RNTester

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

Test Plan: ![Example GIF](http://g.recordit.co/mu3KFo3FMt.gif)

Reviewed By: PeteTheHeat

Differential Revision: D25399097

Pulled By: rickhanlonii

fbshipit-source-id: e688d35b0fc04cecf01d3fbc3253abae40c62b67
2020-12-09 22:53:46 -08:00
Su Min Kim 84dde677d9 Add accessibility examples (#30379)
Summary:
Added examples to RNTester for the AccessibilityInfo API for:
1. SetAccessibilityFocus()
2. isReduceMotionEnabled()
3. iOS Only
   a. isBoldTextEnabled()
   b. isGrayScaleEnabled()
   c. isInvertColorsEnabled()
   d. isReduceTransparencyEnabled()

## 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 new examples to the Accessibility API page

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

Test Plan: ![iOS GIF](http://g.recordit.co/pmzvQXYjdD.gif)

Reviewed By: TheSavior

Differential Revision: D25245329

Pulled By: rickhanlonii

fbshipit-source-id: e9c11c775410075199b4e1011b3dac0acd972e89
2020-12-08 10:17:44 -08:00
Su Min Kim 158abfe8bf Add scrollview example (#30454)
Summary:
Add missing examples to ScrollView for RNTester.

## 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 missing examples to ScrollView for RNTester.

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

Test Plan: There are a lot of examples that have been added that affects the UI (see RNCore Excel sheet for details).

Reviewed By: sammy-SC

Differential Revision: D25310613

Pulled By: rickhanlonii

fbshipit-source-id: 64a771aa8d3c3683eed983b0c36625078e5533fe
2020-12-05 16:04:52 -08:00
Janic Duplessis 0959ff36d1 Move hermes to a separate podspec (#30478)
Summary:
Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon.

## Changelog

[iOS] [Fixed] - Move hermes to a separate podspec

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

Test Plan: Test that it builds and run properly in an app

Reviewed By: fkgozali

Differential Revision: D25308237

Pulled By: hramos

fbshipit-source-id: b4cc44ea2b1b854831e881dbbf9a2f30f6704001
2020-12-03 20:08:00 -08:00
Janic Duplessis 7f16ff8a05 Fix use_framework RNTester crash (#30520)
Summary:
When building RN Tester with use_frameworks it crashes on launch because of duplicate folly singletons. Seems that it is included twice because of Flipper. From what I understand flipper is not really compatible with use_frameworks so this removes it from that build variant. We also remove hardcoded SONARKIT defines in the xcodeproject, those will be added by the Flipper podspec anyway so it is not needed.

This then exposed a missing double conversion header error in Folly so this fixes the DoubleConversion podspec to add its headers path to the user project.

## Changelog

[Internal] [Fixed] - Fix use_framework RNTester crash

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

Test Plan: Tested RN tester with use frameworks on and off. Also made sure flipper works still when frameworks is false.

Reviewed By: fkgozali

Differential Revision: D25307973

Pulled By: hramos

fbshipit-source-id: 17b90e871734e32f5982c4fc9c07aeea232f868f
2020-12-03 16:01:47 -08:00
Nick Gerleman 540735383d Fix RNTester Not Resizing Examples on Rotation/Resize (#30376)
Summary:
Fixes https://github.com/facebook/react-native/issues/30325

After the RNTester redesign, a style started globally caching screen width. This isn't needed, but means that width is incorrect if the device is rotated, or a window is resized. Rely on default layout which will be 100% width instead.
## 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 RNTester Not Resizing Examples on Rotation/Resize

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

Test Plan: Tested viewing an example and rotating the device in iOS simulator

Reviewed By: rickhanlonii

Differential Revision: D25098642

Pulled By: appden

fbshipit-source-id: 9acdb656da7de9fda05f6091b36f8d9aa2155524
2020-12-03 09:39:17 -08:00
Héctor Ramos 5eee2f2bc0 Fix Circle CI iOS Tests: Make FBReactNativeSpec dir as needed
Summary:
Quick fix for Circle CI: Ensure FBReactNativeSpec dir exists before touching files.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25285573

fbshipit-source-id: 8dec496856c90accc687648d7068aadfea24d72b
2020-12-02 16:13:03 -08:00
Héctor Ramos c901c1fbce Integrate Native Module codegen into Xcode build pipeline (#30449)
Summary:
Move the codegen invocation out of Podfiles and into the FBReactNativeSpec Pod itself. With this change, developers do not need to modify their existing project's Podfiles, and yet the codegen will be integrated into their projects automatically by way of the FBReactNativeSpec Pod.

This is accomplished in part by injecting a script build phase into the Pods Xcode project that is generated by CocoaPods. The build phase will save the output of the codegen script to a log in the derived files directory. The codegen will be executed if the codegen log file is not present, or if the contents of the Libraries directory has changed.

The codegen will thus be invoked in these situations:

**RNTester:**
* When `packages/rn-tester/RNTesterPods.xcworkspace` is built, if the codegen output logfile is not present or if the input files have changed.

**OSS React Native apps:**
* When `ios/AwesomeProject.xcworkspace` is built, if the codegen output file is not present or if the input files have changed. Normally, this should not happen, as we do not expect folks to update the contents of `node_modules/react-native/Libraries`.

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

Changelog: [Internal] - Moved codegen invocation out of Podfile and into FBReactNativeSpec Pod

Reviewed By: fkgozali

Differential Revision: D25138896

fbshipit-source-id: 4779f822459cea2c30fd544eee19a49e8d80153d
2020-12-02 14:27:50 -08:00
Su Min Kim a4a517a09d Add example for focus and blur events to AppStateExample (#30381)
Summary:
Added an example to test focus and blur events in AppState (Android only)

## 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] - Add example for focus and blur events to AppStateExample

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

Test Plan: ![Example](http://g.recordit.co/6FGnSzKQaG.gif)

Reviewed By: cpojer

Differential Revision: D25245334

Pulled By: rickhanlonii

fbshipit-source-id: 916f18a74140cc43e0d513eb4073cbcc44e41427
2020-12-02 09:04:13 -08:00
Kshitij Kotasthane 328590d2d9 Added examples for SectionList (#30390)
Summary:
`Added examples for the following missing props in SectionList`
* Prop: initialNumToRender
* Prop: ListEmptyComponent
* Prop: onEndReached

**Motivation** - Missing examples for these props in the 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
-->

[General] [Added] - `Added examples for the missing props in SectionList`

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

Test Plan:
![empty](https://user-images.githubusercontent.com/26821140/99139935-49667000-2663-11eb-8b89-5a6b17abc3e9.png)
![end](https://user-images.githubusercontent.com/26821140/99139944-4e2b2400-2663-11eb-8e95-08e863614dec.png)

Reviewed By: cpojer

Differential Revision: D25245322

Pulled By: rickhanlonii

fbshipit-source-id: 3e44b9cf86128f1d3df535799519631cf2296a7e
2020-12-02 09:00:06 -08:00
Su Min Kim 5cf4ab8dd2 Remove filter pills from example page (#30198)
Summary:
rickhanlonii
Removes filter pills from example page in RNTester app.

## Changelog
Removed filter pills from example page by changing hideFilterPills property to true in RNTesterExampleList.js
<div>
<img src="https://user-images.githubusercontent.com/43835229/96194048-88e05600-0f17-11eb-9262-660a7a4bb170.png" width="200" height="400" style="float:left" />
<img src="https://user-images.githubusercontent.com/43835229/96194345-26d42080-0f18-11eb-9af2-bbf9fcc9518a.png" width="200" height="400" />
</div>

[Android] [Removed] - Remove filter pills
[iOS] [Removed] - Remove filter pills

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

Test Plan:
RNTester app builds and runs as expected and filter pills are removed from the screen.
<div>
<img src="https://user-images.githubusercontent.com/43835229/96194077-9564ae80-0f17-11eb-821e-13da51d37581.png" width="200" height="400" style="float:left"/>
<img src="https://user-images.githubusercontent.com/43835229/96194532-8fbb9880-0f18-11eb-9ecf-48e1b4a9ac25.png" width="200" height="400" />
</div>

Reviewed By: cpojer

Differential Revision: D24395513

Pulled By: rickhanlonii

fbshipit-source-id: 7351ce8972185f973ad302d70929491cc6f56907
2020-12-01 09:06:23 -08:00
Héctor Ramos e99b8bbb40 Use react-native-codegen@0.0.6 in new app template
Summary:
Use pre-built react-native-codegen library from npm in the iOS app template.
Built react-native-codegen from source when used with RNTester.
Published react-native-codegen@0.0.6.

Changelog:
[iOS][Added] - Use react-native-codegen in iOS app template
[Internal] - Bump react-native-codegen: 0.0.6

Reviewed By: fkgozali

Differential Revision: D25128036

fbshipit-source-id: f294c23b9b911aae6f404edc01b62426fb578477
2020-11-20 20:11:59 -08:00
Emily Janzer c0a2998387 Move TurboModuleManager to use RuntimeExecutor instead of jsContext (#30416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30416

This diff changes the constructor param for TurboModuleManager from jsContext (a long representing the `jsi::Runtime` pointer) to a RuntimeExecutor. It also updates callsites to use the new RuntimeExecutor created by CatalystInstance. This is only used for installing the TurboModule JSI binding; it's not currently used for JS invocation in TurboModules, which is handled separately by JSCallInvoker. Ultimately we may be able to implement JSCallInvoker *with* the provided RuntimeExecutor, but there's some additional logic in JSCallInvoker that we don't have here yet.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D21338930

fbshipit-source-id: 1480c328f1a1776ddf22752510c0f3b35168a489
2020-11-20 14:32:59 -08:00
Luke Walczak a7c1c5aff2 Add possibility to disable buttons in action sheet ios (#28979)
Summary:
_**Fixed**_ version of [the previous PR](https://github.com/facebook/react-native/pull/28792) after reverting [changes](c8d678abcf (commitcomment-39299254))

----

I've noticed that currently there is no option to disable button within the `ActionSheetIOS`. It can be really useful and decided to extend the API to support that functionality.

I added a new option called `disabledButtonsIndices` to `ActionSheetIOS` which is an array of button indices which should be disabled.

`ActionSheetIOS` documentation - PR https://github.com/facebook/react-native-website/pull/1898

## Changelog

[iOS] [Added] - Add disableButtonsIndices option to ActionSheetIOS component

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

Test Plan:
1. Run the `RNTester`
2. Choose `ActionSheetIOS`
3. Check the fourth example `Show Action Sheet with disabled buttons`
4. `Option 1` and `Option 2` should be disabled

screenshot | gif
 --- | ---
<img width="493" alt="Screenshot 2020-04-30 at 15 16 22" src="https://user-images.githubusercontent.com/22746080/80739025-1ec52780-8b16-11ea-8b1c-30bb40ad8c99.png"> | <img src="https://user-images.githubusercontent.com/22746080/80739043-24227200-8b16-11ea-8bcb-af25eb57baac.gif" width="493" />

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368
2020-11-18 21:11:48 -08:00
Ramanpreet Nara 27cf82074d Guard against initializer interruptions in {Catalyst,Work,RNTester}TurboModuleManagerDelegate
Summary:
Migrate over to [how we load so libraries in Fb4aTurboModuleManagerDelegate](https://fburl.com/diffusion/wu0mcr8o).

## Motivation
When we migrated Twilight over to TurboModules, we used the CatalystTurboModuleManager as a template. This led to a production crash (T70918829) because we weren't loading so's this way. The fix: D24894071.

I'm updating these two TMMDelegates so that people don't fall into the same trap when migrating other Standalone apps.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24992931

fbshipit-source-id: 3ac3b8c30a67e24f79021f915abf5ae980d5b5d3
2020-11-17 00:34:48 -08:00
Kevin Gozali 58c80d4f8d Use codegen from source in default iOS template apps
Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.

Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template

Reviewed By: TheSavior

Differential Revision: D24904655

fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea
2020-11-12 22:30:28 -08:00
George Zahariev 6a039d7be3 Remove usage of deprecated @flow weak in Xplat
Summary:
This is the one usage of `flow weak` in Xplat - change it to normal `flow` and add a suppression where an error appears.

Changelog: [Internal]

Reviewed By: Hans-Halverson

Differential Revision: D24878970

fbshipit-source-id: 16e459c261b41e04de1555ed7ef4ecf2f5b3721e
2020-11-12 21:14:06 -08:00
Kevin Gozali 803a26cb00 TM Android: Avoid creating TM instance if the module is not TM enabled
Summary:
There is a flow where TM registry is creating a module instance (as registered in the TurboReactPackage), only to discard it if it's not a TM enabled module. This may be fine for many modules, but for module like `UIManagerModule`, this may cause a race condition or other issues, including potential perf regression when accessing UIManager from JS (e.g. for getting native viewConfigs).

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24811838

fbshipit-source-id: 6e1cce6993a6e5c9763773f175083bf52925c910
2020-11-09 02:24:41 -08:00
Christoph Nakazawa 3e77e15526 Continuous Integration cleanup
Reviewed By: yungsters

Differential Revision: D24700192

fbshipit-source-id: 239a8ad4848a41ad721a635d4ec37d990989f041
2020-11-05 06:09:36 -08:00
Kevin Gozali 8663ec4f42 Unbreak iOS build due to header import failure
Summary: Changelog: [Internal]

Reviewed By: p-sun, yungsters

Differential Revision: D24749871

fbshipit-source-id: 70692b8a32f9b7a214d7192ba444c695568e2ccf
2020-11-04 21:39:18 -08:00
Mike Grabowski c95ee5ac18 feat: Enable Hermes to work on iOS (#29914)
Summary:
This PR makes it possible to build iOS applications with Hermes. Note that it doesn't work with `use_frameworks!` just yet.

Fixes https://github.com/facebook/react-native/issues/27845 (by downgrading iOS deployment target for RCT-Folly to 9.0)
Fixes https://github.com/facebook/react-native/issues/28810 (as above)

Checklist:
- [x] Adjust release scripts to create Hermes bytecode bundle
- [x] Release new Hermes npm package that includes iOS files (unreleased right now, if you want to try locally, you have to clone Hermes and `yarn link` its master to this project)
- [x] Test on a new React Native application in both Debug and Release (Device)
- [x] Test on an RNTester application in both Debug and Release (Device)
- [x] Add missing `i386` to Hermes framework and enable Bitcode
- [x] Inspect CI failures for possible regressions
- [x] Resolve Folly issue as reported https://github.com/facebook/react-native/issues/27845 and https://github.com/facebook/react-native/issues/28810
- [x] Release new Hermes and test against it that everything works

## Changelog

[IOS] [FEATURE] - Enable Hermes on iOS
[INTERNAL] - Upgrade to CocoaPods 1.10.0 to resolve Xcode 12.0 issues
[INTERNAL] - Upgrade to Xcode 12.0 on the CircleCI
[INTERNAL] - Fix building RNTester in Release mode
[INTERNAL] - Fix build-time errors of `libevent` with `use_frameworks!`
[INTERNAL] - Introduce `USE_HERMES` variable and test all RNTester configurations on the CI
[INTERNAL] - Do not fetch CocoaPods repository since we're using CDN anyway

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

Test Plan:
Turn on `hermes_enabled` to true in your `Podfile`, install pods, and run the iOS application. Your app should be running Hermes now.

Preview: (note "Engine: Hermes")

<img width="395" alt="Screenshot 2020-09-09 at 19 22 32" src="https://user-images.githubusercontent.com/2464966/92631584-d7c01d80-f2d1-11ea-9b40-33d73db96a53.png">

Reviewed By: hramos

Differential Revision: D24684845

Pulled By: cpojer

fbshipit-source-id: 900cbe3bf9398a6fd4a773d552899a001bf5146b
2020-11-03 01:14:38 -08:00
Héctor Ramos 538446e755 Bump Xcode to 12.1.0, bump CocoaPods 1.10.0 (#30250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30250

Upgrade the version of Xcode used in Circle CI to Xcode 12.1.0, and target iOS 14.1 in tests.

Reference:
* Circle CI Xcode 12.1 container manifest (new version):
https://circle-macos-docs.s3.amazonaws.com/image-manifest/v3985/index.html
* Circle CI Xcode 11.6.0 container manifest (previous version): https://circle-macos-docs.s3.amazonaws.com/image-manifest/v3299/index.html

> Source: https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions

The default version of CocoaPods used in the Xcode 12.1 container image has changed. Use `bundle exec` with `pod install` to ensure we use the same version of CocoaPods as prescribed in the Gemfile.

Changelog:
[iOS][Changed] - Update iOS project template for Xcode 12.1.0
[iOS][Changed] - Bump CocoaPods 1.10.0
[Internal] Bump Xcode version used for iOS tests.

Reviewed By: fkgozali

Differential Revision: D24545010

fbshipit-source-id: 4a39781352bc5a85dae55ed5cd4e1ed6043a4aeb
2020-10-30 23:03:26 -07:00
Janic Duplessis 1e9d7b70fc More reliable way to get ReactAndroid build dir in Android-prebuilt.mk (#30222)
Summary:
Pass the ReactAndroid project build directory as a variable to the ndk build so it can be used instead of assuming that the build directory is under ReactAndroid/build.

## Changelog

[Internal]

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

Test Plan: Tested in an app with a custom build directory

Reviewed By: yungsters

Differential Revision: D24560643

Pulled By: fkgozali

fbshipit-source-id: cc65a70582f546ca2e2ca9fb6a2ff03ea70ca9d8
2020-10-27 10:06:58 -07:00
Kevin Gozali f023519e49 TurboModule Android: Enable TurboModule by default on RNTester
Summary:
This does a few things:
* Remove USE_CODEGEN flag so that TurboModule is enabled by default for RNTester
* Use the codegen output for Java/JNI spec files
* Remove the checked in com.facebook.fbreact.specs Java/JNI files

Changelog: [Changed][Android] RNTester now enables TurboModule by default using codegen.

Reviewed By: RSNara

Differential Revision: D24382083

fbshipit-source-id: 87e3e0581bac3287ef01c1a0deb070c1d7d40f2d
2020-10-26 23:47:54 -07:00
Rick Hanlon 24bca492c3 Update React Native to React 17.0.0
Summary:
This sync includes the following changes:
- **[eaaf4cbce](https://github.com/facebook/react/commit/eaaf4cbce )**: 17.0.1 //<Dan Abramov>//
- **[6f62abb58](https://github.com/facebook/react/commit/6f62abb58 )**: Remove usage of Array#fill ([#20071](https://github.com/facebook/react/pull/20071)) //<Dan Abramov>//
- **[40cfe1f48](https://github.com/facebook/react/commit/40cfe1f48 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[f021a983a](https://github.com/facebook/react/commit/f021a983a )**: Bump versions for 17 ([#20062](https://github.com/facebook/react/pull/20062)) //<Dan Abramov>//
- **[d1bb4d851](https://github.com/facebook/react/commit/d1bb4d851 )**: Profiler: Include ref callbacks in onCommit duration ([#20060](https://github.com/facebook/react/pull/20060)) //<Brian Vaughn>//
- **[c59c3dfe5](https://github.com/facebook/react/commit/c59c3dfe5 )**: useRef: Warn about reading or writing mutable values during render ([#18545](https://github.com/facebook/react/pull/18545)) //<Brian Vaughn>//
- **[7b6cac952](https://github.com/facebook/react/commit/7b6cac952 )**: Improved Profiler commit hooks test ([#20053](https://github.com/facebook/react/pull/20053)) //<Brian Vaughn>//
- **[dfb6a4033](https://github.com/facebook/react/commit/dfb6a4033 )**: [Fast Refresh] Fix crashes caused by rogue Proxies ([#20030](https://github.com/facebook/react/pull/20030)) ([#20039](https://github.com/facebook/react/pull/20039)) //<Kai Riemann>//
- **[37cb732c5](https://github.com/facebook/react/commit/37cb732c5 )**: Use bitwise OR to define flag masks ([#20044](https://github.com/facebook/react/pull/20044)) //<Andrew Clark>//
- **[eb3181e77](https://github.com/facebook/react/commit/eb3181e77 )**: Add Visibility flag for hiding/unhiding trees ([#20043](https://github.com/facebook/react/pull/20043)) //<Andrew Clark>//
- **[0dd809bdf](https://github.com/facebook/react/commit/0dd809bdf )**: Remove last schedulePassiveEffectCallback call ([#20042](https://github.com/facebook/react/pull/20042)) //<Andrew Clark>//
- **[8df7b7911](https://github.com/facebook/react/commit/8df7b7911 )**: Remove Passive flag from "before mutation" phase ([#20038](https://github.com/facebook/react/pull/20038)) //<Andrew Clark>//
- **[c57fe4a2c](https://github.com/facebook/react/commit/c57fe4a2c )**: ReactIs.isValidElementType Unit Test extended with PureComponent case ([#20033](https://github.com/facebook/react/pull/20033)) //<adasq>//
- **[02da938fd](https://github.com/facebook/react/commit/02da938fd )**: Don't double-invoke effects in legacy roots ([#20028](https://github.com/facebook/react/pull/20028)) //<Brian Vaughn>//
- **[d95c4938d](https://github.com/facebook/react/commit/d95c4938d )**: [EventSystem] Revise onBeforeBlur propagation mechanics ([#20020](https://github.com/facebook/react/pull/20020)) //<Dominic Gannaway>//
- **[f46a80ae1](https://github.com/facebook/react/commit/f46a80ae1 )**: Update outdated links and fix two broken links  ([#19985](https://github.com/facebook/react/pull/19985)) //<Saikat Guha>//
- **[0a4c7c565](https://github.com/facebook/react/commit/0a4c7c565 )**: [Flight] Don't warn for key, but error for ref ([#19986](https://github.com/facebook/react/pull/19986)) //<Sebastian Markbåge>//
- **[993ca533b](https://github.com/facebook/react/commit/993ca533b )**: Enable eager listeners statically ([#19983](https://github.com/facebook/react/pull/19983)) //<Dan Abramov>//
- **[40c52de96](https://github.com/facebook/react/commit/40c52de96 )**: [Flight] Add Runtime Errors for Non-serializable Values ([#19980](https://github.com/facebook/react/pull/19980)) //<Sebastian Markbåge>//
- **[1992d9730](https://github.com/facebook/react/commit/1992d9730 )**: Revert "Temporarily disable Profiler commit hooks flag ([#19900](https://github.com/facebook/react/pull/19900))" ([#19960](https://github.com/facebook/react/pull/19960)) //<Brian Vaughn>//
- **[44d39c4d7](https://github.com/facebook/react/commit/44d39c4d7 )**: Removed skip-error-boundaries modifications from old fork ([#19961](https://github.com/facebook/react/pull/19961)) //<Brian Vaughn>//
- **[cc77be957](https://github.com/facebook/react/commit/cc77be957 )**: Remove unnecessary error overriding in ([#19949](https://github.com/facebook/react/pull/19949)) //<Paul Doyle>//
- **[97625272a](https://github.com/facebook/react/commit/97625272a )**: Debug tracing tests for CPU bound suspense ([#19943](https://github.com/facebook/react/pull/19943)) //<Brian Vaughn>//
- **[43363e279](https://github.com/facebook/react/commit/43363e279 )**: Fix codestyle for typeof comparison ([#19928](https://github.com/facebook/react/pull/19928)) //<Eugene Maslovich>//
- **[5427b4657](https://github.com/facebook/react/commit/5427b4657 )**: Temporarily disable Profiler commit hooks flag ([#19900](https://github.com/facebook/react/pull/19900)) //<Brian Vaughn>//
- **[1faf9e3dd](https://github.com/facebook/react/commit/1faf9e3dd )**: Suspense for CPU-bound trees ([#19936](https://github.com/facebook/react/pull/19936)) //<Andrew Clark>//
- **[7f08e908b](https://github.com/facebook/react/commit/7f08e908b )**: Fix missing context to componentDidMount() when double-invoking lifecycles ([#19935](https://github.com/facebook/react/pull/19935)) //<Brian Vaughn>//
- **[9198a5cec](https://github.com/facebook/react/commit/9198a5cec )**: Refactor layout effect methods ([#19895](https://github.com/facebook/react/pull/19895)) //<Brian Vaughn>//
- **[ba82eea38](https://github.com/facebook/react/commit/ba82eea38 )**: Remove disableSchedulerTimeoutInWorkLoop flag ([#19902](https://github.com/facebook/react/pull/19902)) //<Andrew Clark>//
- **[c63741fb3](https://github.com/facebook/react/commit/c63741fb3 )**: offscreen double invoke effects ([#19523](https://github.com/facebook/react/pull/19523)) //<Luna Ruan>//
- **[c6917346f](https://github.com/facebook/react/commit/c6917346f )**: Fixed broken Profiler test ([#19894](https://github.com/facebook/react/pull/19894)) //<Brian Vaughn>//
- **[87c023b1c](https://github.com/facebook/react/commit/87c023b1c )**: Profiler onRender only called when we do work ([#19885](https://github.com/facebook/react/pull/19885)) //<Brian Vaughn>//
- **[81aaee56a](https://github.com/facebook/react/commit/81aaee56a )**: Don't call onCommit et al if there are no effects ([#19863](https://github.com/facebook/react/pull/19863)) //<Andrew Clark>//
- **[7355bf575](https://github.com/facebook/react/commit/7355bf575 )**: Consolidate commit phase hook functions ([#19864](https://github.com/facebook/react/pull/19864)) //<Andrew Clark>//
- **[bc6b7b6b1](https://github.com/facebook/react/commit/bc6b7b6b1 )**: Don't trigger lazy in DEV during element creation ([#19871](https://github.com/facebook/react/pull/19871)) //<Dan Abramov>//
- **[a774502e0](https://github.com/facebook/react/commit/a774502e0 )**: Use single quotes in getComponentName return ([#19873](https://github.com/facebook/react/pull/19873)) //<Gustavo Saiani>//
- **[8b2d3783e](https://github.com/facebook/react/commit/8b2d3783e )**: Use Passive flag to schedule onPostCommit ([#19862](https://github.com/facebook/react/pull/19862)) //<Andrew Clark>//
- **[50d9451f3](https://github.com/facebook/react/commit/50d9451f3 )**: Improve DevTools editing interface ([#19774](https://github.com/facebook/react/pull/19774)) //<Brian Vaughn>//
- **[6fddca27e](https://github.com/facebook/react/commit/6fddca27e )**: Remove passive intervention flag ([#19849](https://github.com/facebook/react/pull/19849)) //<Dan Abramov>//
- **[36df9185c](https://github.com/facebook/react/commit/36df9185c )**: chore(docs): Removed outdated comment about fb.me link  ([#19830](https://github.com/facebook/react/pull/19830)) //<Adnaan Bheda>//
- **[16fb2b6f9](https://github.com/facebook/react/commit/16fb2b6f9 )**: Moved resetChildLanes into complete work ([#19836](https://github.com/facebook/react/pull/19836)) //<Brian Vaughn>//
- **[cc581065d](https://github.com/facebook/react/commit/cc581065d )**: eslint-plugin-react-hooks@4.1.2 //<Dan Abramov>//
- **[0044805c8](https://github.com/facebook/react/commit/0044805c8 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[0f70d4dd6](https://github.com/facebook/react/commit/0f70d4dd6 )**: Consider components in jsx as missing dependencies in typescript-eslint/parser@4.x ([#19815](https://github.com/facebook/react/pull/19815)) //<Sebastian Silbermann>//
- **[84558c61b](https://github.com/facebook/react/commit/84558c61b )**: Don't visit passive effects during layout phase ([#19809](https://github.com/facebook/react/pull/19809)) //<Andrew Clark>//
- **[ad8a0a8cd](https://github.com/facebook/react/commit/ad8a0a8cd )**: eslint-plugin-react-hooks@4.1.1 //<Dan Abramov>//
- **[77544a0d6](https://github.com/facebook/react/commit/77544a0d6 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[ed4fdfc73](https://github.com/facebook/react/commit/ed4fdfc73 )**: test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x ([#19792](https://github.com/facebook/react/pull/19792)) //<Sebastian Silbermann>//
- **[cd75f93c0](https://github.com/facebook/react/commit/cd75f93c0 )**: eslint-plugin-react-hooks: fix compatibility with typescript-eslint/parser@4.0.0+ ([#19751](https://github.com/facebook/react/pull/19751)) //<Matthias Schiffer>//
- **[781212aab](https://github.com/facebook/react/commit/781212aab )**: Remove double space in test name ([#19762](https://github.com/facebook/react/pull/19762)) //<Gustavo Saiani>//
- **[e7b255341](https://github.com/facebook/react/commit/e7b255341 )**: Internal `act`: Flush timers at end of scope ([#19788](https://github.com/facebook/react/pull/19788)) //<Andrew Clark>//
- **[d17086c7c](https://github.com/facebook/react/commit/d17086c7c )**: Decouple public, internal act implementation ([#19745](https://github.com/facebook/react/pull/19745)) //<Andrew Clark>//
- **[d38ec17b1](https://github.com/facebook/react/commit/d38ec17b1 )**: [Flight] Set dispatcher for duration of performWork() ([#19776](https://github.com/facebook/react/pull/19776)) //<Joseph Savona>//
- **[4f3f7eeb7](https://github.com/facebook/react/commit/4f3f7eeb7 )**: Bugfix: Effect clean up when deleting suspended tree ([#19752](https://github.com/facebook/react/pull/19752)) //<Andrew Clark>//
- **[7baf9d412](https://github.com/facebook/react/commit/7baf9d412 )**: Combine Flags and SubtreeFlags types ([#19775](https://github.com/facebook/react/pull/19775)) //<Andrew Clark>//
- **[166544360](https://github.com/facebook/react/commit/166544360 )**: Rename effect fields ([#19755](https://github.com/facebook/react/pull/19755)) //<Andrew Clark>//
- **[708fa77a7](https://github.com/facebook/react/commit/708fa77a7 )**: Decrease expiration time of input updates ([#19772](https://github.com/facebook/react/pull/19772)) //<Andrew Clark>//
- **[36df483af](https://github.com/facebook/react/commit/36df483af )**: Add feature flag to disable scheduler timeout in work loop ([#19771](https://github.com/facebook/react/pull/19771)) //<Ricky>//
- **[bcc0aa463](https://github.com/facebook/react/commit/bcc0aa463 )**: Revert "Revert "Remove onScroll bubbling flag ([#19535](https://github.com/facebook/react/pull/19535))" ([#19655](https://github.com/facebook/react/pull/19655))" ([#19761](https://github.com/facebook/react/pull/19761)) //<Dan Abramov>//
- **[99cae887f](https://github.com/facebook/react/commit/99cae887f )**: Add failing test for passive effect cleanup functions and memoized components ([#19750](https://github.com/facebook/react/pull/19750)) //<Brian Vaughn>//
- **[2cfd73c4d](https://github.com/facebook/react/commit/2cfd73c4d )**: Fix typo in comment (Noticable→Noticeable) ([#19737](https://github.com/facebook/react/pull/19737)) //<Ikko Ashimine>//
- **[53e622ca7](https://github.com/facebook/react/commit/53e622ca7 )**: Fix instances of function declaration after return ([#19733](https://github.com/facebook/react/pull/19733)) //<Bhumij Gupta>//
- **[b7d18c4da](https://github.com/facebook/react/commit/b7d18c4da )**: Support Babel's envName option in React Refresh plugin ([#19009](https://github.com/facebook/react/pull/19009)) //<Kevin Weber>//
- **[1f38dcff6](https://github.com/facebook/react/commit/1f38dcff6 )**: Remove withSuspenseConfig ([#19724](https://github.com/facebook/react/pull/19724)) //<Andrew Clark>//
- **[1396e4a8f](https://github.com/facebook/react/commit/1396e4a8f )**: Fixes eslint warning when node type is ChainExpression ([#19680](https://github.com/facebook/react/pull/19680)) //<Pascal Fong Kye>//
- **[a8500be89](https://github.com/facebook/react/commit/a8500be89 )**: Add `startTransition` as a known stable method ([#19720](https://github.com/facebook/react/pull/19720)) //<Andrew Clark>//
- **[380dc95de](https://github.com/facebook/react/commit/380dc95de )**: Revert "Append text string to <Text> error message ([#19581](https://github.com/facebook/react/pull/19581))" ([#19723](https://github.com/facebook/react/pull/19723)) //<Timothy Yung>//
- **[ddd1faa19](https://github.com/facebook/react/commit/ddd1faa19 )**: Remove config argument from useTransition ([#19719](https://github.com/facebook/react/pull/19719)) //<Andrew Clark>//
- **[92fcd46cc](https://github.com/facebook/react/commit/92fcd46cc )**: Replace SuspenseConfig object with an integer ([#19706](https://github.com/facebook/react/pull/19706)) //<Andrew Clark>//
- **[b754caaaf](https://github.com/facebook/react/commit/b754caaaf )**: Enable eager listeners in open source ([#19716](https://github.com/facebook/react/pull/19716)) //<Dan Abramov>//
- **[c1ac05215](https://github.com/facebook/react/commit/c1ac05215 )**: [Flight] Support more element types and Hooks for Server and Hybrid Components ([#19711](https://github.com/facebook/react/pull/19711)) //<Dan Abramov>//
- **[1eaafc9ad](https://github.com/facebook/react/commit/1eaafc9ad )**: Clean up timeoutMs-related implementation details ([#19704](https://github.com/facebook/react/pull/19704)) //<Andrew Clark>//
- **[8da0da093](https://github.com/facebook/react/commit/8da0da093 )**: Disable timeoutMs argument ([#19703](https://github.com/facebook/react/pull/19703)) //<Andrew Clark>//
- **[60ba723bf](https://github.com/facebook/react/commit/60ba723bf )**: Add SuspenseList to devTools ([#19684](https://github.com/facebook/react/pull/19684)) //<Ben Pernick>//
- **[5564f2c95](https://github.com/facebook/react/commit/5564f2c95 )**: Add React.startTransition ([#19696](https://github.com/facebook/react/pull/19696)) //<Ricky>//
- **[c4e0768d7](https://github.com/facebook/react/commit/c4e0768d7 )**: Remove unused argument from `finishConcurrentRender` ([#19689](https://github.com/facebook/react/pull/19689)) //<inottn>//
- **[848bb2426](https://github.com/facebook/react/commit/848bb2426 )**: Attach Listeners Eagerly to Roots and Portal Containers ([#19659](https://github.com/facebook/react/pull/19659)) //<Dan Abramov>//
- **[d2e914ab4](https://github.com/facebook/react/commit/d2e914ab4 )**: Remove remaining references to effect list ([#19673](https://github.com/facebook/react/pull/19673)) //<Andrew Clark>//
- **[d6e433899](https://github.com/facebook/react/commit/d6e433899 )**: Use Global Render Timeout for CPU Suspense ([#19643](https://github.com/facebook/react/pull/19643)) //<Sebastian Markbåge>//
- **[64ddef44c](https://github.com/facebook/react/commit/64ddef44c )**: Revert "Remove onScroll bubbling flag ([#19535](https://github.com/facebook/react/pull/19535))" ([#19655](https://github.com/facebook/react/pull/19655)) //<Dan Abramov>//
- **[dd651df05](https://github.com/facebook/react/commit/dd651df05 )**: Keep onTouchStart, onTouchMove, and onWheel passive ([#19654](https://github.com/facebook/react/pull/19654)) //<Dan Abramov>//
- **[b8fa09e9e](https://github.com/facebook/react/commit/b8fa09e9e )**: provide profiling bundle for react-reconciler ([#19559](https://github.com/facebook/react/pull/19559)) //<Julien Gilli>//
- **[23595ff59](https://github.com/facebook/react/commit/23595ff59 )**: Add missing param to safelyCallDestroy() ([#19638](https://github.com/facebook/react/pull/19638)) //<Brian Vaughn>//
- **[ee409ea3b](https://github.com/facebook/react/commit/ee409ea3b )**: change destroy to safelyCallDestroy ([#19605](https://github.com/facebook/react/pull/19605)) //<Luna Ruan>//
- **[bcca5a6ca](https://github.com/facebook/react/commit/bcca5a6ca )**: Always skip unmounted/unmounting error boundaries ([#19627](https://github.com/facebook/react/pull/19627)) //<Brian Vaughn>//
- **[1a41a196b](https://github.com/facebook/react/commit/1a41a196b )**: Append text string to <Text> error message ([#19581](https://github.com/facebook/react/pull/19581)) //<Timothy Yung>//
- **[e4afb2fdd](https://github.com/facebook/react/commit/e4afb2fdd )**: eslint-plugin-react-hooks@4.1.0 //<Dan Abramov>//
- **[ced05c46c](https://github.com/facebook/react/commit/ced05c46c )**: Update CHANGELOG.md //<Dan Abramov>//
- **[702fad4b1](https://github.com/facebook/react/commit/702fad4b1 )**: refactor fb.me redirect link to reactjs.org/link ([#19598](https://github.com/facebook/react/pull/19598)) //<CY Lim>//
- **[49cd77d24](https://github.com/facebook/react/commit/49cd77d24 )**: fix: leak strict mode with UMD builds ([#19614](https://github.com/facebook/react/pull/19614)) //<Toru Kobayashi>//
- **[ffb749c95](https://github.com/facebook/react/commit/ffb749c95 )**: Improve error boundary handling for unmounted subtrees ([#19542](https://github.com/facebook/react/pull/19542)) //<Brian Vaughn>//
- **[9b35dd2fc](https://github.com/facebook/react/commit/9b35dd2fc )**: Permanently removed component stacks from scheduling profiler data ([#19615](https://github.com/facebook/react/pull/19615)) //<Brian Vaughn>//
- **[3f8115cdd](https://github.com/facebook/react/commit/3f8115cdd )**: Remove `didTimeout` check from work loop //<Andrew Clark>//
- **[9abc2785c](https://github.com/facebook/react/commit/9abc2785c )**: Remove wasteful checks from `shouldYield` //<Andrew Clark>//
- **[1d5e10f70](https://github.com/facebook/react/commit/1d5e10f70 )**: [eslint-plugin-react-hooks] Report constant constructions ([#19590](https://github.com/facebook/react/pull/19590)) //<Jordan Eldredge>//
- **[dab0854c5](https://github.com/facebook/react/commit/dab0854c5 )**: Move commit passive unmount/mount to CommitWork ([#19599](https://github.com/facebook/react/pull/19599)) //<Sebastian Markbåge>//
- **[ccb6c3945](https://github.com/facebook/react/commit/ccb6c3945 )**: Remove unused argument ([#19600](https://github.com/facebook/react/pull/19600)) //<inottn>//
- **[629125555](https://github.com/facebook/react/commit/629125555 )**: [Scheduler] Re-throw unhandled errors ([#19595](https://github.com/facebook/react/pull/19595)) //<Andrew Clark>//
- **[b8ed6a1aa](https://github.com/facebook/react/commit/b8ed6a1aa )**: [Scheduler] Call postTask directly ([#19551](https://github.com/facebook/react/pull/19551)) //<Andrew Clark>//
- **[ce37bfad5](https://github.com/facebook/react/commit/ce37bfad5 )**: Remove resolutions from test renderer package.json ([#19577](https://github.com/facebook/react/pull/19577)) //<Dan Abramov>//
- **[2704bb537](https://github.com/facebook/react/commit/2704bb537 )**: Add ReactVersion to SchedulingProfiler render scheduled marks ([#19553](https://github.com/facebook/react/pull/19553)) //<Kartik Choudhary>//
- **[0c52e24cb](https://github.com/facebook/react/commit/0c52e24cb )**: Support inner component _debugOwner in memo ([#19556](https://github.com/facebook/react/pull/19556)) //<Brian Vaughn>//
- **[0cd9a6de5](https://github.com/facebook/react/commit/0cd9a6de5 )**: Parallelize Jest in CI ([#19552](https://github.com/facebook/react/pull/19552)) //<Andrew Clark>//
- **[a63893ff3](https://github.com/facebook/react/commit/a63893ff3 )**: Warn about undefined return value for memo and forwardRef ([#19550](https://github.com/facebook/react/pull/19550)) //<Brian Vaughn>//
- **[32ff42868](https://github.com/facebook/react/commit/32ff42868 )**: Add feature flag for setting update lane priority ([#19401](https://github.com/facebook/react/pull/19401)) //<Ricky>//
- **[5bdd4c8c6](https://github.com/facebook/react/commit/5bdd4c8c6 )**: Remove unused argument from call to jest method ([#19546](https://github.com/facebook/react/pull/19546)) //<Gustavo Saiani>//
- **[a5fed98a9](https://github.com/facebook/react/commit/a5fed98a9 )**: Register more node types that are used later as JSXIdentifiers ([#19514](https://github.com/facebook/react/pull/19514)) //<Mateusz Burzyński>//
- **[f77c7b9d7](https://github.com/facebook/react/commit/f77c7b9d7 )**: Re-add discrete flushing timeStamp heuristic (behind flag) ([#19540](https://github.com/facebook/react/pull/19540)) //<Dominic Gannaway>//

Changelog: [general] [feature] Upgrade to React 17

Reviewed By: cpojer

Differential Revision: D24491201

fbshipit-source-id: c947da9dcccbd614e9dc58f3339b63e24829aca7
2020-10-26 20:28:00 -07:00
Héctor Ramos 6f78e16c01 iOS: Build react-native-codegen as part of RNTester pod install
Summary:
Ensure the react-native-codegen package is built before the codegen is invoked during RNTester's pod install.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24515852

fbshipit-source-id: eeb1237f601d83a79a5274261c374bb5fc5689eb
2020-10-26 11:31:08 -07:00
Keith Melmon b5de89755d add testID, helps tests find items in the list (#30138)
Summary:
This change adds a testID to each item in the RNTester list.  This helps Appium find items in the list for automated tests.  The change was added in react-native-windows as part of end-to-end test infrastructure changes.    See https://github.com/microsoft/react-native-windows/pull/5555

We'd like to remove this forked file, upstreaming this change will enable us to do that.

## 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] - add testID to items in RNTester test list, helps test automation tools find the items

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

Test Plan: Change is currently running in react-native-windows CI loop.

Reviewed By: cpojer

Differential Revision: D24434352

Pulled By: appden

fbshipit-source-id: 998916d8fe4e4e4cd6ac764baabb9fd5f2e312c7
2020-10-20 17:29:13 -07:00
Joshua Gross a17ff44adc Upgrade minsdkversion of RN OSS template to API level 21
Summary:
This diff updates the minsdkversion of RN OSS template to API level 21.

Changelog: [Android][Deprecated] Deprecate support of Android API levels 19 and 20. The new minSDK version will be 21+ moving forward.

Reviewed By: fkgozali

Differential Revision: D24379607

fbshipit-source-id: 6801cdcd363065807cdc11006bd94217f914fac7
2020-10-20 17:00:47 -07:00
Héctor Ramos d03c0f965e Generate FBReactNativeSpec ObjC++ source files using CocoaPods
Summary:
Move FBReactNativeSpec codegen invocation to shared `react_native_pods.rb` script and trigger codegen to run as part of `pod install` in both RNTester as well as React Native for iOS projects.

These files need to be generated before CocoaPods generates the Pods project, so the codegen is invoked as part of a `pre_install` hook during `pod install`.

The codegen hook can now take optional paths to allow it to run within different contexts (as part of a `react-native` repo checkout with access to the codegen source, or as part of a React Native iOS project that depends on the `react-native-codegen` npm package).

## Motivation

The FBReactNativeSpec ObjC++ source files (FBReactNativeSpec.h and FBReactNativeSpec-generated.mm) can be generated on demand from the native module specs in `Libraries/` using `react-native-codegen`. They can therefore be removed from the repository, but before we do so, we must ensure they get generated when a React Native iOS workspace is created or updated.

Invoking the codegen as part of the `pod install` step that creates a React Native iOS Xcode workspace ensures the specs are available in the following scenarios:
* Whenever a new React Native iOS project is created. The `react-native init` command invokes `pod install`.
* Whenever a React Native iOS project is upgraded. The `react-native upgrade` command invokes `pod install` as well.
* For contributors to the open source project running the RNTester application, the codegen will be invoked when the RNTester workspace is generated by CocoaPods using `pod install` in `packages/rn-tester`.

In any other case, the codegen can still be invoked directly via `scripts/generate-native-modules-specs.sh`.

> **Note:**
> The codegen will only process native modules in React Native's own Libraries directory.

Changelog:
[iOS][Changed] - Generate FBReactNativeSpec ObjC++ source files using CocoaPods.

Reviewed By: fkgozali

Differential Revision: D24348111

fbshipit-source-id: d62ae5c6f8ce6358bf96a2801c3cdb3d94dd868d
2020-10-20 13:17:00 -07:00
Kevin Gozali 3ed38df175 TurboModule Android: Remove RNTester module lookup override
Summary:
The manual lookup logic was needed before we properly parse the module names from the spec js files. This is no longer necessary after the commit stack starting with 3a75b376cc

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24370567

fbshipit-source-id: fc307d93cdda240a977e37dfe602502bd3f7c2a4
2020-10-17 02:45:48 -07:00
Lorenzo Sciandra fb14fd42b3 Chore: Upgrade Detox to 16.7.2 (#30084)
Summary:
With Xcode 12 being the latest, Detox 15.x has issues - in particular, it means that if you try to `yarn install` the dependencies for the repo, you'll be greeted by this error:

```bash
error /<stuff>/react-native/node_modules/detox: Command failed.
Exit code: 1
Command: node scripts/postinstall.js
Arguments:
Directory: /<stuff>/react-native/node_modules/detox
Output:
/<stuff>/Library/Detox/ios/5824c837515589f21c08f09b716a6eda088aa31f was found, but could not find Detox.framework inside it. This means that the Detox framework build process was interrupted.
         deleting /<stuff>/Library/Detox/ios/5824c837515589f21c08f09b716a6eda088aa31f and trying to rebuild.
Extracting Detox sources...
Building Detox.framework from /<stuff>/Developer/OSS/react-native/node_modules/detox/ios_src...
child_process.js:637
    throw err;
    ^
```

With the {emoji:1f44d} of hramos & alloy I've prep'd up a small defensive PR that can be quickly merged before cutting 0.64, that bumps the version of Detox from 15.4.4 to the highest version available within the reach of "no breaking changes" in changelog.

The main reason why with 16.x this error doesn't happen is that from [16.0.0](https://github.com/wix/Detox/releases/tag/16.0.0):

> Detox now comes as a prebuilt framework on iOS, thus lowering npm install times and saving some build issues that happen due to unexpected Xcode setups.

It would have been better to update directly to latest (at the time of writing 17.7.1) but there are at least two versions that had changelogs that seem to involve bigger changes:

* https://github.com/wix/Detox/releases/tag/17.4.7
* https://github.com/wix/Detox/releases/tag/16.8.0

Hopefully CI will will show that the bump doesn't break any 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
-->

[Internal] [Changed] - Bumped Detox in the repo to 16.7.2 for Xcode 12 compatibility

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

Test Plan: Running yarn in the main repo with Node 14 & Xcode 12, without this change, will cause the error copy-pasted above. After upgrading to this version, the error disappear.

Reviewed By: cpojer

Differential Revision: D24293226

Pulled By: hramos

fbshipit-source-id: 2b4d23b033be621274966262ec19200bee44df58
2020-10-14 12:06:06 -07:00
Lulu Wu ea93151f21 Make RCTEventDispatcher TurboModule-compatible
Summary:
This diff ended up being a bit more complicated than I anticipated, since the source files in `ReactInternal` were depending on `RCTEventDispatcher`. I made the following changes:
1. Make `RCTEventDispatcher` a `protocol`, keep it in `ReactInternal`.
2. Rename the `RCTEventDispatcher` NativeModule to `RCTEventDispatcherModule`, make it conform to the `RCTEventEmitter` `protocol`, and move it to `CoreModules`.
3. Where necessary, replace categories of `RCTEventDispatcher` with functions.

Changelog:
[iOS][Added] - Make RCTEventDispatcher TurboModule-comaptible

Reviewed By: fkgozali

Differential Revision: D18439488

fbshipit-source-id: b3da15c29459fddf884519f33b0c3b8c036b5539
2020-10-14 02:40:10 -07:00
Peter Argany b05d90e8bb Remove type union in Picker.js
Summary:
Flow type unions don't play well with Fabric components. This diff removes a union in `Picker.js` and fixes all the flow errors.

Before this diff, all these surfaces would crash with the new Fabric Picker impl, because the impl asserts that this field is a string.

Reviewed By: sammy-SC

Differential Revision: D24236317

fbshipit-source-id: 6e646c84fcd16658aaabe5e93507f5f33b346a65
2020-10-13 11:19:29 -07:00
Nick Gerleman 4d247fe058 Avoid Repo Structure Assumptions in RNTester Imports (#30141)
Summary:
RNTester has some imports left over that operate on directory traversal, assuming it is contained within react-native sources. This change makes these imports relative to react-native, enabling usage outside of the RN repo.

Relates to https://github.com/microsoft/react-native-windows/issues/6210

## Changelog

[Internal] [Fixed] - Avoid File Structure Assumptions in RNTester Imports

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

Test Plan: Validated we can bundle and flow-check both iOS + Android

Reviewed By: cpojer

Differential Revision: D24259628

Pulled By: appden

fbshipit-source-id: 0c21b5d354b01785d8402599da3b0a5be81b4c6d
2020-10-12 19:56:09 -07:00
simek b7167c23fc PlatformColors: add missing clearColor for iOS (#30054)
Summary:
This small PR adds missing [`clearColor`](https://developer.apple.com/documentation/uikit/uicolor/1621945-clearcolor?language=objc) to the avaiable PlatformColors on iOS.

**Please let me know** if you would like to see ["Fixed colors"](https://developer.apple.com/documentation/uikit/uicolor/standard_colors?language=objc) added to the `PlatformColors`. I can address this within this PR or create a separate one.

## 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] [Added] - PlatformColors: add missing `clearColor`

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

Test Plan:
[(I had to disable the Dark Mode to fix the RNTester readability problems)](https://user-images.githubusercontent.com/719641/94453196-b35cb000-01b0-11eb-8d7d-73d48ceecf53.PNG)

Transparent/clear color has been added to the RNTester PlatformColors API example:
![IMG_6782](https://user-images.githubusercontent.com/719641/94453172-ae97fc00-01b0-11eb-9bef-1a1a387ac009.PNG)

Reviewed By: shergin

Differential Revision: D24241160

Pulled By: sammy-SC

fbshipit-source-id: 41fb51677329cc3b3f915d5d08694c07b4ef2cf3
2020-10-12 02:14:42 -07:00
Janic Duplessis 6685aba462 Update template to xcode 12 (#30150)
Summary:
This makes a few change to the template xcodeproj

- Update to recommended settings for Xcode 12
- Remove the main.jsbundle file that doesn't exists, this file is included automatically in the app bundle and doesn't need to be in xcode (it won't even be at that path).
- Add -e to the bundle images script. It seems like Xcode doesn't fail the build on script errors anymore so this makes it so the build stop. If it doesn't stop the app will launch and crash because the bundle doesn't exist (note this is only if running the app in release mode since in debug we don't generate the bundle).

## Changelog

[iOS] [Added] - Update template to xcode 12

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

Test Plan: Made the same changes in an app and made sure it ran well.

Reviewed By: cpojer

Differential Revision: D24237481

Pulled By: sammy-SC

fbshipit-source-id: 2b06a24c510c423eb45a1a840ea365b64506321b
2020-10-12 01:28:32 -07:00
Kevin Gozali 1d89ef87b6 TurboModule: exclude NativeSampleTurboModule in the schema
Summary:
The sample module is meant for demo only, but it lives alongside other core modules in react-native repo.

For now, exclude it in the Flow-type parsing, just like `NativeUIManager.js`

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24005108

fbshipit-source-id: 9ef524bfe2778dd983c94d1701f9ce49da5e0a68
2020-09-29 18:41:14 -07:00
Kevin Gozali 94b198cfd5 TurboModule Android: install SampleTurboModule and the playground to RNTester
Summary:
This compiles SampleTurboModule into RNTester Android. It also adds the NativeModule playground to show case TurboModule system to RNTester examples, just like in iOS.

{F337854369}

Changelog: [Android][TurboModule] Added TurboModule example to RNTester when `USE_CODEGEN` is set

Reviewed By: hramos

Differential Revision: D24004711

fbshipit-source-id: b682dd51fa998ee2e60f8d6ffd8c39220d13a7fe
2020-09-29 18:41:14 -07:00
Kevin Gozali b9a1ea9e9e TurboModule Android: move SampleTurboModule impl and spec to OSS
Summary:
This is the Java/JNI impl of the NativeSampleTurboModule.js, just like on iOS. The files here are supposed to be generated by the react-native-codegen, but they are checked in to the repo for easier build integration with RNTester.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23985746

fbshipit-source-id: 46340d778f3d964efe5b538d15ebe0f2cab04862
2020-09-29 18:41:14 -07:00
Kevin Gozali b931bd33fe TurboModule Android: properly set up RNTester ndkBuild and cleanup dependencies
Summary:
Before RNTester compilation starts, it needs to wait for :ReactAndroid NDK build to finish, so that it knows where to find the exported .so files. This tells the `preBuild` task to depends on `:ReactAndroid:prepareReactNdkLibs` task. The .so files are now copied over to the local project build dir, instead of depending on :ReactAndroid's build dir.

For cleanup, the reverse ordering is needed: before `clean` removed our temp dir to store the copied .so files, make sure the ndkBuild cleanup tasks execute beforehand.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23982989

fbshipit-source-id: 955d7c9bccb5855b6b066fca89764df2ede89f63
2020-09-29 18:41:14 -07:00
simek 29f5dc2ae0 chore: deduplicate lock, update packages repository fields (#30044)
Summary:
This small PR includes the following changes:
* deduplicate yarn lock file using [`yarn-deduplicate`](https://github.com/atlassian/yarn-deduplicate) package
  * deduplicate script has been added as `update-lock`, let me know if you would like also to see this in [`postinstall`](https://docs.npmjs.com/misc/scripts) (to automatically optimize lock on every dependency change)
* according to the [npm docs](https://docs.npmjs.com/files/package.json#repository):
  * main `package.json` repository field has been replaced with shorthand
  * monorepo packages repository field has been extended by `directory`

The main goal of introducing deduplication script was to optimize the dependencies footprint while developing and speed up the initial installation process. Running `yarn-deduplicate` also increase the security in some way, because it enforces usage only of the latest version of the package. You can read more about the benefits in the deduplicate script [repository](https://github.com/atlassian/yarn-deduplicate#duplicated-packages).

## 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] - add yarn lock deduplication script

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

Test Plan: `yarn install` was successful, this also should not affect yarn workspaces in any way.

Reviewed By: GijsWeterings

Differential Revision: D23959812

Pulled By: cpojer

fbshipit-source-id: e2455e3718378e1ce6206e79463d4083f8fe5d47
2020-09-28 22:41:50 -07:00
simek 2160377574 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

## 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] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:41 -07:00
Joshua Gross 35b8f76c9e RNTester: Add TextInput example to RTL tester
Summary:
Add a TextInput to RTL screen in RNTester, to test RTL languages with TextInput.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23914627

fbshipit-source-id: 84c62efe7034c0dfa2ef21be3f085880292c3930
2020-09-28 10:45:01 -07:00
Kevin Gozali 8d4b5efac7 TurboModule Android: allow RNTester to activate TurboModule system
Summary:
If built with `USE_CODEGEN=1` flag set, RNTester now activates the TurboModule system, also using various codegen output from the previous commits.

Note that this is very early integration, and not thoroughly tested yet.

To verify:

```
console.warn('TM enabled?', global.__turboModuleProxy != null);
```

{F337454276}

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23946944

fbshipit-source-id: 5838aeb9ded07b1cc0fcb069535d1c6fb3725973
2020-09-25 22:14:56 -07:00
Kevin Gozali 9dbab5fb7b TurboModule Android: Implement TurboModuleManagerDelegate specific to RNTester
Summary:
This provides the RNTester specific impl of the manager delegate. The class is responsible to provide module lookup during runtime for TurboModule, and the C++ impl is using the codegen-generated lookup functions from :ReactAndroid and :packages:rn-tester:android:app Gradle targets.

Note: RNTester still needs to explicitly enable TurboModule and instantiate this manager before it can activate TurboModule.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23938537

fbshipit-source-id: 7957847ecc58fef8d9a276d9d3d477ecec36a700
2020-09-25 22:14:56 -07:00
Kevin Gozali 4072b1865a TurboModule Android: rename libreact_nativemodule_manager to libturbomodulejsijni
Summary:
TurboModule Java files are still using the old lib name: `turbomodulejsijni`, so let's keep it that way for now.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23946945

fbshipit-source-id: ff095ff51dca532c82e67e1c75e9a4e9be392d61
2020-09-25 22:14:56 -07:00
Kevin Gozali 45a4a67965 Android: consolidate various prebuilt C++ .so configuration into Android-prebuilt.mk
Summary:
To make it easier for hosting app or other lib to get access to the ReactAndroidNdk .so outputs, let's define common targets in a dedicated Android-prebuilt.mk. Hosting app's Android.mk just need to include the mk path.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23938538

fbshipit-source-id: 850d690326d134212d5f040c6fa54ab50c53cb87
2020-09-25 22:14:56 -07:00
Kevin Gozali abff021261 TurboModule Android: compile codegen C++ output into librntester_appmodules.so
Summary:
The react-native-codegen provides Android.mk in the Android C++ output, but for RNTester (or hosting apps), we should just compile the codegen output with the rest of the app-specific C++ files. This is to simplify the build configuration, and also to not add too many additional .so libs to the APK.

With this commit, `RNTesterAppModuleProvider.cpp` should be "complete" for RNTester use-case. This TurboModule lookup function is the one described in https://github.com/react-native-community/discussions-and-proposals/issues/273.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23913149

fbshipit-source-id: d1ca136787b87a0e8e6504318e1f0a78efef46ea
2020-09-24 15:24:10 -07:00
Kevin Gozali 77c16578bf TurboModule Android: add dependency on ReactAndroid codegen output to RNTester
Summary:
This adds shared libraries dependencies to RNTester so that it can call `ReactAndroidSpec_ReactAndroidSpec_ModuleProvider()` C++ lookup function. That function is generated by the react-native-codegen during build time. This does not make RNTester use TurboModule yet, just the necessary setup to link the C++ libs together.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23901952

fbshipit-source-id: fd5ee0ca266609207962adc5ceaf814956052eec
2020-09-24 09:43:43 -07:00
Ankit Tiwari 99db9f2a42 Minor Code Improvements in RNTester (#29868)
Summary:
* Update single-letter variable names to be more descriptive
* Remove event listener on component unmount
* Add flow types
* Refactor RNTesterNavbar to use descriptive component names

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

Reviewed By: hramos

Differential Revision: D23598579

Pulled By: rickhanlonii

fbshipit-source-id: c5cfc61d7b2fcb2942bf149d0a8ba0b58b0192e6
2020-09-23 19:58:05 -07:00
chirag-singhal 43abf23bff New Button Component Use Cases (#29848)
Summary:
* New use cases for button component in rn-tester
 * E2E tests for the button component

## Changelog
[General] [Changed] - Changed use cases for button component in rn-tester

## Test Plan
![image](https://user-images.githubusercontent.com/42653703/92123053-ced6d400-ee19-11ea-8f10-c5e8529c85ca.png)
After -
![image](https://user-images.githubusercontent.com/42653703/92625569-70609880-f2e6-11ea-9fb9-f7327d842a34.png)
Before -
![image](https://user-images.githubusercontent.com/42653703/92625555-6a6ab780-f2e6-11ea-90d1-8c54ebc60062.png)

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

Reviewed By: hramos

Differential Revision: D23649694

Pulled By: rickhanlonii

fbshipit-source-id: 3590eca08ea58c771596ad731f74eb233b1a40d8
2020-09-23 19:51:49 -07:00