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

6179 Коммитов

Автор SHA1 Сообщение Дата
Rick Hanlon 94c45af136 Add dark mode to loading progress
Summary:
This diff updates the loading banner to respect the RCTAppearance dev mode setting.

Changelog: [General] [iOS] Add dark mode support to loading banner

Reviewed By: fkgozali

Differential Revision: D21429148

fbshipit-source-id: d7d9e778245112a19accf813dcff693f0d187a38
2020-05-12 20:56:06 -07:00
Peter Argany b01fcee4ce Get redbox working in bridgeless mode, disable logbox
Summary: This enables redbox in bridgeless mode, by removing a dep on the bridge. It also disables full screen logbox, since I couldn't figure out how to get it working without the bridge.

Reviewed By: rickhanlonii, ejanzer

Differential Revision: D21440233

fbshipit-source-id: cb1730fefe1639135fdf06039031975d53f95229
2020-05-12 19:55:37 -07:00
Emily Janzer df08d65920 Disable animations on Android again
Summary: We don't yet have native driver support for animations in bridgeless mode on Android, which leads to some weird bugs (like an overlay that never disappears). Let's just disable animations on Android again.

Reviewed By: mdvacca

Differential Revision: D21537982

fbshipit-source-id: b4e8882a414fecbd52dd25e02325b5c588ee68c0
2020-05-12 19:39:36 -07:00
Paige Sun e5a6655e71 iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil
Summary:
## Problem
When self is nil, this may crash in RCTUIImageViewAnimated.m.

```
_displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)];
```

## Fix

Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target.

### Original Github Issue
https://github.com/facebook/react-native/pull/28070#issuecomment-619295254

Changelog: [iOS] [Fixed] -  Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil

Reviewed By: shergin

Differential Revision: D21419385

fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf
2020-05-12 17:08:43 -07:00
Moti Zilberman b4785e5144 Forward all bundle URL params through HMR and bundle splitting
Summary:
Forwards any extra parameters set on the main bundle URL (in development) to the derived bundle URLs used in hot reloading and bundle splitting.

Changelog: [General] - Forward URL parameters from main bundle to hot reloaded bundles

Reviewed By: cpojer

Differential Revision: D21455592

fbshipit-source-id: e1c375e3b6a0f3387372f1d96498dbf7d5237a09
2020-05-12 07:35:51 -07:00
Manvir Singh d54113d8c4 implemented showSoftInputOnFocus for iOS (#28834)
Summary:
`showSoftInputOnFocus` was added in https://github.com/facebook/react-native/issues/25028, but it was only added for Android. There was a lot of discussion on the original issue being addressed (https://github.com/facebook/react-native/issues/14045), that there is a need for this on iOS as well. The issue with iOS was brought up again on https://github.com/facebook/react-native/issues/27243.

On a related note, when searching this repo's issues for `showSoftInputOnFocus`, it appears that there are several closed issues that claim that the Android implementation doesn't work (https://github.com/facebook/react-native/issues/25685, https://github.com/facebook/react-native/issues/25687, https://github.com/facebook/react-native/issues/26643). So perhaps the Android implementation needs to be looked at as well (I myself have not gotten around to confirming whether it works or not)

## Changelog

[iOS] [Added] - Add showSoftInputOnFocus to TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/28834

Test Plan:
You'd use this just like you would in the Android implementation:
```jsx
<TextInput showSoftInputOnFocus={false} />
```

## GIFs
### Before change
![May-04-2020 20-52-49](https://user-images.githubusercontent.com/4932784/81034028-9d89cf80-8e4a-11ea-906c-64f62504f80c.gif)

### After change
![May-04-2020 20-54-27](https://user-images.githubusercontent.com/4932784/81034035-a11d5680-8e4a-11ea-918e-119a1c9e2a19.gif)

Differential Revision: D21418763

Pulled By: shergin

fbshipit-source-id: 561e72fc2cf16b30446132f6b96b8aa2b4a92daf
2020-05-11 09:01:33 -07:00
William Candillon 797367c089 Fix skewX on Android and in the JS decomposition (#28862)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/27649.

By using 2d decomposition that transforms a skewX into a rotate/scale/rotate, the skewX issue on Android was still there which made me suspect that the issue came from the decomposition algorithm. Then I noticed that the bug existed in the JavaScript decomposition as well which led me to a fix on the JS and therefore on the Android side most likely.

## Changelog

[Android] [Fixed] skewX transforms
Pull Request resolved: https://github.com/facebook/react-native/pull/28862

Test Plan:
Check that skewX works on Android.
On JS, making sure that processTransform() doesn't skip, you can try the following sequence:

```tsx
  const matrix = processTransform([{ skewX: `${Math.PI / 3}rad` }]);
  const result = MatrixMath.decomposeMatrix(matrix);
  console.log({ result });
```

Differential Revision: D21493021

Pulled By: shergin

fbshipit-source-id: 89f7aca5fbfd0f0f8c6f90a26bd76bf8550acaa5
2020-05-11 09:01:33 -07:00
Kevin Gozali e57a2d80a5 OSS: fixed incorrect license headers on some files
Summary:
de667fffa4 (commitcomment-39068402) had incorrect license headers. This fixed them.

Changelog: [General] [Fixed] - fixed license headers on some files

Reviewed By: cpojer

Differential Revision: D21496796

fbshipit-source-id: f9d6b0cf4af0ecf6caacbae2396d73efbc4975fe
2020-05-10 16:16:30 -07:00
Tim Yung a1ac2518a3 TextInput: Default `blurOnSubmit` in JS
Summary:
Consolidates the logic for the default value of `blurOnSubmit` on `TextInput` in the JavaScript component.

This only materially impacts Fabric.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D21491482

fbshipit-source-id: 16d8aba32e7d0321a4583e87e03405ea587e35d4
2020-05-09 17:24:19 -07:00
Peter Argany 13ee5c4c16 Enable animations in bridgeless mode on iOS
Reviewed By: ejanzer

Differential Revision: D21465166

fbshipit-source-id: b34e8e97330b897e20d9a4b05dba1826df569e16
2020-05-08 16:13:42 -07:00
João Vieira 16ea9ba813 Support excluding multiple platforms.
Summary:
Currently the schema only allows to exclude a single platform (iOS OR Android). There are cases where we need to exclude multiple. This change converts the previous `excludePlatform` string property into an `excludePlatforms` array.

Changelog:
[Internal][Changed] - Added support to exclude multiple platforms in Codegen.

Reviewed By: sammy-SC

Differential Revision: D21426950

fbshipit-source-id: eff36ffa207109274794b4b300bf6313f8286161
2020-05-07 09:43:52 -07:00
Rubén Norte 26c120c632 Handle initialProps as optional in renderApplication
Summary:
Pass a default empty object to `AppContainer` if no `initialProps` were passed to `renderApplication`.

This prevents issues on Android, where we do not pass a default empty `initialProps` from native, as we do on iOS.

Changelog: [General] [Fixed] - Handle nullish `initialProps` correctly in `renderApplication`

Reviewed By: motiz88

Differential Revision: D21448692

fbshipit-source-id: 9630bdc2414532999abf3bf9da25047f0482fcab
2020-05-07 05:02:26 -07:00
Yuanzhe Bian 851644cfc2 Fix Animated type
Summary:
- Fixed typing of Animated and fixed the callsites

Changelog: [Internal]

Reviewed By: kacieb

Differential Revision: D21311870

fbshipit-source-id: 386fb496ab00ef7917273dc3eb65e1ed76a8dd33
2020-05-07 00:06:27 -07:00
Tim Yung d14b89bd8a RN: Workaround Fabric + Virtual Text Press Bug
Summary:
Workaround for a bug with Fabric when pressing on virtual text.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: JoshuaGross

Differential Revision: D21432793

fbshipit-source-id: fe20eeadd5365707fb71edae7a76d374e26b4c86
2020-05-06 14:23:05 -07:00
Kevin Gozali de667fffa4 Moved some NativeModule JS specs to OSS
Summary:
For some reason the specs were internal, but the native impl is still in github. So let's move these to github for consistency.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D21419934

fbshipit-source-id: f2c4486edca43c4348f3a3c6ce98f76a322bab0b
2020-05-06 12:20:48 -07:00
Rick Hanlon 41f0d9ba8f Rename error titles
Summary:
Based on feedback we're updating these titles to be more clear for their source.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D21413486

fbshipit-source-id: c144e7f759a4ff263b7ec80fa643eeb8ffac741b
2020-05-06 11:40:22 -07:00
Rick Hanlon 5066b662f2 LogBox - Always display the first fatal error
Summary:
This diff fixes an off-by-one error probably caused by my font ligatures where when exactly two exceptions are thrown at the same time we would show the second exception instead of the first. If three or more were thrown, we would show the second.

I also fixed some tests that had the wrong descriptions and wrong behavior enforced.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D21413186

fbshipit-source-id: 8e2940c89251dc042b10c6a2a2186089b6e7b53d
2020-05-06 11:40:22 -07:00
Paige Sun b0d0e51a77 iOS: Animated image should animate at the same speed regardless of framerate
Summary:
In iOS 11, [CADisplayLink](https://developer.apple.com/documentation/quartzcore/cadisplaylink)'s frameInterval was deprecated in favor of preferredFramesPerSecond, but these two properties have different underlying assumptions.

- set frameInterval to 2 for 30fps
- set preferredFramesPerSecond to 30 for 30fps. When you use preferredFramesPerSecond, assume frameInterval is 1.

This fix ensures gifs in <Image> component will animate at same speed regardless of framerate.

Reviewed By: shergin

Differential Revision: D21414014

fbshipit-source-id: 40ab23bab1990cf65d2802830b6835f350999537
2020-05-06 10:38:14 -07:00
Emily Janzer edfd965c46 Update native module specs
Summary: As titled.

Reviewed By: fkgozali

Differential Revision: D21417307

fbshipit-source-id: 7c6b0179f9f1a5108da241d181a24f707a083deb
2020-05-05 19:37:02 -07:00
Mats Byrkjeland de7f69a58e Fix type of exported Touchables: ComponentType -> AbstractComponent (#28737)
Summary:
Fixes https://github.com/facebook/react-native/issues/28726

When importing TouchableOpacity, it is treated as any by Flow. Replacing ComponentType with AbstractComponent works.

The [Flow documentation](https://flow.org/en/docs/react/types/#toc-react-componenttype) says the following about ComponentType:
> Note: In 0.89.0+, React.ComponentType is an alias for React.AbstractComponent<Config, any>, which represents a component with config type Config and any instance type.

So I'm thinking that since the instance type is treated as any with ComponentType, Flow treats TouchableOpacity as any as well.

## 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] [Fixed] - Fix Touchable{Opacity,Bounce,Highlight} being exported as `any` (Flow)
Pull Request resolved: https://github.com/facebook/react-native/pull/28737

Test Plan: I have done the same changes to react-native in my project's node_modules and seen that the components TouchableOpacity went from any to AbstractComponent with some props. Now I have a bunch of errors because I'm sending in wrong props to some touchables, which is good!

Reviewed By: cpojer

Differential Revision: D21362601

Pulled By: TheSavior

fbshipit-source-id: 5b98cc79eaef034eccdb7f47242f9f44be2ef2b8
2020-05-05 12:44:50 -07:00
Rubén Norte 4f5a092bf6 Pass initial props to WrapperComponent
Summary:
`renderApplication` receives the root component that we need to render and an optional wrapper component. There are cases where we want to use the initial props passed to the root component in the wrapper component as well (e.g.: to provide a specific context to the root component), so this adds modifies `AppContainer` to accept the initial props and inject them into the wrapper component.

Changelog: [General] [Added] - Modified `renderApplication` to forward `initialProps` to `WrapperComponent`

Reviewed By: fkgozali

Differential Revision: D21347486

fbshipit-source-id: 1c4f702a3875077630de1a44d3ac9ef2c80bc10c
2020-05-05 04:54:56 -07:00
Joshua Gross aae38c3dfe Support calling LayoutAnimation APIs in Fabric from JS
Summary:
Call Fabric's LayoutAnimation APIs from JS.

Changelog: [Internal] A step towards supporting LayoutAnimations on Fabric

Reviewed By: shergin, mdvacca

Differential Revision: D21297975

fbshipit-source-id: 6d530b01d8152e7c803a7c0299b918a32fb39dc0
2020-05-04 21:28:35 -07:00
Kacie Bawiec 7f2515ece8 Add warning when scrollRef does not have a scrollTo method
Summary:
Add a `console.warn()` call when calling `_scrollRef.scrollTo`, because `scrollTo` is not guaranteed to exist on `_scrollRef`.

Context:
`VirtualizedList` holds `_scrollRef`, which is usually a reference to a `ScrollView` component. However, there are several cases where it holds a `View` or other type of component instead.

A custom component can be passed in to `renderScrollComponent`, and then `_scrollRef` will point to that custom component. Additionally, if two VirtualizedLists are nested with the same orientation, `_defaultRenderScrollComponent` will return a View instead of a ScrollView.

Due to these possibilities, `_scrollRef` is not guaranteed to have a `scrollTo` method.

Changelog: [General] [Added] - Add warning when scrollRef does not have a scrollTo method

Reviewed By: JoshuaGross, TheSavior

Differential Revision: D21386842

fbshipit-source-id: 01e167e0ae0edea8f29853e8b242ce88a5103b49
2020-05-04 16:42:13 -07:00
Tim Yung ddea7c76b3 VirtualizedList: Remove `PropTypes` Dependency
Summary:
Removes `PropTypes` as a dependency of `VirtualizedList` by no longer validating the return value of `getItemLayout`.

Changelog: [Internal]

Reviewed By: TheSavior, cpojer

Differential Revision: D21370890

fbshipit-source-id: 966db3557b714987aa91179c7654a5ebf27818ad
2020-05-04 01:00:07 -07:00
Tim Yung 7bd694fc6f VirtualizedList: Migrate to React.Context
Summary:
Migrates `VirtualizedList` off legacy context by creating `VirtualizedListContext`.

Changelog:
[General][Changed] - Migrated `virtualizedList` legacy context to `React.Context`.

Reviewed By: TheSavior

Differential Revision: D21370882

fbshipit-source-id: 2fa99ee0bc0e6b747a2d3fe7c66ee402c6b9c5af
2020-05-04 01:00:06 -07:00
zhongwuzw 9cdc19a936 Fixes TextInput shaking when typing Chinese (#28805)
Summary:
Fixes https://github.com/facebook/react-native/issues/28488.

## Changelog

[iOS] [Fixed] - Fixes TextInput shaking when typing Chinese
Pull Request resolved: https://github.com/facebook/react-native/pull/28805

Test Plan: Demo see https://github.com/facebook/react-native/issues/28488.

Differential Revision: D21376803

Pulled By: shergin

fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7
2020-05-04 00:28:58 -07:00
Kevin Gozali 8ad810717e iOS: when the bridge has been invalidated, NativeModule lookup should just return nil
Summary:
There's a corner case where:
* The bridge gets invalidated, and native modules are cleaning up themselves (but not done yet)
* Something asks for a NativeModule instance - ideally it should just get nil at this point
* If TM Manager is invalidating, we get nil correctly, but we continue thru the old NativeModule lookup logic
* The latter will fail anyway, and would throw a redbox (RCTLogError).

So, if the bridge is invalidated, if TM Manager returns nil, we should just return nil for old NativeModule lookup.

The module of interest is RCTImageLoader, which was requested by RCTImageView on deallocation. The problem is RCTImageView got dealloc'ed **after** the bridge has been invalidated, so the lookup would always fail...

Bonus: RCTImageView should just keep a weak ref to the RCTImageLoader, so that:
* if the imageLoader is still alive on image dealloc, it can still access them (last minute "meaningless" cleanup)
* if the imageLoader is gone, then the image deallocation doesn't do anything

Changelog: [iOS] [Fixed] - Fix module lookup race condition on bridge invalidation.

Reviewed By: p-sun, sammy-SC

Differential Revision: D21371845

fbshipit-source-id: 862dc07de18ddbfb90e87e24b8dbd001147ddce4
2020-05-03 09:32:54 -07:00
Boyang Yu 12f8b2598f fix duration calculation for RCTUIImageViewAnimated
Summary:
## Changelog:
[iOS] [Fixed] - Fix duration calculation for RCTUIImageViewAnimated

Reviewed By: p-sun, shergin

Differential Revision: D21321089

fbshipit-source-id: 7464231bbc3b90e70d3ba95288fd90707d3d24af
2020-05-01 12:41:31 -07:00
Samuel Susla 2047041c53 Use InteropLayer for ReactART
Summary:
Changelog: [Internal]

Use InteropLayer to bridge ReactART into Fabric.

Reviewed By: shergin

Differential Revision: D21302151

fbshipit-source-id: 46deb381389c6fa87ecad296f616fbaccb29fe30
2020-05-01 03:47:26 -07:00
David Vacca f7e88387fb Enable Animated in Venice
Summary:
This diff extends venice app to render an Animation example test

changelog: [Internal][Android] Internal change to enable Animated in RN Bridgless mode

Reviewed By: PeteTheHeat

Differential Revision: D21317630

fbshipit-source-id: 9726fea9baba86191e63df909639d1d47ef5f359
2020-04-29 19:32:48 -07:00
Rick Hanlon 3729fe8de0 Update loading banner text and colors
Summary:
This diff updates the loading banner text and color on iOS for better UX.

Flow before:
- Loading from localhost:8081...
- Loading 20% (1000/5000)...
- Downloading JavaScript Bundle 20% (10/50)
- Downloading JavaScript Bundle...

After:
- Loading from Metro...
- Bundling 20%...
- Downloading 20%...
- Downloading...

Changelog: [Added] [iOS] Updated loading banner messages and color

Reviewed By: PeteTheHeat

Differential Revision: D21279939

fbshipit-source-id: fd7d90f85e25ce175a87087dfccf2180d49e3e98
2020-04-28 23:20:17 -07:00
Daiki Ihara 78d2b3c813 refine invariant error message at scrollToIndex (#28464)
Summary:
I refined the error message of scrollToIndex.

When I used scrollToIndex with `index:0` and data that length is 0, I met the odd error message `Invariant Violation scrollToIndex out of range: requested index 0 but maximum is -1`.

Next, I thought that scrollToIndex with `index:-1` meant scrollToTop without checking data length. I met `Invariant Violation: scrollToIndex out of range: requested index -1 but maximum is -1`

Finally, I wondered what will happen to use scrollToIndex with `index:-1` and data that length is `5`. The result is `Invariant Violation: scrollToIndex out of range: requested index -1 but maximum is 5`

The above error messages will confuse us. I clarified the boudaries and separated the error messages

## Changelog

[General] [Fixed] - Clarified the boundaries in error message of scrollToIndex
Pull Request resolved: https://github.com/facebook/react-native/pull/28464

Test Plan:
I added 3 test cases to cover the new error messages for VirtualizedList.
Run `yarn test` and confirm it passes.

Reviewed By: cpojer

Differential Revision: D21140133

Pulled By: TheSavior

fbshipit-source-id: 9a7a704f7ec599d833d2ed3ca2be059d950539b5
2020-04-28 19:15:05 -07:00
Samuel Susla e68f9bf768 Calling Paper TextInput setTextAndSelection view command now dirties layout
Summary:
Changelog: [Internal]

Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input.

I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height.

Reviewed By: shergin

Differential Revision: D21182990

fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6
2020-04-27 03:23:34 -07:00
Paige Sun e3e900805b Fix image instrumentation internal lifecycle
Reviewed By: fkgozali

Differential Revision: D20980822

fbshipit-source-id: d0a4a031046509425fbf6662471246ed2ab48a4c
2020-04-27 01:39:49 -07:00
simek 2b56011f9c Add Dark Mode support to the App template and NewAppScreen components (#28711)
Summary:
This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`.

Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds.

Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed.

~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~
> I have updated the Android splash screen and tested this change on the Android emulator.

If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template).

## Changelog

[Internal] [Added] - Add dark mode support to the default app template
Pull Request resolved: https://github.com/facebook/react-native/pull/28711

Test Plan:
I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`.

Screen recording on iOS (demonstarates both modes, both splash screens and transition):
![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif)

Screenshot of iOS app in Dark Mode:
![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG)

Screenshot of iOS app splash screen in Dark Mode:
![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG)

Screenshot of Android app in the emulator:
![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png)

Differential Revision: D21236148

Pulled By: shergin

fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda
2020-04-24 14:35:53 -07:00
Joshua Gross ed29ba13f9 Support `contentOffset` property in Android's ScrollView and HorizontalScrollView
Summary:
For a very long time, iOS has supported the `contentOffset` property but Android has not:

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

This property can be used, primarily, to autoscroll the ScrollView to a starting position when it is first rendered, to avoid "jumps" that occur by asynchronously scrolling to a start position.

Changelog: [Android][Changed] ScrollView now supports `contentOffset`

Reviewed By: mdvacca

Differential Revision: D21198236

fbshipit-source-id: 2b0773569ba42120cb1fcf0f3847ca98af2285e7
2020-04-23 15:39:45 -07:00
Joshua Gross bda8aaeec2 Modal: disable view flattening explicitly for the children of Modal, the content wrappers
Summary:
I noticed that in ModalHostShadowNode.java (not used in Fabric), there's an assumption that the Modal will have exactly one child on the native side; this child is explicitly specified in Modal.js.

However, in Fabric, these views are flattened and so the Modal will actually have N children - whatever children the product code passes into the Modal.

In *theory* this should be fine, but might be causing issues. Not sure.

This is an experiment and shouldn't be landed until we verify that (1) this actually matters, (2) that it fixes an issue with Modal on iOS or Android.

Changelog: [Internal] Change to make Fabric consistent with non-Fabric Modal

Reviewed By: mdvacca

Differential Revision: D21191822

fbshipit-source-id: 9d65f346387fd056649d4063d70220f637ba8828
2020-04-23 15:39:45 -07:00
Jesse Katsumata a903d1b86a BackHandler: specify function return type for handler (#28192)
Summary:
Following the comment https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42618#discussion_r384584159

Modify the flowtype of BackHandler function to have more specific return type.

## Changelog

[General] [Changed] - Changed type of BackHandler to be more specific.
Pull Request resolved: https://github.com/facebook/react-native/pull/28192

Test Plan: No flow error in RNTester

Reviewed By: TheSavior

Differential Revision: D20771113

Pulled By: hramos

fbshipit-source-id: 5ca65e2a2b3f8726b8fb4606473d8fad5b0ce730
2020-04-23 14:13:06 -07:00
Jonny Burger a2f8b9c36e Set black as default text color for <TextInput/> on iOS (#28708)
Summary:
This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin).
This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField.

Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in.

## Changelog

[iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode
Pull Request resolved: https://github.com/facebook/react-native/pull/28708

Test Plan:
I have manually tested the following:
- The default text color in light mode is black
- The default text color in dark mode is black
- The color can be changed using the `style.color` attribute
- Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity.
– Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color.

Differential Revision: D21186579

Pulled By: shergin

fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29
2020-04-22 23:43:34 -07:00
Panagiotis Vekris 57fee33898 Flow 0.123.0 in xplat/js
Summary:
Changelog: [Internal]

## Sync of generated files

Ran
```
js1 upgrade www-shared -p core_windowless
```
but had to manually revert
```
RKJSModules/Libraries/www-shared/core_windowless/logging/FBLoggerType.flow.js
RKJSModules/Libraries/www-shared/core_windowless/logging/FBLogger.js
```
because they introduced more errors

## Flow version bump
```
~/fbsource/fbcode/flow/facebook/deploy_xplat.sh 0.123.0
```

Reviewed By: gkz

Differential Revision: D21159821

fbshipit-source-id: e106fcb43e4fc525b9185f8fc8a246e6c3a6b14f
2020-04-21 22:43:24 -07:00
Tim Yung 5242ad931b RN: Add `RootTag` Type to TurboModule
Summary:
Adds `RootTag` as a valid type for arguments and return types in TurboModules (on both Android and iOS).

This will enable us to change `RootTag` into an opaque type. There are two compelling reasons to do this:

- JavaScript will no longer be able to safely depend on `RootTag` being a number (which means we can change this in the future).
- Call sites using `unstable_RootTagContext` will can get a `RootTag`, but call sites using the legacy `context.rootTag` will not. This means the opaque type will give us a strategy for migrating away from legacy context and eventually making `unstable_RootTagContext` the only way to access `RootTag`.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: RSNara

Differential Revision: D21127170

fbshipit-source-id: baec9d7ad17b2f8c4527f1a84f604fc0d28b97eb
2020-04-21 19:15:54 -07:00
Tim Yung a850d116dc RN: Create `RootTag` Type
Summary:
Creates a `RootTag` type and refactors the `RootTagContext` module a bit.

This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D21127173

fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0
2020-04-21 19:15:53 -07:00
Christoph Nakazawa f248ba1c8b Upgrade to Jest 25
Summary:
This diff upgrades Jest to the latest version which fixes a bunch of issues with snapshots (therefore allowing me to enable the Pressable-test again). Note that this also affects Metro and various other tooling as they all depend on packages like `jest-worker`, `jest-haste-map` etc.

Breaking changes: https://github.com/facebook/jest/blob/master/CHANGELOG.md

This diff increases node_modules by 3 MiB, primarily because it causes more duplicates of `source-map` (0.8 MiB for each copy) and packages like `chalk` 3.x (vs 2.x). The base install was 15 MiB bigger and I reduced it to this size by playing around with various manual yarn.lock optimizations. However, D21085929 reduces node_modules by 11 MiB and the Babel upgrade reduced node_modules by 13 MiB. I will subsequently work on reducing the size through other packages as well and I'm working with the Jest folks to get rid of superfluous TypeScript stuff for Jest 26.

Other changes in this diff:
* Fixed Pressable-test
* Blackhole node-notifier: It's large and we don't need it, and also the license may be problematic, see: https://github.com/facebook/jest/pull/8918
* Updated jest-junit (not a Jest package) but blackholed it internally because it is only used for open source CI.
* Updated some API calls we use from Jest to account for breaking changes
* Made two absolutely egrigious changes to existing product code tests to make them still pass as our match of async/await, fake timers and then/promise using `setImmediate` is tripping up `regenerator` with `Generator is already run` errors in Jest 25. These tests should probably be rewritten.
* Locked everything to the same `resolve` version that we were already using, otherwise it was somehow pulling in 1.16 even though nothing internally uses it.

Changelog: [General] Update Jest

Reviewed By: rickhanlonii

Differential Revision: D21064825

fbshipit-source-id: d0011a51355089456718edd84ea0af21fd923a58
2020-04-20 01:27:35 -07:00
Jason Safaiyeh 335f3aabe2 Migrate deprecated frameInterval to preferredFramesPerSecond (#28675)
Summary:
[frameInterval](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1621231-frameinterval) was deprecated in favor of [preferredFramesPerSecond](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1648421-preferredframespersecond).

This migrates the deprecated call over.

## Changelog

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

[iOS] [Fixed] - Migrate frameInterval to preferredFramesPerSecond
Pull Request resolved: https://github.com/facebook/react-native/pull/28675

Test Plan: Xcode should no longer throw warnings about the deprecated call.

Differential Revision: D21109710

Pulled By: shergin

fbshipit-source-id: 772b9f625d3e22cd4d8cd60bddad57ff8611af54
2020-04-18 17:52:52 -07:00
Zack Argyle 0a67133124 Make ColorValue public in StyleSheet.js
Summary:
This diff makes the ColorValue export "official" by exporting it from StyleSheet in order to encourage its use in product code.

Changelog: Moved ColorValue export from StyleSheetTypes to StyleSheet

Reviewed By: TheSavior

Differential Revision: D21076969

fbshipit-source-id: 972ef5a1b13bd9f6b7691a279a73168e7ce9d9ab
2020-04-17 13:03:47 -07:00
Ramanpreet Nara 03bd7d799e Part 2: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams
Summary:
## Summary
Please check out D21035209.

## Changes
- Codemod all ObjC NativeModule `getTurboModuleWithJsInvoker:nativeInvoker:perfLogger` methods to `getTurboModule:(const ObjCTurboModule::Args)`

## Script
```
var withSpaces = (...args) => args.join('\s*')

var regexString = withSpaces(
  '-',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)',
  '>',
  '\)',
  'getTurboModuleWithJsInvoker',
  ':',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<fbNamespace>(facebook::react::|react::|::|))CallInvoker',
  '>',
  '\)',
  '(?<jsInvokerInstance>[A-Za-z0-9]+)',
  'nativeInvoker',
  ':',
  '\(',
  'std::shared_ptr',
  '<',
  '(facebook::react::|react::|::|)CallInvoker',
  '>',
  '\)',
  '(?<nativeInvokerInstance>[A-Za-z0-9]+)',
  'perfLogger',
  ':',
  '\(',
  'id',
  '<',
  'RCTTurboModulePerformanceLogger',
  '>',
  '\)',
  '(?<perfLoggerInstance>[A-Za-z0-9]+)',
  '{',
  'return',
  'std::make_shared',
  '<',
  '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)',
  '>',
  '\(',
  'self',
  ',',
  '\k<jsInvokerInstance>',
  ',',
  '\k<nativeInvokerInstance>',
  ',',
  '\k<perfLoggerInstance>',
  '\)',
  ';',
  '}',
)

var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModule:(const $<fbNamespace>ObjCTurboModule::InitParams &)params
{
  return std::make_shared<$<specName>>(params);
}`

const exec = require('../lib/exec');
const abspath = require('../lib/abspath');
const relpath = require('../lib/relpath');
const readFile = (filename) => require('fs').readFileSync(filename, 'utf8');
const writeFile = (filename, content) => require('fs').writeFileSync(filename, content);

function main() {
  const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean);

  tmFiles
    .filter((filename) => !filename.includes('microsoft-fork-of-react-native'))
    .map(abspath)
    .forEach((filename) => {
      const source = readFile(filename);
      const newSource = source.replace(new RegExp(regexString, 'g'), replaceString);

      if (source == newSource) {
        console.log(relpath(filename));
      }

      writeFile(filename, newSource);
    });
}

if (!module.parent) {
  main();
}
```

## Re-generating diff
```
> hg revert -r .^ --all
> node index.js # run script
```

Changelog: [iOS][Changed] - Make all ObjC NativeModules create TurboModules using ObjCTurboModule::Args

Reviewed By: PeteTheHeat

Differential Revision: D21036265

fbshipit-source-id: 404bcc548d1775ef23d793527606d02fe384a0a2
2020-04-16 17:29:55 -07:00
Ramanpreet Nara 251ff1bb0a Part 1: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams
Summary:
## Summary
Please check out D21035208.

## Changes
- `ObjCTurboModule::ObjCTurboModule` changed to accept a bag of arguments `const ObjCTurboModule::InitParams` instead of an argument list.
- TurboModule iOS codegen scripts updated to generated `ObjCTurboModule` subclasses that accept a `const ObjCTurboModule::InitParams` object in their constructor, and forward it to `ObjCTurboModule::ObjCTurboModule`.
- All manually checked in code-generated ObjC++ classes (i.e: RCTNativeSampleTurboModule, RCTTestModule, FBReactNativeSpec) are updated.

## Rationale
This way, the code-gen can remain constant while we add, remove, or modify the arguments passed to ObjCTurboModule.

## Commands run
```
function update-codegen() {
  pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd;
}

> update-codegen
```

Changelog:
[iOS][Changed] Update ObjCTurboModule to use ObjCTurboModule::InitParams

Reviewed By: PeteTheHeat

Differential Revision: D21036266

fbshipit-source-id: 6584b0838dca082a69e8c14c7ca50c3568b95086
2020-04-16 17:29:55 -07:00
Christoph Nakazawa 75a6178279 Update Babel to 7.8.x/7.9.x
Reviewed By: motiz88

Differential Revision: D20697095

fbshipit-source-id: ef35d02da0916109ce528d3026f7ca0956911dda
2020-04-15 01:30:45 -07:00
Samuel Susla b861782562 Remove setMostRecentEventCount from TextInput view commands
Summary:
Changelog: [Internal]

We don't use view command `setMostRecentEventCount`, let's get rid of it.

Reviewed By: JoshuaGross

Differential Revision: D21016600

fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b
2020-04-14 15:27:59 -07:00
Samuel Susla 9c54bf4199 Remove redundant input from TextInput
Summary:
`const ReactNative` is assigned to but never used. Let's get rid of it.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D21016502

fbshipit-source-id: afcb0cfc501adf07e0c4d4452a831160e1cda088
2020-04-14 10:59:43 -07:00
Valentin Shergin be78673755 Animated: Early detection of division by zero in AnimatedDivision
Summary:
We currently see a lot of errors happens because of division by zero in `AnimatedDivision` module. We already have a check for that in the module but it happens during the animation tick where the context of execution is already lost and it's hard to find why exactly it happens.
Adding an additional check to the constructor should trigger an error right inside render function which should make the error actionable.

Changelog: [Internal] Early crash in AnimatedDivision in case of division by zero.

Reviewed By: mdvacca

Differential Revision: D20969087

fbshipit-source-id: 0d98774b79be2cc56d468a4f56d2d7c8abf58344
2020-04-11 03:04:14 -07:00
Tom Underhill 411c344794 Remove ColorAndroid function as it adds no value over PlatfromColor (#28577)
Summary:
This change removes the `ColorAndroid` API.   It was added more as a validation tool than as something useful to a developer.   When making the original [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) we felt it was valuable and useful to have working platform specific methods for the two platforms in core to test that the pattern worked in app code (PlatformColorExample.js in RNTester) and that the Flow validation worked, etc.    Practically `PlatformColor()` is more useful to a developer on Android than `ColorAndroid()`.    Now that the construct has served its purpose, this PR removes the `ColorAndroid` function and its related tests and other collateral.

## 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] [Removed] - Remove ColorAndroid function as it adds no value over PlatfromColor
Pull Request resolved: https://github.com/facebook/react-native/pull/28577

Test Plan: RNTester in both iOS and Android was tested.   Jest tests, Flow checks, Lint checks all pass.

Reviewed By: cpojer

Differential Revision: D20952613

Pulled By: TheSavior

fbshipit-source-id: 7d2cbaa2a347fffe59a1f3a26a210676008fdac0
2020-04-09 18:40:31 -07:00
Vojtech Novak 44ec762e41 fix: ripple should be applied even when borderless == false (#28526)
Summary:
With current master, when you render `<Pressable android_ripple={{borderless: false}}>`, there is no ripple effect at all.

I think the expected behavior is to have ripple with default color and radius, just not borderless.

This was how it was done (by me) in https://github.com/facebook/react-native/pull/28156/files but in the import process, the implementation was changed: bd3868643d so either this PR is a fix or you can just close it (but I'd be curious why).

## 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] - ripple should be applied even when borderless == false
Pull Request resolved: https://github.com/facebook/react-native/pull/28526

Test Plan:
`<Pressable android_ripple={{borderless: false}}>` on master

![SVID_20200404_123614_1](https://user-images.githubusercontent.com/1566403/78424971-6b315a80-7671-11ea-8be4-5fea428bc556.gif)

`<Pressable android_ripple={{borderless: false}}>` in this PR

![SVID_20200404_122754_1](https://user-images.githubusercontent.com/1566403/78424986-8bf9b000-7671-11ea-9804-37cd58dbb61e.gif)

Differential Revision: D20952026

Pulled By: TheSavior

fbshipit-source-id: df2b95fc6f20d7e958e91805b1a928c4f85904f1
2020-04-09 15:40:47 -07:00
Lauren Tan dff17effe5 Move CheckBox JS files to FB Internal
Summary:
Move CheckBox JS files to FB internal

## Changelog:
[General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module.

Reviewed By: cpojer

Differential Revision: D20910775

fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327
2020-04-09 15:35:02 -07:00
George Zahariev cd347a7e0e Upgrade Prettier in Xplat to version 1.19.1
Summary:
Upgrades Prettier in Xplat to 1.19.1
Ignores upgrading packages on already on versions greater than 1.19.1

Changelog: [Internal]

allow-large-files
bypass-lint

(Note: this ignores all push blocking failures!)

Reviewed By: gkz, cpojer

Differential Revision: D20879147

fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d
2020-04-09 11:01:58 -07:00
Samuel Susla c7f259526b Migrate setNativeProps to commands in iOS text input
Summary: Changelog: Move from setNativeProps to ViewCommands.

Reviewed By: JoshuaGross

Differential Revision: D20843018

fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765
2020-04-09 03:44:56 -07:00
Samuel Susla 00c4d950cf Implement event count for TextInput
Summary:
Changelog: [Internal]

Implementation of event count for Fabric's Text input.

Reviewed By: JoshuaGross

Differential Revision: D20800185

fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479
2020-04-09 03:44:55 -07:00
Marshall Roch 4a48b021d6 upgrade to flow 0.122.0
Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D20919782

fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097
2020-04-08 15:35:18 -07:00
Ramanpreet Nara bf2609dca5 Make RCTNativeAnimatedModule into a TurboModule
Summary:
D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule.

Changelog:
[iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible

Reviewed By: PeteTheHeat

Differential Revision: D20850744

fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da
2020-04-08 13:04:10 -07:00
Ramanpreet Nara fd5de50aca Fix Cocoapods builds
Summary:
## Problem
For some reason, D20831545 broke the `use_frameworks!` build of RNTester.

## Building RNTester
```
pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd;
```

## Error
I built RNTester locally, and the error was this:

```
Undefined symbols for architecture x86_64:
  "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from:
      vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o
      vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o
      vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o
  "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from:
      vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o
      vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o
      vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o
ld: symbol(s) not found for architecture x86_64
```

## Fix
It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi":

```
arc rfr '  s.dependency "ReactCommon/turbomodule/core", version' '  s.dependency "ReactCommon/turbomodule/core", version\n  s.dependency "React-jsi", version'
```

This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do?

Changelog:
[iOS][Fixed] - Fix Cocoapods builds of RNTester

Reviewed By: fkgozali, hramos

Differential Revision: D20905465

fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec
2020-04-07 19:07:19 -07:00
Bruno Barbieri 3904228704 Make Vibration.vibrate compatible with TurboModules (#27951)
Summary:
This PR fixes a compatibility issue with the Vibration module and TurboModules.
The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem:

![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG)

## Changelog

[iOS] [Fixed] - Make Vibration library compatible with TurboModules.
Pull Request resolved: https://github.com/facebook/react-native/pull/27951

Test Plan:
Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340)

The problem should be reproducible on RNTester due to this line: 91f139b941/RNTester/js/examples/Vibration/VibrationExample.js (L66)  and should be working on this branch.

Reviewed By: TheSavior

Differential Revision: D19761064

Pulled By: hramos

fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124
2020-04-07 18:27:03 -07:00
David Vacca 8e48dc0555 Rename analyticsTag -> internal_analyticsTag in ImageView component
Summary:
This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component

changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally.

Reviewed By: TheSavior

Differential Revision: D20904497

fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674
2020-04-07 17:39:21 -07:00
David Vacca 22e318fab0 Avoid passing analyticsTag prop to native if this is set to null
Summary:
This diff avoids passing the analyticsTag prop to native if this is set to null

changelog: [internal] internal optimization

Reviewed By: TheSavior

Differential Revision: D20904498

fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b
2020-04-07 17:39:21 -07:00
David Vacca ccef84d022 Fix flow types of ImageContext
Summary:
ez diff to Fix flow types of ImageContext

changelog: [internal] internal change to update flow types of ImageContext

Reviewed By: TheSavior

Differential Revision: D20883647

fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a
2020-04-07 17:39:21 -07:00
David Vacca 02dd5c611c Ez cleanup in ImageProps
Summary:
Ez cleanup in ImageProps, this import is not being used anymore

changelog: [internal] internal change

Reviewed By: JoshuaGross

Differential Revision: D20880600

fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3
2020-04-06 18:27:06 -07:00
David Vacca 0128e4602e Create ImageContext object to allow udpating the analyticsTag prop for RN sections
Summary:
As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy

changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy

Reviewed By: JoshuaGross

Differential Revision: D20880603

fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8
2020-04-06 18:27:05 -07:00
David Vacca 1c10568967 Extend Image.android to support analyticsTag prop
Summary:
Quick diff to extend Image.android component to support analytics tag prop

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D20880601

fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263
2020-04-06 18:27:05 -07:00
Eli White f7b90336be Fix Appearance module when using Chrome Debugger
Summary:
The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705

This fix makes the appearance module return 'light' when using the chrome debugger.

Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger

Reviewed By: yungsters

Differential Revision: D20879779

fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2
2020-04-06 18:17:41 -07:00
Eli White 990dd869cf Move DebugEnvironment helper to open source
Summary:
This is an internal only module that we use to detect whether we are in async debugging mode.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D20879780

fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4
2020-04-06 18:17:40 -07:00
Xiaoyu Yin a37e45a57e Back out "Fixed scrollview inset when RN view is embedded in another view"
Summary:
Original commit changeset: fbd72739fb71

Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view"

Reviewed By: TheSavior

Differential Revision: D20878607

fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700
2020-04-06 15:54:10 -07:00
jiggag caa7829aac Modify warning message (#28514)
Summary:
Modify deprecation warning message for `AccessibilityInfo.fetch`

- https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled
- 523ab83338

## Changelog

[Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch`
Pull Request resolved: https://github.com/facebook/react-native/pull/28514

Test Plan: Try using `AccessibilityInfo.fetch` and check log

Reviewed By: cpojer

Differential Revision: D20850223

Pulled By: TheSavior

fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09
2020-04-04 01:09:55 -07:00
Sebastian Markbage e3b7520174 Remove unused fields from error dialog
Summary:
Removed in https://github.com/facebook/react/pull/18487

Changelog: [React Core] Logging changes

Reviewed By: gaearon

Differential Revision: D20853086

fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1
2020-04-03 19:58:32 -07:00
Vojtech Novak bd3868643d add ripple config object to Pressable (#28156)
Summary:
Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520

In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape:
```
export type RippleConfig = {|
  color?: ?ColorValue,
  borderless?: ?boolean,
  radius?: ?number,
|};
```
Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ?

## Changelog

[Android] [Added] - support borderless and custom ripple radius on Pressable
Pull Request resolved: https://github.com/facebook/react-native/pull/28156

Test Plan:
Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that.

![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif)

I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness:

![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif)

Reviewed By: yungsters

Differential Revision: D20071021

Pulled By: TheSavior

fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f
2020-04-03 18:37:10 -07:00
Kacie Bawiec 3246f68952 Remove console warnings for innerViewNode/Ref
Summary:
Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing.

Changelog:
[General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView

Reviewed By: TheSavior

Differential Revision: D20850624

fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e
2020-04-03 17:52:08 -07:00
Daniel Cohen Gindi fb2900e185 Fixed scrollview inset when RN view is embedded in another view (#27607)
Summary:
I'm using RNN, which embeds RN view inside native view controllers.

On iOS 13, a modal view controller is "floating" and is offset from the top of the screen.

This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space.

## Changelog

[iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13)
Pull Request resolved: https://github.com/facebook/react-native/pull/27607

Test Plan:
1. Tested before and after in a simple view controller (should stay the same)
2. Tested before and after in a modal view controller (should be offset before, and fixed after)
3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight)

Reviewed By: cpojer

Differential Revision: D20812231

Pulled By: TheSavior

fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73
2020-04-03 16:09:37 -07:00
Ramanpreet Nara 69698b25fc Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker
Summary:
To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker.

## Script
```
var withSpaces = (...args) => args.join('\s*')

var regexString = withSpaces(
  '-',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)',
  '>',
  '\)',
  'getTurboModuleWithJsInvoker',
  ':',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)',
  '>',
  '\)',
  '(?<jsInvokerInstance>[A-Za-z0-9]+)',
  'perfLogger',
  ':',
  '\(',
  'id',
  '<',
  'RCTTurboModulePerformanceLogger',
  '>',
  '\)',
  '(?<perfLoggerInstance>[A-Za-z0-9]+)',
  '{',
  'return',
  'std::make_shared',
  '<',
  '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)',
  '>',
  '\(',
  'self',
  ',',
  '\k<jsInvokerInstance>',
  ',',
  '\k<perfLoggerInstance>',
  '\)',
  ';',
  '}',
)

var replaceString = `- (std::shared_ptr<$<turboModuleClass>>)
    getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance>
                  nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker
                     perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance>
{
  return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>);
}`

const exec = require('../lib/exec');
const abspath = require('../lib/abspath');
const relpath = require('../lib/relpath');
const readFile = (filename) => require('fs').readFileSync(filename, 'utf8');
const writeFile = (filename, content) => require('fs').writeFileSync(filename, content);

function main() {
  const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean);

  tmFiles
    .filter((filename) => !filename.includes('microsoft-fork-of-react-native'))
    .map(abspath)
    .forEach((filename) => {
      const source = readFile(filename);
      const newSource = source.replace(new RegExp(regexString, 'g'), replaceString);

      if (source == newSource) {
        console.log(relpath(filename));
      }

      writeFile(filename, newSource);
    });
}

if (!module.parent) {
  main();
}
```

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20809202

fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550
2020-04-03 02:27:10 -07:00
Ramanpreet Nara 7e16a9d5e2 Manual changes required to make ObjCTurboModule accept native CallInvoker
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20809200

fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5
2020-04-03 02:27:10 -07:00
Rick Hanlon ec0c65c4b2 Improve component stack parsing
Summary:
Update the error log message parsing to fix missing component stacks in console.errors.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20801985

fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38
2020-04-01 16:43:15 -07:00
Emilis Baliukonis 232517a574 Implement nativePerformanceNow to improve Profiler API results (#27885)
Summary:
When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results.

This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function.

This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools.

Solves https://github.com/facebook/react-native/issues/27274

## Changelog

[General] [Added] - Implement `nativePerformanceNow` and `performance.now()`
Pull Request resolved: https://github.com/facebook/react-native/pull/27885

Test Plan:
```
const initialTime = global.performance.now();
setTimeout(() => {
  const newTime = global.performance.now();
  console.warn('duration', newTime - initialTime);
}, 1000);
```

### Android + Hermes

![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png)

### Android + JSC

![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png)

### iOS

![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png)

Reviewed By: ejanzer

Differential Revision: D19888289

Pulled By: rickhanlonii

fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c
2020-03-31 10:23:51 -07:00
Bartosz Kaszubowski f21f922c83 Update PixelRatio 'getFontScale' method description (#28407)
Summary:
Refs facebook/react-native-website#1776.

Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings).

This PR updates the in-code description to match current behaviour.

I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR.

## Changelog

[Internal] [Fixed] - Fix PixelRatio getFontScale method description
Pull Request resolved: https://github.com/facebook/react-native/pull/28407

Test Plan: N/A

Differential Revision: D20750260

Pulled By: shergin

fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4
2020-03-30 16:37:18 -07:00
Rick Hanlon 21396bb380 Enable inspector for Fabric
Summary:
## Overview
This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer.

Requires https://github.com/facebook/react/pull/18388

## Motivation

Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector.

Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information.

By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D20291710

fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68
2020-03-30 14:05:27 -07:00
Rick Hanlon 3276563806 Partial React Sync for Inspector
Summary:
Partial sync for React that includes:

- https://github.com/facebook/react/pull/18388
- dd7e5e4f5a

Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20651395

fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e
2020-03-30 14:05:26 -07:00
Tom Underhill 602070f44b Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398)
Summary:
The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values.   The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments.   The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future.   But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object.   The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables.   To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape.   A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app.   A second ESLint rule is created for `ColorAndroid` as well.

## Changelog

[General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()`
Pull Request resolved: https://github.com/facebook/react-native/pull/28398

Test Plan: `yarn lint` passes.

Reviewed By: cpojer

Differential Revision: D20685383

Pulled By: TheSavior

fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53
2020-03-27 23:02:15 -07:00
Kacie Bawiec b119a00c45 Remove console warnings from ScrollView methods
Summary:
The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added.

Changelog:
[Removed] Remove console warnings from ScrollView methods

Reviewed By: rickhanlonii

Differential Revision: D20700917

fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b
2020-03-27 15:28:48 -07:00
Martin Sherburn d3658bc2b6 Fix issue with onEndReached
Summary:
onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list.

Changelog:

[General] [Fixed] - Fix double call to onEndReached in VirtualizedList

Reviewed By: sahrens

Differential Revision: D20066740

fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874
2020-03-27 03:58:39 -07:00
Kacie Bawiec d2f314af75 Make ScrollView use ForwardRef
Summary:
Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`.

Previous usage:
```
const myRef = React.createRef<React.ElementRef<typeof ScrollView>>();
<ScrollView ref={myRef} />

const innerViewRef = myRef.current.getNativeScrollRef();

innerViewRef.measure();
```
New usage:
```
const myRef = React.createRef<React.ElementRef<typeof View>>();
<ScrollView ref={myRef} />

// now, myRef.current can be used directly as the ref
myRef.current.measure();
myRef.current.measureLayout();

// Additionally, myRef still has access to ScrollView methods
myRef.current.scrollTo(...);
```

Changes:

* Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder`
* Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`.
* Forwarded the ref to the native scroll view using `setAndForwardRef`.
* Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed.
* Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView.
* Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref.
* Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call.
* Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc).

Changes to mockScrollView:
* Changed mockScrollView to be able to mock the function component instead of a class component
* Updated necessary tests

Changelog:
[General] [Changed] - Make ScrollView use forwardRef

Reviewed By: TheSavior

Differential Revision: D19304480

fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4
2020-03-26 16:53:46 -07:00
Kevin Gozali 25f7aea86c Replace fbsource// with // in xplat/js/ files [1]
Summary:
`fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency.

Changelog: [Internal]

Reviewed By: scottrice

Differential Revision: D20495655

fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5
2020-03-25 21:55:47 -07:00
Spencer Ahrens be35664009 Flow type infoLog
Summary:
Changelog:
[General][Internal] flow type infoLog

Reviewed By: zackargyle

Differential Revision: D20577939

fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1
2020-03-25 21:50:12 -07:00
Ramanpreet Nara faff19a7c6 De-jank DevLoadingView
Summary:
## Problems
Repro steps:
1. Disable Fabric (because CMD + R doesn't work with Fabric right now).
2. Open up Marketplace and hit `CMD + OPT + R`
3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress.
https://pxl.cl/140g1

RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/

## Fixes
The first problem is that progress bar doesn't actually show progress.

**Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't  lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt

If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green.

**Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT

We're almost there, but the progress bar is dismissed twice?

**Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank:
https://pxl.cl/140hn

Changelog:
[iOS][Fixed] - Remove RCTDevLoadingView jank

Reviewed By: rickhanlonii

Differential Revision: D20607815

fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b
2020-03-25 12:09:40 -07:00
Michael Bolin 0b9ea60b4f Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:47:35 -07:00
Michael Bolin cf44650b3f Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:24:47 -07:00
Janic Duplessis cf02bd9b76 Fix Animated Value initialized with undefined in ScrollView (#28349)
Summary:
When passing an object to contentOffset that doesn't have `y` prop set it causes the following error:

```
 Error: AnimatedValue: Attempting to set value to undefined

This error is located at:
    in ScrollView (at src/index.js:638)
...
```

This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471ec)

According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple.

## Changelog

[General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView
Pull Request resolved: https://github.com/facebook/react-native/pull/28349

Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset.

Reviewed By: cpojer

Differential Revision: D20601664

Pulled By: hramos

fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4
2020-03-24 04:07:40 -07:00
Alexander Kawrykow 15434c7c43 Guard against null values in object parameters for bridged methods
Summary:
Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable).

For example, given:
```
export interface Spec extends TurboModule {
  +myFunc: ({|
    foo: ?string,
  |}) => void;
}
```
and calling `NativeModule.myFunc({foo: null})`, we see an error like:
```
JSON value '<null>' of type NSNull cannot be converted to NSString
```
Guarding against this by converting NSNull's to nils

## Changelog:

[iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method

Reviewed By: fkgozali

Differential Revision: D20591590

fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732
2020-03-23 17:21:00 -07:00
Eddie Dugan 22eb711c84 RN picker - implement background color
Summary:
add support to the android implementation of the Picker component for setting the background color.

Changelog: [Android] [Added] - Support item background color in Dialog Picker

Differential Revision: D20566131

fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9
2020-03-23 08:37:16 -07:00
Sebastian Markbage 8bbb2ca44b Remove ReactTypes from fbsource and React sync
Summary:
See https://github.com/facebook/react/pull/18366

This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types.

As a result, these uses have already been codemodded away. Only the imports remained.

Changelog:

[React Core] - Remove ReactTypes from sync.

Reviewed By: gaearon

Differential Revision: D20583740

fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f
2020-03-22 20:34:04 -07:00
Samuel Susla 56cf99a96e Validate selection range passed to setTextAndSelection
Summary:
Changelog: [Internal]

# Fabric

1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input.

2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`.

# Paper

1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input.

Reviewed By: shergin

Differential Revision: D20538290

fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c
2020-03-22 06:11:35 -07:00
Rick Hanlon 9c64bd5739 Properly handle LogBox errors during tests
Summary:
This diff fixes an issue where errors in LogBox during tests would cause the tests to crash.

The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger.

This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods.

Changelog: [Internal]

Differential Revision: D20428590

fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a
2020-03-19 20:31:01 -07:00
Ramanpreet Nara 652fa1b8d4 Add a perfLogger argument to getTurboModuleWithJSInvoker:
Summary:
## Purpose
We must modify the `getTurboModuleWithJsInvoker:` method of all our NativeModules to also accept a `id<RCTTurboModulePerformanceLogger>` object. This performance logger object should then be forwarded to the `Native*SpecJSI` constructor.

## Script
Run the following script via Node:
```
var withSpaces = (...args) => args.join('\s*')

var regexString = withSpaces(
  '-',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)',
  '>',
  '\)',
  'getTurboModuleWithJsInvoker',
  ':',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)',
  '>',
  '\)',
  'jsInvoker',
  '{',
  'return',
  'std::make_shared',
  '<',
  '(?<specName>(facebook::react::|react::|::|)Native[A-Za-z0-9]+SpecJSI)',
  '>',
  '\(',
  '(?<arg1>[A-Za-z0-9]+)',
  ',',
  '(?<arg2>[A-Za-z0-9]+)',
  '\)',
  ';',
  '}',
)

var replaceString = `- (std::shared_ptr<$<turboModuleClass>>)
    getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)jsInvoker
                     perfLogger:(id<RCTTurboModulePerformanceLogger>)perfLogger
{
  return std::make_shared<$<specName>>($<arg1>, $<arg2>, perfLogger);
}`

const exec = (cmd) => require('child_process').execSync(cmd, { encoding: 'utf8' });
const abspath = (filename) => `${process.env.HOME}/${filename}`;
const relpath = (filename) => filename.replace(process.env.HOME + '/', '');
const readFile = (filename) => require('fs').readFileSync(filename, 'utf8');
const writeFile = (filename, content) => require('fs').writeFileSync(filename, content);

function main() {
  const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean);

  tmFiles
    .filter((filename) => !filename.includes('microsoft-fork-of-react-native'))
    .map(abspath)
    .forEach((filename) => {
      const source = readFile(filename);
      const newSource = source.replace(new RegExp(regexString, 'g'), replaceString);

      if (source == newSource) {
        console.log(relpath(filename));
      }

      writeFile(filename, newSource);
    });
}

if (!module.parent) {
  main();
}
```

Also, run: `pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd;`

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20478718

fbshipit-source-id: 89ee27ed8a0338a66a9b2dbb716168a4c4582c44
2020-03-18 11:01:15 -07:00
Jesse Katsumata 5e472b314b chore(switch): migrate to es6 import/export (#28333)
Summary:
Migrate Switch component to use ES6 import/exports

motivation: trying to slowly migrate each files to use es6 import/exports to make this discussion happen
https://github.com/react-native-community/discussions-and-proposals/issues/201#issuecomment-588454552

## Changelog

[General] [Changed] - Use es6 import/export syntax for Switch component
Pull Request resolved: https://github.com/facebook/react-native/pull/28333

Test Plan: Test on RNTester

Reviewed By: TheSavior

Differential Revision: D20493110

Pulled By: hramos

fbshipit-source-id: 25279ec41955b0dbda1abab6e45b93ca1c28fa32
2020-03-17 18:35:22 -07:00
Ramanpreet Nara 91c5ff4a12 Guard against nil methodQueue in RCTBlobManager
Summary:
## Description
In T63516227, we're seeing a crash that occurs because `networking.methodQueue` is `nil`, and we try to `dispatch_async` to it.

## Hypothesis
This looks like a problem with NativeModule cleanup:
1. Some JS executes a call to `RCTBlobManager.addNetworkingHander`. This schedules an async method call on the `RCTBlobManager` method queue.
2. In `RCTCxxBridge invalidate`, on the JS thread, we loop through all the `RCTModuleData`s, and invalidate them. This invalidates our NativeModules (perhaps not all but only `RCTNetworking`).
3. The `RCTBlobManager.addNetworkingHander` method call finally executes, with `RCTNetworking`'s methodQueue set to nil, which throws this error.

Changelog:
[iOS][Fixed] - Fix RCTBlobManager cleanup crash

Reviewed By: PeteTheHeat

Differential Revision: D20498096

fbshipit-source-id: d2d60984637ddf883278289258aa9b2ae81bb172
2020-03-17 14:56:14 -07:00
Nick Gerleman 161b910494 Do not explicitly include ".js" in Library imports (#28311)
Summary:
A few recent imports have explicitly added ".js" to the end of their path. This prevents Metro from resolving platform-specific JS files, e.g. "Foo.android.js" or "Foo.windows.js" instead of "Foo.js".

React Native Windows provides its own implementation of files in a few cases where stock React Native will share them between Android and iOS. We hope to reduce/eliminate these long term, but requiring explicit ".js" files currently breaks us in a couple of places where we have custom implementations.

This change is a quick regex replace of ES6 and CommonJS imports in 'Libraries/" to eliminate ".js".

## Changelog

[General] [Fixed] - Do not explicitly include ".js" in Library imports
Pull Request resolved: https://github.com/facebook/react-native/pull/28311

Test Plan: I haven't done any manual validation of this, but `flow-check` should catch any issues with this during CI.

Reviewed By: cpojer

Differential Revision: D20486466

Pulled By: TheSavior

fbshipit-source-id: 31e1ccc307967417d7d09c34c859f0b2b69eac84
2020-03-17 02:11:53 -07:00
Hans Halverson 4482e531d8 Move suppressions to primary locations in xplat/js
Reviewed By: gkz

Differential Revision: D20446329

fbshipit-source-id: 2713e7713f6b0e8d1dfd9ab8c0ccb27294177589
2020-03-16 21:28:17 -07:00
Luna Ruan bac9e69593 React Native sync for revisions 241c446...b5c6dd2
Summary:
This sync includes the following changes:
- **[b5c6dd2de](https://github.com/facebook/react/commit/b5c6dd2de )**: Don't use Spread in DevTools Injection (#18277) //<Sebastian Markbåge>//
- **[a463fef31](https://github.com/facebook/react/commit/a463fef31 )**: Revert "[React Native] Add getInspectorDataForViewAtPoint (#18233)" //<Sebastian Markbage>//
- **[dc7eedae3](https://github.com/facebook/react/commit/dc7eedae3 )**: Encode server rendered host components as array tuples (#18273) //<Sebastian Markbåge>//
- **[bf351089a](https://github.com/facebook/react/commit/bf351089a )**: [React Native] Add getInspectorDataForViewAtPoint (#18233) //<Ricky>//
- **[99d737186](https://github.com/facebook/react/commit/99d737186 )**: [Flight] Split Streaming from Relay Implemenation (#18260) //<Sebastian Markbåge>//
- **[160505b0c](https://github.com/facebook/react/commit/160505b0c )**: ReactDOM.useEvent: Add more scaffolding for useEvent hook (#18271) //<Dominic Gannaway>//
- **[526c12f49](https://github.com/facebook/react/commit/526c12f49 )**: Enable enableProfilerCommitHooks flag for FB (#18230) //<Brian Vaughn>//
- **[29534252a](https://github.com/facebook/react/commit/29534252a )**: ReactDOM.useEvent add flag and entry point (#18267) //<Dominic Gannaway>//
- **[704c8b011](https://github.com/facebook/react/commit/704c8b011 )**: Fix Flow type for AnyNativeEvent (#18266) //<Dominic Gannaway>//
- **[bdc5cc463](https://github.com/facebook/react/commit/bdc5cc463 )**: Add Relay Flight Build (#18242) //<Sebastian Markbåge>//
- **[7a1691cdf](https://github.com/facebook/react/commit/7a1691cdf )**: Refactor Host Config Infra (getting rid of .inline*.js) (#18240) //<Sebastian Markbåge>//
- **[238b57f0f](https://github.com/facebook/react/commit/238b57f0f )**: [Blocks] Make it possible to have lazy initialized and lazy loaded Blocks (#18220) //<Sebastian Markbåge>//
- **[235a6c4af](https://github.com/facebook/react/commit/235a6c4af )**: Bugfix: Dropped effects in Legacy Mode Suspense (#18238) //<Andrew Clark>//
- **[562cf013d](https://github.com/facebook/react/commit/562cf013d )**: Add a flag to disable module pattern components (#18133) //<Dan Abramov>//
- **[115cd12d9](https://github.com/facebook/react/commit/115cd12d9 )**: Add test run that uses www feature flags (#18234) //<Andrew Clark>//
- **[4027f2a3b](https://github.com/facebook/react/commit/4027f2a3b )**: Break up require/import statements in strings (#18222) //<Christoph Nakazawa>//
- **[024a76431](https://github.com/facebook/react/commit/024a76431 )**: Implemented Profiler onCommit() and onPostCommit() hooks (#17910) //<Brian Vaughn>//
- **[d35f8a581](https://github.com/facebook/react/commit/d35f8a581 )**: feat: honor displayName of context types (#18224) //<Brian Vaughn>//
- **[3ee812e6b](https://github.com/facebook/react/commit/3ee812e6b )**: Revert "feat: honor displayName of context types (#18035)" (#18223) //<Dominic Gannaway>//
- **[6a0efddd8](https://github.com/facebook/react/commit/6a0efddd8 )**: Modern Event System: export internal FB flag for testing (#18221) //<Dominic Gannaway>//
- **[fa03206ee](https://github.com/facebook/react/commit/fa03206ee )**: Remove _ctor field from Lazy components (#18217) //<Sebastian Markbåge>//
- **[2fe0fbb05](https://github.com/facebook/react/commit/2fe0fbb05 )**: Use accumulateTwoPhaseDispatchesSingle directly (#18203) //<Dominic Gannaway>//
- **[503fd82b4](https://github.com/facebook/react/commit/503fd82b4 )**: Modern Event System: Add support for internal FB Primer (#18210) //<Dominic Gannaway>//
- **[45c172d94](https://github.com/facebook/react/commit/45c172d94 )**: feat: honor displayName of context types (#18035) //<Brian Vaughn>//
- **[ec652f4da](https://github.com/facebook/react/commit/ec652f4da )**: Bugfix: Expired partial tree infinite loops (#17949) //<Andrew Clark>//
- **[d2158d6cc](https://github.com/facebook/react/commit/d2158d6cc )**: Fix flow types (#18204) //<Brian Vaughn>//
- **[7e83af17c](https://github.com/facebook/react/commit/7e83af17c )**: Put React.jsx and React.jsxDEV behind experimental build (#18023) //<Luna Ruan>//
- **[8cb2fb21e](https://github.com/facebook/react/commit/8cb2fb21e )**: Refine isFiberSuspenseAndTimedOut (#18184) //<Dominic Gannaway>//
- **[62861bbcc](https://github.com/facebook/react/commit/62861bbcc )**: More event system cleanup and scaffolding (#18179) //<Dominic Gannaway>//
- **[8ccfce460](https://github.com/facebook/react/commit/8ccfce460 )**: Only use Rollup's CommonJS plugin for "react-art" (#18186) //<Sebastian Markbåge>//
- **[c26506a7d](https://github.com/facebook/react/commit/c26506a7d )**: Update react-shallow-renderer from 16.12.0 to 16.13.0 (#18185) //<Minh Nguyen>//
- **[26aa1987c](https://github.com/facebook/react/commit/26aa1987c )**: [Native] Enable and remove targetAsInstance feature flag. (#18182) //<Eli White>//
- **[4469700bb](https://github.com/facebook/react/commit/4469700bb )**: Change ReactVersion from CJS to ES module (#18181) //<Sebastian Markbåge>//
- **[58eedbb02](https://github.com/facebook/react/commit/58eedbb02 )**: Check in a forked version of object-assign only for UMD builds (#18180) //<Sebastian Markbåge>//
- **[053347e6b](https://github.com/facebook/react/commit/053347e6b )**: react-test-renderer: improve findByType() error message (#17439) //<Henry Q. Dineen>//
- **[4ee592e95](https://github.com/facebook/react/commit/4ee592e95 )**: Add an early invariant to debug a mystery crash (#18159) //<Dan Abramov>//
- **[7ea4e4111](https://github.com/facebook/react/commit/7ea4e4111 )**: Fix typo in warning text (#18103) //<Sophie Alpert>//
- **[79a25125b](https://github.com/facebook/react/commit/79a25125b )**: feat: add recommended config eslint rule (#14762) //<Simen Bekkhus>//
- **[ae60caacf](https://github.com/facebook/react/commit/ae60caacf )**: [Fabric] Fix targetAsInstance dispatchEvent "cannot read property of null" (#18156) //<Joshua Gross>//
- **[d72700ff5](https://github.com/facebook/react/commit/d72700ff5 )**: Remove runtime dependency on prop-types (#18127) //<Dan Abramov>//
- **[549e41883](https://github.com/facebook/react/commit/549e41883 )**: Move remaining things to named exports (#18165) //<Sebastian Markbåge>//
- **[739f20bed](https://github.com/facebook/react/commit/739f20bed )**: Remove Node shallow builds (#18157) //<Sebastian Markbåge>//
- **[3e809bf5d](https://github.com/facebook/react/commit/3e809bf5d )**: Convert React Native builds to named exports (#18136) //<Sebastian Markbåge>//
- **[869dbda72](https://github.com/facebook/react/commit/869dbda72 )**: Don't build shallow renderer for FB (#18153) //<Dan Abramov>//
- **[293878e07](https://github.com/facebook/react/commit/293878e07 )**: Replace ReactShallowRenderer with a dependency (#18144) //<Minh Nguyen>//
- **[b4e314891](https://github.com/facebook/react/commit/b4e314891 )**: Remove unused flag (#18132) //<Dan Abramov>//
- **[849e8328b](https://github.com/facebook/react/commit/849e8328b )**: Remove unnecessary warnings (#18135) //<Dan Abramov>//
- **[f9c0a4544](https://github.com/facebook/react/commit/f9c0a4544 )**: Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) //<Sebastian Markbåge>//
- **[c1c5499cc](https://github.com/facebook/react/commit/c1c5499cc )**: update version numbers for 16.13 (#18143) //<Sunil Pai>//
- **[e1c7e651f](https://github.com/facebook/react/commit/e1c7e651f )**: Update ReactDebugHooks to handle composite hooks (#18130) //<Brian Vaughn>//
- **[d28bd2994](https://github.com/facebook/react/commit/d28bd2994 )**: remove OSS testing builds (#18138) //<Sunil Pai>//
- **[8e13e770e](https://github.com/facebook/react/commit/8e13e770e )**: Remove /testing entry point from 'react' package (#18137) //<Sebastian Markbåge>//
- **[60016c448](https://github.com/facebook/react/commit/60016c448 )**: Export React as Named Exports instead of CommonJS (#18106) //<Sebastian Markbåge>//
- **[8d7535e54](https://github.com/facebook/react/commit/8d7535e54 )**: Add nolint to FB bundle headers (#18126) //<Dominic Gannaway>//
- **[bf13d3e3c](https://github.com/facebook/react/commit/bf13d3e3c )**: [eslint-plugin-react-hooks] Fix cyclic caching for loops containing a… (#16853) //<Moji Izadmehr>//
- **[501a78881](https://github.com/facebook/react/commit/501a78881 )**: runAllPassiveEffectDestroysBeforeCreates's feature flag description typo fixed (#18115) //<adasq>//
- **[09348798a](https://github.com/facebook/react/commit/09348798a )**: Codemod to import * as React from "react"; (#18102) //<Sebastian Markbåge>//
- **[78e816032](https://github.com/facebook/react/commit/78e816032 )**: Don't warn about unmounted updates if pending passive unmount (#18096) //<Brian Vaughn>//
- **[2c4221ce8](https://github.com/facebook/react/commit/2c4221ce8 )**: Change string refs in function component message (#18031) //<Sebastian Markbåge>//
- **[65bbda7f1](https://github.com/facebook/react/commit/65bbda7f1 )**: Rename Chunks API to Blocks (#18086) //<Sebastian Markbåge>//
- **[8b596e00a](https://github.com/facebook/react/commit/8b596e00a )**: Remove unused arguments in the reconciler (#18092) //<Dan Abramov>//
- **[5de5b6150](https://github.com/facebook/react/commit/5de5b6150 )**: Bugfix: `memo` drops lower pri updates on bail out (#18091) //<Andrew Clark>//
- **[abfbae02a](https://github.com/facebook/react/commit/abfbae02a )**: Update Rollup version to 1.19.4 and fix breaking changes (#15037) //<Kunuk Nykjær>//
- **[b789060dc](https://github.com/facebook/react/commit/b789060dc )**: Feature Flag for React.jsx` "spreading a key to jsx" warning (#18074) //<Sunil Pai>//
- **[3f85d53ca](https://github.com/facebook/react/commit/3f85d53ca )**: Further pre-requisite changes to plugin event system (#18083) //<Dominic Gannaway>//
- **[ea6ed3dbb](https://github.com/facebook/react/commit/ea6ed3dbb )**: Warn for update on different component in render (#17099) //<Andrew Clark>//
- **[085d02133](https://github.com/facebook/react/commit/085d02133 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[1000f6135](https://github.com/facebook/react/commit/1000f6135 )**: Add container to event listener signature (#18075) //<Dominic Gannaway>//
- **[a12dd52a4](https://github.com/facebook/react/commit/a12dd52a4 )**: Don't build some packages for WWW (#18078) //<Dan Abramov>//
- **[2512c309e](https://github.com/facebook/react/commit/2512c309e )**: Remove Flare bundles from build (#18077) //<Dominic Gannaway>//
- **[4912ba31e](https://github.com/facebook/react/commit/4912ba31e )**: Add modern event system flag + rename legacy plugin module (#18073) //<Dominic Gannaway>//
- **[4d9f85006](https://github.com/facebook/react/commit/4d9f85006 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[14afeb103](https://github.com/facebook/react/commit/14afeb103 )**: Added missing feature flag //<Brian Vaughn>//
- **[691096c95](https://github.com/facebook/react/commit/691096c95 )**: Split recent passive effects changes into 2 flags (#18030) //<Brian Vaughn>//
- **[56d8a73af](https://github.com/facebook/react/commit/56d8a73af )**: [www] Disable Scheduler `timeout` w/ dynamic flag (#18069) //<Andrew Clark>//
- **[d533229fb](https://github.com/facebook/react/commit/d533229fb )**: Fix Prettier //<Dan Abramov>//
- **[56a8c3532](https://github.com/facebook/react/commit/56a8c3532 )**: eslint-plugin-react-hooks@2.4.0 //<Dan Abramov>//
- **[93a229bab](https://github.com/facebook/react/commit/93a229bab )**: Update eslint rule exhaustive deps to use new suggestions feature (#17385) //<Will Douglas>//
- **[9def56ec0](https://github.com/facebook/react/commit/9def56ec0 )**: Refactor DOM plugin system to single module (#18025) //<Dominic Gannaway>//
- **[2d6be757d](https://github.com/facebook/react/commit/2d6be757d )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//
- **[d4f2b0379](https://github.com/facebook/react/commit/d4f2b0379 )**: Add Auto Import to Babel Plugin  (#16626) //<Luna Ruan>//
- **[8777b44e9](https://github.com/facebook/react/commit/8777b44e9 )**: Add Modern WWW build (#18028) //<Dan Abramov>//
- **[a607ea4c4](https://github.com/facebook/react/commit/a607ea4c4 )**: Remove getIsHydrating (#18019) //<Dan Abramov>//
- **[f7278034d](https://github.com/facebook/react/commit/f7278034d )**: Flush all passive destroy fns before calling create fns (#17947) //<Brian Vaughn>//
- **[529e58ab0](https://github.com/facebook/react/commit/529e58ab0 )**: Remove legacy www config from Rollup build (#18016) //<Dominic Gannaway>//
- **[42918f40a](https://github.com/facebook/react/commit/42918f40a )**: Change build from babylon to babel (#18015) //<Dominic Gannaway>//
- **[df5faddcc](https://github.com/facebook/react/commit/df5faddcc )**: Refactor commitPlacement to recursively insert nodes (#17996) //<Dominic Gannaway>//
- **[517de74b0](https://github.com/facebook/react/commit/517de74b0 )**: Tweak comment wording (#18007) //<Dan Abramov>//
- **[b63cb6f6c](https://github.com/facebook/react/commit/b63cb6f6c )**: Update ReactFiberExpirationTime.js (#17825) //<haseeb>//
- **[89c6042df](https://github.com/facebook/react/commit/89c6042df )**: fix: typo in test (#18005) //<Jesse Katsumata>//
- **[4f71f25a3](https://github.com/facebook/react/commit/4f71f25a3 )**: Re-enable shorthand CSS property collision warning (#18002) //<Sophie Alpert>//
- **[c55c34e46](https://github.com/facebook/react/commit/c55c34e46 )**: Move React Map child check to behind flags or __DEV__ (#17995) //<Dominic Gannaway>//
- **[3f814e758](https://github.com/facebook/react/commit/3f814e758 )**: Fix Flow type for React Native (#17992) //<Dan Abramov>//
- **[256d78d11](https://github.com/facebook/react/commit/256d78d11 )**: Add feature flag for removing children Map support (#17990) //<Dominic Gannaway>//
- **[9dba218d9](https://github.com/facebook/react/commit/9dba218d9 )**: [Mock Scheduler] Mimic browser's advanceTime (#17967) //<Andrew Clark>//
- **[d6e08fe0a](https://github.com/facebook/react/commit/d6e08fe0a )**: Remove Suspense priority warning (#17971) //<Dan Abramov>//
- **[812277dab](https://github.com/facebook/react/commit/812277dab )**: Fix onMouseEnter is fired on disabled buttons (#17675) //<Alfredo Granja>//
- **[3e9251d60](https://github.com/facebook/react/commit/3e9251d60 )**: make testing builds for React/ReactDOM (#17915) //<Sunil Pai>//
- **[ace9e8134](https://github.com/facebook/react/commit/ace9e8134 )**: Simplify Continuous Hydration Targets (#17952) //<Sebastian Markbåge>//
- **[7df32c4c8](https://github.com/facebook/react/commit/7df32c4c8 )**: Flush `useEffect` clean up functions in the passive effects phase (#17925) //<Brian Vaughn>//
- **[434770c3b](https://github.com/facebook/react/commit/434770c3b )**: Add beforeRemoveInstance method to ReactNoop (#17959) //<Dominic Gannaway>//
- **[6ae2c33a7](https://github.com/facebook/react/commit/6ae2c33a7 )**: StrictMode should call sCU twice in DEV (#17942) //<Brian Vaughn>//
- **[9dbe1c54d](https://github.com/facebook/react/commit/9dbe1c54d )**: Revert "Bugfix: Expiring a partially completed tree (#17926)" (#17941) //<Andrew Clark>//
- **[b2382a715](https://github.com/facebook/react/commit/b2382a715 )**: Add ReactDOM.unstable_renderSubtreeIntoContainer warning flag (#17936) //<Dominic Gannaway>//
- **[01974a867](https://github.com/facebook/react/commit/01974a867 )**: Bugfix: Expiring a partially completed tree (#17926) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 241c446...b5c6dd2

Reviewed By: gaearon

Differential Revision: D20347361

fbshipit-source-id: e9e6282474ab6471585e8e7fb6ea8518aa48390d
2020-03-16 13:09:54 -07:00
Jesse Katsumata 66e7a4c1aa Fix outdated urls (#28285)
Summary:
Fixed some url in the code that was outdated.

## Changelog

[Internal] [Fixed] - Fix outdated url in Image Example of RNTester and comment in StyleSheet Type
Pull Request resolved: https://github.com/facebook/react-native/pull/28285

Test Plan: Url can be accessed, and content displayed makes sense.

Differential Revision: D20464293

Pulled By: shergin

fbshipit-source-id: f0c97f7a95ed2a3d6c396cff6cda0bdaab7f5c35
2020-03-15 22:58:14 -07:00
maschad bcf2a716fb Removed core RCTConvert CoreLocation Libraries as well as reference i… (#28300)
Summary:
This PR is to address https://github.com/facebook/react-native/issues/28200

Even though GeoLocation was extracted from the Core, there are still libraries i.e. the CoreLocation.h library included which cause Apple to reject Apps, as mentioned here.

This removed all references to the CoreLocation library that where remaining.

## Changelog

[iOS] [Removed] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/28300

Test Plan:
- Flow check passes.
- RNTest built successfully.

Differential Revision: D20441145

Pulled By: shergin

fbshipit-source-id: 03faa4d20dc15cea931b42f34f13814df9c94a01
2020-03-15 22:36:53 -07:00
Héctor Ramos 07def55396 fbshipit-source-id: da15f69185e724eaf7d4bc78dbc61fcdcb3074d5 2020-03-13 21:46:45 -07:00
Tim Yung 5ca1d8f260 Pressability: Fix Missing `onLongPress` Gestures
Summary:
The current implementation of `Pressability` has a bug related to `onLongPress`.

When a user starts a press gesture, we keep track of the activation position (occurs after waiting `delayPressIn` milliseconds). If the touch moves away from that position by more than 10dp, we rule out the long press gesture. This means no matter how long you hold down the press, even if you move it back to within 10dp, we will not fire `onLongPress`.

However, there is currently a bug where we never reset the cached activation position. This means that after the first press gesture, all subsequent long press gestures must start within 10dp of that first press gesture. This leads to seemingly intermittent missing long press gestures.

This fixes the bug by ensuring that whenever a press gestures is terminated (either via a cancel or release), we reset the activation position.

Changelog:
[General][Fixed] - Fixed Pressability to properly fire `onLongPress`.

Reviewed By: TheSavior

Differential Revision: D20410075

fbshipit-source-id: e4727b7a9585ce3ea39481fc13e56b6b91740c8c
2020-03-11 23:10:48 -07:00
Tommy Nguyen f332fac163 iOS: Add UIScene support to RCTImageView (#28141)
Summary:
Apps implementing `UISceneDelegate` no longer clear out images when backgrounded because `UIApplicationDidEnterBackgroundNotification` no longer gets fired.

## Changelog

[iOS] [Added] - UIScene support for RCTImageView
Pull Request resolved: https://github.com/facebook/react-native/pull/28141

Test Plan:
1. Create a new iOS app implementing `UISceneDelegate` or modify an existing one
2. Open a React view with some images
3. Switch to another app, or background the current app
4. Observe that `-[RCTImageView clearImageIfDetached]` gets called

Reviewed By: shergin

Differential Revision: D20009200

Pulled By: hramos

fbshipit-source-id: bdbf79d6cf56a295344c036b9225efec672fa780
2020-03-11 18:01:32 -07:00
Samuel Susla 3198009410 Remove redundant queue switch from RCTLocalAssetImageLoader
Summary:
Switching queues in `RCTLocalAssetImageLoader` is unnecessary. We dispatch to main queue before assigning the image to `UIImageView`.

Changelog: Remove redundant queue switch from RCTLocalAssetImageLoader

Reviewed By: PeteTheHeat

Differential Revision: D20347223

fbshipit-source-id: ff6215838f0462356d4a516e6ec31c82a742881a
2020-03-11 14:01:21 -07:00
Joshua Gross f3a53fd338 TextInput: keep less stateful data on the View
Summary:
Allow JS to keep track of mostRecentEventCount and pass it into each event or prop update. We really don't want to separately keep track of that data.

In non-Fabric, the ShadowNode will keep track of the mostRecentEventCount associated to prop updates. In Fabric, that happens on the C++ ShadowNode.

Changelog: [Internal] Simplification to TextInput native state

Reviewed By: mdvacca

Differential Revision: D20374573

fbshipit-source-id: 385fba6ec69a071c78832a686b397699a6c55d67
2020-03-11 12:32:40 -07:00
Miguel Bolivar 686d8a57f8 Update: Fixing typo on Modal comment code � (#28057)
Summary:
This PR only fixes a little typo that I noticed working on the documentation of React Native website taking reference from this source code, and then saw it 😅

## Changelog

[General] [Fixed] - Fixed typo from `inly` to `only` inside `Modal.js` library code.
Pull Request resolved: https://github.com/facebook/react-native/pull/28057

Test Plan: Not needed.

Reviewed By: cpojer

Differential Revision: D20197178

Pulled By: TheSavior

fbshipit-source-id: 372f263a16a2de665ced7c0d3f10e3897777d19f
2020-03-11 10:00:04 -07:00
Luna Wei a3aaa471ec Add JS error to AnimatedValue constructor
Summary:
Changelog: [Internal]
Add one more error around AnimatedValue.js returning an undefined value for "value" property.

Since this error happens in construction of the animated node, it makes sense that the constructor could be passed an undefined value?

Reviewed By: zackargyle

Differential Revision: D20354532

fbshipit-source-id: ba35172cd91977c48c849a2b1e27596c4dd8b4d4
2020-03-10 18:03:22 -07:00
Max Kareta c38318d084 deleting marker cancel 2/N. [DO NOT LAND]
Summary: Added markerDrop API that will replace markerCancel in future.

Reviewed By: furdei

Differential Revision: D20003457

fbshipit-source-id: 38cf68455d9274761a49014d9cbb50d82f4e9437
2020-03-10 07:11:42 -07:00
Spencer Ahrens 08c338eebf update JSTime to last call
Summary: ChangeLog: [General] [Added] - support PerformanceLogger stopTimespan updates

Reviewed By: alexeylang

Differential Revision: D20095949

fbshipit-source-id: 3522a8d16ced44d6b699b294004371e223f9f619
2020-03-09 19:47:36 -07:00
Jesse Katsumata 42c1957aff chore: fix typo in comments (#28269)
Summary:
Fixed some typos in the comment.

## Changelog

[Internal] [Fixed] - Fixed typo in the comments
Pull Request resolved: https://github.com/facebook/react-native/pull/28269

Test Plan: Changes are only made in the comments, so test is not necessary.

Reviewed By: cpojer

Differential Revision: D20342637

Pulled By: shergin

fbshipit-source-id: f6e7dd538ee54c43e1570c35e1f8c4502054e328
2020-03-09 15:37:33 -07:00
Rick Hanlon 69126069fc LogBox - Handle invalid requires
Summary:
This diff updates the errors thrown by Metro for invalid requires, and fixed a bug in Fast Refresh that was failing to handle errors returned by metro. The net result is that invalid requires are displayed as syntax errors with code frames.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20107057

fbshipit-source-id: 59f77aa1da620d2c619a7cc45d90f40ef8b54448
2020-03-09 06:02:07 -07:00
Logan Daniels 074a2fab74 Update measurements for Footer in VirtualizedList when the footer's onLayout is called
Summary:
When any list cell that may contain nested VirtualizedLists is laid out, it's possible that the offset of any child lists relative to the outermost list has changed. We need to tell these children to re-measure themselves relative to that outermost list, so that their viewability calculations are correct.

We already do this for regular list cells -- we just need to extend that logic to any child lists that may live in the ListFooterComponent.

Changelog: [General] [Fixed] - Fix viewability calculations for nested VirtualizedLists inside of a parent list's FooterComponent

Differential Revision: D20310961

fbshipit-source-id: 4bfcfb95c87329f2ee337d5499e5c7162ba692e8
2020-03-06 15:51:33 -08:00
Daniel Sainati 1beef1e18d deploy 120 to xplat
Summary:
Changelog: [Internal]

bypass-lint
allow-large-files

Reviewed By: mroch

Differential Revision: D20290164

fbshipit-source-id: 6f8633b1a8685b0551757fc4841b82eab77525c5
2020-03-06 11:09:08 -08:00
Christoph Nakazawa 78de0865cf Adjust React error messages to obfuscate imports
Summary:
Similar to the previous diff in this stack, I'm adjusting the React files we use to make sure require and import statements don't get extracted by Jest. Right now Jest extracts them, and when it looks up dependencies in reverse it just ignores the ones that don't exist.

Corresponding React PR (to make sure this change doesn't get reverted during the next sync): https://github.com/facebook/react/pull/18222

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D20282829

fbshipit-source-id: 5ff6a64d31672dd29243d020e8174797a44d9267
2020-03-06 03:57:40 -08:00
Logan Daniels b85cb0cf7a Back out "Moving towards UIWindowScene support"
Summary:
Original commit changeset: ae2a4478e2e7

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D20289851

fbshipit-source-id: 1167ce8f5135411b80630b523c91c10e2b7eece1
2020-03-05 15:58:44 -08:00
Jesse Katsumata fbd09b1797 Image: remove unused ImageProps (#28151)
Summary:
I noticed that there was a `height` and `width` props in `Image` component, but those props are not being used in `RCTImageView`(ios) or `ReactImageView`(android).

## Changelog

[GENERAL] [Removed] - Remove Unused ImageProp
Pull Request resolved: https://github.com/facebook/react-native/pull/28151

Test Plan: Start a new React Native Project, and use `Image` component with `width` and `height` props and verify that it does not display the image on both iOS and Android

Reviewed By: shergin

Differential Revision: D20197126

Pulled By: TheSavior

fbshipit-source-id: 186119448826659d7c01c7c8a271157228169c30
2020-03-05 13:33:08 -08:00
Logan Daniels c203ec00e5 Add flow types for ReactTestRenderer
Summary: Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20260771

fbshipit-source-id: 3935e546ebbc65a1baa9d0a25cff47753f6bc590
2020-03-05 12:01:18 -08:00
radex b58e176af0 Moving towards UIWindowScene support (#28058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/28058

I'm taking the first step towards supporting iOS 13 UIScene APIs and modernizing React Native not to assume an app only has a single window. See discussion here: https://github.com/facebook/react-native/issues/25181#issuecomment-505612941

The approach I'm taking is to take advantage of `RootTagContext` and passing it to NativeModules so that they can identify correctly which window they refer to. Here I'm just laying groundwork.

- [x] `Alert` and `ActionSheetIOS` take an optional `rootTag` argument that will cause them to appear on the correct window
- [x] `StatusBar` methods also have `rootTag` argument added, but it's not fully hooked up on the native side — this turns out to require some more work, see: https://github.com/facebook/react-native/issues/25181#issuecomment-506690818
- [x] `setNetworkActivityIndicatorVisible` is deprecated in iOS 13
- [x] `RCTPerfMonitor`, `RCTProfile` no longer assume `UIApplicationDelegate` has a `window` property (no longer the best practice) — they now just render on the key window

Next steps: Add VC-based status bar management (if I get the OK on https://github.com/facebook/react-native/issues/25181#issuecomment-506690818 ), add multiple window demo to RNTester, deprecate Dimensions in favor of a layout context, consider adding hook-based APIs for native modules such as Alert that automatically know which rootTag to pass

## Changelog

[Internal] [Changed] - Modernize Modal to use RootTagContext
[iOS] [Changed] - `Alert`, `ActionSheetIOS`, `StatusBar` methods now take an optional `surface` argument (for future iPadOS 13 support)
[iOS] [Changed] - RCTPresentedViewController now takes a nullable `window` arg
[Internal] [Changed] - Do not assume `UIApplicationDelegate` has a `window` property
Pull Request resolved: https://github.com/facebook/react-native/pull/25425

Test Plan:
- Open RNTester and:
- go to Modal and check if it still works
- Alert → see if works
- ACtionSheetIOS → see if it works
- StatusBar → see if it works
- Share → see if it works

Reviewed By: PeteTheHeat

Differential Revision: D16957751

Pulled By: hramos

fbshipit-source-id: ae2a4478e2e7f8d2be3022c9c4861561ec244a26
2020-03-04 14:25:12 -08:00
Tim Yung fc45530ded Pressability: Restore Press In Delay
Summary:
During the development of `Pressability`, I removed the default "press in delay" in order to minimize differences between `Touchable` (as used by `TouchableWithoutFeedback`) and `Pressability`. However, it was a bug that `TouchableWithoutFeedback` zero'd out the default press delay.

This restores the original "press in delay". This will make it so that when users swipe over a pressable element in a scroll view, the scroll view will have time to cancel the touch and prevent a press in behavior (visual jank).

Changelog:
[General] [Changed] - Increase default `delayPressIn` value for `Pressability` to 130ms.

Reviewed By: TheSavior

Differential Revision: D20176152

fbshipit-source-id: 5d6481395ee501bcab20ab98cb46a6be2c423ddf
2020-03-04 11:06:48 -08:00
Samuel Susla 3ee1e5312a Back out "Rename measure to measureContent and pass it LayoutContext"
Summary:
Original commit changeset: 8928b59d5194

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D20246918

fbshipit-source-id: 0b9142d9bc4774a07304769126411a34cc8c33c5
2020-03-04 05:01:53 -08:00
Vojtech Novak 884c86ae02 change onRefresh flow typing (#28167)
Summary:
I propose this change because we (and a lot of other people, I'd guess) pass an `async` function as a parameter to `onRefresh`. Because the `async` function returns a `promise`, flow is reporting an error. I think the type checking here can be relaxed either all the way to `any` (because RN does not care here what we return) or to `void | Promise<void>` to account for async functions.

looking at fb7b2d3533 (diff-a9c5687ae65236ba3e7f34bfdcdec81d) seems like the second is preferred

## Changelog

[General] [changed] - relax RefreshControl's onRefresh flow typing
Pull Request resolved: https://github.com/facebook/react-native/pull/28167

Test Plan: * flow passes

Reviewed By: hramos

Differential Revision: D20196529

Pulled By: TheSavior

fbshipit-source-id: bb5a314bcfb5fb9c8ab71eccb449f1322aeebacb
2020-03-03 16:00:52 -08:00
Samuel Susla b40f0562f5 Rename measure to measureContent and pass it LayoutContext
Summary:
In order to build dynamic text sizing, `LayoutableShadowNode::measure` needs to accept `LayoutContext`

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D20184598

fbshipit-source-id: 8928b59d51948caf3654f40049212a89a91dceb6
2020-03-03 04:14:04 -08:00
Riley Dulin ce1703a84d Change stringifySafe to have limits on larger objects
Summary:
In heap snapshots, it was found that really large (20 MB) strings representing network data
were being logged as part of `Systrace.beginEvent` strings from `MessageQueue` in DEV mode.

To combat this, use `JSON.stringify` with limits to keep the depth, strings, arrays, and objects
in check.

Changelog: [Internal] Change `stringifySafe` to have max limits on string size

Reviewed By: yungsters

Differential Revision: D20016501

fbshipit-source-id: e123016557bc154e4210e0b4df44360570da8016
2020-03-02 17:28:21 -08:00
Tom Underhill f4de45800f PlatformColor implementations for iOS and Android (#27908)
Summary:
This Pull Request implements the PlatformColor proposal discussed at https://github.com/react-native-community/discussions-and-proposals/issues/126.   The changes include implementations for iOS and Android as well as a PlatformColorExample page in RNTester.

Every native platform has the concept of system defined colors. Instead of specifying a concrete color value the app developer can choose a system color that varies in appearance depending on a system theme settings such Light or Dark mode, accessibility settings such as a High Contrast mode, and even its context within the app such as the traits of a containing view or window.

The proposal is to add true platform color support to react-native by extending the Flow type `ColorValue` with platform specific color type information for each platform and to provide a convenience function, `PlatformColor()`, for instantiating platform specific ColorValue objects.

`PlatformColor(name [, name ...])` where `name` is a system color name on a given platform.  If `name` does not resolve to a color for any reason, the next `name` in the argument list will be resolved and so on.   If none of the names resolve, a RedBox error occurs.  This allows a latest platform color to be used, but if running on an older platform it will fallback to a previous version.
 The function returns a `ColorValue`.

On iOS the values of `name` is one of the iOS [UI Element](https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors) or [Standard Color](https://developer.apple.com/documentation/uikit/uicolor/standard_colors) names such as `labelColor` or `systemFillColor`.

On Android the `name` values are the same [app resource](https://developer.android.com/guide/topics/resources/providing-resources) path strings that can be expressed in XML:
XML Resource:
`@ [<package_name>:]<resource_type>/<resource_name>`
Style reference from current theme:
`?[<package_name>:][<resource_type>/]<resource_name>`
For example:
- `?android:colorError`
- `?android:attr/colorError`
- `?attr/colorPrimary`
- `?colorPrimaryDark`
- `android:color/holo_purple`
- `color/catalyst_redbox_background`

On iOS another type of system dynamic color can be created using the `IOSDynamicColor({dark: <color>, light:<color>})` method.   The arguments are a tuple containing custom colors for light and dark themes. Such dynamic colors are useful for branding colors or other app specific colors that still respond automatically to system setting changes.

Example: `<View style={{ backgroundColor: IOSDynamicColor({light: 'black', dark: 'white'}) }}/>`

Other platforms could create platform specific functions similar to `IOSDynamicColor` per the needs of those platforms.   For example, macOS has a similar dynamic color type that could be implemented via a `MacDynamicColor`.   On Windows custom brushes that tint or otherwise modify a system brush could be created using a platform specific method.

## Changelog

[General] [Added] - Added PlatformColor implementations for iOS and Android
Pull Request resolved: https://github.com/facebook/react-native/pull/27908

Test Plan:
The changes have been tested using the RNTester test app for iOS and Android.   On iOS a set of XCTestCase's were added to the Unit Tests.

<img width="924" alt="PlatformColor-ios-android" src="https://user-images.githubusercontent.com/30053638/73472497-ff183a80-433f-11ea-90d8-2b04338bbe79.png">

In addition `PlatformColor` support has been added to other out-of-tree platforms such as macOS and Windows has been implemented using these changes:

react-native for macOS branch: https://github.com/microsoft/react-native/compare/master...tom-un:tomun/platformcolors

react-native for Windows branch: https://github.com/microsoft/react-native-windows/compare/master...tom-un:tomun/platformcolors

iOS
|Light|Dark|
|{F229354502}|{F229354515}|

Android
|Light|Dark|
|{F230114392}|{F230114490}|

{F230122700}

Reviewed By: hramos

Differential Revision: D19837753

Pulled By: TheSavior

fbshipit-source-id: 82ca70d40802f3b24591bfd4b94b61f3c38ba829
2020-03-02 15:12:09 -08:00
Luna Wei b8715dc31c Throw error when setting value of AnimatedValue to undefined
Summary:
Changelog: [Internal] Throw error when setting Animated value to undefined.

Background:
ReadableNativeMap removes keys that have undefined values. Somewhere some animation is setting the value to be undefined.

Follow up: Find a way to warn generally that undefined values are being set for maps that become ReadableNativeMaps

Reviewed By: JoshuaGross

Differential Revision: D20169325

fbshipit-source-id: 404b727dc238703ebe5f71a0939340d5f1b3b211
2020-03-02 13:17:01 -08:00
Janic Duplessis 0569d4c431 Remove JS autoFocus implementation (#27923)
Summary:
Follow up to https://github.com/facebook/react-native/issues/27803 and https://github.com/facebook/react-native/issues/27924. We no longer need to call focus on mount from JS as both iOS and Android implements it natively now.

## Changelog

[General] [Fixed] - Remove JS autoFocus implementation
Pull Request resolved: https://github.com/facebook/react-native/pull/27923

Test Plan: Test that focus works in RN Tester with this, https://github.com/facebook/react-native/issues/27803 and https://github.com/facebook/react-native/issues/27924

Differential Revision: D19956373

Pulled By: TheSavior

fbshipit-source-id: 5d99ead55011663b3edaf499ac7616765a24cb50
2020-03-02 11:34:36 -08:00
Kevin Gozali 30822e3923 make RN infra labels public
Summary:
Internal build target labeling.

Changelog: [Internal]

Reviewed By: zlern2k

Differential Revision: D20152676

fbshipit-source-id: 89615a0b3a6f3994b18f2c07b86d0ae93e052327
2020-02-28 12:46:49 -08:00
Pieter De Baets 64720ab14a Improve typing of Animated component wrappers
Summary:
Provides flow-types for callers of AnimatedScrollView etc

Changelog: [Internal] [Fixed] Fixed flow types of Animated components

Reviewed By: cpojer

Differential Revision: D20158990

fbshipit-source-id: 3d06a89086629eb9f9d2cc0f3e7a819a80456fb0
2020-02-28 09:31:12 -08:00
Arjan Zuidema 0a9cc34dd8 Added userInterfaceStyle prop to ActionSheetmanager to override user interface style for iOS 13 (#26401)
Summary:
Support to override actionsheet and share interface style to match your app. For example, when your app has it's own theming you want to match the stying on actionsheet and the share menu.

## Changelog

[iOS] [Added] - Added userInterfaceStyle for ActionSheetIOS and Share to override user interface style on IOS 13
Pull Request resolved: https://github.com/facebook/react-native/pull/26401

Test Plan:
Set dark style
![dark](https://user-images.githubusercontent.com/30040390/64685321-12a53080-d487-11e9-8846-f2ef89e114a2.jpg)
Set light style
![light](https://user-images.githubusercontent.com/30040390/64685322-12a53080-d487-11e9-9dfd-1e07b9fe0ce2.jpg)

Differential Revision: D17314080

Pulled By: hramos

fbshipit-source-id: f84278ca99ba20347d17e27295f661d6690fa68c
2020-02-28 00:08:54 -08:00
Eli White 9fdb96eec7 Partial React Sync from 241c4467e...00d8e5b80
Summary:
- **[00d8e5b80](https://github.com/facebook/react/commit/00d8e5b80 )**: [Fabric] Fix targetAsInstance dispatchEvent "cannot read property of null" (#18156) //<Joshua Gross>//
- **[ad84625f8](https://github.com/facebook/react/commit/ad84625f8 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[a6dfe9aa4](https://github.com/facebook/react/commit/a6dfe9aa4 )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[General][React] Partial React Sync from 241c4467e...00d8e5b80

Reviewed By: JoshuaGross

Differential Revision: D20153744

fbshipit-source-id: 09c5fec620370f1844a89af1c6ba2d487020216d
2020-02-27 19:39:26 -08:00
Ramanpreet Nara 6a9a76e420 Make RCTDevLoadingView TurboModule-compatible
Summary:
This is a redo of D16969764, with a few extensions.

## Changes
1. Move `RCTDevLoadingView.{h,m}` to `CoreModuels/RCTDevLoadingView.{h,mm}`
2. Extract ObjC API of `RCTDevLodingView` into `RCTDevLoadingViewProtocol` in `ReactInternal`.
3. Create API `RCTDevLoadingViewSetEnabled.h` in `ReactInternal` to enable/disable `RCTDevLoadingView`

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18642554

fbshipit-source-id: 6b62e27e128d98254b7a6d018399ec1c06e274fc
2020-02-27 17:06:13 -08:00
Hans Halverson a3d9e91203 Move suppression to primary locations in xplat/js
Summary:
We will soon be enforcing that flow suppressions will only apply when on an error's primary location ([post](https://fb.workplace.com/groups/179614562644215/permalink/559286354677032/)). This diff uses the codemod created in D20008770 to move all suppression comments to their primary locations in the  `xplat/js` flow root, and deletes suppression comments that are not on any primary locations.

This diff was generated with:
```
~/fbsource/fbcode/flow/packages/flow-dev-tools/bin/tool suppression-primary-locations --json-file ~/www/errors.json  ~/fbsource/xplat/js
hg st -n | xargs grep -l -P '@(partially-)?generated' | xargs hg revert
hg st -n | xargs grep -l 'format' | xargs prettier --write
```

Changelog: [Internal]

bypass-lint

Reviewed By: dsainati1

Differential Revision: D20122544

fbshipit-source-id: d94e409aadb18bb399a1ddbf9f3f2494fe4fb54c
2020-02-27 12:14:57 -08:00
Samuel Susla d33ead3f16 Fix matricesDiffer ignoring first value of matrix
Summary:
Changelog: [internal]

# Problem

Implementation of `matricesDiffer` was ignoring first element in the matrix, therefore two matrixes that were different were actually evaluated as same and React didn't pass value to native.

# Solution

Take first element in the matrix into account when comparing matrices.

Reviewed By: cpojer

Differential Revision: D20117210

fbshipit-source-id: 84c3b4e580da44bda4fc8bd8669318282ae9aa32
2020-02-27 05:43:02 -08:00
Nikita Kraev 79efa43428 Update ImageEditingManager to use internal storage before falling back to external for cache
Summary:
Changelog: [Android] [Changed] - Internal storage now will be preferred for caching images from ImageEditor.

Now we try to write to internal cache directory first.
If that fails (due to no memory error or other IOException), we attempt to write to external storage (if that is allowed).

I introduced additional configuration flag, `allowExternalStorage` which is true by default.
And i updated documentation for new behaviour - see
 `ImageEditor.cropImage(..)` comment.

Reviewed By: makovkastar

Differential Revision: D19878158

fbshipit-source-id: 7e338ce68f535f74c62b5eecd5a94af7e7396f8b
2020-02-25 05:46:59 -08:00
Rick Hanlon 956359bee6 Handle errors in Metro by showing a code frame
Summary:
Right now the code frame and stack trace for metro errors are useless. This diff improved these errors by showing the metro code frame for the source of the issue, and stripping the stack trace.

Ideally we could show the metro stack trace as well, but since stack traces are tightly coupled to symbolication (and metro source code does not need symbolicated, nor could it be), this is an acceptable incremental improvement.

Arguably, even showing the code frame is inappropriate and we should show a generic crash screen with reload and report buttons.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20057353

fbshipit-source-id: 5e999cea14c1cbd2f69737e3992a3e8d159fdf89
2020-02-25 04:34:38 -08:00
Joshua Gross ed5f9eeb2a TextInput: use commands instead of setNativeProps on Android
Summary:
Use codegen'd ViewCommands added in previous diff as a replacement for setNativeProps.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18619298

fbshipit-source-id: 08069e828e92ac3cca9813bbcdca99d99fb50883
2020-02-24 16:19:36 -08:00
Joshua Gross 7f80b1c8c7 TextInput: Fix controlled TextInput selection in Paper
Summary:
The migration from classy to functional component partially broke controlled TextInput selections. This fixes it.

The nuance is that even though we have "event counters" sent from native, "onChange" and "onChangeSelection" are separate events;
so even if you receive new text and a new native event counter, your selection may be out-of-date. Incrementing the event counter
when sending selection events breaks text updates; and adding another native event counter seems like overkill. Instead, in JS, we statefully
keep track of (1) the native event counter, (2) whether or not the selection has been updated for that event counter.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D18867152

fbshipit-source-id: c569ecd03ce0042d6feb5fa8af4c756588607a09
2020-02-24 16:19:35 -08:00
Kacie Bawiec aebeb3b0a9 Add Snapshot Rendering Test to ScrollView
Summary:
As title.

Changelog: [Added] Add snapshot rendering test to ScrollView

Reviewed By: zackargyle, TheSavior

Differential Revision: D20037673

fbshipit-source-id: 4270bc63a6065789f072893756468b67deae169d
2020-02-24 14:48:40 -08:00
Rachel Nabors c0d8c1db90 Updating the URLs to point at new domain name reactnative.dev
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code

CHANGELOG:
[INTERNAL]

Reviewed By: hramos

Differential Revision: D20072842

fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
2020-02-24 13:09:11 -08:00
generatedunixname89002005287564 796a4ea7e3 Add "complete_nullability = True" to compatible libraries
Reviewed By: natestedman

Differential Revision: D19968574

fbshipit-source-id: cf31e22e4a624f2f2a37bfd1b23ae65ff121f263
2020-02-24 07:38:53 -08:00
Pieter De Baets bcc6f9b5e4 Avoid unneccessary array copies in timer callbacks
Summary:
Removed an array.slice() call in the callImmediatesPass, which seems unnecessary to me, as the variable is immediately re-assigned on the next line.

Also fixed some flow issues, clarified a systrace marker and opensourced the relevant tests.

Changelog: [Internal] [Fixed] Improved JSTimer efficiency

Reviewed By: yungsters

Differential Revision: D20039181

fbshipit-source-id: 9b146980e8fa9f94b2f6153cc67cc7ced58104e5
2020-02-24 03:17:27 -08:00
Rick Hanlon cf20bb8921 Delete YellowBox
Summary:
This diff removes YellowBox (RIP).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949737

fbshipit-source-id: 0b653b128d8fc78255778d424a1c014bf5ddbcd0
2020-02-21 10:34:40 -08:00
Rick Hanlon 64bc400c77 LogBox - Fix code frame whitespace trimming
Summary:
This diff fixes whitespace trimming in codeframes by setting the whitespace size to 0 instead of infinity for lines that's don't have whitespace. This fixes a bug in frames where lines with 0 whitespace would not be considered.

So frames like this, where the common whitespace should be 0:

```
  217 | function Hi(a?: String) {
> 218 |   return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                  ^
  219 | }
  220 |
  221 | export default CrashReactApp;
```

Are instead trimmed at the second most common whitespace, which is 2. That's because line 217 has a whitespace length of 0, but we consider it as Infinity. When we get to line 218, we set the whitespace to 2. Then on line 19 we consider if 2 < Infinity and decide that the common whitespace is 2 resulting in:

```
  217 | nction Hi(a?: String) {
> 218 | return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                ^
  219 |
  220 |
  221 | port default CrashReactApp;
```

By setting the whitespace per line to 0 when there's no whitespace match, lines without whitespace can accurately report their size and move the pointer back to the 0 position.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20030301

fbshipit-source-id: f1dec8cc57479f37ffa8128f93f7c8b3c6baaf91
2020-02-21 10:23:31 -08:00
Rick Hanlon c6d5019573 Interpolate strings before giving them to abd
Summary:
This diff interpolates logs before passing them downstream so that we don't see a bunch of logs with "%s" everywhere.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20034903

fbshipit-source-id: 966917aa21ba07af3fb114e6a6931d4bbf860040
2020-02-21 09:33:00 -08:00
Pieter De Baets bdafc55f50 Make animation types exact
Summary: Changelog: [General][Changed] Improved flowtype support for Animated

Reviewed By: cpojer

Differential Revision: D20002839

fbshipit-source-id: 537ac00b3fe408585d34a0ffac8adc598e01d1b7
2020-02-21 06:54:03 -08:00
Eli White 3212f7dfe8 Release Pressable!
Summary:
*Pressable* is a component which is intended to replace the Touchable* components such as *TouchableWithoutFeedback* and *TouchableOpacity*. The motivation is to make it easier to create custom visual touch feedback so that React Native apps are not easily identified by the “signature opacity fade” touch feedback.

We see this component as eventually deprecating all of the existing Touchable components.

Changelog:
[Added][General] New <Pressable> Component to make it easier to create touchable elements

Reviewed By: yungsters

Differential Revision: D19674480

fbshipit-source-id: 765d657f023caea459f02da25376e4d5a2efff8b
2020-02-20 19:27:20 -08:00
Vojtech Novak 7f2a79f40b allow custom ripple radius on TouchableNativeFeedback (#28009)
Summary:
motivation: there are cases where one'd like to control the radius of the ripple effect that's present on TouchableNativeFeedback  - in my case, I want to make sure that both icons and text have the same ripple appearance, but that's currently not possible as far as I can tell.

Currently (afaik) the only way to set  (upper) ripple limits is by specifying width, height and border radius ( + `overflow: hidden`), and this works well for icons which can usually be bounded by a square, but not for text which can have rectangular shape.

This PR adds `rippleRadius` parameter to `SelectableBackground()`, `SelectableBackgroundBorderless()` and `Ripple()` static functions present on `TouchableNativeFeedback`. It can make the ripple smaller but also larger. The result looks like this:

added to RNTester:

![SVID_20200219_182027_1](https://user-images.githubusercontent.com/1566403/74858131-147ff380-5345-11ea-8a9e-2730b79eec38.gif)

difference from the other ripples:

![SVID_20200209_110918_1](https://user-images.githubusercontent.com/1566403/74109152-4513a080-4b81-11ea-8ec3-bb5862c57244.gif)

I'm ofc open to changing the api if needed, but I'm not sure there's much space for manoeuvring. While I was at it, I did a slight refactor of the class into several smaller, more focused methods.

It's possible that in some cases, this might help to work around this issue https://github.com/facebook/react-native/issues/6480.

## Changelog

[Android] [Added] - allow setting custom ripple radius on TouchableNativeFeedback
Pull Request resolved: https://github.com/facebook/react-native/pull/28009

Test Plan: I tested this locally using RNTester

Reviewed By: TheSavior

Differential Revision: D20004509

Pulled By: mdvacca

fbshipit-source-id: 10de1754d54c17878f36a3859705c1188f15c2a2
2020-02-20 15:29:07 -08:00
Radek Czemerys 1c5938eae7 chore: tweak missing RCTAnimation warning message (#28139)
Summary:
As we don't link modules manually anymore it's better to point the user in another direction when they face this issue.

## Changelog

[Internal] [Changed] - tweak missing RCTAnimation warning message

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

Reviewed By: cpojer

Differential Revision: D20009264

Pulled By: hramos

fbshipit-source-id: 114cae4fe908186eab3d8d9e79c2016015406821
2020-02-20 14:44:31 -08:00
Janette Cheng a793ed7598 Unbreak the build
Summary:
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

fbshipit-source-id: 316b879368503114ea1af16276643301601bcca8
2020-02-20 08:30:46 -08:00
Tom Underhill dbe0d7d4b5 Add NativeColorType opaque type to normalizeColor() ahead of PlatformColor PR. (#28040)
Summary:
The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) is currently open to implement the [PlatformColor proposal](react-native-community/discussions-and-proposals#126).   When that PR was imported into Facebooks internal builds it was found that the change to the `processColor()` function to return an opaque type or `number` instead of just `number` breaks internal components.

This PR is a simplification of the PlatformColor PR only changing the return type of `processColor()` from `?number` to `?number | NativeColorType` where `NativeColorType` is just an empty but opaque type.   This will allow changes to be made to these internal components but with less risk than the larger PR.

## Changelog

[General] [Changed] - Add NativeColorType opaque type to normalizeColor() ahead of PlatformColor PR
Pull Request resolved: https://github.com/facebook/react-native/pull/28040

Test Plan: Flow checks, Jest test, iOS unit tests, iOS integration tests, and manual testing performed on RNTester for iOS and Android.

Differential Revision: D19860205

Pulled By: TheSavior

fbshipit-source-id: 799662c6621d3974158b375ccccfa136982c43b4
2020-02-19 19:33:27 -08:00
Rick Hanlon 372771dc8c Remove LogBox.ignoreWarnings
Summary:
This method isn't necessary for the migration to LogBox because we have a YellowBoxDeprecated module instructing users to use LogBox.ignoreLogs (so no old code should be calling LogBox.ignoreWarnings).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19950302

fbshipit-source-id: 4850884e770f812273978b9a205f5b914e5a9d2f
2020-02-19 18:01:43 -08:00
Rick Hanlon d66169b4fc Deprecate YellowBox and unstable_enableLogBox
Summary:
This diff replaces YellowBox with YellowBoxDeprecated, adding warnings for using the module directly instead of YellowBox. Also adds a no-op message for unstable_enableLogBox.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949700

fbshipit-source-id: 269c341a2cedcdb2f7a80947d3239db078238201
2020-02-19 18:01:43 -08:00
Rick Hanlon a83ea6ab8c Switch to LogBox completely
Summary:
This diff replaces YellowBox with LogBox so that it can be deprecated and removed.

After this diff, it will no longer be possible to go back to YellowBox and all paths referencing it will be gone.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949695

fbshipit-source-id: 28a55866e514020bdcc6854aae565cffbbe8af58
2020-02-19 18:01:43 -08:00
Eli White da9364fa3e Switch iOS focus/blur calls to use new commands
Summary:
Make iOS use Commands instead of UIManager.{focus,blur}. This makes these apis compatible with Fabric and paper at the same time.

Changelog:
[Internal] Switch iOS focus/blur calls to use new commands

Reviewed By: mdvacca

Differential Revision: D19458995

fbshipit-source-id: 8c4aacd41941f54a887aeec1a17d9ce0b6878ab1
2020-02-19 15:29:00 -08:00
Eli White 147055466a Switch Android focus/blur calls to use new commands
Summary:
This makes Android dispatch focus/blur through the Fabric view manager when running in Fabric.

Changelog:
[Internal] Switch Android focus/blur calls to use new commands

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D19458362

fbshipit-source-id: 23e1d989ec55bc8abff4279e259f4b6c953ac0a3
2020-02-19 15:29:00 -08:00
Eli White 6286270e4c Migrate TextInputState to take a ref instead of a reactTag
Summary:
Changelog:
[General][Breaking] Multiple deprecations and breaking changes to TextInputState. Use native component refs instead of react tags

Reviewed By: JoshuaGross

Differential Revision: D19458214

fbshipit-source-id: f67649657fa44b6c707a0ac91f07d2ceb433bc70
2020-02-19 15:28:59 -08:00
Eli White 862c71908c Partial React Sync from 241c4467...ad84625f8
Summary:
Test sync of https://github.com/facebook/react/pull/18068

- **[ad84625f8](https://github.com/facebook/react/commit/ad84625f8 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[a6dfe9aa4](https://github.com/facebook/react/commit/a6dfe9aa4 )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[Changed][General] Partial React Sync from 241c4467...ad84625f8

Reviewed By: mdvacca

Differential Revision: D19459322

fbshipit-source-id: daefcf854e3da1c849f8376671065c53a1319ef9
2020-02-19 15:28:59 -08:00
Eli White 3b813cade1 Enable target as instance experiment
Summary:
This diff is just here to make it easier for me to work on the stack. It needs to be ripped out of the stack before landing

Changelog:
[Breaking][General] The `target` field of events is now a native component, not a react tag

Reviewed By: mdvacca

Differential Revision: D19458361

fbshipit-source-id: 1d03a58553cf96dc72f6d1323dfb37b1a8cdca75
2020-02-19 15:28:58 -08:00
Venits e99800267b - Remove leftover `Incremental` component (#28107)
Summary:
1/4 of https://github.com/facebook/react-native/issues/28103

## Changelog

[JavaScript][Removed] - Remove leftover `Incremental` component.
Pull Request resolved: https://github.com/facebook/react-native/pull/28107

Test Plan: In RNTester `Incremental` component is no longer used so I modified one of existing examples to use it.

Reviewed By: rickhanlonii

Differential Revision: D19960536

Pulled By: TheSavior

fbshipit-source-id: 791bda7138ac23916957577ed5f5c465c5e96299
2020-02-18 20:44:43 -08:00
Eli White 010c9241cb Partial React Sync from 241c4467..edab5c074
Summary:
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//

Changelog:
[General][Changed] Partial React Sync from 241c4467..edab5c074

Reviewed By: mdvacca, gaearon

Differential Revision: D19961765

fbshipit-source-id: d4a84a4076da332db76d66ddd7250eaea375f8ff
2020-02-18 19:03:18 -08:00
Eloy Durán a43fd60e18 Fix backgroundColor typing. (#28105)
Summary:
TextInput’s `InputAccessoryView` was using a [deprecated] prop-type as a Flow type, which TheSavior asked me to fix [here](6ba4b28a22 (r37343692)).

## Changelog

[iOS] [Fixed] - Fixes the `InputAccessoryView.backgroundColor` prop’s typing to use `ColorValue`.
Pull Request resolved: https://github.com/facebook/react-native/pull/28105

Test Plan:
Passes:

```bash
yarn flow-check-ios
```

Differential Revision: D19956401

Pulled By: TheSavior

fbshipit-source-id: 0c16f292b0143e83235a23712a0a7a11b8317f4e
2020-02-18 13:53:45 -08:00
Rick Hanlon 96f19a3d89 Replace YellowBox references with LogBox
Summary:
This diff replaces some YellowBox references with LogBox so we can remove it.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19948126

fbshipit-source-id: b26ad1b78d86a8290f7e08396e4a8314fef7a9f3
2020-02-18 07:51:46 -08:00
Rick Hanlon af710ab177 Switch from YellowBox.ignoreWarnings to LogBox.ignoreLogs
Summary:
Migrates internal calls from ignoreWarnings to ignoreLogs so we can remove YellowBox.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19813781

fbshipit-source-id: 16c7b3f2cd38cba1901eccb4d5b9a2396a37ba1b
2020-02-18 06:19:46 -08:00
Rick Hanlon 87f1e22434 Deprecate console.disableYellowBox in favor of LogBox.ignoreAllLogs()
Summary:
We're replacing console.disableYellowBox (untyped, global hack, only warnings) with LogBox.ignoreAllLogs() (typed, local method, handles errors and warnings).

Changelog: [General] [Removed] Replace console.disableYellowBox with LogBox.ignoreAllLogs.

Reviewed By: TheSavior

Differential Revision: D19813775

fbshipit-source-id: ffd33ddbca0276a27d23b5b6023a15aef761934e
2020-02-18 06:19:45 -08:00
Rick Hanlon 40646e8418 LogBox - Move images to files
Summary:
Moves the LogBox images from base64 data to files since base64 is not supported everywhere.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D19879323

fbshipit-source-id: 2dc03eebfc712ed863ed76322e133fcad5b00bb4
2020-02-17 08:17:08 -08:00
Spencer Ahrens 71b8ececf9 Add perf markers in XMLHttpRequest
Summary:
ChangeLog: [Both] Adds perf markers for `XMLHttpRequest`s

Makes it easier to see JS-based network operations in performance traces.

Reviewed By: zackargyle

Differential Revision: D19903143

fbshipit-source-id: c5ce60163569e003830d8079cb2b580469d5bd5d
2020-02-17 07:27:37 -08:00
Eli White 6e3389c82b Partial React Sync from 241c4467...349ff315b
Summary:
Includes these commits:

- **[349ff315b](https://github.com/facebook/react/commit/349ff315b )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[General][Changed] - React Native sync for revisions 241c4467...349ff315b

Reviewed By: zackargyle

Differential Revision: D19893829

fbshipit-source-id: 77f35d6b7a0ddf375941c3185decf3862b6807a7
2020-02-13 19:45:08 -08:00
Eli White 8293e4c301 Remove ReactNative.NativeComponent from React Native
Summary:
This class is no longer used by the core and thus can be removed.

It isn't exposed as part of our public API so this is technically not a breaking change, although it may still cause people trouble if they are reaching into internals. It is expected that people will use forwardRef instead of this class.

I will follow up this diff with a removal from the ReactNativeRenderer as well.

Changelog:
[Internal] Remove ReactNative.NativeComponent from React Native

Reviewed By: JoshuaGross

Differential Revision: D19888400

fbshipit-source-id: 78da51e6c0edf9d8706395d376c3bfe75dabda03
2020-02-13 15:08:27 -08:00
Adam Ernst bcc62a6d17 Clean up misc references to ComponentScript
Summary:
ComponentScript is defunct.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: yungsters

Differential Revision: D19883555

fbshipit-source-id: 4459e42518468086489bb5d1470a38710423656a
2020-02-13 14:29:02 -08:00
Jason Safaiyeh 04fed6508b Resolve React-RCTText Xcode warning (#28054)
Summary:
Resolve React-RCTText warning: `'UIKeyboardTypeASCIICapableNumberPad' is only available on iOS 10.0 or newer`

## Changelog

[iOS] [Fixed] - Resolve React-RCTText Xcode warning
Pull Request resolved: https://github.com/facebook/react-native/pull/28054

Test Plan: Build template, React-RCTText should no longer throw a warning.

Differential Revision: D19887063

Pulled By: hramos

fbshipit-source-id: 3437ee993babd7cdaec259af24526e197acb64bb
2020-02-13 12:45:08 -08:00
Dan Abramov aa41fd5e37 React Native sync for revisions 19f6fe1...241c446
Summary:
This sync includes the following changes:
- **[57333ca33](https://github.com/facebook/react/commit/57333ca33 )**: Show first component stack in context warning (#17922) //<Dan Abramov>//
- **[cf0081263](https://github.com/facebook/react/commit/cf0081263 )**: Upgrade to jest 25 (#17896) //<Simen Bekkhus>//
- **[6faf6f5eb](https://github.com/facebook/react/commit/6faf6f5eb )**: Update to flow 0.97 (#17892) //<Nicolas Gallagher>//
- **[81e30c7ff](https://github.com/facebook/react/commit/81e30c7ff )**: Remove unused modules from legacy event responders (#17907) //<Nicolas Gallagher>//
- **[3c713d513](https://github.com/facebook/react/commit/3c713d513 )**: chore: update to latest release of babel (#17897) //<Simen Bekkhus>//
- **[3b3decf87](https://github.com/facebook/react/commit/3b3decf87 )**: add warning when owner and self are different for string refs (#17864) //<Luna Ruan>//
- **[6c00c5bba](https://github.com/facebook/react/commit/6c00c5bba )**: Update to flow-bin@0.89 (#17842) //<Nicolas Gallagher>//
- **[cf7a0c24d](https://github.com/facebook/react/commit/cf7a0c24d )**: Remove dynamic GKs for selective/train (#17888) //<Sebastian Markbåge>//
- **[c322f5913](https://github.com/facebook/react/commit/c322f5913 )**: Add unstable_renderSubtreeIntoContainer and unstable_createPortal feature flags (#17880) //<Dominic Gannaway>//
- **[f2fd484af](https://github.com/facebook/react/commit/f2fd484af )**: Add React.createFactory() deprecation warning (#17878) //<Dominic Gannaway>//
- **[0c04acaf8](https://github.com/facebook/react/commit/0c04acaf8 )**: Remove FB specific build (#17875) //<Sebastian Markbåge>//
- **[9fd760ce7](https://github.com/facebook/react/commit/9fd760ce7 )**: Add disable <textarea/> children flag (#17874) //<Dominic Gannaway>//
- **[a209a97ed](https://github.com/facebook/react/commit/a209a97ed )**: Add feature flag around React.createFactory (#17873) //<Dominic Gannaway>//
- **[95bd7aad7](https://github.com/facebook/react/commit/95bd7aad7 )**: Remove renderPhaseUpdates Map (#17625) //<Andrew Clark>//
- **[b43b36dd9](https://github.com/facebook/react/commit/b43b36dd9 )**: Remove ReactInstanceMap_DO_NOT_USE shim (#17861) //<Dominic Gannaway>//
- **[9e075d16b](https://github.com/facebook/react/commit/9e075d16b )**: [react-interactions] Remove deprecated Scope APIs + update Focus components/docs (#17859) //<Dominic Gannaway>//
- **[b6173e643](https://github.com/facebook/react/commit/b6173e643 )**: [react-interactions] Add DO_NOT_USE to Scope methods (#17835) //<Dominic Gannaway>//
- **[f4ca909e0](https://github.com/facebook/react/commit/f4ca909e0 )**: react-refresh@0.7.2 //<Dan>//
- **[255d9ac5f](https://github.com/facebook/react/commit/255d9ac5f )**: [Fresh] Fix edge case with early function call (#17824) //<Dan Abramov>//
- **[d8570ec6e](https://github.com/facebook/react/commit/d8570ec6e )**: Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164) //<Emily>//
- **[5d6129b5d](https://github.com/facebook/react/commit/5d6129b5d )**: Update ReactSuspenseList-test.internal.js (#17034) //<Ganapati V S>//
- **[3ac81a57f](https://github.com/facebook/react/commit/3ac81a57f )**: Update create-react-app note for eslint-plugin-react-hooks (#16982) //<Tao>//
- **[e70672149](https://github.com/facebook/react/commit/e70672149 )**: Update Flow to 0.84 (#17805) //<Dan Abramov>//
- **[b979db4e7](https://github.com/facebook/react/commit/b979db4e7 )**: Bump Prettier (#17811) //<Dan Abramov>//

Changelog:
[General][Changed] - React Native sync for revisions 19f6fe1...241c446

Reviewed By: yungsters

Differential Revision: D19623180

fbshipit-source-id: 3cdecb33aa66dfc21a2b347bf7f63a5b27fcf6ea
2020-02-12 14:07:48 -08:00
Josh Leibsly ca431c2179 Remove product/platform/infra layers from ios supermodules
Summary:
Context: https://fb.workplace.com/groups/2116332615111503/permalink/2773825422695549/

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review
allow-large-files
allow_many_files

Differential Revision:
D19858113
Ninja: master broken

fbshipit-source-id: d9e531f9579bfe7ef87097f0d50512722eb1de5e
2020-02-12 10:25:27 -08:00
Michel Weststrate ffb82cb2f0 Make sure exceptions and console.errors are send to metro
Summary: changelog: [General] `console.error` calls, and uncaught exceptions are now displayed in the Metro logs as well

Reviewed By: passy

Differential Revision: D19743075

fbshipit-source-id: a665a06cfc7854ae785af177af8f2478bb1d76b0
2020-02-12 08:27:04 -08:00
Lukas Weber 0d4b0e9417 Fixes RCTReconnectingWebSocket connecting in infinite loop when stopped before it connects (#26864)
Summary:
When `[RCTReconnectingWebSocket stop]` is called and `[RCTReconnectingWebSocket  reconnect]` is scheduled afterwards (i.e. connection didn't happen before `[RCTReconnectingWebSocket stop]` being invoked), it will keep reconnecting forever.

Also fixes retain loop in block within `[RCTReconnectingWebSocket  reconnect]`. When RCTReconnectingWebSocket is stopped and reference to it set to nil, block in reconnect will still keep self alive and reconnecting forever.

I found this edge case when I tried to stop RCTPackagerConnection after some time, so it doesn't spam with `[] nw_socket_handle_socket_event [C34585.1:1] Socket SO_ERROR [61: Connection refused]` when we don' have Metro running (we have brownfield app, so iOS devs don't need Metro running most of the time).

## Changelog
[iOS] [Fixed] -  RCTReconnectingWebSocket is reconnecting infinitely when stopped before getting connected
Pull Request resolved: https://github.com/facebook/react-native/pull/26864

Test Plan:
- Put breakpoint into `[RCTReconnectingWebSocket  reconnect]`
- Start sample RN app **without having Metro running**
- Into AppDelegate add something like
```objc
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
   [RCTPackagerConnection.sharedPackagerConnection stop]
});
```
- After the previous block is dispatched reconnect should not be invoked anymore

Reviewed By: motiz88

Differential Revision: D19767742

Pulled By: rickhanlonii

fbshipit-source-id: dabb2369b06217b961e9d2611257c106d350f70c
2020-02-11 10:54:39 -08:00
Kacie Bawiec 10254a900a Add innerViewRef prop to ScrollView
Summary:
Right now, people are calling `getInnerViewNode` and `getInnerViewRef` to get the ref of the `View` within `ScrollView`. Instead, this change adds a prop to `ScrollView` to give people direct access to that `View` if they need it.

Previous usage:
```
const myRef = React.createRef<React.ElementRef<typeof ScrollView>>();

<ScrollView ref={myRef} />

const innerViewRef = myRef.current.getInnerViewRef();

innerViewRef.measure();

```

New usage:
```
const myRef = React.createRef<React.ElementRef<typeof View>>();

<ScrollView innerViewRef={myRef} />

// now, myRef.current can be used directly as the ref
myRef.current.measure();
```

Changelog:
[Changed][General] ScrollView: Deprecate getInnerViewNode and getInnerViewRef methods. Use innerViewRef={myRef} prop instead.

Reviewed By: TheSavior

Differential Revision: D19713191

fbshipit-source-id: 3304cb94a253dafb458ef49d6331e0e432693431
2020-02-11 10:39:24 -08:00
Jesse Katsumata 9f8e4accfa chore: add description for rejectResponderTermination prop (#28001)
Summary:
Added description for rejectResponderTermination prop for the TextInput, which seemed to have been deleted.
Descriptions are taken from https://github.com/facebook/react-native/pull/16755/files

## Changelog

[Internal] [Added] - Add description for rejectResponderTermination prop for TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/28001

Test Plan: This PR only changes comment, which has no effect on actual function.

Differential Revision: D19820886

Pulled By: TheSavior

fbshipit-source-id: 5cbaafcbae0bdbf6932ef9c7c0c1a75cd6d8794e
2020-02-10 14:48:50 -08:00
Jesse Katsumata 3f5c42f357 fix: prop name for passwordRules (#27999)
Summary:
There was a typo in passwordRules prop for TextInput.

ref:
https://github.com/facebook/react-native/blob/master/ReactCommon/fabric/components/textinput/iostextinput/propsConversions.h#L106-L110
https://github.com/facebook/react-native/blob/master/Libraries/Components/TextInput/RCTSinglelineTextInputViewConfig.js#L126

## Changelog

[iOS] [Fixed] - Fix prop name of passwordRules in TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/27999

Test Plan: run `flow` type check with TextInput that has `passwordRules` in the prop.

Differential Revision: D19805819

Pulled By: TheSavior

fbshipit-source-id: a59729c466eb3f47675c7f1472bec269d6c3ed5d
2020-02-10 11:11:52 -08:00
Samuel Susla fb8f5ea07f Implement setTextAndSelection as view command in TextInput
Summary: Changelog: Add view command `TextInput.setTextAndSelection`

Reviewed By: JoshuaGross

Differential Revision: D19789675

fbshipit-source-id: 8eb19bd21b1e153c9639507016a9f452c5f835b0
2020-02-07 14:10:28 -08:00
Samuel Susla 111f04ff11 Implement setMostRecentEventCount as view command
Summary: Changelog: Add view command `TextInput.setMostRecentEventCount`

Reviewed By: JoshuaGross

Differential Revision: D19789587

fbshipit-source-id: a52456cf5d39e25c730bbb2840009220b2242f87
2020-02-07 14:10:28 -08:00
Paige Sun edfdafc7a1 Resolve and reject promise for PushNotificationIOS.requestPermissions
Summary:
**Resolve/Reject Promise**
* Add onFulfill and onReject to the `PushNotificationIOS.requestPermissions()` Promise

**Replace Apple-deprecated notification method**
* Old: In iOS 10, `UIApplication.registerUserNotificationSettings` was deprecated. Calling this would then call the AppDelegate's lifecycle function `didRegisterUserNotificationSettings`, and then in the AppDelegate, we'd call `RCTPushNotificationManager.didRegisterUserNotificationSettings` to return the user settings.
[registerusernotificationsettings Doc](https://developer.apple.com/documentation/uikit/uiapplication/1622932-registerusernotificationsettings?language=objc)

* New: Replace deprecated function with Apple's recommended `UNUserNotificationCenter.currentNotificationCenter getNotificationSettingsWithCompletionHandler`, which no longer needs the AppDelegate lifecycle method because it directly returns the user's settings in a completion hander.
[requestauthorizationwithoptions Doc](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649527-requestauthorizationwithoptions?language=objc)

**Add Tests**
* Add tests on `PushNotificationIOSExample.js` to test that the onFulfill and onReject are called
* On `PushNotificationIOSExample.js`, instead of asking permission upon page load, ask for permission when the user taps the button "Request Notifications (Should Display Alert)".
* Before, asking for permission multiple times before would result in the RN error "cannot call requestPermissions twice before the first has returned", now you can ask for permission as many times as you want because I've removed the now unused `RCTPromiseResolveBlock`.

**Future**
If this works on device (we have to land this to test push on device), we can delete `RTCPushNotificationManager.didRegisterUserNotificationSettings` which is being called from several apps.

Changelog:
[iOS] [Added]  Resolve and reject promise for PushNotificationIOS.requestPermissions

Reviewed By: PeteTheHeat

Differential Revision: D19700061

fbshipit-source-id: 02ba815787efc9047f33ffcdfafe962b134afe6d
2020-02-07 08:50:26 -08:00
Valentin Shergin ed11a12a7c Revert D19235758: Implement onRequestClose for iOS 13+ modals
Differential Revision:
D19235758

Original commit changeset: c0f1d946c77c

fbshipit-source-id: c4a9d7876aa8d07ff5b8419f097b02e9c28e2880
2020-02-06 14:45:42 -08:00
Eli White 1e9db7bd6d Remove animated prop
Summary:
This prop was deprecated in April 2016 in [this commit](2bb1c263db (diff-931cea019b5e9faceffef4e46f1fff08)), first in 0.26.0

It's been a while, we can remove it now.

Changelog:
[Breaking][General] Modal: Remove support for `aniamted` prop (deprecated in 0.26)

Reviewed By: cpojer

Differential Revision: D19762163

fbshipit-source-id: b6173bba066fc9ad0e786f56a946e2f3fa3d79cc
2020-02-06 12:45:09 -08:00
Pieter De Baets 13d8f4848e Stub out callFunctionReturnResultAndFlushedQueue
Summary: Changelog: [Internal] Remove unused BatchedBridge.callFunctionReturnResultAndFlushedQueue

Reviewed By: cpojer

Differential Revision: D19765606

fbshipit-source-id: d639e76c48113060013f9e858a669d8b1e4d20e7
2020-02-06 03:35:32 -08:00
Eli White a26d622d04 Remove deprecated support for Alert.prompt with type as Callback
Summary:
This functionality was deprecated in [this commit](e2bd7db732) on Feb 12th, 2019, originall in 0.59.0

Changelog:
[Breaking][General] Alert: Remove deprecated support for Alert.prompt with type as Callback (deprecated in 0.59)

Reviewed By: cpojer

Differential Revision: D19762618

fbshipit-source-id: a8edb6045bbc57d56e75fd281e602f5370ba1810
2020-02-06 02:02:31 -08:00
Eli White 26912bd979 Delete thumbTintColor, tintColor, onTintColor props
Summary:
Deprecations for these props were added in 0.57, June 2018, in this commit: 965adee109 (diff-6ee4e62c750fcd87064f152f53214a05), with warnings added in 9a4fd6b78d (diff-6ee4e62c750fcd87064f152f53214a05)

It has been a couple releases now, so let's clean up the component code and finally remove support.

For instructions on how to migrate off these props, see the commit summary of 965adee109 (diff-6ee4e62c750fcd87064f152f53214a05)

Changelog:
[Breaking][General] Switch: Remove support for thumbTintColor, tintColor, onTintColor props (deprecated in 0.57)

Reviewed By: cpojer

Differential Revision: D19760913

fbshipit-source-id: 8fdcf7af99fecadecf3157c00e6d1cbab8e63268
2020-02-06 01:58:00 -08:00
Jorge Bernal 8e5fac89bb Implement onRequestClose for iOS 13+ modals (#27618)
Summary:
Starting on iOS 13, a View Controller presented modally will have a "bottom sheet" style unless it's explicitly presented full screen.

Before this, modals on iOS were only being dismissed programatically by setting `visible={false}`. However, now that the dismissal can happen on the OS side, we need a callback to be able to update the state.

This PR reuses the `onRequestClose` prop already available for tvOS and Android, and makes it work on iOS for this use case.

Should fix https://github.com/facebook/react-native/issues/26892

## Changelog

[iOS] [Added] - Add support for onRequestClose prop to Modal on iOS 13+
Pull Request resolved: https://github.com/facebook/react-native/pull/27618

Test Plan:
I tested this using the RNTester app with the Modal example:

1. Select any presentation style other than the full screen ones
2. Tap Present and the modal is presented
3. Swipe down on the presented modal until dismissed
4. Tap Present again and a second modal should be presented

![Screen Recording 2019-12-26 at 14 05 33](https://user-images.githubusercontent.com/8739/71477208-0ac88c80-27e9-11ea-9342-8631426a9b80.gif)

Differential Revision: D19235758

Pulled By: shergin

fbshipit-source-id: c0f1d946c77ce8d1baab209eaef7eb64697851df
2020-02-05 21:42:17 -08:00
Eli White f555202531 Make JS Animated Driver use forceUpdate in Fabric for list components
Summary:
List components aren't host components so checking if the direct component itself's internals isn't sufficient to know if we are in Fabric. For lists, we have to call through some helper functions to get to the host component.

Hopefully we will fix this in the future by making the lists use forwardRef, or by getting rid of the JS Driver altogether, but for now, this is fine (TM).

Changelog: Internal

Reviewed By: mdvacca

Differential Revision: D19731067

fbshipit-source-id: 0e73583c6bf7c10de30e668a390d29718d31b295
2020-02-05 18:38:28 -08:00
Pieter De Baets 46dcce0031 Remove unused callFunctionReturnResultAndFlushedQueue
Summary: Changelog: [Internal] Remove unused BatchedBridge.callFunctionReturnResultAndFlushedQueue

Reviewed By: sammy-SC

Differential Revision: D19740946

fbshipit-source-id: 9919d52074180d0fcfb7c0929005f0d925578912
2020-02-05 13:02:06 -08:00
Peter Argany 5ad964ba3e Disable animations in bridgeless mode
Summary:
Bridgeless mode requires all native modules to be turbomodules. The iOS animated module was converted to TM, but reverted due to perf issues. RSNara is looking into it, but it may be an involved fix. As a short term workaround, to unblock release mode testing of bridgeless mode, use `AnimatedMock`.

Changelog: [Internal] Disable animations in bridgeless mode

Reviewed By: RSNara

Differential Revision: D19729827

fbshipit-source-id: e6c4d89258ec23da252c047b4c67c171f7f21c25
2020-02-04 15:30:54 -08:00
Spencer Ahrens b7bc31a305 Cleanup StaticContainer a bit
Summary:
React is way better than it used to be...

Changelog: [Internal]

Reviewed By: zackargyle, lunaleaps

Differential Revision: D19421772

fbshipit-source-id: db82b68a0c2f31e9ef7e1875fd9e4bf27ef6295a
2020-02-04 13:54:27 -08:00
Yuanzhe Bian 484f62a71f Add hybrid scene tracker
Summary:
## This diff

- Add a hybird scene tracker that support both native navigation and js navigation
- It also has a filter that bypass loading routes and unrelated routes like log box
- The tracker can provide exactly what surface user is looking at

Changelog: [Internal]

Differential Revision: D19667699

fbshipit-source-id: 600efd05e68bf2702c6c2b1d794e720059f75f81
2020-02-03 18:46:38 -08:00
Emily Janzer bc210c03be Enable JS view configs for ViewNativeComponent in bridgeless mode
Summary:
All of our other JS view configs are gated by the `RN$Bridgeless` flag. This one has been behind a DEV flag instead. We've been using it in DEV for a long time now, so it's probably ok to be in prod, but I figured it's better to just be consistent with the rest of the native components, since we only need this for bridgeless.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19669902

fbshipit-source-id: bd28cf84947bfe298efd95ae07e38c2bf4e45091
2020-02-03 11:38:31 -08:00
Moti Zilberman ee01be3462 Fix indentation of inline snapshots in tests
Summary:
This diff regenerates all Jest inline snapshots (`expect().toMatchInlineSnapshot()`) now that we use Jest 24.9.0 which fixes a longstanding [formatting instability bug](https://github.com/facebook/jest/issues/8424).

This is strictly a formatting change.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D19684238

fbshipit-source-id: 77c1e5fe9d2dfef85dffdcc00056fb439d7d7f84
2020-02-03 03:19:10 -08:00
Janic Duplessis 7deeec7396 Fix resolving assets outside of the project root (#27932)
Summary:
When an asset is outside of the metro project root, it can lead to relative paths like `/assets/../../node_modules/coolpackage/image.png` as the `httpServerLocation`. This can happen for example when using yarn workspaces with hoisted node_modules.

This causes issues when bundling on iOS since we use this path in the filesystem. To avoid this we replace `../` with `_` to preserve the uniqueness of the path while avoiding these kind of problematic relative paths. The same logic is used when bundling assets in the rn-cli.

CLI part of this PR: https://github.com/react-native-community/cli/pull/939

## Changelog

[General] [Fixed] - Fix resolving assets outside of the project root
Pull Request resolved: https://github.com/facebook/react-native/pull/27932

Test Plan: Tested that an asset in a hoisted node_modules package doesn't show up before this patch and does after in a release build.

Differential Revision: D19690587

Pulled By: cpojer

fbshipit-source-id: 8a9c68af04594ce1503a810ecf2e97ef5bfb8004
2020-02-03 03:15:56 -08:00
Janic Duplessis 6adba409e6 Implement TextInput autoFocus natively on iOS (#27803)
Summary:
This implement the autoFocus functionality natively instead of calling the focus method from JS on mount. This is needed to properly fix the issue described in https://github.com/facebook/react-native/issues/27217, where when using native navigation (UINavigationController) text input focus needs to happen in the same frame transition starts or it leads to an animation bug in UIKit.

My previous attempt fixed the problem only partially and the bug could still happen since there is no guaranty code executed in useEffect will end up in the same frame as the native view being created and attached.

To fix this I added an autoFocus prop to the native component on iOS and in didAttachToWindow we focus the input if it is set. This makes sure the focus is set in the same frame as the view hierarchy containing the input is created.

## Changelog

[iOS] [Fixed] - Add native support for TextInput autoFocus on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/27803

Test Plan:
- Tested that the UI glitch when transitionning to a screen with an input with autofocus no longer happens in my app.
- Tested that autofocus still works in RNTester
- Made sure that onFocus does get called and TextInputState is updated properly

Differential Revision: D19673369

Pulled By: TheSavior

fbshipit-source-id: 14d8486ac635901622ca667c0e61c75fb446e493
2020-01-31 21:56:18 -08:00
Mackenzie Mance 6a4e06faa8 Allow zIndex to useNativeDriver (#27418)
Summary:
STYLES_WHITELIST
+zIndex
Pull Request resolved: https://github.com/facebook/react-native/pull/27418

Test Plan: Working on sim and device.

Differential Revision: D19644753

Pulled By: shergin

fbshipit-source-id: 9a3516f65de7011f7e91587e62153e083504d283
2020-01-30 22:15:41 -08:00
Peter Argany e1b8c954ef Add a hand-written JS view config for RCTSinglelineTextInputView
Summary: `requireNativeComponent` redboxes in bridgeless mode because there is no UIManager. This adds a handwritten view config to avoid using UIManager.

Reviewed By: ejanzer

Differential Revision: D19624044

fbshipit-source-id: 5ae68f63068a131a305754003154ee0cf0f1be46
2020-01-30 15:30:11 -08:00
Arthur Kushka 6a00a5deab Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android
Summary:
In case when Platform is different from Android or iOS, ScrollView initialised RCTScrollView two times, which caused a crash. It looks for me that default option is obsolete and can be united with iOS one to fix this issue.

## Changelog:
[Internal] [Fixed] - Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android

Reviewed By: ejanzer

Differential Revision: D19623046

fbshipit-source-id: 84f8a46ea24b463aa6aae761f4386ab7e4e95f9b
2020-01-29 12:52:34 -08:00
Peter Argany 0d968fd7dc Ignore deprecatedPropType in bridgeless mode
Summary:
This validate function uses the `UIManager.getViewManagerConfig` API to verify if props are supported. Bridgeless mode doesn't support UIManager APIs.

It seems like these `deprecatedPropType` will be removed eventually, so let's ignore it in bridgeless.

Changelog: [Internal] Ignore deprecatedPropType in bridgeless mode

Reviewed By: ejanzer

Differential Revision: D19603819

fbshipit-source-id: 2c744705be8821cc6a9d8daaac3e652987447e4d
2020-01-29 12:02:48 -08:00
Rick Hanlon 044991a93f LogBox - Add build version and open in browser
Summary:
Adds build version and an onPress for the build info.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D19334440

fbshipit-source-id: b201b630086179faca31a08c62019a2019cedf4f
2020-01-29 06:23:26 -08:00
Jesse Katsumata 5b8f4ef195 Clear some lint warnings (#27893)
Summary:
Applied linting for warnings that seemed trivial.

## Changelog

[Internal] [Fixed] - clear lint warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/27893

Test Plan: yarn lint

Differential Revision: D19619569

Pulled By: cpojer

fbshipit-source-id: f9f02838c56e94abc1590686c8443c6c6e6f44ca
2020-01-29 04:36:28 -08:00
Spencer Ahrens f0dafd34fe Export LayoutAnimationConfig type
Summary:
Can be handy for general animation components, like `FancySuspense`.

ChangeLog:
[General][Added] Export LayoutAnimationConfig flow type

Reviewed By: zackargyle, TheSavior

Differential Revision: D19345668

fbshipit-source-id: 26178d1eb0b6f710f652bf82c8095dec5bf5afbd
2020-01-28 17:10:30 -08:00
Eli White 9cc920be2f Pressability: Support Rect or Numeric Size
Summary:
Introduces `Rect`, an (eventual) replacement for `EdgeInsetsProp`.

This new type is then used in `Pressability` to expand support such that `hitSlop` and `pressRectOffset` can be either a `Rect` or a numeric size.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18742616

fbshipit-source-id: 13dd360f68ab804839938fc950fa2f4b25d3ed8c
2020-01-28 15:14:23 -08:00
Eli White 4bbbe6a5ba Pressability: Create `usePressability` Hook
Summary:
Creates `usePressability`, a hook to simplify using `Pressability` from functional components.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18742613

fbshipit-source-id: 55cf48ad60a16a6a5c2c3fa2785f61f784a46b45
2020-01-28 15:14:23 -08:00
Eli White 4e31fbd39c Pressable: Update ReactTestTools to be able to tab on Pressable
Summary:
This was all yungsters idea. I blame him. :)

Switching Pressable to be a functional component presents a new challenge. ReactNativeTestTools can no longer find its instance because there is no instance Pressable uses forwardRef.

We need a way to both find a pressable, and then call the onPress callback if the pressable isn't also disabled.

So in DEV (and thus test) we add the pressable config to a secret key on a function passed onto View. The TestTools look for this key on this function, and then can call onPress.

Super hacky, but so is all of ReactNativeTestTools. We aren't proud of this.

Changelog:
[General][Changed]: Added support for Pressable to ReactNativeTestTools.tap

Reviewed By: yungsters

Differential Revision: D18849358

fbshipit-source-id: ea8880ceedfc04cda217ee17ba140475d003172c
2020-01-28 15:14:23 -08:00
Mike Vitousek 7bc2b91790 Deploy Flow v0.117.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D19596867

fbshipit-source-id: 3fc2ec51672bb453cec0eb6bf3c522f23cf9cd38
2020-01-28 14:36:44 -08:00
Eloy Durán 25571ec452 Make C++ requirement opt-in (#27730)
Summary:
When building as a framework these headers get automatically added to the framework umbrella header for React-Core. Instead of converting all the React sources to ObjC++ files and still forcing external users that build native source (and link against a framework build) to also compile as ObjC++, this makes the attribution related methods that were added in https://github.com/facebook/react-native/commit/fdcdca4 opt-in to ObjC++ builds.

This is also the reason for the current failure of the CI `test_ios_frameworks` run.

## Changelog

I’m unsure if this change really warrants an entry in the CHANGELOG, as it’s more of an amendment of the (afaik) unreleased [change](https://github.com/facebook/react-native/commit/fdcdca4).

[iOS] [Fixed] - Make framework builds work again by making `RCTImageLoader` C++ requirement opt-in
Pull Request resolved: https://github.com/facebook/react-native/pull/27730

Test Plan:
I tested static and dynamic (framework) builds and ran the test suite.

This change should make the `test_ios_frameworks` CI run _build_ again, ~~but it may still fail overall as in my local testing one of the tests leads to a segfault (which I will try to address separately)~~.

Reviewed By: PeteTheHeat

Differential Revision: D19348846

Pulled By: fkgozali

fbshipit-source-id: 8a74e6f7ad3ddce2cf10b080b9a5d7b399bd5fc0
2020-01-28 13:14:35 -08:00
Moti Zilberman f7c6066425 Log VirtualizedList nesting hierarchy in listKey collision error
Summary:
## Context

When a `VirtualizedList` contains a cell which itself contains more than one `VirtualizedList` of the same orientation as the parent list, we log an error if sibling lists in a cell don't have unique `listKey`s (e.g. when the `listKey` prop isn't explicitly set). In release builds, this error does not have a component stack - nor a useful call stack - so it can be hard to track down the true source of the error in complex applications.

## This diff

Here, in addition to the generic error message, we also print the `listKey`, `cellKey` and orientation of each `VirtualizedList` in the hierarchy, from the child list upwards. This is done without significant overhead, by reusing the already-in-place context that `VirtualizedList`s use to manage nesting.

The assumption is that common strategies for deriving `listKey`s and `cellKey`s will make it possible to identify at least some lists in the hierarchy in common cases, and therefore help narrow down the search space even when component stacks are not available.

## Example

(See code in unit test)

```
A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

VirtualizedList trace:
  Child (horizontal):
    listKey: level2
    cellKey: cell0
  Parent (horizontal):
    listKey: level1
    cellKey: cell0
  Parent (vertical):
    listKey: level0
    cellKey: rootList
```

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19600366

fbshipit-source-id: 73f29507ec58a6a3f9b3f6b174a32b21dcd237a1
2020-01-28 11:34:14 -08:00
Ramanpreet Nara 9a8c06b502 Transform empty responses into empty Blobs
Summary:
In `XMLHttpRequest`, if the responseType is `Blob`, but the response is an empty string, we return `null` from `XMLHttpRequest.prototype.response()`. Instead, we should return an empty Blob. This is the behaviour on the web. To demonstrate, run the following HTTP server with Node:

## server.js
```
const http = require('http');
const server = http.createServer();

server.on('request', (request, response) => {
  if (request.url.includes('img.png')) {
    console.log('sending image');
    response.end('');
    return;
  }

  response.end('Hello World!');
});

server.listen('9000');
```

Then, open up a web browser to `http://localhost:9000`, and type the following in the console:

```
var oReq = new XMLHttpRequest();
oReq.open('GET', 'http://localhost:9000/img.png', true);
oReq.responseType = 'blob';

oReq.onload = function(oEvent) {
  var blob = oReq.response;
  console.warn(blob);
};

oReq.onerror = function(error) {
  console.warn('Error!');
};

oReq.send();
```

This warns:
```
Blob {size: 0, type: "text/xml"}
```

Changelog:
[Both][Fixed] - [RN][XMLHttpRequest] Transform empty responses into empty Blobs

Reviewed By: sahrens

Differential Revision: D19500607

fbshipit-source-id: ec35e534b32a507c8a94a29e955b7bc4c62902a0
2020-01-27 10:27:14 -08:00
Jesse Katsumata 674ac69cee fix: resolve Require Cycle warning (#27851)
Summary:
When I was testing React Native 0.62-rc.1, I noticed that console was showing a warning for Require Cycle as shown in image below

![Screen Shot 2020-01-24 at 12 22 38](https://user-images.githubusercontent.com/6936373/73042467-998dff00-3ea4-11ea-911c-955d55fd0743.png)

This is because ScrollResponder was importing `ScrollView` to get the `typeof ScrollView`.
I've made an export for ScrollView type in `ScrollView` so that Require cycle warning will not show up.

## Changelog

[General] [Fixed] - Remove Require cycle warning.
Pull Request resolved: https://github.com/facebook/react-native/pull/27851

Differential Revision: D19577644

Pulled By: cpojer

fbshipit-source-id: 257b9421a91244d69394375102cfbe683326bba2
2020-01-27 02:04:46 -08:00
Ahmed Ibrahim 5d08aab526 Disable `usesFontLeading` for NSLayoutManager on iOS to fix baseline alignment issue on some fonts (#27195)
Summary:
Fixes https://github.com/facebook/react-native/issues/27137

This PR fixes an issue on iOS where RCTTextView height is not calculated as it should for some fonts where font `leading` attributed is not equal to zero, which results in wrong baseline alignment behaviour.

The fix for this is by setting `usesFontLeading` property of `NSLayoutManager` to `NO`, which results is a layout behavior that is similar to `UILabel`

Probably the documentation for `usesFontLeading` describes why UILabel has a different (correct) layout behavior in that case
> // By default, a layout manager will use leading as specified by the font.  However, this is not appropriate for most UI text, for which a fixed leading is usually specified by UI layout guidelines.  These methods allow the use of the font's leading to be turned off.

## Changelog

[iOS] [Fixed] - Fix RCTTextView layout issue that happens on some font with `leading` attribute not equal to zero, which causes wrong base-alignment layout
Pull Request resolved: https://github.com/facebook/react-native/pull/27195

Test Plan:
Below are the test results before and after the change, and comparing that to native UILabel behavior.

The test is done with using system font and custom font (`GothamNarrow-Medium`) and font size 50

[GothamNarrow-Medium.otf.zip](https://github.com/facebook/react-native/files/3832143/GothamNarrow-Medium.otf.zip)

```js
const App: () => React$Node = () => {
  return (
    <View style={{flex: 1, margin: 40, flexDirection: 'row', justifyContent: 'center', alignItems: 'baseline'}}>
      <View style={{width: 30, height: 30, backgroundColor: 'lightgray'}} />
      <Text style={{fontSize: 50, backgroundColor: 'green', fontFamily: 'GothamNarrow-Medium'}}>{'Settings'}</Text>
    </View>
  );
};
```

-------
### Before the fix

<img width="962" alt="Screenshot 2019-11-11 at 16 53 26" src="https://user-images.githubusercontent.com/5355138/68601049-dd778780-04a3-11ea-879e-cc7b4eb2af95.png">

-----
### After the fix
<img width="944" alt="Screenshot 2019-11-11 at 16 55 11" src="https://user-images.githubusercontent.com/5355138/68601180-1d3e6f00-04a4-11ea-87bc-61c6fa2cdb18.png">

-----
### Using `UILabel`
<img width="805" alt="Screenshot 2019-11-11 at 16 59 28" src="https://user-images.githubusercontent.com/5355138/68601487-b2d9fe80-04a4-11ea-9a0f-c025c7753c24.png">

Differential Revision: D19576556

Pulled By: shergin

fbshipit-source-id: 4eaafdab963c3f53c461884c581e205e6426718a
2020-01-26 19:46:38 -08:00
Nikita Shanin 6237cfb325 disable momentum scrolling for vertical ScrollView (#27666)
Summary:
Following up changes added in https://github.com/facebook/react-native/issues/24045 I had the same use case for vertical ScrollView. This PR just enables existing `disableIntervalMomentum` property to work with vertical ScrollViews: restricts vertical pagination when page height is less than height of ScrollView.

## Changelog

[General] [Changed] - changed property `disableIntervalMomentum` to work with both horizontal and vertical ScrollViews
Pull Request resolved: https://github.com/facebook/react-native/pull/27666

Test Plan:
No new tests at the moment

`iOS`
```
All tests
Test Suite RNTesterUnitTests.xctest started
RCTAllocationTests
    ✓ testBridgeIsDeallocated (0.045 seconds)
    ✓ testContentViewIsInvalidated (0.006 seconds)
    ✓ testModuleMethodsAreDeallocated (0.002 seconds)
    ✓ testModulesAreDeallocated (0.022 seconds)
    ✓ testModulesAreInvalidated (0.017 seconds)
RCTAnimationUtilsTests
    ✓ testClampExtrapolate (0.002 seconds)
    ✓ testExtendExtrapolate (0.002 seconds)
    ✓ testIdentityExtrapolate (0.001 seconds)
    ✓ testManySegments (0.003 seconds)
    ✓ testSimpleOneToOneMapping (0.002 seconds)
    ✓ testWiderInputRange (0.003 seconds)
    ✓ testWiderOutputRange (0.002 seconds)
RCTBlobManagerTests
    ✓ testCreateFromParts (0.002 seconds)
    ✓ testRemove (0.001 seconds)
    ✓ testResolve (0.001 seconds)
    ✓ testResolveMap (0.001 seconds)
    ✓ testResolveURL (0.001 seconds)
RCTBundleURLProviderTests
    ✓ testBundleURL (0.041 seconds)
    ✓ testIPURL (0.005 seconds)
    ✓ testLocalhostURL (0.005 seconds)
RCTComponentPropsTests
    ✓ testNeedsOffscreenAlphaCompositing (0.019 seconds)
    ✓ testResetBackgroundColor (0.008 seconds)
    ✓ testResetProps (0.012 seconds)
    ✓ testSetProps (0.009 seconds)
RCTConvert_NSURLTests
    ✓ test_basic (0.002 seconds)
    ✓ test_documentsFolder (0.001 seconds)
    ✓ test_filePath (0.001 seconds)
    ✓ test_filePathWithEncodedSpaces (0.001 seconds)
    ✓ test_filePathWithSpaces (0.001 seconds)
    ✓ test_fileURL (0.001 seconds)
    ✓ test_fullURL (0.001 seconds)
    ✓ test_imageAt2XPath (0.001 seconds)
    ✓ test_imageFile (0.001 seconds)
    ✓ test_imageURL (0.001 seconds)
    ✓ test_imageURLWithSpaces (0.001 seconds)
    ✓ test_null (0.001 seconds)
    ✓ test_unicodeURL (0.001 seconds)
    ✓ test_urlWithEncodedSpaces (0.001 seconds)
    ✓ test_urlWithSpaces (0.001 seconds)
    ✓ testDataURL (0.003 seconds)
RCTConvert_YGValueTests
    ✓ testNumberPoints (0.002 seconds)
    ✓ testStringPercent (0.002 seconds)
    ✓ testUndefined (0.001 seconds)
RCTDevMenuTests
    ✓ testClosingActionSheetAfterAction (0.009 seconds)
    ✓ testShowCreatingActionSheet (0.017 seconds)
RCTEventDispatcherTests
    ✓ testBasicCoalescingReturnsLastEvent (0.006 seconds)
    ✓ testCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testDifferentEventTypesDontCoalesce (0.001 seconds)
    ✓ testDifferentViewTagsDontCoalesce (0.001 seconds)
    ✓ testLegacyEventsAreImmediatelyDispatched (0.001 seconds)
    ✓ testMultipleEventsResultInOnlyOneDispatchAfterTheFirstOne (0.001 seconds)
    ✓ testNonCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testRunningTheDispatchedBlockResultInANewOneBeingEnqueued (0.001 seconds)
    ✓ testSameEventTypesWithDifferentCoalesceKeysDontCoalesce (0.001 seconds)
RCTFontTests
    ✓ testFamily (0.029 seconds)
    ✓ testFamilyAndStyle (0.001 seconds)
    ✓ testFamilyAndWeight (0.002 seconds)
    ✓ testFamilyStyleAndWeight (0.002 seconds)
    ✓ testInvalidFont (0.002 seconds)
    ✓ testSize (0.001 seconds)
    ✓ testStyle (0.003 seconds)
    ✓ testStyleAndWeight (0.002 seconds)
    ✓ testVariant (0.002 seconds)
    ✓ testWeight (0.002 seconds)
RCTFormatErrorTests
    ✓ testSymbolication (0.002 seconds)
RCTGzipTests
    ✓ testDontRezipZippedData (0.004 seconds)
    ✓ testGzip (0.002 seconds)
    ✓ testRequestBodyEncoding (0.003 seconds)
RCTImageLoaderTests
    ✓ testImageDecoding (0.010 seconds)
    ✓ testImageLoaderUsesImageDecoderWithHighestPriority (0.003 seconds)
    ✓ testImageLoaderUsesImageURLLoaderWithHighestPriority (0.004 seconds)
    ✓ testImageLoading (0.004 seconds)
RCTImageUtilTests
    ✓ testLandscapeSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourcePortraitTarget (0.001 seconds)
    ✓ testRounding (0.001 seconds)
    ✓ testScaling (0.001 seconds)
RCTJSONTests
    ✓ testDecodingArray (0.001 seconds)
    ✓ testDecodingMutableArray (0.001 seconds)
    ✓ testDecodingObject (0.001 seconds)
    ✓ testDecodingString (0.001 seconds)
    ✓ testEncodingArray (0.001 seconds)
    ✓ testEncodingNSError (0.023 seconds)
    ✓ testEncodingObject (0.001 seconds)
    ✓ testEncodingString (0.001 seconds)
    ✓ testErrorPointer (0.002 seconds)
    ✓ testLeadingWhitespace (0.001 seconds)
    ✓ testNaN (0.001 seconds)
    ✓ testNotJSONSerializable (0.001 seconds)
    ✓ testNotUTF8Convertible (0.004 seconds)
RCTMethodArgumentTests
    ✓ testAttributes (0.001 seconds)
    ✓ testGenericArray (0.001 seconds)
    ✓ testGenericDictionary (0.001 seconds)
    ✓ testGenericSet (0.001 seconds)
    ✓ testNamespacedCxxStruct (0.001 seconds)
    ✓ testNestedGenericArray (0.001 seconds)
    ✓ testNewlines (0.001 seconds)
    ✓ testNullability (0.001 seconds)
    ✓ testOneArgument (0.001 seconds)
    ✓ testSemicolonStripping (0.001 seconds)
    ✓ testSpaces (0.001 seconds)
    ✓ testTwoArguments (0.001 seconds)
    ✓ testUnnamedArgs (0.001 seconds)
    ✓ testUntypedUnnamedArgs (0.001 seconds)
    ✓ testUnused (0.001 seconds)
RCTModuleInitNotificationRaceTests
    ✓ testViewManagerNotInitializedBeforeSetBridgeModule (0.009 seconds)
RCTModuleInitTests
    ✓ testCustomInitModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testCustomSetBridgeModuleInitializedAtBridgeStartup (0.006 seconds)
    ✓ testExportConstantsModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testInjectedModulesInitializedDuringBridgeInit (0.003 seconds)
    ✓ testLazyInitModuleNotInitializedDuringBridgeInit (0.005 seconds)
RCTModuleMethodTests
    ✓ testFunctionType (0.001 seconds)
    ✓ testNonnull (0.001 seconds)
    ✓ testNumbersNonnull (0.001 seconds)
    ✓ testReturnsNilForDefaultFunction (0.001 seconds)
    ✓ testReturnsValueForSyncFunction (0.001 seconds)
    ✓ testReturnTypeForSyncFunction (0.001 seconds)
    ✓ testStructArgument (0.001 seconds)
    ✓ testWhitespaceTolerance (0.001 seconds)
RCTMultipartStreamReaderTests
    ✓ testMultipleParts (0.001 seconds)
    ✓ testNoCloseDelimiter (0.001 seconds)
    ✓ testNoDelimiter (0.001 seconds)
    ✓ testSimpleCase (0.001 seconds)
RCTNativeAnimatedNodesManagerTests
    ✓ testAdditionNode (0.002 seconds)
    ✓ testAnimationCallbackFinish (0.001 seconds)
    ✓ testCritcallyDampedSpringAnimation (0.003 seconds)
    ✓ testDecayAnimation (0.004 seconds)
    ✓ testDecayAnimationLoop (0.012 seconds)
    ✓ testFramesAnimation (0.001 seconds)
    ✓ testFramesAnimationLoop (0.002 seconds)
    ✓ testHandleStoppingAnimation (0.002 seconds)
    ✓ testInterpolationNode (0.002 seconds)
    ✓ testMultiplicationNode (0.001 seconds)
    ✓ testNativeAnimatedEventDoNotUpdate (0.001 seconds)
    ✓ testNativeAnimatedEventDoUpdate (0.002 seconds)
    ✓ testNodeValueListenerIfListening (0.001 seconds)
    ✓ testNodeValueListenerIfNotListening (0.001 seconds)
    ✓ testSpringAnimationLoop (0.007 seconds)
    ✓ testSpringTrackingRetainsSpeed (0.007 seconds)
    ✓ testTracking (0.002 seconds)
    ✓ testTrackingPausesWhenEndValueIsReached (0.001 seconds)
    ✓ testUnderdampedSpringAnimation (0.003 seconds)
    ✓ testViewReceiveUpdatesIfOneOfAnimationHasntStarted (0.001 seconds)
    ✓ testViewReceiveUpdatesWhenOneOfAnimationHasFinished (0.001 seconds)
RCTPerformanceLoggerTests
    ✓ testLabelCountInSyncWithRCTPLTag (0.001 seconds)
RCTShadowViewTests
    ✓ testAncestorCheck (0.001 seconds)
    ✓ testApplyingLayoutRecursivelyToShadowView (0.002 seconds)
    ✓ testAssignsSuggestedHeightDimension (0.001 seconds)
    ✓ testAssignsSuggestedWidthDimension (0.001 seconds)
    ✓ testDoesNotAssignSuggestedDimensionsWhenStyledWithFlexAttribute (0.001 seconds)
    ✓ testDoesNotOverrideDimensionStyleWithSuggestedDimensions (0.001 seconds)
RCTUIManagerTests
    ✓ testManagingChildrenToAddRemoveAndMove (0.001 seconds)
    ✓ testManagingChildrenToAddViews (0.001 seconds)
    ✓ testManagingChildrenToRemoveViews (0.001 seconds)
RCTURLUtilsTests
    ✓ testAppendParam (0.001 seconds)
    ✓ testDuplicateParamTakesLatter (0.001 seconds)
    ✓ testGetEncodedParam (0.001 seconds)
    ✓ testGetQueryParam (0.001 seconds)
    ✓ testIsLocalAssetsURLParam (0.001 seconds)
    ✓ testNilURLAppendQueryParam (0.001 seconds)
    ✓ testNilURLGetQueryParam (0.001 seconds)
    ✓ testQueryParamNotFound (0.001 seconds)
    ✓ testRemoveParam (0.001 seconds)
    ✓ testReplaceEncodedParam (0.001 seconds)
    ✓ testReplaceParam (0.001 seconds)
RCTUnicodeDecodeTests
    ✓ testEmojis (0.001 seconds)
    ✓ testNiqqud (0.001 seconds)

         Executed 167 tests, with 0 failures (0 unexpected) in 0.530 (0.667) seconds
```
`Android`
```
PASS      8.4s  7 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedInterpolationTest
PASS     16.7s 23 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedNodeTraversalTest
PASS     13.5s  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.BaseJavaModuleTest
PASS     341ms  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.FallbackJSBundleLoaderTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.JavaOnlyArrayTest
PASS     13.0s 10 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.JSDebuggerWebSocketClientTest
PASS      6.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.MultipartStreamReaderTest
PASS      6.1s  5 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.StackTraceHelperTest
PASS     13.9s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.blob.BlobModuleTest
PASS      6.7s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.camera.ImageStoreManagerTest
PASS      5.2s  1 Passed   0 Skipped   0 Failed   com.facebook.react.modules.clipboard.ClipboardModuleTest
PASS      3.8s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.dialog.DialogModuleTest
PASS    <100ms 10 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.HeaderUtilTest
PASS      3.3s 14 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.NetworkingModuleTest
PASS      1.4s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ProgressiveStringDecoderTest
PASS      1.6s  4 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ReactCookieJarContainerTest
PASS      2.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.modules.share.ShareModuleTest
PASS      5.1s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.storage.AsyncStorageModuleTest
PASS      2.7s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.timing.TimingModuleTest
PASS      9.2s  9 Passed   0 Skipped   0 Failed   com.facebook.react.packagerconnection.JSPackagerClientTest
PASS      7.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.layoutanimation.InterpolatorTypeTest
PASS      8.9s  2 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.BaseViewManagerTest
PASS      6.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.MatrixMathHelperTest
PASS      8.8s  3 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.SimpleViewPropertyTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.util.JSStackTraceTest
PASS      9.5s  1 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ImageResizeModeTest
PASS     15.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ReactImagePropertyTest
PASS      9.2s  4 Passed   0 Skipped   0 Failed   com.facebook.react.CompositeReactPackageTest
PASS      9.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.RootViewTest
```

Differential Revision: D19576473

Pulled By: shergin

fbshipit-source-id: 35a6bce9f7dd3efec0cfcdbb00796852e1a79d6c
2020-01-26 19:10:01 -08:00
Josh Leibsly efc2344868 Rename isolation root to "default" in fbobjc
Summary:
The reason for this change is that it is the primary root that we want people to be using and the naming should reflect that.

#nocancel

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

Changelog: [Internal]

Oncall Short Name: fbobjc_sheriff

Differential Revision: D19431128

fbshipit-source-id: c7208e20ed0f5f5eb6c2849428c09a6d4af9b6f3
2020-01-24 08:26:36 -08:00
Janic Duplessis d72e078df4 Add missing NativeEventListener methods to NativeDevSettings (#27838)
Summary:
Since migrating to Turbomodules (8fe04cf) the addMenuItem method crashes because the NativeEventListener methods are missing from the codegen flow type. Added the same methods based on what we do in AppState which is another native module that extends NativeEventListener.

## Changelog

[Internal] [Fixed] - Add missing NativeEventListener methods to NativeDevSettings
Pull Request resolved: https://github.com/facebook/react-native/pull/27838

Test Plan:
|Before|After|
|{F226978596}|{F226978628}

Differential Revision: D19518474

Pulled By: PeteTheHeat

fbshipit-source-id: acddba9f18dd558df1d6df78b539689fdfd0062f
2020-01-23 13:20:53 -08:00
Pieter De Baets 19362f6116 Fix validation of AnimatedEvent mapping
Summary:
Noticed the _validateMapping call right now is a no-op, as the traverse method is never invoked. We can only really do validation once we've received a sample of an event, and can then verify the values being extracted indeed correspond with a valid key.

Changelog: [General] [Fixed] - Fix validation of event mappings for AnimatedEvent

Reviewed By: cpojer

Differential Revision: D19498971

fbshipit-source-id: e978dda895498a7e567d5e18b3181b319d88d95c
2020-01-23 07:59:29 -08:00
Emily Janzer 4dd93582b6 Add a hand-written JS view config for AndroidTextInput
Summary:
Hand-writing a JS view config for AndroidTextInputNativeComponent.

This diff was generated by adding logging to `getNativeComponentAttributes`. Diff preview: https://our.intern.facebook.com/intern/diff/view-version/96875488/

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19456328

fbshipit-source-id: b2d5abd2fde380be182b95881c335d24481343f1
2020-01-22 14:12:22 -08:00
Samuel Susla 6449cc4363 Implement setMostRecentEventCount and setTextAndSelection commands in TextInput
Summary:
Implements JS interface and commands in native, however it isn't connected anywhere.
Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19471025

fbshipit-source-id: 7ec53c04b38cb27b84ef06dea7a0fdb9e1deee60
2020-01-22 05:12:11 -08:00
Kudo Chien a27e31c059 Upgrade Folly to v2020.01.13.00 (#27810)
Summary:
Upgrade Folly to v2020.01.13.00. Fixes https://github.com/facebook/react-native/issues/27640

## Changelog

[iOS] [Changed] - Upgrade Folly to v2020.01.13.00
Pull Request resolved: https://github.com/facebook/react-native/pull/27810

Test Plan: Test by building and running RNTester

Reviewed By: mdvacca

Differential Revision: D19483115

Pulled By: fkgozali

fbshipit-source-id: 4a85325a95b5f7857da75995d587218740d8b077
2020-01-21 12:44:00 -08:00
Samuel Susla 7a8e10dac8 Use commands to send focus and blur to TextInput
Summary:
Migrate to Native commands with Blur and Focus on TextInput.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412085

fbshipit-source-id: 33b29b2699bc74d31ef1b4b0e585daffd88c4140
2020-01-20 03:08:23 -08:00
Samuel Susla f43c9316e1 Add blur and focus native commands to TextInput
Summary:
Add Native Commands handlers to TextInput.
It is intentionally done in a way so that it can be easily swapped for codegened implementation once we properly type TextInput.

We also add native commands to view managers for backwards compatibility.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412026

fbshipit-source-id: 8dc64275cf1da599b1bd5992a41035d51dd4148f
2020-01-20 03:08:23 -08:00
Rajat Gupta 9457efa84c Always update background color and bar style on Android status bar
Summary: Changelog: [Fix] Fix status bar color not updating when navigating between two screens with the same status bar color.

Reviewed By: RSNara

Differential Revision: D19439424

fbshipit-source-id: 44388f1f94c87c12102471d72183bb6c152a46b6
2020-01-17 16:14:57 -08:00
Samuel Susla dd476d0506 Run rn-native-modules/specs/update_oss to stop tests from failing
Summary:
Changelog: [Internal]

Fix following test failure

```
Date: 2020-01-17 07:18:10.533721
Step JSON: {"name": "Test: Verify OSS NativeModules Specs for iOS are up-to-date.", "continue_after_user_failure": true, "timeout": 3600, "shell": "cd \"$(hg root)/xplat/js\" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios", "env": {}}
Command: cd "$(hg root)/xplat/js" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios
Exit code: 1
Stdout:
Building OSS NativeModule Specs - platform: ios...
Stderr:
Starting new Buck daemon...
Using additional configuration options from .buckconfig.local, /etc/buckconfig.d/sandcastle
PARSING BUCK FILES: FINISHED IN 5.9s
CREATING ACTION GRAPH: FINISHED IN 0.1s
DOWNLOADED 0 ARTIFACTS, 0.00 BYTES, 0.0% CACHE MISS
BUILDING: FINISHED IN 8.5s (100%) 1/1 JOBS, 1 UPDATED
Top slow rules
    //xplat/js:FBReactNativeSpec-flow-types-ios: 0.1s
BUILD SUCCEEDED
More details at https://our.intern.facebook.com/intern/buck/build/d68bbc08-49cf-4ef5-8eba-51d79bea09ba
Error: Spec files are not up-to-date, please re-run 'js1 build oss-native-modules-specs -p ios'!
    at main.then.updated (/data/sandcastle/boxes/trunk-hg-fbobjc-fbsource/xplat/js/scripts/rn-native-modules/specs/update-specs.js:96:15)
```

I ran `js1 build oss-native-modules-specs -p ios` to fix it.

Reviewed By: PeteTheHeat

Differential Revision: D19450371

fbshipit-source-id: 0957298ad70ad3e8feca96622cd29ed223438961
2020-01-17 11:21:56 -08:00
Nat Mote c40988cc22 Deploy Flow v0.116 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D19416307

fbshipit-source-id: 32767f24e5bfeb1912f7dd5527eb8c4db7a08a1a
2020-01-16 14:05:49 -08:00
Kevin Gozali 58a6a40eac Re-land [RN] iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
Re-landing the reverted change:

This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: sammy-SC

Differential Revision: D19411136

fbshipit-source-id: ec0a957dc57819f0ee7d138c858209cabe3e5102
2020-01-15 09:23:30 -08:00
Jiawei Lv f11937ef65 Revert D19271321: iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Differential Revision:
D19271321

Original commit changeset: 424ad7e21612

fbshipit-source-id: 2bd9599e8fb31914dbcbc03f732379d6c8103028
2020-01-14 21:43:08 -08:00
Kevin Gozali d3e81d5832 iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: hramos

Differential Revision: D19271321

fbshipit-source-id: 424ad7e2161261d148cb436cc20b4c531a4ba5b7
2020-01-14 18:23:49 -08:00
Nate Stedman 644eb0a961 Revert D19400656: Revert D19377037: [fb_apple_library][codemod][12/12] Add extension API parameters to libraries
Differential Revision:
D19400656

Original commit changeset: 57deddfd6006

fbshipit-source-id: 5271e9faa002ff64508d8e52d0c60bf7a362ff02
2020-01-14 15:27:31 -08:00
Shubho Sadhu 89823c944b Revert D19377037: Add extension API parameters to libraries
Differential Revision:
D19377037

Original commit changeset: 3026a3400570

fbshipit-source-id: 57deddfd6006c6d171a005f4dd35e1d1df30de64
2020-01-14 14:45:39 -08:00
Ramanpreet Nara 7e3a43c23d Fix NativeJSCHeapCapture
Summary:
In D15393464, we introduced `NativeHeapCapture`, but it had a few problems:
1. It required `JSCHeapCapture` by doing `TurboModuleRegistry.get<Spec>('HeapCapture')`, when it should have done `TurboModuleRegistry.get<Spec>('JSCHeapCapture')`.
2. It had an additional method `captureHeap`, which didn't exist on the Android NativeModule.

This diff corrects those mistakes.

Changelog:
[Both][Fixed] - Fix JSCHeapCapture

Reviewed By: PeteTheHeat

Differential Revision: D19383511

fbshipit-source-id: 30e69afbcdba673f3f32c16bde4f0342568ab97d
2020-01-14 08:03:49 -08:00
Oleksandr Melnykov e848b0036d Use commands instead of setNativeProps for PickerAndroid
Summary:
Fabric doesn't support setNativeProps, so we are using view commands instead.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18044169

fbshipit-source-id: d5f199b930244d02f174ea8a7ef732e9a8ef2476
2020-01-14 03:57:28 -08:00
Oleksandr Melnykov 1e6e37a3a8 Use commands instead of setNativeProps for AndroidSwipeRefreshLayout
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the RefreshControl component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18475450

fbshipit-source-id: ad89547fada3444f725fd9b00e8482cfc8f4d7fc
2020-01-14 03:53:57 -08:00
Oleksandr Melnykov 461d68e656 Use commands instead of setNativeProps for CheckBox
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the Checkbox component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18451749

fbshipit-source-id: 49d786ef3383df95b10260ba2b7f68489ad31789
2020-01-14 03:44:25 -08:00
Nate Stedman 8d57691a60 Add extension API parameters to libraries
Summary: Changelog: [Internal]

Differential Revision: D19377037

fbshipit-source-id: 3026a34005707fb371df60eaacd142988b012751
2020-01-13 23:26:15 -08:00
Christoph Nakazawa 35c6bb9ac0 Only set dimensions if the window attributes change
Differential Revision: D19386339

fbshipit-source-id: b7f14c540ceec40cae0c4eb9fc93f2020a6ee16f
2020-01-13 23:26:14 -08:00
Valentin Shergin 41557966b5 Fabric: <TextInput> component on iOS: RCTTextInputUtils
Summary:
RCTTextInputUtils contains a bunch of conventions and convenience functions that we use in TextInput.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D19226658

fbshipit-source-id: df72dcdc052b96b6daef2cc0839235761005d914
2020-01-13 23:22:10 -08:00
Peter Argany 442dd26873 Fix error in RCTImageLoader in bridgeless mode
Summary:
Bridgeless mode hasn't been able to load random images. I was able to repro this 100% with base64 images. Loading these images hits a particular flow in `RCTImageLoader` which relies on the bridge to access `RCTNetworking`. This diff uses the TM Lookup Delegate as a fallback.

Changelog: [iOS][Internal] Fix error in RCTImageLoader in bridgeless mode

Reviewed By: sammy-SC

Differential Revision: D19331467

fbshipit-source-id: 8239ee258425da4ed8cb9f6dcdcd7f37c162eb19
2020-01-13 22:54:16 -08:00
Peter Argany 12f78f145a Fix crash in RCTBlobManager in bridgeless mode
Summary:
When bridge is nil, RCTBlobManager crashes with `EXC_BAD_ACCESS`.

The fix: instead of using the bridge to find RCTNetworking, use TM lookup delegate.

Changelog: [iOS][Internal] Fix crash in RCTBlobManager in bridgeless mode

Reviewed By: mdvacca

Differential Revision: D19320136

fbshipit-source-id: 49aabb3ce53b2ec620fcc02be1c6c1b44066f440
2020-01-13 22:54:16 -08:00
Dan Abramov 159624d901 React Native sync for revisions 6cff70a...19f6fe1
Summary:
This sync includes the following changes:
- **[19f6fe170](https://github.com/facebook/react/commit/19f6fe170 )**: Revert "Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232)" (#17799) //<Eli White>//
- **[6250462be](https://github.com/facebook/react/commit/6250462be )**: Renamed "ReactDOM-fb" imports to "ReactDOM" in www shims (#17797) //<Brian Vaughn>//
- **[59f21f1b2](https://github.com/facebook/react/commit/59f21f1b2 )**: HostText needs to copy over from current if it is unchanged in persistent  mode (#17538) //<Sebastian Markbåge>//
- **[ccc6100d7](https://github.com/facebook/react/commit/ccc6100d7 )**: Fix comments typos (#17550) //<Nick S. Plekhanov>//
- **[1b9328cd9](https://github.com/facebook/react/commit/1b9328cd9 )**: Null stateNode after unmount (#17666) //<Brian Vaughn>//
- **[897976600](https://github.com/facebook/react/commit/897976600 )**: [ESLint] Allow partial matches for custom Effect Hooks (#17663) //<Dan Abramov>//
- **[72592310a](https://github.com/facebook/react/commit/72592310a )**: Create packages/dom-event-testing-library (#17660) //<Nicolas Gallagher>//
- **[a5e951d4c](https://github.com/facebook/react/commit/a5e951d4c )**: [react-interactions] Event testing library improvements (#17614) //<Nicolas Gallagher>//
- **[7dc974542](https://github.com/facebook/react/commit/7dc974542 )**: [Flight] Chunks API (#17398) //<Sebastian Markbåge>//
- **[9354dd275](https://github.com/facebook/react/commit/9354dd275 )**: Make HostComponent inexact (#17412) //<Eli White>//
- **[4c270375e](https://github.com/facebook/react/commit/4c270375e )**: Favor fallthrough switch instead of case statements for work tags (#17648) //<Sebastian Markbåge>//
- **[6fef7c47a](https://github.com/facebook/react/commit/6fef7c47a )**: Add a regression test for switching from Fragment to a component (#17647) //<Dan Abramov>//
- **[9fe103124](https://github.com/facebook/react/commit/9fe103124 )**: [react-interactions] Rename Flare APIs to deprecated and remove from RN (#17644) //<Dominic Gannaway>//
- **[4b0cdf29a](https://github.com/facebook/react/commit/4b0cdf29a )**: Build FB RN targets only in experimental mode (#17641) //<Dan Abramov>//
- **[7309c5f93](https://github.com/facebook/react/commit/7309c5f93 )**: Use zero-fill right shift instead of Math.floor (#17616) //<伊撒尔>//
- **[3c54df091](https://github.com/facebook/react/commit/3c54df091 )**: Fix missing stacks in WWW warnings (#17638) //<Dan Abramov>//
- **[b66e86d95](https://github.com/facebook/react/commit/b66e86d95 )**: react-refresh@0.7.1 //<Dan Abramov>//
- **[c2d1561c6](https://github.com/facebook/react/commit/c2d1561c6 )**: [Fast Refresh] Support injecting runtime after renderer executes (#17633) //<Dan Abramov>//
- **[f42431abe](https://github.com/facebook/react/commit/f42431abe )**: Revert "Remove renderPhaseUpdates Map (#17484)" (#17623) //<Dan Abramov>//
- **[0b5a26a48](https://github.com/facebook/react/commit/0b5a26a48 )**: Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605) //<Dan Abramov>//
- **[0cf22a56a](https://github.com/facebook/react/commit/0cf22a56a )**: Use console directly instead of warning() modules (#17599) //<Dan Abramov>//
- **[b6c423daa](https://github.com/facebook/react/commit/b6c423daa )**: Use matching test command for equivalence tests (#17604) //<Dan Abramov>//
- **[8a347ed02](https://github.com/facebook/react/commit/8a347ed02 )**: Remove renderPhaseUpdates Map (#17484) //<Sebastian Markbåge>//
- **[be603f5a5](https://github.com/facebook/react/commit/be603f5a5 )**: [react-events] Remove lastNativeEvent in favor of SystemFlags (#17585) //<Dominic Gannaway>//
- **[b15bf3675](https://github.com/facebook/react/commit/b15bf3675 )**: Add component stacks to (almost) all warnings (#17586) //<Dan Abramov>//
- **[2afeebdcc](https://github.com/facebook/react/commit/2afeebdcc )**: [react-interactions] Remove responder root event types + revert commit phase change (#17577) //<Dominic Gannaway>//
- **[9ac42dd07](https://github.com/facebook/react/commit/9ac42dd07 )**: Remove the condition argument from warning() (#17568) //<Laura buns>//
- **[7bf40e1cf](https://github.com/facebook/react/commit/7bf40e1cf )**: Initialize update queue object on mount (#17560) //<Andrew Clark>//
- **[e039e690b](https://github.com/facebook/react/commit/e039e690b )**: Revert Update Queue Refactor //<Andrew Clark>//
- **[b617db3d9](https://github.com/facebook/react/commit/b617db3d9 )**: Refactor Update Queues to Fix Rebasing Bug //<Andrew Clark>//
- **[b43eec7ea](https://github.com/facebook/react/commit/b43eec7ea )**: Replace `wrap-warning-with-env-check` with an eslint plugin (#17540) //<Laura buns>//
- **[acfe4b21b](https://github.com/facebook/react/commit/acfe4b21b )**: [react-interactions] Upgrade passive event listeners to active listeners (#17513) //<Dominic Gannaway>//
- **[5064c7f6a](https://github.com/facebook/react/commit/5064c7f6a )**: Revert Rerender Error Check (#17519) //<Sebastian Markbåge>//
- **[6d105ad3f](https://github.com/facebook/react/commit/6d105ad3f )**: [react-interactions] Move Flare event registration to commit phase (#17518) //<Dominic Gannaway>//
- **[dc18b8b8d](https://github.com/facebook/react/commit/dc18b8b8d )**: Don't group Idle/Offscreen work with other work (#17456) //<Sebastian Markbåge>//
- **[f523b2e0d](https://github.com/facebook/react/commit/f523b2e0d )**: Use fewer global variables in Hooks (#17480) //<Sebastian Markbåge>//
- **[d75323f65](https://github.com/facebook/react/commit/d75323f65 )**: Remove case that only exists for createBatch (#17506) //<Sebastian Markbåge>//
- **[79572e34d](https://github.com/facebook/react/commit/79572e34d )**: Adjust SuspenseList CPU bound heuristic (#17455) //<Sebastian Markbåge>//
- **[969f4b5bb](https://github.com/facebook/react/commit/969f4b5bb )**: Change DevTools hook warning message (#17478) //<Dan Abramov>//
- **[6470e0f16](https://github.com/facebook/react/commit/6470e0f16 )**: [Fresh] Make all errors recoverable (#17438) //<Dan Abramov>//

Changelog:
[General][Changed] - React sync for revisions 6cff70a...19f6fe1

Reviewed By: TheSavior

Differential Revision: D19318286

fbshipit-source-id: acaa5224f7162a274c395a62e54da82199001005
2020-01-09 11:18:06 -08:00
Eli White 66601e755f Attempted fix for view parenting issue
Summary:
View should reset whether we are inside of a text or not. For example, inline images should only be rendered inside text, but if we have a view inside text, then it should render a regular image, not an inline image.

This logic *should* exist in native instead of in JS, but this is an easier change for now.

I'm sad to have to turn this back into a JS component instead of just being the string 'RCTView' as this will have performance implications on all surfaces, but this is how it always used to be so maybe it's fine.

This example previously crashed, and no longer does:
```
function PlaygroundContent(props: {}) {
  return (
    <View style={styles.container}>
      <Text>
        <View style={{width: 10, height: 10}}>
          <Image source={fbicon.filled('chevron-down', 10)} />
        </View>
      </Text>
    </View>
  );
}
```

Changelog:
[General][Fixed] Fixes bug where <Text><View><Image> would crash.

Reviewed By: JoshuaGross

Differential Revision: D17564510

fbshipit-source-id: 0ecf49b3d466e7adf57a46a7a097dd3798c721a4
2020-01-08 13:30:49 -08:00
Christoph Nakazawa 02633fe522 Remove old JSC workarounds in HMRClient
Reviewed By: fkgozali

Differential Revision: D19297717

fbshipit-source-id: e85abe1c0d1b96cf21ae3a223ee65d92e6f88824
2020-01-07 16:53:15 -08:00
Kevin Gozali 11ea095ee0 iOS: removed the image instrumentation gating
Summary:
We're keeping the perf logging flag, but the general instrumentation flag is no longer needed (the use case isn't significant to need separate flag).

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D19304789

fbshipit-source-id: 094f7079283e4f4bf3d546dfd0ae50eb641d562e
2020-01-07 16:41:10 -08:00
Peter Argany 80cfa9c8ee Handwritten view configs for Image
Summary:
Hand writing view configs for NativeImageViewComponent so that it'll work in bridgeless mode and won't fall back to the UIManager.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D19217961

fbshipit-source-id: d5a123b35a75ba3e22c57b1dde18a47893681614
2020-01-07 14:46:11 -08:00
Jesse Katsumata e8f577e541 feat: add custom color for iOS13 segmented control (#27643)
Summary:
Addresses Issue from https://github.com/react-native-community/react-native-segmented-control/issues/16

SegmentedControlIOS changed how it looks in iOS13.

This PR allows allows more customization of SegmentedControl for iOS13.

## Changelog

[iOS] [Added] - add textColor and backgroundColor props for iOS >=13
Pull Request resolved: https://github.com/facebook/react-native/pull/27643

Test Plan:
| Before | After |
| --- | --- |
| <img src="https://user-images.githubusercontent.com/6936373/71608475-e68ff580-2bc4-11ea-9fe4-b85b99130356.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/71608757-dc6ef680-2bc6-11ea-85be-aa31f25ecf36.png" width="320" /> |

Differential Revision: D19296783

Pulled By: cpojer

fbshipit-source-id: 81a31b2d5ae3085a6fd1874e7d72e75be4c51318
2020-01-06 22:19:37 -08:00
Poyan Nabati 26e8870fbf Add AnimatedInterpolation as possible type for toValue (#27558)
Summary:
AnimatedInterpolation should be a valid type to pass to `toValue` according to the documentation.

https://facebook.github.io/react-native/docs/animations#tracking-dynamic-values

## Changelog

[General] [Fixed] - Add AnimationInterpolation as possible type for toValue
Pull Request resolved: https://github.com/facebook/react-native/pull/27558

Test Plan: `yarn flow` works without errors.

Differential Revision: D19296804

Pulled By: cpojer

fbshipit-source-id: 7f09c762308c40f1eede5834fadf1837114aa397
2020-01-06 21:29:47 -08:00
Panagiotis Vekris 15ce226f5f v0.115 in xplat/js
Summary:
https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/Updating_Internal_Repositories/#update-xplat-js

reverted manually:
```
RKJSModules/Apps/Jobs/top_level_components/JobsCandidateDetailView.js
RKJSModules/Apps/MobileHome/ui/sevs/v2/MobileHomeSevsDetailsEscalationLogRow.js
RKJSModules/Apps/MobileHome/ui/sevs/v2/MobileHomeSevsDetailsHeaderMetadata.js
RKJSModules/Apps/MobileHome/ui/user/MobileHomeUserDetails.js
RKJSModules/Apps/Profile/ProfileEdit/apps/ProfileEditCollegeApp.js
RKJSModules/Apps/Profile/ProfileEdit/apps/ProfileEditWorkApp.js
metro/packages/metro/src/cli.js
RKJSModules/Apps/AdsLWI/Surfaces/AdsLWICallToActionEditorSurface.js
react-native-github/jest/preprocessor.js
```

Changelog: [Internal]

allow-large-files

Reviewed By: jbrown215

Differential Revision: D19292958

fbshipit-source-id: 4aa969bf2d0f2f5857e68a7e31ff4dcaf29e67cd
2020-01-06 18:06:26 -08:00