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

5638 Коммитов

Автор SHA1 Сообщение Дата
Ramanpreet Nara da6274ba76 Make RCTAlertManager TurboModule-compatible
Summary:
**Note:** This was landed in D17722913, but reverted in D17855088. The revert had nothing to do with this NativeModule.

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

Reviewed By: PeteTheHeat

Differential Revision: D17917827

fbshipit-source-id: d86ea2cddddd9535d656709296c74aebd6f45793
2019-10-15 09:16:56 -07:00
Valentin Shergin beae6d6fa0 Revert D17456225: [RN] RCTRefreshControl was renamed to PullToRefreshView (for Paper)
Differential Revision:
D17456225

Original commit changeset: a8db99ddd507

fbshipit-source-id: 3186d76de13cccc21619702a1ad07842a4788b15
2019-10-15 07:11:53 -07:00
Valentin Shergin 08d6cb19c4 RCTRefreshControl was renamed to PullToRefreshView (for Paper)
Summary:
The component RCTRefreshControl was renamed to PullToRefreshView (for Paper). Now only old Objective-C class names have the old name, which is okay.

Changelog: [Internal] [Changed] - The internal name of PullToRefresh component was changed from `RCTRefreshControl` to `PullToRefreshView` (No public API changes)

Reviewed By: rickhanlonii

Differential Revision: D17456225

fbshipit-source-id: a8db99ddd507377d8c98b26707a3b9fae483d20c
2019-10-14 20:49:48 -07:00
Eli White 878f0500e7 TextInput: Add tests for checking which input is focused
Summary:
We are going to need to change some of these APIs to use refs instead of findNodeHandle. I figured I'd start by adding some tests

Changelog:
[Internal] Adding tests for TextInput

Reviewed By: yungsters

Differential Revision: D17892806

fbshipit-source-id: f59ff99fa4d064239f171acb64a8441e07bb71c1
2019-10-14 14:40:07 -07:00
Eli White e640637928 Core: Remove `any` from calls to requireNativeComponent
Summary:
These were being cast to a NativeComponent but that is no longer accurate. `requireNativeComponent` returns the type of `HostComponent` now which is more accurate. We don't need the cast through `any` anymore.

In order to know that I found all the callsites, I ran this command to find these:
```
grep -r "requireNativeComponent" react-native-github -C 5 | grep 'any'
```

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D17864165

fbshipit-source-id: 3774d6d47d7bb0d885cc1a1352f81fec7d3bca0d
2019-10-14 13:53:48 -07:00
Moti Zilberman 9f71551167 Remove use of framesToPop from JSTimers
Summary:
Replaces the use of `framesToPop` in `_allocateCallback` (in `__DEV__` only) with statically accessing the second frame of the stack.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D17877261

fbshipit-source-id: 8e4d0eb2ed7984b66a99752fb21f7909474fda8f
2019-10-14 09:03:51 -07:00
Tim Yung 6c7d34e8ec RN: Delete `merge[Into]`
Summary:
Deletes `merge[Into]` in favor of object spread.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17884312

fbshipit-source-id: e70b4d4e388d3c6a68908258019bf2bd145e6752
2019-10-12 15:52:27 -07:00
Tim Yung 3a3b535874 RN: Delete `getObjectValues`
Summary:
Deletes `getObjectValues` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17884311

fbshipit-source-id: c97caeed00fe94a6cc099fba7039d9defee719dd
2019-10-12 15:52:26 -07:00
Tim Yung 2d99b3bab3 RN: Delete `isEmpty`
Summary:
Deletes `isEmpty` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: zackargyle, fred2028

Differential Revision: D17884310

fbshipit-source-id: 0554aee4044452b6c04f638f1ad762025eecd929
2019-10-12 15:52:26 -07:00
Tim Yung da3e23fa70 RN: Delete `guid`
Summary:
Deletes `guid` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17882369

fbshipit-source-id: c3ee6d23e5fa233a7f5d2e2c7baef005384ea5b1
2019-10-12 15:52:26 -07:00
Tim Yung 82f4a44086 RN: Delete `toIterator`
Summary:
Deletes `toIterator` because there are no more call sites.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17879834

fbshipit-source-id: 95679d7504c044d0e842bfcbdc07a8c33268f5d6
2019-10-12 15:52:25 -07:00
Tim Yung fc9feb16e0 RN: Delete `mixInEventEmitter`
Summary:
Deletes `mixInEventEmitter` and its dependencies that are no longer being used by anything in `react-native`.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17879835

fbshipit-source-id: 45f30d21cb01365fcfc723cf564ebb47794ea176
2019-10-12 15:52:25 -07:00
Tim Yung 2becdfd404 RN: Delete `TextInput.selectionState` Prop
Summary:
Deletes the `selectionState` prop from `TextInput`.

It does not provide meaningful value over `onBlur`, `onFocus`, and `selectionState`.

Changelog:
[Breaking][TextInput] Removing `selectionState` prop, use `onBlur`, `onFocus`, and `onUpdate` instead.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17879667

fbshipit-source-id: 03a4e239406932adad898d6d2a092e3bc2e6b064
2019-10-12 15:52:25 -07:00
Albert Sun 63769518e0 Fix selecting videos from library in iOS 13
Summary:
In iOS 13, Apple made a change that results in video URLs returned by UIImagePickerController becoming invalidated as soon as the info object from the delegate callback is released. This commit works around this issue by retaining these info objects by default and giving the application a way to release them once it is done processing the video.

See also https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13

Reviewed By: olegbl, mmmulani

Differential Revision: D17845889

fbshipit-source-id: 12d0e496508dafa2581ef12730f7537ef98c60e2
2019-10-11 16:33:19 -07:00
Eli White db84ae8fb3 Improve return type for ScrollView getters
Summary: These types are more accurate

Reviewed By: lunaleaps

Differential Revision: D17862010

fbshipit-source-id: 84dfcade35c21b7be49db46ae021819dda020c98
2019-10-11 11:46:00 -07:00
Eli White db662af5b2 Fix ref type for Native Scroll View
Summary: These types were wrong, this is a HostComponent, not a ReactNative.NativeComponent

Reviewed By: lunaleaps

Differential Revision: D17862305

fbshipit-source-id: e1e7acc7a5892f124b07cdc39d73d6ce7d414063
2019-10-11 11:46:00 -07:00
Eli White 06f32bff82 Improve ScrollView and friends flow types for Props
Summary:
These components had props that were poorly typed and let many things through. This diff tightens that all up.

The main difference in this diff is using `{...BaseProps, ...LocalProps }` instead of `BaseProps & LocalProps`.

The majority of the changes in this diff is reducing duplicated prop definitions. For example, FlatList defines a bunch of props that VirtualizedList also defines. Since FlatList extends those props, using spread now means that FlatList can't duplicate those props. So I've moved the definitions to the correct base file and deleted the duplicates.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17824459

fbshipit-source-id: 089ac4c58c3c9f70a9f28e517f2e9ecd8aab1a50
2019-10-11 09:49:31 -07:00
Eli White bd70cbf042 VirtualizedSectionList: Fix flow error about this.props.onViewableItemsChanged being null
Summary:
Flow complains that the function could be null or undefined even after checking that because this._convertviewable is called first and could potentially muck with the type.
Here is an example in try flow: https://flow.org/try/#0CYUwxgNghgTiAEA3W8AeAueBvAZpg-ABSEB2ArgLYBGIMAlPALwB8SA9gJbB0C+A3ACgcZEmAAuHNiXg5CdTOWq1s8OGLIxpAZh4CBHHPEKoAdIYCEjeOQgQGWAfDRnCsunUE8gA

Changelog:
[Internal]

Reviewed By: jbrown215

Differential Revision: D17863358

fbshipit-source-id: 7689819de4c15f22e427cf5af520566bcea17bbc
2019-10-11 09:49:30 -07:00
Eli White ce3628e9d8 Change FillRateHelper.computeBlankness to take any, as expected
Summary:
Data doesn't have to be an array. data and getItemCount can take any arbitrarty data, as long as they expect the same thing. This should probably be parameterized with a generic but that is an improvement for another day.

It is worth noting the comment explanation for the defintion of `data` and `getItem` in VirtualizedList: https://fburl.com/u7ldzaa8

```
/**
 * The default accessor functions assume this is an Array<{key: string} | {id: string}> but you can override
 * getItem, getItemCount, and keyExtractor to handle any type of index-based data.
 */
data?: any,
/**
 * A generic accessor for extracting an item from any sort of data blob.
 */
getItem: (data: any, index: number) => ?Item,
/**
 * Determines how many items are in the data blob.
 */
getItemCount: (data: any) => number,
```

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17863130

fbshipit-source-id: 40a1d57e3b4dd1e38c84d5907fe88f6b665287ae
2019-10-11 09:49:30 -07:00
Eli White 43ff9da68d VirtualizedList update parentProps.getItemLayout flow type
Summary:
This is a tighter type that matches the actual prop as defined on line 100

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17863133

fbshipit-source-id: 97f966ff13aa2ce36ef936a9a154fdd137191c6b
2019-10-11 09:49:30 -07:00
Eli White 7a2e83dba5 Nit change to VirtualizedSectionList callback flow type
Summary: This change surprisingly fixes a Flow error because these types weren't compatible with the prop types these were passed into that had `info: `. Flow passes now though!

Reviewed By: lunaleaps

Differential Revision: D17863131

fbshipit-source-id: 094f1d97e96686d16bb69732b8a4b319492b5780
2019-10-11 09:49:30 -07:00
Eli White 8eea187085 VirtualizedList clean up prop flow definitions and comments
Summary: These comments existed for other components that had these props. Putting them here as this is the proper base of those other components. Also adding `ItemSeparatorComponent` as it is used in this component.

Reviewed By: lunaleaps

Differential Revision: D17860495

fbshipit-source-id: b7b60058d37e90699b28419af27d488bd46d3ebd
2019-10-11 09:49:29 -07:00
Eli White 5d2de9e54e ScrollView: Fix flow type for StickyHeaderComponentType
Summary: The instance type wasn't being set properly. Using AbstractComponent

Reviewed By: lunaleaps

Differential Revision: D17859988

fbshipit-source-id: 95e2098a7218afeaf3f6ee39ba2b69170ee2f54c
2019-10-11 09:49:29 -07:00
Eli White dd3bf0545a Change ScrollView event flow types to support spreading
Summary: These need to be both optional and nullable to support spreading props like `<ScrollView {...props} />` where these types are optional in a parent component.

Reviewed By: lunaleaps

Differential Revision: D17859633

fbshipit-source-id: 093456d13ee041473a4605e62bf48b3510b49b8f
2019-10-11 09:49:29 -07:00
Eli White fb5276c189 Remove duplicate flow type for TouchableProps
Summary: These are already defined as part of ViewProps. They don't need to be duplicated

Reviewed By: lunaleaps

Differential Revision: D17859553

fbshipit-source-id: c3de534526efd94c0a9ff2c772a4d92c6164815b
2019-10-11 09:49:28 -07:00
Eli White 55b32130bb Lists: Change flow type to not allow rendering undefined
Summary:
`?React.Element<any>` allows passing in `undefined`, an invalid value to render into a React component. Changing these types to be `null | React.Element<any>`.

The issues that this caught were fixed in a previous diff.

Reviewed By: lunaleaps

Differential Revision: D17859220

fbshipit-source-id: 71438cb357b44bca0bf3437aea99ece99a616f7d
2019-10-11 09:49:28 -07:00
Eli White 51bf5f9962 Move VirtualizedSectionList's getItem into a class helper
Summary:
Moving this to the class lets the first argument be typed as `Props<SectionT>` instead of `Props<SectionBase<any>>`. This is consistent with the structure of FlatList

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17841258

fbshipit-source-id: 3e0e6c2f6b21cbce0e662647cb43a012e062c4bc
2019-10-11 09:49:28 -07:00
Eli White d1789dbf8c Destructure out unused props
Summary:
These props are unusupported by the component they were being passed to.

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17839765

fbshipit-source-id: 13c80a07da2026b61070ffc93f26194b979ee8fc
2019-10-11 09:49:27 -07:00
Eli White 515cc6f596 Fix some $FlowFixMe in VirtualizedList
Summary:
Fixing up some of the FlowFixMes in VirtualizedList

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17839611

fbshipit-source-id: c763a799efca63fd7110cfaed87afde80995b8aa
2019-10-11 09:49:27 -07:00
Sharon Gong 3042407f43 Add accessibilityValue prop on Touchables (#26752)
Summary:
AccessibilityValue support was added for view in PR[https://github.com/facebook/react-native/issues/26169](https://github.com/facebook/react-native/pull/26169). This patch is to extend the support for all touchables.

## Changelog

[General] [Added] - Add accessibilityValue prop on Touchables
Pull Request resolved: https://github.com/facebook/react-native/pull/26752

Test Plan: Modify one accessibility value example to use Touchable in AccessibilityExample.js.

Differential Revision: D17878614

Pulled By: mdvacca

fbshipit-source-id: ef201225f7dfbb2c6054102ab22fa151499656d5
2019-10-11 08:59:59 -07:00
Pavol Fulop c35a419e5d Make android modal to appear underneath translucent StatusBar (#26706)
Summary:
As described in https://github.com/facebook/react-native/issues/26559 , the modal is not appearing underneath translucent StatusBar so you can see previous view underneath the StatusBar instead. As a solution you can now provide prop to set the modal to have translucent StatusBar and therefore the content will appear underneath. I tried to reuse layout flags that are possibly set if you use StatusBar component but sadly values in them do not reflect the props set by StatusBar component.

## Changelog

[Android] [added] - Added statusBarTranslucent prop to Modal component, to indicate if StatusBar should appear translucent.
Pull Request resolved: https://github.com/facebook/react-native/pull/26706

Test Plan:
### With StatusBar translucent

![image](https://user-images.githubusercontent.com/3984319/66131336-8bfdf200-e5f3-11e9-940e-c6bb3f67ea6f.png)

``` <Modal statusBarTranslucent>```
### Without

![image](https://user-images.githubusercontent.com/3984319/66131403-a768fd00-e5f3-11e9-9814-ff7592b4ceac.png)

``` <Modal>```

Differential Revision: D17872874

Pulled By: mdvacca

fbshipit-source-id: 8c4b48a75cddf86c4429b62d0c63313e7a2dd1b8
2019-10-10 22:14:23 -07:00
Dulmandakh 8fdf85685c update NativePermissionsAndroid.js to include ACCESS_BACKGROUND_LOCATION (#26668)
Summary:
https://github.com/facebook/react-native/pull/26562 added support for ACCESS_BACKGROUND_LOCATION permission, and thymikee requested to update NativePermissionsAndroid.js too. This PR updates NativePermissionsAndroid.js to include ACCESS_BACKGROUND_LOCATION

## Changelog

[Android] [Changed] - update NativePermissionsAndroid.js to include ACCESS_BACKGROUND_LOCATION
Pull Request resolved: https://github.com/facebook/react-native/pull/26668

Test Plan: Everything builds and runs as expected

Differential Revision: D17683670

Pulled By: cpojer

fbshipit-source-id: 5fe342e79a0d29ba69dddfe70f0fa950498abd50
2019-10-10 21:39:46 -07:00
Kevin Gozali abf612aecd iOS - clean up weakproxy gating
Summary: The proper weakproxy usage should be enabled by default from now on.

Reviewed By: PeteTheHeat

Differential Revision: D17866448

fbshipit-source-id: da404a41fd1136d7feebfc7591fa2965a65c4c6b
2019-10-10 21:06:45 -07:00
Moti Zilberman cf4d45ec2b Remove framesToPop from YellowBox
Summary: Removes the use of `framesToPop` to manage frame skipping in YellowBox and replaces it with support for the `collapse` field populated by Metro's [`customizeFrame`](https://github.com/facebook/metro/pull/435) config option. `framesToPop` is a deprecated mechanism which will be removed in the future.

Reviewed By: bvaughn

Differential Revision: D17857057

fbshipit-source-id: 120383ba4aad877b7ca79c7cf9d5b7579a490577
2019-10-10 11:59:52 -07:00
Ashok Menon df96de78bb Back out D17720575 -- D17724498
Summary: This stack caused FB4A builds to start failing, complaining about `RCTImageApple`.

Reviewed By: RSNara

Differential Revision: D17855088

fbshipit-source-id: 21ecedc3725dde65fab20f414d07b32c3548447c
2019-10-10 09:41:33 -07:00
Martin Sherburn bfd01552af Fix TimingAnimation rounding error issue (Take 2)
Summary:
This fixes a bug where the frames array can contain a duplicate entry at the end.
For example, suppose the duration is 1000.0 then it would create an array with the following:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1,
  1 ]
```

With this change, it now generates the following array:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1 ]
```

Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop.

Reviewed By: dimach1977

Differential Revision: D17828204

fbshipit-source-id: 4483303de852071436cf9a82e50296baf3392329
2019-10-10 06:00:49 -07:00
Pavel Jacko b61583a780 Elements no longer focusable on tvOS (#26775)
Summary:
This PR fixes broken focus on tvOS due to `isTVSelectable` and `tvParallaxProperties` not being available in validAttributes definition object of ReactNativeViewViewConfig

## Changelog

[ios] [Fixed] - elements no longer focusable on tvOS
Pull Request resolved: https://github.com/facebook/react-native/pull/26775

Test Plan:
```
import React from 'react';
import {
    StyleSheet,
    View,
    Text,
    TouchableOpacity
} from 'react-native';

const parallax = {
    enabled: true,
    shiftDistanceY: 2,
    shiftDistanceX: 2,
    tiltAngle: 0.05,
    pressMagnification: 1,
    magnification: 1.1,
};

const Button: () => React$Node = () => (
    <TouchableOpacity style={styles.buttonx} tvParallaxProperties={parallax}>
        <Text>
Touchable Button
        </Text>
    </TouchableOpacity>
);

const App: () => React$Node = () => (
    <View style={styles.wrapper}>
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
    </View>
);

const styles = StyleSheet.create({
    buttonx: {
        backgroundColor: 'red',
        height: 100,
        width: 500
    },
    wrapper: {
        justifyContent: 'center',
        flex: 1,
        alignItems: 'center'
    }
});

export default App;
```

![Oct-08-2019 12-11-19](https://user-images.githubusercontent.com/4638697/66459930-3d7aa880-ea76-11e9-9b94-686094dc8667.gif)

Differential Revision: D17845058

Pulled By: TheSavior

fbshipit-source-id: b6c71d370efd6cf7763ab3a98bbfe1630f789821
2019-10-09 17:49:41 -07:00
Ramanpreet Nara 60321a78ad Make RCTAlertManager TurboModule-compatible
Summary: See title.

Reviewed By: PeteTheHeat

Differential Revision: D17722913

fbshipit-source-id: cb78b9ea1bf497d27b19255e48809850e698ba0d
2019-10-09 12:34:00 -07:00
Ramanpreet Nara a7d2f0dc33 Make RCTLocalAssetImageLoader and RCTGIFImageDecoder TurboModule-compatible
Summary: Couldn't make RCTImageEditingManager and RCTImageStoreManager TurboModule-compatible because their specs live in fb-internal code. I will tackle them in a subsequent diff. See T54946472.

Reviewed By: PeteTheHeat

Differential Revision: D17720574

fbshipit-source-id: 5d634da475522565f874020301de8e74ff73aa8d
2019-10-09 12:33:59 -07:00
Ramanpreet Nara 3aa8a40659 Move RCTImage NativeModules back to RCTImage
Summary: In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`.

Reviewed By: PeteTheHeat

Differential Revision: D17720575

fbshipit-source-id: 44b07cfa07cbb2b87254132810f86974edc7edab
2019-10-09 12:33:59 -07:00
Rick Hanlon 90a9d59679 Partial React Sync
Summary:
This diff is a partial sync of React into React Native.

## Source
The source branch is from my fork [here](https://github.com/facebook/react/compare/master...rickhanlonii:react-native-partial-sync-october-9?expand=1)

This branch is created from D17456249 which partially synced Dan's branch [here](https://github.com/facebook/react/compare/master...gaearon:partsync).

To create my branch, I forked from Dan's branch and added two commits from these PRs:

- Joshua's PR to improve view config errors https://github.com/facebook/react/pull/16879
- Eli's PR to remove setNativeProps warning https://github.com/facebook/react/pull/17045

Reviewed By: gaearon

Differential Revision: D17828989

fbshipit-source-id: 75c99737f2dec4889d7d453bbdebaeb47656b5ce
2019-10-09 09:37:03 -07:00
Rick Hanlon 2fbcdad09c Revert TextInput back to old setNativeProps API
Summary: Reverts D14176217 so we can do the partial React sync in the next diff which removes this API

Reviewed By: TheSavior

Differential Revision: D17828977

fbshipit-source-id: 7dd98c19890aeee0a153746ce65fd3b148b4ca7b
2019-10-09 09:37:02 -07:00
Moti Zilberman a483f802fd Remove framesToPop from bridge
Summary: Removes the use of `framesToPop` from method wrappers in the RN bridge.

Reviewed By: rubennorte

Differential Revision: D17764986

fbshipit-source-id: f2fac0c33a9a7c821bb920fa65b92a4672150a38
2019-10-09 05:48:15 -07:00
Dmitri Svetlanov 5e938077f8 Back out "Fix TimingAnimation rounding error issue"
Summary: Original commit changeset: deba5d5a08ae

Differential Revision: D17813959

fbshipit-source-id: bcd2076bc8f50e835dec3dccf6bd68a41cb8a5ec
2019-10-08 12:33:43 -07:00
Martin Sherburn 77b6e26538 Fix TimingAnimation rounding error issue
Summary:
This fixes a bug where the frames array can contain a duplicate entry at the end.
For example, suppose the duration is 1000.0 then it would create an array with the following:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1,
  1 ]
```

With this change, it now generates the following array:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1 ]
```

Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop.

Reviewed By: sahrens

Differential Revision: D17738602

fbshipit-source-id: deba5d5a08ae842e2a9e2b75f2e25e14f3700518
2019-10-08 06:22:28 -07:00
Eli White d576a5bcc0 Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0
Summary:
If you passed
```
contentInset: { bottom: 10 }
```

then it wouldn't go into the if case and it could try to call `setOffset` with `undefined`. `setOffset` requires a number.

Changelog:
[Fix][ScrollView] ScrollView contentInset top now defaults to 0 in expected situations

Reviewed By: JoshuaGross

Differential Revision: D17796155

fbshipit-source-id: 951dbbb0de1052f64a6835963e8bbc564990c120
2019-10-07 15:31:54 -07:00
Eli White 15be1448f7 Remove unused scrollResponderHandleTerminate from ScrollView
Summary:
This function doesn't exist on the scroll responder so this prop is being set to undefined.

As this is an event, not setting the prop just means that nothing will listen to the event.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D17795678

fbshipit-source-id: 73f2c125e0868e19258b43e3a053447be3f5e768
2019-10-07 15:31:54 -07:00
Ramanpreet Nara 021a63d4da Ensure internal builds don't use plugin stubs
Summary: We generate a stub for plugin system, so that TurboModules can work in OSS. Unless the `RN_DISABLE_OSS_PLUGIN_HEADER` define is seet, TurboModules will use the plugin stub. Therefore, for internal builds, we should set this define.

Reviewed By: fkgozali, mdvacca

Differential Revision: D17789993

fbshipit-source-id: a93735738513457236adb3064b80601053c95dd3
2019-10-07 14:55:39 -07:00
Samuel Susla 9cefc96e43 Remove redundant props from Picker
Summary: Props are being ignored on native side, let's get rid of them.

Reviewed By: TheSavior

Differential Revision: D17765185

fbshipit-source-id: d3625dd25d2e41a49e701d54fe9a7b74cd47786c
2019-10-07 11:34:50 -07:00
Oleksandr Melnykov 3560093115 Add setNativeValue command to ReactSwitchManager
Summary: Fabric doesn't support setNativeProps, so we have to use commands instead to set the value of the native component.

Reviewed By: JoshuaGross

Differential Revision: D17736274

fbshipit-source-id: 18c47365926c3c2cfc3551f4b5b6cc72e4162367
2019-10-07 03:54:09 -07:00
Samuel Susla 07fd3125c8 Migrate MVP SafeAreaView to Fabric
Reviewed By: shergin

Differential Revision: D17736209

fbshipit-source-id: e70c309f2599cdcb8f234d96915546032b71d223
2019-10-04 07:07:36 -07:00
Adam Ernst a45e6a8b5f React Native supermodule
Summary: #nocancel

Reviewed By: fkgozali

Differential Revision: D17747685

fbshipit-source-id: 9bad072d3549959528612c2f0329799853d4b675
2019-10-03 15:43:38 -07:00
Eli White 21f1cce148 Remove unused code
Summary:
There are some unused imports and variables. This was flagged by running
```
$ js1 lint --only "no-unused-vars: [1, {vars: 'all', args: 'none', ignoreRestSiblings: true}]" ~/fbsource/xplat/js/react-native-github --only "react/jsx-uses-vars" --only "react/jsx-uses-react" --fast
```

Changelog:
Internal

Reviewed By: zackargyle, JoshuaGross

Differential Revision: D17724836

fbshipit-source-id: 2b6a44f55c878d659c9c23f5878ba34f21f8bb69
2019-10-03 14:33:59 -07:00
Ramanpreet Nara d7864d20d5 Mark plugin function definitions used
Summary: We need to mark the OSS plugin functions with `__attribute__((used))`, so that the compiler doesn't strip them out.

Reviewed By: fkgozali

Differential Revision: D17742818

fbshipit-source-id: df8055286cace850cea21bb6f09eb5ee6b587c0e
2019-10-03 13:06:06 -07:00
luancurti d66931987a Fix platform ios get version type (#26639)
Summary:
Fix flow type platform ios get version

## Changelog

[INTERNAL] [FIXED] - Fix flow type platform ios get version

## Test Plan
Pull Request resolved: https://github.com/facebook/react-native/pull/26639

Differential Revision: D17743074

Pulled By: TheSavior

fbshipit-source-id: de97c612dbf615a8ede1905cb158f258c9ce5737
2019-10-03 12:29:47 -07:00
Oleksandr Melnykov d0dd1aed29 Integrate AndroidSwitch into Fabric on Android
Summary:
In this diff we integrate the Switch component on Android in Fabric. Since the component has a custom measure function, we need to write some C++ to call the measure method in Java.

The component isn't fully functional yet (setNativeProps isn't supported in Fabric) and has some problems with measuring itself. I will fix the component in the next diffs in this stack.

Reviewed By: JoshuaGross

Differential Revision: D17571258

fbshipit-source-id: be4e201495b9b197ddec44ee3484357bfb6225a8
2019-10-03 03:15:20 -07:00
Luna Wei ea1e8bbd34 Add queryCache to ImageLoader native module
Summary:
[iOS] [Added] - Add definition for `queryCache` in ImageLoader

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17714521

fbshipit-source-id: 722cc17a2ebb03e72d7c080dfc4d0aa6d7440e85
2019-10-02 14:05:12 -07:00
Luna Wei 40667a8147 Add prefetchImage to ImageLoader native module
Summary:
[iOS] [Added] - Add `prefetchImage` to ImageLoader native module.

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17714519

fbshipit-source-id: 0a50f640cf0c5668a11dd5d40553c257ebbd9d2b
2019-10-02 14:05:12 -07:00
Luna Wei db20260b03 Add getSizeWithHeaders to ImageLoader turbomodule
Summary:
Define getSizeWithHeaders in ImageLoader native module.

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.
See it's usage here: D17704091

Reviewed By: TheSavior

Differential Revision: D17693907

fbshipit-source-id: 3c2d7b19ac68ead831e780c4ee23e3ed0643be3a
2019-10-02 14:05:12 -07:00
Eli White da8ae011bb Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null
Summary:
We are seeing these errors in prod:

```
TypeError: Cannot read property '_nativeTag' of null

at
ReactNativeFiberHostComponent.prototype.measureLayout(ReactNativeRenderer-prod.fb.js:1594)
ScrollResponderMixin.scrollResponderScrollNativeHandleToKeyboard(ScrollResponder.js:557)
```

This error is coming from these lines: 69c38e5a63/Libraries/Components/ScrollResponder.js (L563-L567)

Either `nodeHandle` is null or `this.getInnerViewRef()`. If `nodeHandle` was null, we'd get an error that we can't call `measureLayout` on null. So `this.getInnerViewRef()` must be null.

In the React Native Renderer this error of `_nativeTag of null` is coming from this line: db8afe4f63/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js (L84)

Which means indeed `this.getInnerViewRef()` is null.

So adding a null check here which is what we do at all the other product callsites of `measureLayout`. Flow should have caught this, but because ScrollView is one of the only components left using mixins (ScrollResponder), `this.getInnerViewRef` is typed as `any` instead of what it should be:

```
?React.ElementRef<Class<ReactNative.NativeComponent<mixed>>>
```

If `scrollResponder` was typed correctly then Flow would have caught this.

Changelog:
[Fixed] Exception in scrollResponderScrollNativeHandleToKeyboard when ref is null

Reviewed By: mmmulani

Differential Revision: D17717150

fbshipit-source-id: d7bc4c897ad259fb588e8100f37ccfb8a5d07874
2019-10-02 11:28:50 -07:00
Ramanpreet Nara 48653a2a63 Make RCTBridgingToOptionalVec understand kCFNull
Summary:
When converting an array into a Vec, we should also check whether the array pointer is `kCFNull`.

In TurboModules, when an object's property is mapped to null, we simply do not insert that property into the corresponding `NSDictionary`. This causes the `NSDictionary` lookup to return `nil`. In the legacy infra, it looks like we may insert `kCFNull` into the `NSDictionary`, which will cause the lookup to return `kCFNull`.

Reviewed By: fkgozali

Differential Revision: D17716785

fbshipit-source-id: 62ffbe14aec7040edd6b3ce687769a285b14b5a1
2019-10-02 11:01:59 -07:00
Gunnar Kudrjavets b53d3d80f9 Fix free page calculations on iOS
Summary:
[iOS] [Fixed] - Fix how the amount of free memory is calculated to mimic the logic Apple uses.

For example, see https://opensource.apple.com/source/system_cmds/system_cmds-805.250.2/vm_stat.tproj/vm_stat.c.auto.html for how `vm_stat` does it:

```
sspstat("Pages free:", (uint64_t) (vm_stat.free_count - vm_stat.speculative_count));
```

Reviewed By: shergin

Differential Revision: D17671714

fbshipit-source-id: 18ef31e17a0527a9bef7a408922cd687260866db
2019-10-01 12:06:44 -07:00
Ramanpreet Nara 601981a67d Make CameraRoll NativeModules TurboModule-compatible
Summary:
Aside from RCTCameraRollManager, this diff makes the following NativeModules TurboModule-compatible:
- RCTAssetsLibraryRequestHandler
- RCTImagePickerManager
- RCTPhotoLibraryImageLoader

I couldn't convert CameraRollManager to a TurboModule because its NativeMoudle spec is located in fb-internal code. We should probably just move all these NativeModules outside of react-native-github. See: T54882565.

Reviewed By: PeteTheHeat

Differential Revision: D17678033

fbshipit-source-id: 4d10b7b1ad4e167bb9e46ff2bfd1559a5092e201
2019-10-01 11:15:09 -07:00
Ramanpreet Nara 3908702de9 Make RCTFileReaderModule and RCTBlobManager TurboModule-compatible
Summary: Make RCTFileReaderModule and RCTBlobModule TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D17583286

fbshipit-source-id: 4cab350aadce00c03a6c631a6b57e86f35484d2f
2019-10-01 11:15:09 -07:00
Ramanpreet Nara bf063f425f Make RCTSettingsManager TurboModule-compatible
Summary: Make RCTSettingsManager TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D17581374

fbshipit-source-id: 22ec6237ea8b504ff826d0fe7b3db2fabfee9f80
2019-10-01 11:15:08 -07:00
Ramanpreet Nara 789e9fbff0 Make RCTVibration TurboModule-compatible
Summary: Making RCTVibration TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D17581373

fbshipit-source-id: a7aa2d12e7251d332c855435c2f0d83d87f0d2ac
2019-10-01 11:15:08 -07:00
Ramanpreet Nara 101125f891 Make RCTActionSheetManager TurboModule-compatible
Summary: RCTActionSheetManager is now hooked up to the NativeModule codegen. It's also TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D16966007

fbshipit-source-id: 8fdd32cf9fa09ccda9f38513bb0ac9896f8af1b0
2019-09-30 14:32:21 -07:00
Rick Hanlon 7e49a632c2 Send fast refresh stats
Summary: Report fast refreshes to the native module that handles reporting

Reviewed By: cpojer

Differential Revision: D17528523

fbshipit-source-id: 6f8a0b72a18c2d08ab160dc8b6621fce5420a473
2019-09-30 07:03:51 -07:00
Rick Hanlon 2d95668aa8 Add fastRefresh to NativeDevSettings
Summary: This diff adds a method to call whenever a fast refresh happens. Right now this is only useful for reporting.

Reviewed By: cpojer

Differential Revision: D17528033

fbshipit-source-id: 17e82abe7a3e2bab6829de5adecda853fe5335c5
2019-09-30 07:03:51 -07:00
Rick Hanlon 4cea628e0c Add reloadWithReason to Fast Refresh
Summary: This diff adds reload reasons to Fast Refresh. This will help us understand why, for internal Facebook users, Fast Refresh is bailing out to a full reload so that we can improve it for everyone.

Reviewed By: cpojer

Differential Revision: D17499348

fbshipit-source-id: b6e73dc3f396c8531a0872f5572a13928450bb3b
2019-09-30 07:03:51 -07:00
Rick Hanlon 549cac63cb Add reloadWithReason to DevSettings
Summary:
This diff adds reloadWithReason to the NativeDevSettings and updates the exposed DevSettings.reload method to send to it if it's available (setting an 'uncategorized' reason if one isn't set.

[General][Feature] Update DevSettings.reload to accept a reason

Reviewed By: RSNara

Differential Revision: D17499343

fbshipit-source-id: e8c9724800f93d3b9a5d2a8fe9f689d51947d39b
2019-09-30 07:03:50 -07:00
Roshan Gautam 9caf99162d Fixes button partially showing when parent view height is 0 (#26435)
Summary:
When the parent view that wraps a button has height 0, the button is still shown partially because of the padding given for text inside Button component for iOS. Here is the issue raised for that:
https://github.com/facebook/react-native/issues/26421

Probably, we should not hard code these values, rather provide a way to provide custom style ? This is my first PR so not making big change. :D

## Changelog

[iOS] [Fixed] - Give margin instead of padding to text in Button component
Pull Request resolved: https://github.com/facebook/react-native/pull/26435

Test Plan:
When using this block of code,
```
<View style={{height:0}}>
    <Button title="There is an issue"></Button>
</View>
```
Before:
<img width="284" alt="image" src="https://user-images.githubusercontent.com/5866078/64905271-6c129700-d6f5-11e9-86c1-c301eb8123f3.png">

After:
<img width="283" alt="image" src="https://user-images.githubusercontent.com/5866078/64905284-8cdaec80-d6f5-11e9-9589-28d8d01c8ba1.png">

Differential Revision: D17661181

Pulled By: cpojer

fbshipit-source-id: 62b04123d9edb4d760bd54d96ae0615c1ccff7ab
2019-09-29 19:35:17 -07:00
Pablo Espinosa e1d89fbd9d Added Warning message Linking API with Phones in iOS Simulator (#26607)
Summary:
This PR, tries to fix the problem at https://github.com/facebook/react-native/issues/26554

## Changelog
iOS Fixed - Now it will show a warning when trying to use it inside a simulator, instead of throwing a red screen error.

## Notes
Docs PR opened as well at: https://github.com/facebook/react-native-website/pull/1295
<img width="418" alt="image" src="https://user-images.githubusercontent.com/12865914/65734976-532ebc00-e0cd-11e9-8e8c-2b4a5a7b8aea.png">
Pull Request resolved: https://github.com/facebook/react-native/pull/26607

Differential Revision: D17661091

Pulled By: cpojer

fbshipit-source-id: 3d660f25546374adfa3436e2954c9c27750039b7
2019-09-29 19:01:13 -07:00
Miguel Alatzar 0a282c42b4 Include transform in OUTER_PROPS (#26611)
Summary:
Without `transform` in `OUTER_PROPS`, the refresh control component would not include `transform: {scaleY: -1}` in its style and so pulling down, rather than up, on a scroll view would trigger a refresh.

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

## Changelog
[Android] [Fixed] - Fixed issue with refresh control not working properly on an inverted ScrollView
Pull Request resolved: https://github.com/facebook/react-native/pull/26611

Test Plan: Updated unit test in splitLayoutProps-test.js.

Differential Revision: D17661079

Pulled By: cpojer

fbshipit-source-id: 747da27b11c3ca59b7f639f393ae5ac137f5490a
2019-09-29 18:49:45 -07:00
vasilich 9a2bc71064 Export props type for TextInput component (#26622)
Summary:
Fix for issue https://github.com/facebook/react-native/issues/26263

## Changelog

[JavaScript] [Fixed] - Added an export for TextInput props type
Pull Request resolved: https://github.com/facebook/react-native/pull/26622

Test Plan: This PR does not change user interface

Differential Revision: D17661069

Pulled By: cpojer

fbshipit-source-id: 7a8e0159de9dc9e775eae349d0f1e743155e56db
2019-09-29 18:39:20 -07:00
Dulmandakh 8c099b5f53 add ACCESS_BACKGROUND_LOCATION to PermissionsAndroid (#26562)
Summary:
This PR adds ACCESS_BACKGROUND_LOCATION to PermissionsAndroid. Fixes https://github.com/facebook/react-native/issues/26541

## Changelog

[Android] [Changed] - add ACCESS_BACKGROUND_LOCATION to PermissionsAndroid
Pull Request resolved: https://github.com/facebook/react-native/pull/26562

Test Plan:
```javascript
PermissionsAndroid.ACCESS_BACKGROUND_LOCATION === 'android.permission.ACCESS_BACKGROUND_LOCATION'
```

Differential Revision: D17660062

Pulled By: cpojer

fbshipit-source-id: 3133504c6065ffb2f46e4dff14d2d662348e0987
2019-09-29 17:45:27 -07:00
Luna Wei 06d3031281 Native changes for ImageLoader native module
Summary:
Split changes from D17587836
Native changes for ImageLoader native module

Reviewed By: TheSavior

Differential Revision: D17607364

fbshipit-source-id: 451e24d4cf3c982b64bd6196addacef4cb967d1b
2019-09-26 17:37:38 -07:00
Eli White a2aa008b33 Remove unused flow suppressions
Summary: I'm trying to clean up core files and finding suppressions that aren't needed. Bulk removing them.

Reviewed By: cpojer

Differential Revision: D17586683

fbshipit-source-id: fc289bd70b0c928b49a75015ecb5aebe8ab4f1da
2019-09-26 08:16:24 -07:00
Eli White c0029be953 Update ReactNativeTypes from PR to React
Summary:
I upstreamed the changes to this file from previous commits to React in this (unlanded) PR: https://github.com/facebook/react/pull/16898#issuecomment-535248721

I had to make some additional changes to be able to make Flow pass there. Bringing those changes back to FBSource as well. Having this change made here will make the next sync easier as we won't have to deal with conflicts then.

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D17586781

fbshipit-source-id: 4be8376d0af4fb5d63410afaaf5bb0005d992981
2019-09-26 08:16:24 -07:00
Eli White 79e08f3c15 Add Flowtests for HostComponent
Summary:
`HostComponent` is built specifically to differentiate from `ReactNative.NativeComponent`. These tests should ensure that is the case, and help it stay that way.

I also expect these tests to be duplicated to DefinitelyTyped to help the team working on the TypeScript types ensure they have things modeled correctly.

Reviewed By: cpojer

Differential Revision: D17580120

fbshipit-source-id: c14eb18507cbee1b308beeff0092607e18706171
2019-09-26 08:16:23 -07:00
Eli White bcc58bce02 Strengthen flowtype of measureLayout
Summary:
MeasureLayout requires either a reactTag or a ref to a host component. Now that we have a type for Host Components we can be more differentiating here.

Also, because Object is treated as `any` in flow, the type was allowing the return from findNodeHandle or a ref itself be passed, even though both of those are nullable.

This change explicitly requires checking for null before calling the function which is consistent with the behavior of the implementation of measureLayout.

Changelog:
[Changed] Flowtype for measureLayout now disallows null as reactTag

Reviewed By: cpojer

Differential Revision: D17579300

fbshipit-source-id: af062fcd9dfc40eab42e5c5452af2ff653d0888e
2019-09-26 08:16:23 -07:00
Logan Daniels 1bfd15ccb6 Re-land stack of D17563110: codemod xplat/js
Summary:
The stack of D17563110 was reverted because it triggered a failing OTA job that wasn't caught at land time.

Fixing the issue by reverting the change to `Route.js` and re-landing the rest of the diff.

Differential Revision: D17564219

fbshipit-source-id: 166b50a163ce8ae226de224882a98c40652e29ac
2019-09-25 14:47:02 -07:00
Eli White 5876052615 Make setting useNativeDriver required. Add runtime warning if not specified
Summary:
We found that many callsites existed that could be using the native driver, but weren't. In order to help people use it when appropriate and eventually switch the default, we are requiring that useNativeDriver is explicit, even when set to false.

This change adds a runtime warning if useNativeDriver is not specified, hopefully giving some light feedback to remember to use the native driver when you can. Without it being explicit it is very easy to forget setting this.

Reviewed By: JoshuaGross

Differential Revision: D17575918

fbshipit-source-id: e54612d87177e1821692b7de20fe673df0e890d2
2019-09-25 13:36:27 -07:00
Eli White 0676ebf79a Migrate NativeComponentType from codegenNativeComponent to HostComponent #2
Summary:
We need to migrate to HostComponent instead of the exported type from codegenNativeComponent which is the same type

Changelog:
[Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent

Reviewed By: rickhanlonii

Differential Revision: D17563307

fbshipit-source-id: 01c8fea8c67b33bed42ae28ffb8c132be87b9a7a
2019-09-25 11:44:38 -07:00
Eli White 1b4eaeb184 Migrate NativeComponentType from codegenNativeComponent to HostComponent #1
Summary:
We need to migrate to HostComponent, this is the first batch.

Changelog:
[Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent

Reviewed By: rickhanlonii

Differential Revision: D17562879

fbshipit-source-id: ce1993b64a79cede3598c89ddff0dadf07fde92f
2019-09-25 11:44:38 -07:00
Eli White 69c38e5a63 Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent
Summary:
In React Native there are three types of "Native" components.

```
createReactClass with NativeMethodsMixin
```
```
class MyComponent extends ReactNative.NativeComponent
```
```
requireNativeComponent('RCTView')
```

The implementation for how to handle all three of these exists in the React Native Renderer. Refs attached to components created via these methods provide a set of functions such as
```
.measure
.measureInWindow
.measureLayout
.setNativeProps
```

These methods have been used for our core components in the repo to provide a consistent API. Many of the APIs in React Native require a `reactTag` to a host component. This is acquired by calling `findNodeHandle` with any component. `findNodeHandle` works with the first two approaches.

For a lot of our new Fabric APIs, we will require passing a ref to a HostComponent directly instead of relying on `findNodeHandle` to tunnel through the component tree as that behavior isn't safe with React concurrent mode.

The goal of this change is to enable us to differentiate between components created with `requireNativeComponent` and the other types. This will be needed to be able to safely type the new APIs.

For existing components that should support being a host component but need to use some JS behavior in a wrapper, they should use `forwardRef`. The majority of React Native's core components were migrated to use `forwardRef` last year. Components that can't use forwardRef will need to have a method like `getNativeRef()` to get access to the underlying host component ref.

Note, we will need follow up changes as well as changes to the React Renderer in the React repo to fully utilize this new type.

Changelog:
[Internal] Flow type to differentiate between HostComponent and NativeMethodsMixin and NativeComponent

Reviewed By: jbrown215

Differential Revision: D17551089

fbshipit-source-id: 7a30b4bb4323156c0b2465ca41fcd05f4315becf
2019-09-25 10:12:38 -07:00
Eli White e028ac7af2 Fix ref and component return types
Summary:
These types aren't robust to changes in the React component type. When we refactor requireNativeComponent these will error. This change is forwards compatible.

Changelog:
[Internal] Improve internal type in DrawerLayoutAndroid

Reviewed By: JoshuaGross

Differential Revision: D17561194

fbshipit-source-id: 470289449b4d5b3148692f1945fb720e1e3972eb
2019-09-24 18:51:46 -07:00
Eli White 419722bd07 Flow type vendor/core/merge.js
Summary:
This is used by Image.android.js and needs to be flow typed to be able to have confidence in the requireNativeComponent type change

Changelog:
[Internal] Flow type vendor/core/merge.js

Reviewed By: JoshuaGross

Differential Revision: D17561195

fbshipit-source-id: 2639f2628e15b2dd5469bb2ebfe935a444025a21
2019-09-24 18:51:45 -07:00
Joshua Gross fb90f64d9c Collect more information on Debug T48643168
Summary:
It's possible that this crashes because the callback is non-null/non-undefined but isn't a function; if so, I would like to collect that information.

 These changes have already been made in the React repo.

Reviewed By: TheSavior

Differential Revision: D17559022

fbshipit-source-id: a0538d533c3c482d27eef0ed3c8c980e2bc8e817
2019-09-24 18:35:13 -07:00
Joshua Gross c16b219456 Revert D17518337: [flow][types-first] Export types so codemod can use them
Differential Revision:
D17518337

Original commit changeset: 253bf0fb4955

fbshipit-source-id: 4bd08c1061f6759f08f1186f5bd5a2c207c96315
2019-09-24 17:21:30 -07:00
Mehdi Mulani 2fbe956aac Make NSData usage in RCTNetworkTask threadsafe
Summary:
@public
We're seeing crashes from multiple threads trying to call `[NSData appendData:]` at the same time. Usually the RCTURLRequestHandlers implementation avoids this but if you're using a background queue, it is pretty easy to reach this case.
Adding a lock to accessors of `_data` should prevent this.

Reviewed By: shergin

Differential Revision: D17552136

fbshipit-source-id: 3384d36221d0ada8cda638ad8e79e1bf3862f93f
2019-09-24 12:41:05 -07:00
Logan Daniels 4f7659d675 Export types so codemod can use them
Reviewed By: panagosg7

Differential Revision: D17518337

fbshipit-source-id: 253bf0fb4955efc7788be1bc4e662bed37e67acf
2019-09-24 10:00:59 -07:00
Kevin Gozali bfc9839a63 iOS Image: skip CADisplayLink optimization only when weakProxy is enabled
Summary: Just need to validate the intended fix properly via simple gating mechanism.

Reviewed By: mmmulani

Differential Revision: D17536264

fbshipit-source-id: 92db4156beabd6dec2a71b6ea7c2d7bf708d44b1
2019-09-23 15:25:30 -07:00
Luna Wei 9cd2a5f86e Create ScrollViewCommands
Summary: Use NativeCommands interface to dispatch command for ScrollViewManager

Reviewed By: TheSavior

Differential Revision: D17077016

fbshipit-source-id: 3f16b0ab212a7de31ebde1515aafb137ac4f8001
2019-09-23 15:25:30 -07:00
Daniel 21890e964d Fix onPress prop for Touchable Components being called twice on Android Tv (#26474)
Summary:
Due to an update to react-native on the  android tv platform tapping the select button on a remote calls the onPress prop twice for `TouchableHighlight`, `TouchableOpacity`, and `TouchableWithoutFeedback`. This is happening because touchableHandlePress gets called from two places. First from the onClick prop in the touchable component and second from the TVEventHandler in the TouchableMixin.

## Changelog

[Android] [Fixed] - Adds a not android check to the select case of the TVEventHandler callback in the TouchableMixin.
Pull Request resolved: https://github.com/facebook/react-native/pull/26474

Test Plan:
Confirmed on Android Tv and Apple Tv

1) Add a TouchableOpacity to a screen with an onPress callback
2) Run app
3) Focus the TouchableOpacity
4) Press the Select Button on the Remote

**Expected Results**
onPress is called once

Differential Revision: D17530170

Pulled By: TheSavior

fbshipit-source-id: b776faba477c6231ad296abd21f072335dca5556
2019-09-23 14:46:41 -07:00
Janic Duplessis 0cafa0f5d1 Use `warnOnce` for excessive number of callbacks error (#26508)
Summary:
I happened to hit this error a couple times and the issue is that if there are let's say 1000 pending callbacks the error would be triggered 500 times and pretty much crash the app. I think it is reasonable to use warn once here so it only happens once.

## Changelog

[General] [Fixed] - Use `warnOnce` for excessive number of callbacks error
Pull Request resolved: https://github.com/facebook/react-native/pull/26508

Test Plan: Tested by reducing the number of pending callbacks required to trigger the error.

Reviewed By: TheSavior

Differential Revision: D17512917

Pulled By: JoshuaGross

fbshipit-source-id: 5ce8e2a0a166805cc6f3fe6d78e2716d6792a80e
2019-09-23 10:14:51 -07:00
Valentin Shergin 30e9443487 Fabric: Fixed threading issue in RCTNativeAnimatedModule
Summary:
The previous version of the code accessed `_animIdIsManagedByFabric` on the main thread (which is should be accessed on the UIManager thread) and called `flushOperationQueues` on the main thread as well (also must be called on UIManager thread because it modifies instance variables (e.g. `_operations`) which supposed to be accessed on UIManager thread).

The diff fixes that introducing an additional queue jump. That's should be fine because the overall architecture of RCTNativeAnimatedModule is appeared to be asynchronous and should be resilient to possible races.

Reviewed By: sammy-SC

Differential Revision: D17523958

fbshipit-source-id: c4b4ce38b68b009726b2f6c28c38b32b9f9d6921
2019-09-23 09:30:38 -07:00
Samuel Susla 845cbec5cf Add codegen support for EdgeInsets
Summary: Add codegen support for `EdgeInsets`.

Reviewed By: rickhanlonii

Differential Revision: D17500509

fbshipit-source-id: b2909fe296c51d3a47cc961c45294eead7707853
2019-09-23 09:12:51 -07:00
Oleksandr Melnykov 5cfe588993 Use generated Java delegate for setting properties on ReactSwitchManager
Summary: This diff migrates `ReactSwtichManager` to use the generated `ReactSwtichManagerDelegate` for setting its properties.

Reviewed By: TheSavior

Differential Revision: D17395067

fbshipit-source-id: 1489c5d08cef860030ecbd23ef19bd8de1328d71
2019-09-23 07:18:10 -07:00
Oleksandr Melnykov 81f567d4aa Use generated Java delegate for setting properties on ReactDrawerLayoutManager
Summary: This diff migrates `ReactDrawerLayoutManager` to use the generated `AndroidDrawerLayoutManagerDelegate` for setting its properties.

Reviewed By: mdvacca

Differential Revision: D17343383

fbshipit-source-id: 85cd7ee3531b152da2601048f5e458f5dad73ad6
2019-09-23 07:18:10 -07:00
Oleksandr Melnykov 2e7545cf7e Use generated Java delegate for setting properties on ReactProgressBarViewManager
Summary: This diff migrates `ReactProgressBarViewManager` to use the generated `AndroidProgressBarManagerDelegate` for setting its properties.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D17315619

fbshipit-source-id: 6293c6fc18567a934b6f3dce9b77abcc408052d8
2019-09-23 07:18:09 -07:00
Oleksandr Melnykov 23557d1f9a Flow type AndroidSwitch and generate Android OSS classes
Summary: This diff adds Flow types to `AndroidSwitchNativeComponent`.

Reviewed By: TheSavior

Differential Revision: D17205083

fbshipit-source-id: 3d11f11e269388b78a5f0ed528be94df04f9719d
2019-09-23 07:18:09 -07:00
Oleksandr Melnykov ef3b16ef6d Use generated Java delegate for setting properties on SwipeRefreshLayoutManager
Summary: This diff migrates `SwipeRefreshLayoutManager` to use the generated `AndroidSwipeRefreshLayoutManagerDelegate`.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D17225894

fbshipit-source-id: e659d2a9cb5dba42c589559f61a0e98330e21612
2019-09-23 07:18:08 -07:00
Oleksandr Melnykov 5925b3d408 Use generated Java delegate for setting properties on ReactSliderManager
Summary: This diff migrates `ReactSliderManager` to use the generated `SliderManagerDelegate` for setting its properties.

Reviewed By: mdvacca

Differential Revision: D17203078

fbshipit-source-id: 726736ef275074ecb799b334342ac64976153e2b
2019-09-23 07:18:07 -07:00
Mike Vitousek d34bc5fa64 Upgrade to Flow v0.108.0
Reviewed By: gabelevi

Differential Revision: D17488182

fbshipit-source-id: e67c5bcbd9f0bda49d52531387d92d7c83a01f21
2019-09-20 13:37:25 -07:00
Mike Vitousek e0ea5b3aeb Remove unused suppression comments ahead of v0.108.0 deploy
Summary:
```
# From the Flow directory:
$ ./tool remove-comments --bin $(which flow) ../../xplat/js --check check
# Commit, then change to xplat/js:
$ hg revert -r .^ $(hg st --change . -n | xargs grep -l 'generated')
$ prettier --write --require-pragma $(hg st --change . -n)
$ hg st --change . -n | xargs sed -i -e '/flowlint-next-line *$/d'
$ hg st --change . -n | xargs sed -i -e 's/\/\/ flowlint-line$//'
# Run prettier again and amend

```

Reverted changes to metro/cli.js, which caused errors under a separate flowconfig
drop-conflicts

Reviewed By: gabelevi

Differential Revision: D17483256

fbshipit-source-id: 4222fdb7860ebe7ab6e45741a7cedb9d2cc295ef
2019-09-20 13:37:25 -07:00
Ramanpreet Nara 4c998fd05d Rename JSCallInvoker{,Holder} to CallInvoker{,Holder}
Summary:
## Motivation
The concept behind JSCallInvoker doesn't necessarily have to apply only to the JS thread. On Android, we need to re-use this abstraction to allow execution of async method calls on the NativeModules thread.

Reviewed By: PeteTheHeat

Differential Revision: D17377313

fbshipit-source-id: 3d9075cbfce0b908d800a366947cfd16a3013d1c
2019-09-20 10:52:56 -07:00
Eli White eb7dbc8532 Generate doc info for RN components
Summary:
We used to generate the documentation for the website but moved the docs to another repo.

There is some work on the docs to be able to ingest info from this repo in order to go back to generating API information. The current thinking is we will generate this JSON file and the website repo will pull it in to generate the docs.

I plan to make the script run on CI and fail if the generated file isn't updated, in a follow up PR.

Reviewed By: zackargyle

Differential Revision: D17183936

fbshipit-source-id: 99ce3fa5d7becc0ef20df5d439b175eedbe546f3
2019-09-19 18:36:25 -07:00
Eli White 0baacbecf5 Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef
Summary:
We need to get rid of findNodeHandle calls so migrating scrollResponderScrollNativeHandleToKeyboard to take a ref to a host component.

I made this change with Flow, and tested by rendering UserJobApplicationForm

Reviewed By: mdvacca

Differential Revision: D17099280

fbshipit-source-id: 96af692006aace2c206f268f5416984b00f8a438
2019-09-19 18:16:20 -07:00
Janic Duplessis d67c8d4dec Fix printing of false boolean values in the style inspector (#26431)
Summary:
React can't print false, we can just use `JSON.stringify` for any values except string to avoid adding quotes.

## Changelog

[General] [Fixed] - Fix printing of false boolean values in the style inspector
Pull Request resolved: https://github.com/facebook/react-native/pull/26431

Test Plan:
Before

![image](https://user-images.githubusercontent.com/2677334/64896741-e4724d00-d64e-11e9-82b2-57275754523b.png)

After

![image](https://user-images.githubusercontent.com/2677334/64896725-d8868b00-d64e-11e9-903b-8e5212456d78.png)

Reviewed By: TheSavior, mmmulani

Differential Revision: D17468880

Pulled By: JoshuaGross

fbshipit-source-id: 838d3f512037b067ca96fcf5c9d98e2a18fc9821
2019-09-19 13:44:25 -07:00
Ruriko Araki b782934f3f Fix excessive toggles on the Switch component (#26496)
Summary:
In Windows, if you clicked on a Switch component to toggle it, you could see it "shimmy" back and forth once before settling. The native Switch ends up toggling three times every time it's invoked.

`Switch.js` prevents the native switch from toggling to the new value by explicitly setting the switch to `this.props.value` when it receives an `onChange` event. The re-setting of the value wasn't fast enough to prevent the `Switch` from starting to toggle, causing the visual shimmy.

The solution is taken from `TextInput`. `TextInput.js` stores `_lastNativeText` when it receives an `onChange` event. In `componentDidUpdate`, it puts `this.props.text` back on the native textbox if the value of `this.props.text` isn't the same as `_lastNativeText`, which is how it ensures that it is a controlled component. Porting this to the `Switch` results in only one toggle happening per invoke, removing the shimmy, while preserving the controlled component behavior.

This bug is not visible on Android or iOS, only Windows, however the code causing the bug was in `Switch.js` and it seems reasonable to avoid changing the value of the native switch excessively.

## Changelog

[General] [Fixed] - Fix excessive toggles on the Switch component
Pull Request resolved: https://github.com/facebook/react-native/pull/26496

Test Plan: Used RNTester on Android and iOS to test the Switch component and made sure that all scenarios behave as expected visually. Also ensured through the debugger that the value of the native switch is only being changed once, instead of three times.

Reviewed By: TheSavior

Differential Revision: D17468905

Pulled By: JoshuaGross

fbshipit-source-id: 92bf511510306968c3573ee4eed6df009850fd77
2019-09-19 12:46:23 -07:00
Eli White 523ab83338 Add deprecation warning to AccessibilityInfo.fetch
Summary: This was already deprecated, but without a message.

Reviewed By: zackargyle, ejanzer

Differential Revision: D17180347

fbshipit-source-id: 44aa5d1821e56f7600033e82062c4661fe663471
2019-09-18 18:34:45 -07:00
Alexander Kawrykow ee5cb5a880 React Partial Sync
Summary:
Base: 85d05b3a4d439c504ee43652d586ee253a01faf6

Author: Dan Abramov <dan.abramov@gmail.com>
Date:   Wed Sep 18 16:32:11 2019 +0100

    [Fresh] Always remount classes (#16823)

commit acfdc9760b4dc55d192b08de42b2c45e5e5bb531
Author: Ricky <rickhanlonii@gmail.com>
Date:   Wed Sep 18 15:31:00 2019 +0100

    [React Native] Fix for view config registrations (#16821)

commit dbe593d96c35b33fcc1f1bec70af86c24779392b
Author: Dominic Gannaway <trueadm@users.noreply.github.com>
Date:   Wed Sep 18 14:18:32 2019 +0200

    [react-core] Do not null fiber.sibling in detachFiber (#16820)

commit 30fa2f5ea3313b4b7932783d8ac71b5d59b8a8c7
Author: Dominic Gannaway <trueadm@users.noreply.github.com>
Date:   Tue Sep 17 17:30:22 2019 +0200

    [react-core] Clear more properties in detachFiber (#16807)

commit ea374e751b164ed029b35063b84c825305024a0a
Author: Dan Abramov <dan.abramov@gmail.com>
Date:   Wed Aug 28 16:55:56 2019 +0100

    Don't ignore dependencies for render phase update (#16574)

Reviewed By: gaearon

Differential Revision: D17456249

fbshipit-source-id: 87bad63fed4a571f65592ee904606828e3aa39af
2019-09-18 13:16:48 -07:00
Marc Mulcahy 7df3eea1a7 Add accessibilityValueDescription support. (#26169)
Summary:
React Native components need a mechanism to specify their value to assistive technologies. This PR adds the notion of accessibilityValueDescription-- a property which either contains a textual description of a component's value, or for range-based components, such as sliders and progress bars, it contains range information (minimum, current, and maximum).

On iOS, the range-based info if present is converted into a percentage and added to the accessibilityValue property of the UIView. If text is present as part of the accessibilityValueDescription, it is used instead of the range-based information.

On Android, any range-based information in accessibilityValueDescription is exposed in the AccessibilityNodeInfo's RangeInfo. Text which is part of accessibilityValueDescription is appended to the content description.

## Changelog

[GENERAL] [Change] - add accessibilityValuedescription property.
Pull Request resolved: https://github.com/facebook/react-native/pull/26169

Test Plan: Added two new accessibility examples to RNTester, one which uses text and another which uses range-based info in accessibilityValueDescription. Verified that they both behave correctly on both Android and iOS.

Differential Revision: D17444730

Pulled By: cpojer

fbshipit-source-id: 1fb3252a90f88f7cafe1cbf7db08c03f14cc2321
2019-09-18 03:16:42 -07:00
Eli White c7e89909da Remove scrollWithoutAnimationTo from ScrollView
Summary: This function was deprecated in Dec 2016. It has no callsites at FB and should be deleted.

Reviewed By: zackargyle, ejanzer

Differential Revision: D17180174

fbshipit-source-id: de3ab78c469220b629ef7f6773d60507959f6db6
2019-09-17 19:25:11 -07:00
empyrical e98a4b5eff AndroidTextInputNativeComponent: Make event properties ReadOnly (#26469)
Summary:
This pull request makes properties of events' Flow types in `AndroidTextInputNativeComponent` be `$ReadOnly`.

This will make them more compatible with the callback types in `TextInput`.

## Changelog

[Internal] [Changed] - Made properties of events' Flow types in `AndroidTextInputNativeComponent` readonly
Pull Request resolved: https://github.com/facebook/react-native/pull/26469

Test Plan:
`yarn flow-check-ios` and `yarn flow-check-android` both pass.

No regressions to running `scripts/generate-rncore.sh` have been noted.

Differential Revision: D17435579

Pulled By: TheSavior

fbshipit-source-id: 92e6c0623c4dd3fe06ebfb22dc73916bf5917bcc
2019-09-17 16:32:11 -07:00
Valentin Shergin e271fa190d Proper type for `RCTBackedTextInputViewProtocol::defaultTextAttributes`
Summary:
This diff changes how we apply default text attributes to backed text input.
The original change in https://github.com/facebook/react-native/pull/23585 that introduced the `reactTextAttributes` field in for RCTBackedTextInputViewProtocol was great! Thank you Wu zhongwuzw !
However, there is one detail that needs to be changed.
RCTBackedTextInputViewProtocol is designed to only abstract complexity of iOS text input components (UITextView and UITextField); it intentionally does not have any React-specific fields or types. Adding a field `RCTTextAttributes *reactTextAttributes;` violates this principle and make it hard to reuse this functionality in the new Fabric-powered TextInput.

This diff changes the type of this prop from `RCTTextAttributes` to `NSDictionary<NSAttributedStringKey,id> *`  (exact same type that UITextView and UITextField use).

Reviewed By: cpojer

Differential Revision: D17408501

fbshipit-source-id: 65f2bba119ccc30f22e87c28d0f8ea6f731cd365
2019-09-17 09:20:54 -07:00
Janic Duplessis cc068b0551 Export the DevSettings module, add `addMenuItem` method (#25848)
Summary:
I wanted to configure the RN dev menu without having to write native code. This is pretty useful in a greenfield app since it avoids having to write a custom native module for both platforms (and might enable the feature for expo too).

This ended up a bit more involved than planned since callbacks can only be called once. I needed to convert the `DevSettings` module to a `NativeEventEmitter` and use events when buttons are clicked. This means creating a JS wrapper for it. Currently it does not export all methods, they can be added in follow ups as needed.

## Changelog

[General] [Added] - Export the DevSettings module, add `addMenuItem` method
Pull Request resolved: https://github.com/facebook/react-native/pull/25848

Test Plan:
Tested in an app using the following code.

```js
if (__DEV__) {
 DevSettings.addMenuItem('Show Dev Screen', () => {
    dispatchNavigationAction(
      NavigationActions.navigate({
        routeName: 'dev',
      }),
    );
  });
}
```

Added an example in RN tester

![devmenu](https://user-images.githubusercontent.com/2677334/62000297-71624680-b0a1-11e9-8403-bc95c4747f0c.gif)

Differential Revision: D17394916

Pulled By: cpojer

fbshipit-source-id: f9d2c548b09821c594189d1436a27b97cf5a5737
2019-09-17 06:38:10 -07:00
Tom Targosz a4fbb8e75b Fix ShareSheet crash on iOS 13 (#26429)
Summary:
Currently on iOS 13 the app will crash if you:
- Open the share sheet
- Tap something like messages or photos
- Cancel the dialog
- Perform any other action

This is because `shareController.completionWithItemsHandler` is called when the dialog box is canceled and currently `failureCallback` or `successCallback` will always be called. In the situation above, `activityError` is `nil` so `successCallback` will be called even though `completed` is false. This leaves us in a state where the callback has been invoked but the ShareSheet is still active, meaning the success or error callback will be invoked again, leading to the crash.

This PR adds a check to make sure `completed` is true before calling `successCallback`. This way `successCallback` will only be called when the user has successfully completed an action and the ShareSheet is closed.

## Changelog

[iOS] [Fixed] - Fix crash in RCTActionSheetManager.m on iOS 13
Pull Request resolved: https://github.com/facebook/react-native/pull/26429

Test Plan:
- Saved an image successfully
- Opened and dismissed the `Photos` dialog multiple times without crashing

Differential Revision: D17369712

Pulled By: PeteTheHeat

fbshipit-source-id: 228b696243cd39fad1fa134f4412d95d845b1bc5
2019-09-13 11:33:07 -07:00
Christoph Nakazawa dbf070c51e Remove TimePickerAndroid from React Native
Summary: Lean Core

Reviewed By: rubennorte

Differential Revision: D17344045

fbshipit-source-id: a5a7ab41075da93f8a1929059abe183838b00c82
2019-09-13 07:47:58 -07:00
Christoph Nakazawa 9a0ebe0aba Move ART JS files to FB internal
Summary: This is part of Lean Core.

Reviewed By: rubennorte

Differential Revision: D17343246

fbshipit-source-id: 1185e6c1f75e8272048ce1a24c2f195728d436c4
2019-09-13 07:47:57 -07:00
Christoph Nakazawa 56fb72b2c8 Move RCTNetInfo iOS to Facebook internal
Summary: This is the only remaining part of NetInfo that's in open source. Moving it to FB internal.

Reviewed By: motiz88

Differential Revision: D17343031

fbshipit-source-id: 482a2daa397aa9f1391a72775735027de996ddb3
2019-09-13 05:18:52 -07:00
Moti Zilberman 5789e67760 Reuse preprocessed exception message in redbox after symbolication
Summary: Reuse preprocessed exception message when sending the symbolicated update to the redbox, in case `preprocessException` has actually modified it.

Reviewed By: cpojer

Differential Revision: D17318008

fbshipit-source-id: 8b4c606c662140fb44c5305e2f3c7faa0b60f0ee
2019-09-12 03:55:41 -07:00
Christoph Nakazawa e54ecf907e Move `react-native-implementation.js` to `index.js`
Summary: I am unsure whether there was a reason not to use an `index.js` file from the beginning. It always struck me as confusing and odd to have the main API hidden in a folder somewhere. This changes RN to use the standard `index.js` file that is common in almost all JavaScript packages.

Reviewed By: yungsters, rubennorte

Differential Revision: D17314423

fbshipit-source-id: 10eaf4fddd41e91163de7d10c0879b623dab00d7
2019-09-12 03:29:51 -07:00
jainkuniya 9349313c99 picker: Add `warnOnce` saying, it has been moved to `@react-native-community/picker` (#25899)
Summary:
`Picker` & `PickerIOS` are moved to `react-native-community/picker`(https://github.com/react-native-community/react-native-picker) as part of https://github.com/facebook/react-native/issues/23313,

## Changelog

[Picker] [deprecate] - Add `warnOnce` saying, it has been moved to `react-native-community/picker`
Pull Request resolved: https://github.com/facebook/react-native/pull/25899

Test Plan:
Import Picker from `react-native`: warning will be visible saying
```
Picker has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from 'react-native-community/picker' instead of 'react-native'. See https://github.com/react-native-community/react-native-picker
```

Differential Revision: D17314510

Pulled By: cpojer

fbshipit-source-id: 15798698eaab9eee5fddef5be24d21ec52c4134a
2019-09-11 08:04:35 -07:00
Alec Larson 4fc3e7ae71 fix: avoid calling Timing.deleteTimer for setImmediate and requestIdleCallback (#26113)
Summary:
Fix a simple error where `types[index]` was being accessed after it was cleared, instead of before.

## Changelog

[iOS] [Fixed] - never call deleteTimer for setImmediate and requestIdleCallback
Pull Request resolved: https://github.com/facebook/react-native/pull/26113

Test Plan: None

Differential Revision: D17314489

Pulled By: cpojer

fbshipit-source-id: 74715f0f7cc2d5cee3b97a67313c5e96e9d6c555
2019-09-11 06:04:41 -07:00
jeswinsimon 20ab946f34 Support bare hosts. Add missing / between url (#26050)
Summary:
Fix for https://github.com/facebook/react-native/issues/26019 URL cannot handle "localhost" domain for base url. Also noticed another issue where `/` is not added between base URL and path if it is missing. Added fix for that too.

## Changelog

[Javascript] [Fixed] - `URL`: Bare Hosts are now supported.
Pull Request resolved: https://github.com/facebook/react-native/pull/26050

Test Plan:
* `new URL('home', 'http://localhost')` now returns `http://localhost/home` instead of throwing an error.
* `new URL('en-US/docs', 'https://developer.mozilla.org')` now returns `https://developer.mozilla.org/en-US/docs` and not `https://developer.mozilla.orgen-US/docs`.

Differential Revision: D17314137

Pulled By: cpojer

fbshipit-source-id: ef56c4f4032187a7efee32b28e2b3c935b6a2599
2019-09-11 05:09:36 -07:00
Adam Chelminski 42ee5ec934 Expose RCTNetworking as a public 'Networking' API (#25718)
Summary:
This PR introduces the `EventSource` web standard as a first-class networking feature in React Native. In the discussion we had in February at https://github.com/react-native-community/discussions-and-proposals/issues/99, cpojer indicated that the RN maintainers would be willing to accept a PR to offer this functionality.

The linked discussion goes into detail about why this change must happen in React Native Core as opposed to a community library, but the tl;dr is that `XmlHttpRequest` doesn't let you do streaming in a resource-efficient way, since it holds onto the entire response buffer until the request is complete. When processing a stream that might last for a long time, that's not ideal since there might be a lot of data in that buffer that is now useless to maintain.

For more information about EventSource and server-sent events, check out these links:
* [EventSource on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
* [Using server-sent events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
* [WHATWG spec for server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html)

I've tried as best as I can to satisfy the linked specification so that this is as standard as possible.

One of the projects I maintain has an ideal use case for this feature. The SDK for MongoDB Stitch (a backend-as-a-service for the MongoDB database) has the ability to open a "change stream" to watch for changes that happen on a database. However, in our JavaScript SDK, this feature depends on `EventSource`, because the backend service implements the one-way streaming protocol with server-sent events. We know there is demand for this feature because users have requested it: https://github.com/mongodb/stitch-js-sdk/issues/209.

If this PR will be accepted, I am happy to update the `Networking` documentation at https://facebook.github.io/react-native/docs/network

## Changelog

[JavaScript] [Added] Implements the `EventSource` web standard in `Libraries/Networking`
[JavaScript] [Added] Exposes the `EventSource` implementation in `Libraries/Core/setUpXHR.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/25718

Test Plan:
To test the `EventSource` implementation, I added a comprehensive set of unit tests that cover the basic functionality, as well as edge cases that are laid out in the spec. See `EventSource-test.js` for the cases that the tests handles. For convenience, I've also included the test descriptions as produced by the `jest` test output here.

```
 PASS  Libraries/Network/__tests__/EventSource-test.js
  EventSource
    ✓ should pass along the correct request parameters (527ms)
    ✓ should transition readyState correctly for successful requests (4ms)
    ✓ should call onerror function when server responds with an HTTP error (2ms)
    ✓ should call onerror on non event-stream responses (1ms)
    ✓ should call onerror function when request times out (1ms)
    ✓ should call onerror if connection cannot be established (1ms)
    ✓ should call onopen function when stream is opened (1ms)
    ✓ should follow HTTP redirects (2ms)
    ✓ should call onmessage when receiving an unnamed event (2ms)
    ✓ should handle events with multiple lines of data (1ms)
    ✓ should call appropriate handler when receiving a named event (1ms)
    ✓ should receive multiple events (1ms)
    ✓ should handle messages sent in separate chunks (1ms)
    ✓ should forward server-sent errors
    ✓ should ignore comment lines (1ms)
    ✓ should properly set lastEventId based on server message (1ms)
    ✓ should properly set reconnect interval based on server message
    ✓ should handle messages with non-ASCII characters (1ms)
    ✓ should properly pass along withCredentials option (3ms)
    ✓ should properly pass along extra headers (1ms)
    ✓ should properly pass along configured lastEventId (2ms)
    ✓ should reconnect gracefully and properly pass lastEventId (9ms)
    ✓ should stop attempting to reconnect after five failed attempts (2ms)
```

As a manual E2E test, I also added streaming support to the Stitch React Native SDK, and tested it with my React Native EventSource implementation, and confirmed that our `EventSource`-based streaming implementation worked with this `EventSource` implementation.
* Source code for E2E app test: https://gist.github.com/adamchel/6db456c1a851ed7dd20b54f6db3a6759
* PR for streaming support on our React Native SDK: https://github.com/mongodb/stitch-js-sdk/pull/294
* Very brief video demonstrating E2E functionality: https://youtu.be/-OoIpkAxmcw

Differential Revision: D17283890

Pulled By: cpojer

fbshipit-source-id: 0e9e079bdb2d795dd0b6fa8a9a9fa1e840245a51
2019-09-11 03:24:03 -07:00
Joshua Gross 84a05a11b9 Always use `forceUpdate` for Fabric JS animations (resubmit)
Summary:
This bypasses setNativeProps and causes all animations to go through the mounting layer in Fabric only. Resubmit of D17201061

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D17246910

fbshipit-source-id: 88effbaa9b04b277b07cd14427c59e464549ad4a
2019-09-09 22:24:48 -07:00
Kevin Gozali e92235ddf2 Move architecture indicator to internal only
Summary: Since it's only relevant/used internally at FB.

Reviewed By: JoshuaGross

Differential Revision: D17273015

fbshipit-source-id: 0ac6cc48d1c7625c5c867fd8b3a896b44b2b9940
2019-09-09 18:40:02 -07:00
Kevin Gozali d0c618a1f1 Add prefix to the architecture overlay
Summary: This indicator is not to be used globally, only to some folks. For now prefix it with (FB-ONLY) since it's only used internally at FB.

Reviewed By: PeteTheHeat

Differential Revision: D17266514

fbshipit-source-id: f22411c26f5f412a1a3da9666f57cffabd2cc017
2019-09-09 18:40:02 -07:00
Tim Yung 8924639613 RN: Improve `nativeImageSource` Return Type
Summary: Now that `ImageURISource` is a proper type, `nativeImageSource`'s return type should simply use that instead of being an untyped `Object`.

Reviewed By: cpojer

Differential Revision: D17246527

fbshipit-source-id: 6ec0c80a93b8794e6c243154875e3560ddacbc59
2019-09-09 14:58:38 -07:00
Benoit Dion 5f53cb0b85 Add missing available guard to RCTInputAccessoryViewContent (#26332)
Summary:
The new podspec includes all .h and .m files, `RCTInputAccessoryViewContent` was missing a tvOS guard.

## Changelog

[iOS] [Fixed] - Restore RCTText tvOS pod compatibility
Pull Request resolved: https://github.com/facebook/react-native/pull/26332

Test Plan: Build RCTText for tvOS

Differential Revision: D17258958

Pulled By: cpojer

fbshipit-source-id: 5e7408680133aa3ec111552d1413a928193945a7
2019-09-09 07:04:50 -07:00
Kevin Gozali 24ababc915 Back out "[RN] Remove RCTUIImageViewAnimated WeakProxy gating"
Summary:
Original commit changeset: 91eb08181f82
Original diff: D16940181

The original commit removed the gating logic to enable the "fix" to T48583301. However, v236 was burned, and v237+ no longer had this gating, making it impossible to measure the impact of the fix.

This diff reverted the original gating removal until we confirm the fix in prod. Note: this is to be picked to RC v238 (but will have merge conflict for sure, will send a separate diff for the branch).

Reviewed By: mmmulani

Differential Revision: D17251340

fbshipit-source-id: 359ac54aeb9c9e728c2735c688346a1f79ed2189
2019-09-07 19:04:45 -07:00
Eli White 16256f83f8 Revert D17201061: [RN][Fabric] Always use `forceUpdate` for Fabric JS animations
Differential Revision:
D17201061

Original commit changeset: c43b59913d82

fbshipit-source-id: 470e3fcddafceb0677585c0a1f482120b97e8d2a
2019-09-06 21:33:32 -07:00
Joshua Gross 7fd20a5f3c Always use `forceUpdate` for Fabric JS animations
Summary: This bypasses setNativeProps and causes all Fabric animations to go through the mounting layer.

Reviewed By: mdvacca

Differential Revision: D17201061

fbshipit-source-id: c43b59913d8240860e5269e73e1c0ec10ec8e717
2019-09-06 18:14:06 -07:00
Dan Abramov 16eccf304e Remove BugReporting extraData log
Summary: We still include this info in real reports. We also still print the root tag when the app starts. This just removes the redbox "extra data" logging to console. It's noisy, especially on smaller apps in open source that only have one root tag and always empty props.

Reviewed By: cpojer

Differential Revision: D17226903

fbshipit-source-id: a702daaf3a02600fbe9038c46d294c3392953239
2019-09-06 08:32:03 -07:00
Christoph Nakazawa 90a8e3012c Remove live reloading option from RN iOS
Summary: See previous diff in this stack

Reviewed By: motiz88

Differential Revision: D17156649

fbshipit-source-id: 12bdba248481258b9c6ca001472a41ca19fb4b6f
2019-09-06 03:48:49 -07:00
Joshua Gross e6b11e0953 AndroidTextInput: remove enum todos from flow typing
Summary: It looks like codegen supports string enums as long as defaults are provided. Uncommenting the enums and removing TODOs.

Reviewed By: rickhanlonii

Differential Revision: D17196139

fbshipit-source-id: a076b1a25eb38b23cfd53fd92e8c42f121d08d6b
2019-09-04 23:20:15 -07:00
Valentin Shergin 10fe41cc8c Fabric: Exposing `findShadowNodeByTag_DEPRECATED` to JavaScript
Summary: This allows to implement `findNodeHandle` in Fabric world (temporary).

Reviewed By: zackargyle, JoshuaGross, mdvacca

Differential Revision: D17175953

fbshipit-source-id: c88bd1c58608450812799d4ecb4a6bf2c027c5f3
2019-09-04 23:16:56 -07:00
Rick Hanlon 69020a8e87 Add back accessibilityStates until next release
Reviewed By: fkgozali

Differential Revision: D17196525

fbshipit-source-id: 56445ea34b3f0d55ac05e17034a969e3bfea0150
2019-09-04 20:14:26 -07:00
David Vacca 1ee811c951 Revert D17170140: [Fabric][JS] Use SoundManager in Pressability and Touchable
Differential Revision:
D17170140

Original commit changeset: 33a8ca508ec3

fbshipit-source-id: ec7dbded4caf3e9efd61e0c3370c894e8a9c054d
2019-09-04 06:43:18 -07:00
David Vacca de2572ce12 Use SoundManager in Pressability and Touchable
Summary:
This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound()

Previously landed and unladed: D16543433

Reviewed By: rickhanlonii, JoshuaGross

Differential Revision: D17170140

fbshipit-source-id: 33a8ca508ec31f034c76fb0ac4107150d43c608b
2019-09-03 18:56:17 -07:00
Ramanpreet Nara 55276a9b10 Fix codegen output
Summary:
It looks like the codegen output for OSS NativeModule specs was modified in D17152891. In this diff, I run `js1 build oss-native-modules-specs -p ios` to unbreak stable.

build-break

Differential Revision:
D17171834
Ninja: master broken

fbshipit-source-id: 3eb14e555030dc3cd50ae6f9f946c75710c0f141
2019-09-03 15:04:51 -07:00
Ram N 49f59a6b9e Handle empty string returned from NativeAppearance.getColorScheme()
Reviewed By: PeteTheHeat

Differential Revision: D17151675

fbshipit-source-id: 39b9a32271cd45b82faa5e0248d589ef1ed9f4c9
2019-09-03 12:11:15 -07:00
Marc Mulcahy 7b35f427fd Remove deprecated accessibilityStates property. (#26168)
Summary:
We added the accessibilityState property as a more semantically rich way for components to describe information about their state to accessibility services. This PR removes the old accessibilityStates property.

 <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

## Changelog

[General] [Change] - Remove accessibilityStates property.
Pull Request resolved: https://github.com/facebook/react-native/pull/26168

Test Plan: Ensure that RNTester accessibility examples function properly on both iOS and Android.

Differential Revision: D17152891

Pulled By: cpojer

fbshipit-source-id: d71d3cf0f2e0846979d2ba104b6c69e4e5725252
2019-09-02 11:25:31 -07:00
Héctor Ramos 51681e80ab useColorScheme hook (#26143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/26143

A new useColorScheme hook is provided as the preferred way of accessing the user's preferred color scheme (aka Dark Mode).

Changelog:

[General] [Added] - useColorScheme hook

Reviewed By: yungsters

Differential Revision: D16860954

fbshipit-source-id: 8a2b6c2624ed7cf431ab331158bc5456cde1f185
2019-08-31 11:22:43 -07:00
Itamar Ostricher 2c9173365d Fix some typing annotations
Summary: Export font weight type to use in typing

Reviewed By: panagosg7

Differential Revision: D17128236

fbshipit-source-id: baf9d5e5c5fa0b8aad4cf29ea94430adfe1e8b5f
2019-08-31 10:09:42 -07:00
Héctor Ramos a397d330a4 Support light and dark themes in RNTester
Summary:
Initial conversion of RNTester to support light and dark themes. Theming is implemented by providing the desired color theme via context. Example:

```
const ThemedContainer = props => (
  <RNTesterThemeContext.Consumer>
    {theme => {
      return (
        <View
          style={{
            paddingHorizontal: 8,
            paddingVertical: 16,
            backgroundColor: theme.SystemBackgroundColor,
          }}>
          {props.children}
        </View>
      );
    }}
  </RNTesterThemeContext.Consumer>
);
```

As RNTester's design follows the base iOS system appearance, I've chosen light and dark themes based on the actual iOS 13 semantic colors. The themes are RNTester-specific, however, and we'd expect individual apps to build their own color palettes.

## Examples

The new Appearance Examples screen demonstrates how context can be used to force a theme. It also displays the list of colors in each RNTester theme.

https://pxl.cl/HmzW (screenshot: Appearance Examples screen on RNTester with Dark Mode enabled. Displays useColorScheme hook, and context examples.)
https://pxl.cl/HmB3 (screenshot: Same screen, with light and dark RNTester themes visible)

Theming support in this diff mostly focused on the main screen and the Dark Mode examples screen. This required updating the components used by most of the examples, as you can see in this Image example:
https://pxl.cl/H0Hv (screenshot: Image Examples screen in Dark Mode theme)

Note that I have yet to go through every single example screen to update it. There's individual cases, such as the FlatList example screen, that are not fully converted to use a dark theme when appropriate. This can be taken care later as it's non-blocking.

Reviewed By: zackargyle

Differential Revision: D16681909

fbshipit-source-id: e47484d4b3f0963ef0cc3d8aff8ce3e9051ddbae
2019-08-31 10:05:06 -07:00
Joshua Gross ba56fa43f0 Flow type and codegen for AndroidTextInput
Summary: Flow type for AndroidTextInput. This could theoretically be used for the interface codegen in the future, and I did use this to codegen the scaffolding for AndroidTextInput (see previous diffs).

Reviewed By: mdvacca

Differential Revision: D16926831

fbshipit-source-id: d01c2e041efb4151f6091dd0fea191989d133881
2019-08-30 22:39:57 -07:00
Dan Abramov 42a385bddf Partial RN sync
Summary:
This cherry-picks one commit: 01fb68b9bf

It fixes a bug in Fast Refresh.

Reviewed By: threepointone

Differential Revision: D17140543

fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22
2019-08-30 18:10:35 -07:00
Dan Abramov f107d3b78c Fix Redbox on iOS
Summary:
Looks like we broke iOS redbox in D16812212. It stopped showing up because the feature detection stopped working, and we started calling noops. The fix is an explicit platform check.

Fixes #26260

Reviewed By: motiz88

Differential Revision: D17139310

fbshipit-source-id: 829eec23cbb49151ac250889c34ab28d36b05e6a
2019-08-30 18:10:35 -07:00
Kevin Gozali 951785de8a Architecture indicator: hide the overlay when Fabric/TM are both disabled
Summary: Instead of showing a thin gray line, don't render anything if no new architecture project is active.

Reviewed By: ejanzer

Differential Revision: D17142557

fbshipit-source-id: 644a8e515c04f84336d80bea00d641c2bfa3be41
2019-08-30 17:14:44 -07:00
Héctor Ramos 63fa3f21c5 Add Appearance native module
Summary:
Implements the Appearance native module as discussed in https://github.com/react-native-community/discussions-and-proposals/issues/126.

The purpose of the Appearance native module is to expose the user's appearance preferences. It provides a basic get() API that returns the user's preferred color scheme on iOS 13 devices, also known as Dark Mode. It also provides the ability to subscribe to events whenever an appearance preference changes.

The name, "Appearance", was chosen purposefully to allow for future expansion to cover other appearance preferences such as reduced motion, reduced transparency, or high contrast modes.

Changelog:

[iOS] [Added] - The Appearance native module can be used to prepare your app for Dark Mode on iOS 13.

Reviewed By: yungsters

Differential Revision: D16699954

fbshipit-source-id: 03b4cc5d2a1a69f31f3a6d9bece23f6867b774ea
2019-08-30 17:07:57 -07:00
Isaac Lem 36d4a969dd Prevent usage of Array index in keys (#26102)
Summary:
To ensure source code conform with no-array-index-key rules: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md

## Changelog

[General] [Fixed] - To avoid using index as key
Pull Request resolved: https://github.com/facebook/react-native/pull/26102

Reviewed By: rubennorte

Differential Revision: D17093314

Pulled By: osdnk

fbshipit-source-id: 3c50f8fa0b220638e4cec1b71292f2c5c1bdc1c9
2019-08-30 04:57:40 -07:00
Eli White f8e5093823 Improve Flow Type for ScrollResponder
Summary: FlatList and VirtualizedList were typing this value as any instead of using the actual type from ScrollView. I started with that change and then fixed the type to solve the other callsites in the codebase.

Reviewed By: zackargyle

Differential Revision: D17089934

fbshipit-source-id: bfc22cec9993904d779cad37b1de7cb3c0484d2c
2019-08-28 13:15:29 -07:00
Eli White c526b3ff14 Back out "Migrate TouchableNativeFeedback to use codegenNativeCommands"
Summary:
Reverting D16909622 and D16909622 due to T53098065. This change made TouchableNativeFeedback a bit less resilient to non native components being passed as the child. We probably need to handle this migration a little bit safer.

Original commit changeset: 902528623742

Differential Revision: D17096765

fbshipit-source-id: e3fc1a21504459b6d7ea5442c4bc926bbd77379d
2019-08-28 12:41:23 -07:00
zhongwuzw 6f2e6f170e Fixes animated gifs incorrectly looping (#25612)
Summary:
[After migrate to new GIF implementation](https://github.com/facebook/react-native/pull/24822), we need to do some cleanup, before, we already unify the gif loop count between iOS and Android, more details please see https://github.com/facebook/react-native/pull/21999, so let's unify it again.

## Changelog

[iOS] [Fixed] - Fixes animated gifs incorrectly looping
Pull Request resolved: https://github.com/facebook/react-native/pull/25612

Test Plan:
example gif should repeat playback twice.
```
        <Image
          style={styles.gif}
          source={{uri: "https://user-images.githubusercontent.com/475235/47662061-77011f00-db57-11e8-904f-a1824912ace9.gif"}}
        />
```

Reviewed By: sammy-SC

Differential Revision: D16280067

Pulled By: osdnk

fbshipit-source-id: 2351499855f1e0e97c358fa0b3544dd2cc0cf703
2019-08-28 08:15:11 -07:00
André Krüger 51aacd5241 Implement fading edges for ScrollView and it's dependent FlatList (#26163)
Summary:
This should add props for enabling horizontal and vertical fading
edges for Scrollview and FlatList.
These fading edges are used to communicate to the user that there is more content to see.

## Changelog

[Android] [Added] - fading edges props to the FlatList and ScrollView components
Pull Request resolved: https://github.com/facebook/react-native/pull/26163

Test Plan:
Open the React Native test app and navigate to the FlatList section.
Enable the `useFadingEdges` switch and insert a number into `Fading edge length`.

![device-2019-08-23-123745](https://user-images.githubusercontent.com/222393/63587150-7385cb00-c5a3-11e9-98dc-bffe8276d30c.png)
![device-2019-08-23-123844](https://user-images.githubusercontent.com/222393/63587156-75e82500-c5a3-11e9-9e9f-66876ac8f506.png)

Differential Revision: D17080676

Pulled By: TheSavior

fbshipit-source-id: 91df629c17052d43c99145672e9084e1379a4113
2019-08-27 18:37:04 -07:00
Luna Wei 25f6be109b zoomToRect convert to command
Summary: Convert this to a UIManager command

Reviewed By: TheSavior

Differential Revision: D16973257

fbshipit-source-id: 0e129c17926229fc20d020e3c0e52a36b0b405d2
2019-08-27 09:28:03 -07:00
Brian Vaughn 92a3c9da0a React DevTools v4 integration
Summary:
This Diff is being posted for discussion purposes. It will not be ready to land until React DevTools v4 has been published to NPM.

Update React Native to be compatible with the [new version 4 React DevTools extension](https://github.com/bvaughn/react-devtools-experimental).

**Note that this is a breaking change**, as the version 3 and version 4 backends are **not compatible**. Once this update ships (in React Native) users will be required to update their version of the [`react-devtools` NPM package](https://www.npmjs.com/package/react-devtools). The same will be true for IDEs like Nuclide as well as other developer tools like Flipper and [React Native Debugger](https://github.com/jhen0409/react-native-debugger).

Related changes also included in this diff are:
* Pass an explicit whitelist of style props for the React Native style editor (to improve developer experience when adding new styles).
* Update `YellowBox` console patching to coordinate with DevTools own console patching.
  * Also improved formatting slightly by not calling `stringifySafe` for strings (since this adds visible quotation marks).

Regarding the console patching- component stacks will be appended by default when there's no DevTools frontend open. The frontend will provide an option to turn this behavior off though:

{F168852162}

React DevTools will detect if the new version is used with an older version of React Native, and offer inline upgrade instructions:

{F169306863}

**Note that the change to the `RCTEnableTurboModule` will not be included in this Diff**. I've just turned those off temporarily so I can use v8+Chrome for debugging.

Reviewed By: rickhanlonii

Differential Revision: D15973709

fbshipit-source-id: bb9d83fc829af4693e7a10a622acc95a411a48e4
2019-08-26 23:56:59 -07:00
Kevin Gozali e5b63410b4 Show both TM/Fabric overlay over the root view
Summary: This expands the existing FABRIC overlay to also indicate "TM" if turbomodule is active.

Reviewed By: yungsters

Differential Revision: D16999391

fbshipit-source-id: 42eedb697636c1172e595bc7c1ace2a9367a13b8
2019-08-26 11:02:25 -07:00
Spencer Ahrens 8e04a1485f Back out "[react-native][PR] [Android] Implement fading edges for ScrollView and it's dependent FlatList"
Summary:
After some thought, we decided we don't need the flexibility of
separate horizontal and vertical props - it would be much nicer
to just have a single prop for the edge length and then the native
code can enable the booleans as appropriate.

Original PR: https://github.com/facebook/react-native/pull/26163

Original commit changeset: f72a9a890d90

Reviewed By: TheSavior

Differential Revision: D16997468

fbshipit-source-id: 7973262287a7ec2cee5957f8dc1806a0f28c1432
2019-08-23 17:11:17 -07:00
Dulmandakh 3b3c95b017 Fix useWindowDimensions firing continuously after dims change (#26008)
Summary:
https://github.com/facebook/react-native/pull/25990 fixed the `forceUpdate` method to actually update the component, but caused the useEffect to fire on every render, causing continuous updates after dimensions changed (e.g. from rotation).

This reworks things a bit to be a bit simpler and more idiomatic so it's not quite as confusing, and fixes the bugs.

## Changelog

[General] [Fixed] - Fix useWindowDimensions hook firing continuously after dimensions change

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

Test Plan:
Aparently the Mobile Home app supports rotation on iOS now, so replaced it's content with the first `DimensionsExample` and confirmed with logging that `useEffect` fires exactly once, on initial mount, but the view still updates as expected when rotated:

https://pxl.cl/Hfds

Reviewed By: yungsters

Differential Revision: D16765269

Pulled By: sahrens

fbshipit-source-id: ef55d8a470dcfe87aa125d4c426bf01cfe0091a7
2019-08-23 13:50:56 -07:00
André Krüger f8a64f9d61 Implement fading edges for ScrollView and it's dependent FlatList (#26163)
Summary:
This should add props for enabling horizontal and vertical fading
edges for Scrollview and FlatList.
These fading edges are used to communicate to the user that there is more content to see.

## Changelog

[Android] [Added] - fading edges props to the FlatList and ScrollView components
Pull Request resolved: https://github.com/facebook/react-native/pull/26163

Test Plan:
Open the React Native test app and navigate to the FlatList section.
Enable the `useFadingEdges` switch and insert a number into `Fading edge length`.

![device-2019-08-23-123745](https://user-images.githubusercontent.com/222393/63587150-7385cb00-c5a3-11e9-98dc-bffe8276d30c.png)
![device-2019-08-23-123844](https://user-images.githubusercontent.com/222393/63587156-75e82500-c5a3-11e9-9e9f-66876ac8f506.png)

Differential Revision: D16992488

Pulled By: sahrens

fbshipit-source-id: f72a9a890d9056bb017cc5747c6f66b7c35633dd
2019-08-23 13:02:52 -07:00
Peter Argany f229d67498 Make RCTAccessibilityManger a TurboModule
Summary:
Move RCTAccessibilityManager to CoreModules (since that's the only dir that supports TM).

Fixup some variable names to match spec.

Reviewed By: RSNara

Differential Revision: D16861739

fbshipit-source-id: a0a53b221dcc172979d1f2c83851ab92e23f2333
2019-08-23 12:01:52 -07:00
Moti Zilberman db9fab4473 Add unstable_setExceptionDecorator
Summary: Adds a way for the app to add information to an exception report before it is sent to native. This API is not final.

Reviewed By: rubennorte

Differential Revision: D16984151

fbshipit-source-id: 8450356d608e05deaed437e2a35094cd16962027
2019-08-23 11:52:30 -07:00
ifsnow bb05176a4b Better implementation for getItemCount on FlatList (#26164)
Summary:
Flatlist's `getItemCount` function is frequently called internally by VirtualizedList.
As with other functions, we can remove unnecessary operations with the `numColumns` value.
This makes it much more efficient.

## Changelog
[Internal] [Changed] - Better implementation for getItemCount on FlatList
Pull Request resolved: https://github.com/facebook/react-native/pull/26164

Test Plan: Not required

Differential Revision: D16989335

Pulled By: sahrens

fbshipit-source-id: b0075b2c2aeb9b9d7644c8bb18702a7cca8a4dce
2019-08-23 11:48:59 -07:00
Logan Daniels b6333f79e1 Final fixes and seal xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16946423

fbshipit-source-id: 89ca82c955e99a23a14984d51f3c97346c363afd
2019-08-23 08:45:11 -07:00
glevi@fb.com 97b42bb142 Deploy v0.106.0 to xplat/js
Reviewed By: mroch

Differential Revision: D16979246

fbshipit-source-id: 995fbd391823eaf0c9e3a673cf8fbe061ce0545a
2019-08-23 08:06:44 -07:00
Logan Daniels 08daad4427 Add annotations to ReactNativePrivateInterface
Reviewed By: panagosg7

Differential Revision: D16946424

fbshipit-source-id: 90f13dd8bb25aac7ed8b2bebe6d7e49fa97958ff
2019-08-22 17:50:36 -07:00
Eli White 2f7732b145 Migrate TouchableNativeFeedback to use codegenNativeCommands
Summary:
Instead of dispatching the command with findNodeHandle and the UIManager, go through the new API. This is safe because codegenNativeCommands can work at runtime as well as with the babel transform.

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D16909599

fbshipit-source-id: 90252862374290dbeb7202483fa585b6a7051c12
2019-08-22 14:02:16 -07:00
Eli White 3b7eb7ed85 Fix Flowtype for Command refs
Summary:
The types we were using before weren't very strict and it had been on my list to fix this. I *think* this is the right type. With Flow's type first project having these exported types will be necessary anyways so we can just use that for the ref.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D16930573

fbshipit-source-id: 05c1e097794633a2cefa7384c9d81ab15a63d8af
2019-08-22 12:07:50 -07:00
Mehdi Mulani 2211eb5fe8 Don't allocate a CADisplayLink for static images
Summary:
@public
The mass majority of RCTUIImageViewAnimated uses are actually for static images. As such, we don't need to create a CADisplayLink.

Reviewed By: shergin

Differential Revision: D16945038

fbshipit-source-id: a7cb63000987d1ea7a8a9b4d596e1e474709d2ac
2019-08-22 10:36:59 -07:00
Mehdi Mulani 59f84ca1fd Remove RCTUIImageViewAnimated WeakProxy gating
Summary:
To help determine how severe this issue is, put the fix behind a MC.
We will only pick the parent diff to the RC branch so that the fix immediately goes to master and we don't have to worry about fixing this any further.

Reviewed By: fkgozali

Differential Revision: D16940181

fbshipit-source-id: 91eb08181f82f51aea6a20b3fd489a33bdc0e424
2019-08-22 10:16:52 -07:00
Mehdi Mulani 947e71a922 Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated
Summary:
@public
CADisplayLink strongly holds onto its target, so you have to use a weak proxy object to pass the target into the CADisplayLink.

Previously we passed a weak-self point (i.e. weakSelf) but this did not have the intended effect, since the pointer to self would still be passed to CADisplayLink, and thus it would hold onto the RCTUIImageViewAnimated strongly.

So is weakSelf doing anything other than using self?
It is but it's very minor and not useful. In the case that the object got de-allocated between assigning self to weakSelf and creating the CADisplayLink, then we would pass a nil target. This is actually impossible though because we are running an instance method, so self is implicitly retained! So semantically it is something different but in practice it is the same as passing self through.

Notes:
* This system was added originally in https://github.com/facebook/react-native/pull/24822
* https://github.com/facebook/react-native/pull/25636 then "enabled" this system by deprecating existing approach

Reviewed By: fkgozali

Differential Revision: D16939869

fbshipit-source-id: 7a0e947896f23aa30ad074d1dcb4d4db7543e00a
2019-08-22 10:16:52 -07:00
Rubén Norte d2213c75ff Define type signature for react-native-implementation
Summary: Explicitly define the types of the getters in `react-native-implementation` so we can enable Flow's types-first mode for that file.

Reviewed By: cpojer

Differential Revision: D16937607

fbshipit-source-id: 2e4cf483043a53c5407254ffa2b3211d40211019
2019-08-21 19:03:07 -07:00
Rubén Norte bc4825ee9d Fix typing for ProgressBarAndroid
Summary: `ProgressBarAndroid` exported the wrong type and Flow wasn't catching some issues with it because they were hidden by a `$FlowFixMe` annotation. This exports the right type and fixes the bad usages.

Differential Revision: D16938853

fbshipit-source-id: 7ea4bbf379a010a76dc68ccb405e1f890d7e590a
2019-08-21 19:03:06 -07:00
Ramanpreet Nara 80f64f1e5b Ensure ImageLoader is lazily loaded as necessary
Summary: In D16805827, I moved ImageLoader to CoreModules. In the process, I migrated usages of `[_bridge moduleForClass:[RCTImageLoader class]]` to `[_bridge moduleForName:@"ImageLoader"]`. These two APIs aren't equivalent, however, since `[_bridge moduleForClass:[RCTImageLoader class]]` by default lazily loads the requested NativeModule, but `[_bridge moduleForName:@"ImageLoader"]` doesn't. So, I had to explicitly set `lazilyLoadIfNecessary` to `YES` in all the call-sites I migrated, to ensure that ImageLoader is correctly initialized when necessary.

Reviewed By: PeteTheHeat

Differential Revision: D16948165

fbshipit-source-id: 434697637dfa5e32de1c398744f9c28c19a6fd94
2019-08-21 16:11:32 -07:00
Anatolii Shevchenko d8e335df0e Remove ; from method implementation definition
Summary: Removing excessive semicolon ";" symbol from method implementation definition.

Reviewed By: adamjernst

Differential Revision: D16912006

fbshipit-source-id: 9c3e778a107e8fd0055f40a95ea9ca58d461e1c5
2019-08-21 15:49:16 -07:00
Logan Daniels 92073d4a71 Clean-up $TEMPORARY$object in xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16931667

fbshipit-source-id: d87e5ed02bf7f95005cf0f36c3cd127026189058
2019-08-21 09:58:24 -07:00
Joshua Gross 1013a01049 TextInput: include AndroidTextInputNativeComponent instead of calling requireNativeComponent directly
Summary: Include AndroidTextInputNativeComponent so we can rely on codegen and flow typing in a future diff.

Reviewed By: TheSavior

Differential Revision: D16903634

fbshipit-source-id: 767d7c854533d641eb7fcb2147bf584621581411
2019-08-20 10:34:14 -07:00
Eli White 84f148ba44 Delete UIManagerStatTracker
Summary: This code was added in D2442406 in Sep 2015. We have other ways to track the calls to these methods these days. I'm not even sure if this works anymore and it isn't called anywhere.

Reviewed By: JoshuaGross

Differential Revision: D16833299

fbshipit-source-id: cad70c06b149ed424122a9a464564835e7a877e5
2019-08-19 11:05:07 -07:00
Tim Yung 9a3d722ccb RN: Delete Long Press Error in Touchable
Summary: This error is not actionable or valuable right now.

Reviewed By: cpojer

Differential Revision: D16859423

fbshipit-source-id: b25504a9556b4d3102b35b2bffcd2d01566e0399
2019-08-16 10:53:23 -07:00
Peter Argany 30c1196d7d Convert RCTImageLoader to TurboModules [4/N]
Summary:
This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there.

The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable.

Reviewed By: JoshuaGross

Differential Revision: D16495674

fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6
2019-08-15 11:33:37 -07:00
Joshua Gross c8b9a3f8e2 Support Double in when generating props for .h files, in parsing component props, and for commands and events
Summary: I realized my previous diff was incomplete. Adding parsing and generation code for Double for props, commands, and events.

Reviewed By: rickhanlonii

Differential Revision: D16823540

fbshipit-source-id: fbed9897bb84b789c502cf4153e81060590152b8
2019-08-15 10:18:16 -07:00
empyrical 0057cc9bf2 Deprecate Text proptypes (#26055)
Summary:
This pull request moves `Text`'s prop types to the `DeprecatedPropTypes` folder.

This was already partly in progress - there were redundant `TextPropTypes` and `DeprecatedTextPropTypes` files so I removed one, and made sure the version with the doc strings was the one used.

## Changelog

[General] [Deprecated] - Move `Text` component's proptypes to DeprecatedPropTypes
Pull Request resolved: https://github.com/facebook/react-native/pull/26055

Test Plan: Flow checks pass for iOS and Android

Differential Revision: D16801078

Pulled By: TheSavior

fbshipit-source-id: ef19300945d48d0a4a83d728ee32cdf7d1c0f0cc
2019-08-14 17:34:07 -07:00
Ramanpreet Nara bf78d7969a Migrate RCTImage NativeModules to CoreModules
Summary:
This diff moves RCTImageLoader, RCTImageEditingManager, and RCTImageStoreManager to CoreModules. This is necessary for us to convert all these NativeModules to TurboModules.

**Note:** As a part of this diff, I had to break apart `RCTImageLoader.h`. All the protocols that were in `RCTImageLoader` are now in their own headers. Furthermore, `RCTImageLoader`'s methods are defined in `RCTImageLoaderProtocol`, so that we can call them from classes like `RCTImageViewManager` in `RCTImage`.

Reviewed By: PeteTheHeat

Differential Revision: D16805827

fbshipit-source-id: 89f6728b0766c30b74e25f7af1be8e6b8a7e6397
2019-08-14 13:39:30 -07:00
David Vacca 441c00abc9 Revert D16543433: [Fabric][JS] Use SoundManager in Pressability and Touchable
Differential Revision:
D16543433

Original commit changeset: a2ba060bc480

fbshipit-source-id: 0ba31019fb7a9e77577e495782a3b10029575d22
2019-08-14 13:32:56 -07:00
David Vacca 9dbe5e241e Use SoundManager in Pressability and Touchable
Summary: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound()

Reviewed By: yungsters

Differential Revision: D16543433

fbshipit-source-id: a2ba060bc480889c1e08c5c87086361e06974684
2019-08-14 12:38:36 -07:00
Eli White 9a31fa5fd6 Delete ensureComponentIsNative.js
Summary:
This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component.

This is needed for some setNativeProps cleanup

Reviewed By: sahrens

Differential Revision: D16796973

fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6
2019-08-14 11:46:58 -07:00
empyrical d00f0882fb Add documentation to TextInput's Flow types (#26054)
Summary:
The documentation from the Flow types' respective proptypes have been copied over to `TextInput`.

## Changelog

[Internal] [Changed] - Added documentation to TextInput's Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/26054

Test Plan: `yarn flow-check-ios` and `yarn flow-check-android` both pass.

Differential Revision: D16801435

Pulled By: TheSavior

fbshipit-source-id: 7f3d75ba149259d5bbf719375320e2e325188826
2019-08-14 11:33:14 -07:00
jsfu 71d7d6883c fix display problems when image fails to load (#25969)
Summary:
This problem was also affecting Fabric and was fixed in D16708532.
When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time.

## Changelog

[iOS] [Fixed] - fix display problems when image fails to load
Pull Request resolved: https://github.com/facebook/react-native/pull/25969

Test Plan:
This is catalyst playground with following code P78264143.
TLDR of the code, it sets URL <Image> that is 404.

{F175486515}

Reviewed By: makovkastar

Differential Revision: D16783330

Pulled By: sammy-SC

fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd
2019-08-14 03:35:14 -07:00
Adam Ernst 724fe11472 Add reexport_all_header_dependencies to (yet more) misc rules
Summary: Currently this is the default, but I plan to toggle the default to False shortly. False is better for build speed, as it forces you to separate deps and exported_deps.

Reviewed By: williamtwilson

Differential Revision: D16785991

fbshipit-source-id: 8cb73b87f1dfa50f21c0c12df1579054cdc99e6e
2019-08-13 11:14:06 -07:00
Vojtech Novak 8a82503b54 fix SectionList scrollToLocation and prevent regressions (#25997)
Summary:
Recently there were quite a few changes to this functionality, and they caused breakages

https://github.com/facebook/react-native/issues/21577
https://github.com/facebook/react-native/issues/24034
https://github.com/facebook/react-native/issues/24734
https://github.com/facebook/react-native/issues/24735

Currently,  whichever `viewOffset` I pass, it will be overridden (either by 0 or something computed in the if body). This fixes the issue and also adds tests to make sure there is no regression.

## Changelog

[Javascript] [Fixed] - VirtualizedSectionList scrollToLocation viewOffset param ignored
Pull Request resolved: https://github.com/facebook/react-native/pull/25997

Test Plan: tests pass

Differential Revision: D16784036

Pulled By: cpojer

fbshipit-source-id: 46421250993785176634b30a2629a6e12f0c2278
2019-08-13 07:52:54 -07:00
empyrical 427b54eef6 Move TextInput PropTypes to Deprecated PropTypes (#26042)
Summary:
This pull request moves `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`. This is in line with what is happening with other components.

## Changelog

[General] [Deprecated] - Moved `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`
Pull Request resolved: https://github.com/facebook/react-native/pull/26042

Test Plan: Flow checks pass.

Differential Revision: D16782322

Pulled By: cpojer

fbshipit-source-id: c5f9caa402c0c5cd878e7fff502d380c7b468cbd
2019-08-13 03:36:58 -07:00
jeswinsimon e104204ae0 URL: Do not prepend baseUrl if the URL is not a relative URL (#26009)
Summary:
Fix for bug https://github.com/facebook/react-native/issues/26006 URL with base is always used, even when absolute URL is provided

## Changelog

[Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url.
Pull Request resolved: https://github.com/facebook/react-native/pull/26009

Test Plan:
`new URL('http://github.com', 'http://google.com')` now returns `http://github.com/`
Added a test case to `URL-test.js` to verify the same.

Differential Revision: D16781921

Pulled By: cpojer

fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626
2019-08-13 02:55:21 -07:00
Spencer Ahrens a9c8103baa Fix jest test crashes with animated components
Summary:
In the jest test renderer, host components have null refs by default. `createAnimatedComponent` tries to access the ref in componentDidMount, which then crashes. This is particularly problematic when trying to update test data:

https://fb.workplace.com/groups/mpen00bs/permalink/494236684721027/?comment_id=510656413079054

Just checking for null fixes the issue and shouldn't affect anything else.

Reviewed By: TheSavior, yungsters

Differential Revision: D16777137

fbshipit-source-id: 0b9f7c5734c849f36318512ceffcc42dd44c58bb
2019-08-12 20:44:50 -07:00
Vojtech Novak bef87b648c improve VirtualizedList error message (#25973)
Summary:
Motivation: when you receive error like `scrollToIndex out of range: 5 vs -1` it's not immediately clear if I requested 5 or -1. This will make the error a little easier to understand.

## Changelog

not needed
Pull Request resolved: https://github.com/facebook/react-native/pull/25973

Test Plan: not needed, tests must pass

Differential Revision: D16708522

Pulled By: osdnk

fbshipit-source-id: 8dfcbd95ff0f42805dbe32cd57969a93aea55add
2019-08-12 04:34:25 -07:00
Eli White 0ccedf3964 React sync for revisions 55bc393...85d05b3
Summary:
This sync includes the following changes:
- **[85d05b3a4](https://github.com/facebook/react/commit/85d05b3a4 )**: Bump package.json versions //<Andrew Clark>//
- **[d9fdec6cf](https://github.com/facebook/react/commit/d9fdec6cf )**: [Flare] Remove contextmenu logic from Press (#16322) //<Dominic Gannaway>//
- **[12be8938a](https://github.com/facebook/react/commit/12be8938a )**: [Fresh] Support multiple renderers at the same time (#16302) //<Dan Abramov>//
- **[6f3c8332d](https://github.com/facebook/react/commit/6f3c8332d )**: Reset hydration state after reentering (#16306) //<Sebastian Markbåge>//
- **[028c07f89](https://github.com/facebook/react/commit/028c07f89 )**: Ensure Fundamental flags are added to more locations (#16311) //<Dominic Gannaway>//
- **[9dfe973b5](https://github.com/facebook/react/commit/9dfe973b5 )**: Nit: fix inconsistent spacing in a warning (#16310) //<Dan Abramov>//
- **[c4f0b9370](https://github.com/facebook/react/commit/c4f0b9370 )**: Warn when Using String Refs (#16217) //<lunaruan>//
- **[7c838a645](https://github.com/facebook/react/commit/7c838a645 )**: [Flare] Adds support for hydrating host components with listeners (#16304) //<Dominic Gannaway>//
- **[ed4970079](https://github.com/facebook/react/commit/ed4970079 )**: [react-events] Separate the Focus/FocusWithin unit tests (#16298) //<Nicolas Gallagher>//
- **[23405c9c4](https://github.com/facebook/react/commit/23405c9c4 )**: [react-events] Add ContextMenu responder (#16296) //<Nicolas Gallagher>//
- **[606f76b6e](https://github.com/facebook/react/commit/606f76b6e )**: Fix hydration bug with nested suspense boundaries (#16288) //<Sebastian Markbåge>//
- **[a1dbb852c](https://github.com/facebook/react/commit/a1dbb852c )**: warn if you try to use act() in prod (#16282) //<Sunil Pai>//
- **[dc232e677](https://github.com/facebook/react/commit/dc232e677 )**: chore: remove outdated comment about gcc (#16232) //<Ashwin Ramaswami>//
- **[6b565ce73](https://github.com/facebook/react/commit/6b565ce73 )**: Rendering tasks should not jump the queue (#16284) //<Andrew Clark>//
- **[c4c9f086e](https://github.com/facebook/react/commit/c4c9f086e )**: BugFix: Suspense priority warning firing when not supposed to (#16256) //<lunaruan>//
- **[05dce7598](https://github.com/facebook/react/commit/05dce7598 )**: Fix priority of clean-up function on deletion (#16277) //<Andrew Clark>//
- **[a53f5cc22](https://github.com/facebook/react/commit/a53f5cc22 )**: [SuspenseList] Bug fix: Reset renderState when bailing out (#16278) //<Sebastian Markbåge>//
- **[0c1ec049f](https://github.com/facebook/react/commit/0c1ec049f )**: Add a feature flag to disable legacy context (#16269) //<Dan Abramov>//
- **[42794557c](https://github.com/facebook/react/commit/42794557c )**: [Flare] Tweaks to Flare system design and API (#16264) //<Dominic Gannaway>//
- **[b5af4fe3c](https://github.com/facebook/react/commit/b5af4fe3c )**: Remove FocusScope (#16267) //<Dominic Gannaway>//
- **[375616788](https://github.com/facebook/react/commit/375616788 )**: Add missing check to unmocked Scheduler warning (#16261) //<Andrew Clark>//
- **[f939df402](https://github.com/facebook/react/commit/f939df402 )**: [act] Wrap IsThisRendererActing in DEV check (#16259) //<Andrew Clark>//
- **[f440bfd55](https://github.com/facebook/react/commit/f440bfd55 )**: Bugfix:  Effects should never have higher than normal priority (#16257) //<Andrew Clark>//
- **[db3ae32b8](https://github.com/facebook/react/commit/db3ae32b8 )**: flush fallbacks in tests (#16240) //<Sunil Pai>//
- **[e6a0473c3](https://github.com/facebook/react/commit/e6a0473c3 )**: Warn when rendering tests in concurrent/batched mode without a mocked scheduler (#16207) //<Sunil Pai>//
- **[e276a5e85](https://github.com/facebook/react/commit/e276a5e85 )**: [Flare] Remove delay props from Hover (#16248) //<Nicolas Gallagher>//
- **[1912b4a0f](https://github.com/facebook/react/commit/1912b4a0f )**: [Flare] Remove delay props from Press (#16247) //<Nicolas Gallagher>//

Changelog:
[General][Changed] - React sync for revisions 55bc393...85d05b3

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D16720468

fbshipit-source-id: 1884ef67f404623697f516cd77ad952d1fbb4737
2019-08-09 14:32:40 -07:00
Ramanpreet Nara bfecb1266a Remove usage of NativeModules.AccessibilityManager
Summary: We introduced NativeAccessibilityManager a while back. This diff makes sure that there are no usages of NativeModules.AccessibilityManager in our codebase.

Reviewed By: ejanzer

Differential Revision: D16714424

fbshipit-source-id: edebf0f7a0fab615aa1722406f9d538696bd65a0
2019-08-09 14:23:52 -07:00
Logan Daniels 91f139b941 xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16657770

fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33
2019-08-09 10:11:15 -07:00
Logan Daniels 9127fb51fc Manual fixes for xplat/js/react-native-github
Summary:
Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle.

I'll call out areas I need a close eye on in the comments.

Reviewed By: panagosg7

Differential Revision: D16659053

fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f
2019-08-09 10:11:15 -07:00
Bruno Lemos 742a544b73 Fix forceUpdate method on useWindowDimensions (#25990)
Summary:
useState won't trigger re-renders if the value passed is the same.

## Changelog

[Internal] [Fixed] - Fix forceUpdate method on useWindowDimensions
Pull Request resolved: https://github.com/facebook/react-native/pull/25990

Test Plan: Codesandbox: https://codesandbox.io/embed/elegant-cori-0ixbx

Differential Revision: D16723962

Pulled By: sahrens

fbshipit-source-id: 8a46152908a90553151e0353bbfd8c2e64cfd2af
2019-08-08 17:12:26 -07:00
Ramanpreet Nara aecdee0ab0 Introduce NativeFrameRateLogger
Summary: This diff introduces `NativeFrameRateLogger` and eliminates all usages of `NativeModules.FrameRateLogger` from our codebase.

Reviewed By: ejanzer

Differential Revision: D16718105

fbshipit-source-id: caf903162bab978ee1b3faef56aedef6ada75b89
2019-08-08 16:03:41 -07:00
Ramanpreet Nara b1b5bd4418 Introduce NativeBugReporting
Summary: This diff introduces `NativeBugReporting` and eliminates all uses of `NativeModules.BugReporting` from our codebase.

Reviewed By: ejanzer

Differential Revision: D16717540

fbshipit-source-id: 67b8620ba9dd4b41557ae042c30bdc521e927d30
2019-08-08 16:03:41 -07:00
Eli White 305b0a2814 DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated
Summary: The native change to support strings was made in D15912607 on June 21st. Migrating the JS callsites now to start passing strings instead of the constants.

Reviewed By: zackargyle, mdvacca

Differential Revision: D16703569

fbshipit-source-id: cb1d8698df55d2961cde1e2b1fbfcba086a03bb2
2019-08-08 12:01:56 -07:00
Eli White 87d2f4e33a Refactor TextInput.js passes strings to Java for autoCapitalize
Summary:
We are working to remove constants from the view configs.

On June 21st I modified native to support both numbers and strings. D15911323

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D16697916

fbshipit-source-id: f346f37b2e664c2dd49e2a1308a0517f50284e4d
2019-08-08 11:06:34 -07:00
Kevin Gozali d2e18a1c5c iOS: Revert RCT->RN prefix renaming to avoid confusion
Summary: The previous rename from RCT->RN prefix ended up causing some confusions on which prefix to use for which files and under what circumstances. To avoid further confusion before we're done with the re-architecture project, let's keep them as RCT.

Reviewed By: mdvacca

Differential Revision: D16705566

fbshipit-source-id: 395bff771c84e5ded6b2261a84c7549df1e6c5e5
2019-08-08 07:21:25 -07:00
Rick Hanlon 2e8ecab583 Add tests for codegenNativeComponent
Summary: Adds tests for codegenNativeComponent

Reviewed By: TheSavior

Differential Revision: D16582627

fbshipit-source-id: 3527126c7838f3e2c0c56b19956c618f0a7fb9f9
2019-08-07 06:00:23 -07:00
Brian Vaughn cf819bf048 Remove outdated React async component check
Summary: I added this check [a couple of years ago](1b22d49ae8) to mimic how [React used to check for async roots](acabf11245/packages/react-reconciler/src/ReactFiberReconciler.js (L321-L330)). This code doesn't make sense anymore since there's neither an async base class or an `unstable_ConcurrentMode` export, so I'm just cleaning it up.

Reviewed By: threepointone, sebmarkbage

Differential Revision: D16668567

fbshipit-source-id: 5ccf5feccc4b65ffb3aeb0a09891d8be7490df26
2019-08-06 12:16:26 -07:00
Rick Hanlon deaaab908b Fix error string in codegenNativeComponent
Summary: This diff fixes the error message in the codegenNativeComponent fallback

Reviewed By: TheSavior

Differential Revision: D16579775

fbshipit-source-id: 176f81ea91e11f671407a5e5e5b000c4b83f93b2
2019-08-06 07:02:57 -07:00
Ramanpreet Nara a5b925d950 Fix up NativeDialogManagerAndroid PR
Summary:
This diff has three changes:
1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call).
2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`.
3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done.

Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s.

Reviewed By: PeteTheHeat

Differential Revision: D16428855

fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576
2019-08-05 12:16:46 -07:00
Moti Zilberman 3eaf245540 Pop frames correctly in console.error handler
Reviewed By: cpojer

Differential Revision: D16648992

fbshipit-source-id: 4581e2cd6859f27bc384fc3ab328ab5b9414c704
2019-08-05 11:19:56 -07:00
Michał Osadnik 306c8d64d9 Back out "[react-native][PR] Allow Animation EndResult callback to return Promise"
Summary:
Original commit changeset: 420d29d262b6

Reverts https://github.com/facebook/react-native/pull/25793 / D16515465

Union type property is not supported by codegen. We don't want to support unions yet and because the improvement is not that big and not yet published as stable for OSS (neither used anywhere internally) we can safely revert it.

Reviewed By: RSNara

Differential Revision: D16621228

fbshipit-source-id: 2fa416eef1ae353990860026ca97d2b0b429a852
2019-08-05 02:37:56 -07:00
Thibault Malbranche f4f08d3c54 Fix missing rotateZ to useAnimatedDriver Whitelist (#25938)
Summary:
Added missing property to whitelist

## Changelog

[General] [Fixed] - Fixed rotateZ native animation
Pull Request resolved: https://github.com/facebook/react-native/pull/25938

Differential Revision: D16645798

Pulled By: cpojer

fbshipit-source-id: ef74d7230fa80068dcceaaff841af27365df92e9
2019-08-05 02:33:40 -07:00
Eli White e906af18a1 Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands
Summary:
`codegenNativeCommands` returns an object with functions for each command that has the previous behavior inside the React Renderer, and the new Fabric logic inside of the Fabric React Native Renderer.

Changelog:
[Internal] - Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands

Reviewed By: rickhanlonii

Differential Revision: D16529887

fbshipit-source-id: 24a5307944a7f62e18482d60d26052fea3be2051
2019-08-02 16:55:31 -07:00
Eli White d123bea8c1 Change Animated's Flow Type to require useNativeDriver be explicit
Summary:
We found that many callsites existed that could be using the native driver, but weren't. In order to help people use it when appropriate and eventually switch the default, we are requiring that useNativeDriver is explicit, even when set to false.

For now, we are changing the flow type to turn this on at Facebook, but aren't making this a runtime warning until we have a bit more confidence in our plans so that we don't churn the community.

Reviewed By: mdvacca

Differential Revision: D16611301

fbshipit-source-id: dfa8536786fc949f0239118a9e0936b268b1081d
2019-08-02 14:03:30 -07:00
Moti Zilberman 9f85f1e39c Type ErrorUtils (error-guard.js)
Summary:
* Adds Flow types to `error-guard.js` and propagates them via the `ErrorUtils` module.
* Fixes some call sites to account for the stricter (correct) types.

Differential Revision: D16619538

fbshipit-source-id: c006ff2736ec380763956c4b89702cf44dd4deb0
2019-08-02 09:38:46 -07:00
Kevin Gozali 9420de6860 iOS: codemod react-native-github: RCT->RN prefix for Fabric
Summary: Fabric ObjC(++) files will be prefixed by RN* for the time being, this codemod is a simple rename. This includes `interface` and `protocol` definition

Reviewed By: PeteTheHeat, yungsters

Differential Revision: D16611524

fbshipit-source-id: 868d2571ea2414dde4cbb3b75b1334b779b5d832
2019-08-01 20:06:04 -07:00
David Vacca a55ae3a3f0 Implement SoundManager TurboModule in JS and Android
Summary: This diff implements the Turbo Module SoundManager, this will be used by following diffs of the stack

Reviewed By: JoshuaGross

Differential Revision: D16543430

fbshipit-source-id: 34ba545f54b759fe4e49d4e3c5f8867205de907c
2019-08-01 19:49:11 -07:00
David Vacca a03a406ad7 Create Turbo Module spect for SoundManager
Summary: This diff creates the Turbo Module SoundManager to expose the method playTouchSound

Reviewed By: JoshuaGross

Differential Revision: D16543435

fbshipit-source-id: b83c679e3c3be9b19a84c470e4bc7cfd12792c11
2019-08-01 19:49:11 -07:00
Spencer Ahrens 103ec2f770 Fix Dimensions for ComponentScript
Summary: ComponentScript uses Dimensions, but doesn't support native modules, so we need to keep the `nativeExtensions` stuff that was dropped in D16525189.

Reviewed By: PeteTheHeat

Differential Revision: D16611233

fbshipit-source-id: c0add40529743e02ab7943814dc9f2188e8e0633
2019-08-01 18:25:57 -07:00
Eli White 0a68763743 Add explicit `useNativeDriver: false` to callsites
Summary:
In order to cleanup the callsites that are not using Animated's native driver, we are going to make useNativeDriver a required option so people have to think about whether they want the native driver or not.

I made this change by changing [Animated.js](https://fburl.com/ritcebri) to have this animation config type:

```
export type AnimationConfig = {
  isInteraction?: boolean,
  useNativeDriver: true,
  onComplete?: ?EndCallback,
  iterations?: number,
};
```

This causes Flow to error anywhere where useNativeDriver isn't set or where it is set to false.

I then used these Flow errors to codemod the callsites.

I got the location of the Flow errors by running:
```
flow status --strip-root --json --message-width=0 | jq '.errors | [.[].extra | .[].message | .[].loc | objects | {source: .source, start: .start, end: .end}]'
```

And then ran this codemod:
```
const json = JSON.parse('JSON RESULT FROM FLOW');

const fileLookup = new Map();

json.forEach(item => {
  if (!fileLookup.has(item.source)) {
    fileLookup.set(item.source, []);
  }

  fileLookup.get(item.source).push(item);
});

export default function transformer(file, api) {
  const j = api.jscodeshift;

  const filePath = file.path;
  if (!fileLookup.has(filePath)) {
    return;
  }

  const locationInfo = fileLookup.get(filePath);

  return j(file.source)
    .find(j.ObjectExpression)
    .forEach(path => {
      if (
        path.node.properties.some(
          property =>
            property != null &&
            property.key != null &&
            property.key.name === 'useNativeDriver',
        )
      ) {
        return;
      }

      const hasErrorOnLine = locationInfo.some(
        singleLocationInfo =>
          singleLocationInfo.start.line === path.node.loc.start.line &&
          Math.abs(
            singleLocationInfo.start.column - path.node.loc.start.column,
          ) <= 2,
      );
      if (!hasErrorOnLine) {
        return;
      }

      path.node.properties.push(
        j.property(
          'init',
          j.identifier('useNativeDriver'),
          j.booleanLiteral(false),
        ),
      );
    })
    .toSource();
}

export const parser = 'flow';
```

```
yarn jscodeshift --parser=flow --transform addUseNativeDriver.js RKJSModules react-native-github
```

Followed up with

```
hg status -n --change . | xargs js1 prettier
```

Reviewed By: mdvacca

Differential Revision: D16611291

fbshipit-source-id: 1157587416ec7603d1a59e1fad6a821f1f57b952
2019-08-01 16:46:30 -07:00
Eli White a6fffb7cd0 Add runtime behavior to codegenNativeCommands
Summary:
Previously codegenNativeCommands was just a hint to the babel transform. This meant that in order to use the codegen'd JS command functions it required having the babel transform turned on.

We aren't ready to turn the transform on for open source so we are adding runtime behavior to the function that will run when it isn't replaced with the transform.

Reviewed By: rickhanlonii

Differential Revision: D16574781

fbshipit-source-id: 583e8857f69ae1695445ee887432d15248dd35a9
2019-08-01 15:05:57 -07:00
Eli White b526f66c19 Back out "Back out "[RNCodegen] codegenNativeCommands takes list of supported commands""
Summary:
Original commit changeset: 34a8f8395ca7

The problem with the original commit was the usage of optional chaining. This diff removes the usage of optional chaining with good old fashioned null checks.

Reviewed By: rickhanlonii

Differential Revision: D16593623

fbshipit-source-id: d24cc40c85de9a2e712e5de19e9deb196003ccf2
2019-08-01 15:05:57 -07:00
Joshua Gross 678d5f7cd1 Back out "[RNCodegen] codegenNativeCommands takes list of supported commands"
Summary: Original commit changeset: 189754a567a3

Reviewed By: rickhanlonii

Differential Revision: D16586885

fbshipit-source-id: 34a8f8395ca73e190ccf0242f02626094f6d87b6
2019-07-31 14:11:06 -07:00
Moti Zilberman 6764385c80 Type StackFrame fields as nullable
Summary: `parseErrorStack` (which uses the `stacktrace-parser` package) can return null file names, line numbers and column numbers. This diff updates the associated types and adds explicit null checks in some call sites.

Reviewed By: rickhanlonii

Differential Revision: D16542176

fbshipit-source-id: b72c73c05b95df0bbcb5b5baa7bc2d42cff1e074
2019-07-31 09:08:06 -07:00
Martin Sherburn e85cd6cd02 Only use IntentAndroid on android
Summary:
For other platforms such as React VR it doesn't make sense to use `IntentAndroid` native module and it should use `LinkingManager` instead.

The code used to be:

```
const LinkingManager =
  Platform.OS === 'android'
    ? NativeModules.IntentAndroid
    : NativeModules.LinkingManager;
```

This diff changes the behaviour back to what it used to be.

Reviewed By: cpojer

Differential Revision: D16561073

fbshipit-source-id: 544551f8ff1affca5a71835133e8a9e7abc75e1a
2019-07-31 05:48:36 -07:00
Martin Sherburn d8f1161c8a Improvement to lazy view config loading
Summary: While adding support for this to React VR I noticed that `viewConfig.Manager` was `undefined` which meant that the view config never get assigned to the `viewManagerConfigs` object and caused errors later on. This change makes it so that even if `viewConfig.Manager` is not set the viewConfig still gets added to the `viewManagerConfigs` object.

Reviewed By: rickhanlonii

Differential Revision: D16560992

fbshipit-source-id: 626dc133602b142caff60f41d043d02968e6ccfc
2019-07-31 05:40:49 -07:00
Moti Zilberman 2dadb9e2b0 Move React error message formatting into ExceptionsManager
Summary:
# Context

In https://github.com/facebook/react/pull/16141 we imported `ReactFiberErrorDialog` unchanged from React. That implementation was not idempotent: if passed the same error instance multiple times, it would amend its `message` property every time, eventually leading to bloat and low-signal logs.

The message bloat problem is most evident when rendering multiple `lazy()` components that expose the same Error reference to React (e.g. due to some cache that vends the same rejected Promise multiple times).

More broadly, there's a need for structured, machine-readable logging to replace stringly-typed interfaces in both the production and development use cases.

# This diff

* We leave the user-supplied `message` field intact and instead do all the formatting inside `ExceptionsManager`. To avoid needless complexity, this **doesn't** always have the exact same output as the old code (but it does come close). See tests for the specifics.
* The only mutation we do on React-captured error instances is setting the `componentStack` expando property. This replaces any previously-captured component stack rather than adding to it, and so doesn't create bloat.
* We also report the exception fields `componentStack`, unformatted `message` (as `originalMessage`) and `name` directly to `NativeExceptionsManager` for future use.

Reviewed By: cpojer

Differential Revision: D16331228

fbshipit-source-id: 7b0539c2c83c7dd4e56db8508afcf367931ac71d
2019-07-31 02:34:15 -07:00
Eli White f161583713 codegenNativeCommands takes list of supported commands
Summary:
We want to enable codegenNativeCommands to have a runtime fallback that will work if the babel transform is not enabled. For example, in open source until we turn it on everywhere. By listing the supported commands, we can create the necessary functions at runtime to support what we need.

A follow up diff will add that runtime behavior to codegenNativeCommands.

Reviewed By: JoshuaGross

Differential Revision: D16573450

fbshipit-source-id: 189754a567a3a5ccd34629a8dfedf808e6824e82
2019-07-30 20:28:26 -07:00
Eli White 40e8a5f685 React sync for revisions ec6691a...55bc393
Summary:
This sync includes the following changes:
- **[55bc393f7](https://github.com/facebook/react/^Cmmit/55bc393f7 )**: [Flare] Ensure we check for bad polyfill when creating responders (#16243) //<Dominic Gannaway>//
- **[47656bf2a](https://github.com/facebook/react/^Cmmit/47656bf2a )**: [Flare] Remove longpress from press responder (#16242) //<Nicolas Gallagher>//
- **[9914a1919](https://github.com/facebook/react/^Cmmit/9914a1919 )**: [Fresh] Transfer refs when remounting (#16241) //<Dan Abramov>//
- **[75ab53b9e](https://github.com/facebook/react/^Cmmit/75ab53b9e )**: [scheduler] Yield many times per frame, no rAF (#16214) //<Andrew Clark>//
- **[0d7141dd4](https://github.com/facebook/react/^Cmmit/0d7141dd4 )**: [Flare] Fix SSR issue with serializing responders prop (#16227) //<Dominic Gannaway>//
- **[ed57bf8ed](https://github.com/facebook/react/^Cmmit/ed57bf8ed )**: [Bugfix] Check tag before calling hook effects (#16215) //<Andrew Clark>//
- **[858c84206](https://github.com/facebook/react/^Cmmit/858c84206 )**: Don't hyphenate custom CSS properties for ReactDOMServer (#16167) //<Belmin Bedak>//
- **[d412eec83](https://github.com/facebook/react/^Cmmit/d412eec83 )**: [act] flush work correctly without a mocked scheduler (#16223) //<Sunil Pai>//
- **[b43785e15](https://github.com/facebook/react/^Cmmit/b43785e15 )**: Update use-subscription README (#16216) //<Sophie Alpert>//
- **[c0830a0e6](https://github.com/facebook/react/^Cmmit/c0830a0e6 )**: [Scheduler] Test browser implementation details (#16198) //<Andrew Clark>//
- **[857deb2ed](https://github.com/facebook/react/^Cmmit/857deb2ed )**: Warn when Using DefaultProps on Function Components (#16210) //<lunaruan>//
- **[e0472709c](https://github.com/facebook/react/^Cmmit/e0472709c )**: [Flare] Adds Keyboard event responder (#16204) //<Dominic Gannaway>//
- **[5b08f7b43](https://github.com/facebook/react/^Cmmit/5b08f7b43 )**: [Flare] Adds useListener implementation to ReactDebugHooks (#16205) //<Dominic Gannaway>//
- **[ed72f4025](https://github.com/facebook/react/^Cmmit/ed72f4025 )**: [Flare] Remove references to EventComponent (#16206) //<Dominic Gannaway>//
- **[121bfb03b](https://github.com/facebook/react/^Cmmit/121bfb03b )**: update legacy context warning message (#16196) //<Sunil Pai>//
- **[9ae5e38f1](https://github.com/facebook/react/^Cmmit/9ae5e38f1 )**: Add guard to ensure Profiler onRender prop is function before calling (#16197) //<Brian Vaughn>//
- **[144dba1a1](https://github.com/facebook/react/^Cmmit/144dba1a1 )**: Fix suspenseCallback type warning, add a test (#16194) //<Benoit Girard>//
- **[7ad221126](https://github.com/facebook/react/^Cmmit/7ad221126 )**: [Flare] Ensure Flare components are no-ops for TestRenderer (#16192) //<Dominic Gannaway>//
- **[06cc99699](https://github.com/facebook/react/^Cmmit/06cc99699 )**: Edit Suspense Priority Warning Message (#16186) //<lunaruan>//
- **[42b75ab00](https://github.com/facebook/react/^Cmmit/42b75ab00 )**: Add suspenseCallback feature for runtime tracing of loading states (#16134) //<Benoit Girard>//
- **[c73e1f236](https://github.com/facebook/react/^Cmmit/c73e1f236 )**: flush work on exiting outermost act(), with nested act()s from different renderers (#16181) //<Sunil Pai>//
- **[509889119](https://github.com/facebook/react/^Cmmit/509889119 )**: [Flare] Redesign core event system (#16163) //<Dominic Gannaway>//
- **[19354db51](https://github.com/facebook/react/^Cmmit/19354db51 )**: [Scheduler] Add names to inline functions (#16180) //<Andrew Clark>//
- **[bff7abf6b](https://github.com/facebook/react/^Cmmit/bff7abf6b )**: [Scheduler][Bugfix] Multiple rAFs in same frame (#16184) //<Andrew Clark>//
- **[afb599168](https://github.com/facebook/react/^Cmmit/afb599168 )**: Enable profiler+tracing for test renderer (#16178) //<Brian Vaughn>//
- **[2237efcef](https://github.com/facebook/react/^Cmmit/2237efcef )**: [Fresh] Track unrecoverable errors (#16183) //<Dan Abramov>//
- **[bbd21066e](https://github.com/facebook/react/^Cmmit/bbd21066e )**: [Flare] Press: fix keyboard interactions (#16179) //<Nicolas Gallagher>//
- **[03944bfb0](https://github.com/facebook/react/^Cmmit/03944bfb0 )**: Update Suspense Priority Warning to Include Component that Triggered Update (#16030) //<lunaruan>//
- **[3f2cafe8b](https://github.com/facebook/react/^Cmmit/3f2cafe8b )**: [WIP][Scheduler] Use rIC to post first callback (#16166) //<Andrew Clark>//
- **[2bd88e38a](https://github.com/facebook/react/^Cmmit/2bd88e38a )**: [Scheduler] Bugfix: Cancelling a continuation (#16151) //<Andrew Clark>//
- **[783b8f4ae](https://github.com/facebook/react/^Cmmit/783b8f4ae )**: [Flare] Ensure mouse events can use target to validate press (#16172) //<Dominic Gannaway>//
- **[2c4d61e10](https://github.com/facebook/react/^Cmmit/2c4d61e10 )**: Adds experimental fundamental interface (#16049) //<Dominic Gannaway>//
- **[b4178af81](https://github.com/facebook/react/^Cmmit/b4178af81 )**: clean up nextEffect pointers (#16115) //<Paul Shen>//
- **[997154bcc](https://github.com/facebook/react/^Cmmit/997154bcc )**: [Flare] Add FocusWithin responder (#16152) //<Nicolas Gallagher>//
- **[65b80fdd9](https://github.com/facebook/react/^Cmmit/65b80fdd9 )**: [Flare] Add Input event responder surface (#16148) //<Dominic Gannaway>//
- **[ce883a19d](https://github.com/facebook/react/^Cmmit/ce883a19d )**: useSubscription hook (#15022) //<Brian Vaughn>//
- **[c45c2c3a2](https://github.com/facebook/react/^Cmmit/c45c2c3a2 )**: Move ReactFiberErrorDialog RN fork into RN itself (#16141) //<Moti Zilberman>//
- **[d9b4c55d5](https://github.com/facebook/react/^Cmmit/d9b4c55d5 )**: unify deprecated/unsafe lifecycle warnings, pass tests (#16103) //<Sunil Pai>//
- **[424099da6](https://github.com/facebook/react/^Cmmit/424099da6 )**: Inject getCurrentFiber() function to DevTools (#16133) //<Brian Vaughn>//
- **[9f395904c](https://github.com/facebook/react/^Cmmit/9f395904c )**: Inject ReactDebugCurrentFrame into DevTools so it can append component stacks to warnings in DEV mode (#16127) //<Brian Vaughn>//
- **[fcff9c57b](https://github.com/facebook/react/^Cmmit/fcff9c57b )**: Add tail="hidden" option to SuspenseList (#16024) //<Sebastian Markbåge>//
- **[8d413bf2c](https://github.com/facebook/react/^Cmmit/8d413bf2c )**: Remove React.error and React.warn (#16126) //<Brian Vaughn>//
- **[ca4d78f9b](https://github.com/facebook/react/^Cmmit/ca4d78f9b )**: [Flare] Press: fix middle-click handling (#16114) //<Nicolas Gallagher>//
- **[3f1dee09a](https://github.com/facebook/react/^Cmmit/3f1dee09a )**: expose act() sigil correctly for umd builds (#16110) //<Sunil Pai>//
- **[b7669044d](https://github.com/facebook/react/^Cmmit/b7669044d )**: Use Map instead of object as map in ReactNativeComponentTree (#16107) //<Sebastian Markbåge>//
- **[d2d9b1f70](https://github.com/facebook/react/^Cmmit/d2d9b1f70 )**: [Scheduler] Support inferring priority from stack (#16105) //<Andrew Clark>//
- **[48f659447](https://github.com/facebook/react/^Cmmit/48f659447 )**: Add warning when single item or nested arrays are used with SuspenseList (#16094) //<Sebastian Markbåge>//
- **[2073a7144](https://github.com/facebook/react/^Cmmit/2073a7144 )**: [Flare] Press includes button type (#16100) //<Nicolas Gallagher>//
- **[23b8a2534](https://github.com/facebook/react/^Cmmit/23b8a2534 )**: [Flare] Remove responder flags to simplify logic (#16084) //<Dominic Gannaway>//
- **[8533c0a16](https://github.com/facebook/react/^Cmmit/8533c0a16 )**: [Fabric] Add dispatchCommand to React Native renderers (#16085) //<Eli White>//
- **[2253bc81d](https://github.com/facebook/react/^Cmmit/2253bc81d )**: [Flare] Switch from currentTarget model to responderTarget model (#16082) //<Dominic Gannaway>//
- **[67e3f3fb6](https://github.com/facebook/react/^Cmmit/67e3f3fb6 )**: [Flare] Revise responder event types (#16081) //<Dominic Gannaway>//
- **[2a0f6390e](https://github.com/facebook/react/^Cmmit/2a0f6390e )**: Fix typos (#16076) //<Min ho Kim>//
- **[aa519c17c](https://github.com/facebook/react/^Cmmit/aa519c17c )**: [Flare] Add currentTarget and unify RN and DOM codepaths (#16066) //<Dominic Gannaway>//
- **[35d2b3bb5](https://github.com/facebook/react/^Cmmit/35d2b3bb5 )**: fix spelling error: resoltion ->  resolution (#16055) //<fnll>//
- **[bd72b0493](https://github.com/facebook/react/^Cmmit/bd72b0493 )**: [Flare] Clear pressStart timeout on pointercancel (#16067) //<Vincent Riemer>//
- **[c40075a72](https://github.com/facebook/react/^Cmmit/c40075a72 )**: [Flare] Remove capture phase Flare events (#16054) //<Dominic Gannaway>//
- **[786186c69](https://github.com/facebook/react/^Cmmit/786186c69 )**: [Flare] createInitialState -> getInitialState (#16051) //<Dominic Gannaway>//
- **[c64f40d71](https://github.com/facebook/react/^Cmmit/c64f40d71 )**: [Flare] Remove dead event target code (#16063) //<Dominic Gannaway>//
- **[e6bfa327d](https://github.com/facebook/react/^Cmmit/e6bfa327d )**: [Flare] Cleanup ReactFiberEvents-test (#16047) //<Dominic Gannaway>//
- **[b365ee281](https://github.com/facebook/react/^Cmmit/b365ee281 )**: [Fire] Remove unused React fire fork (#16046) //<Dominic Gannaway>//
- **[b8f91e664](https://github.com/facebook/react/^Cmmit/b8f91e664 )**: [fail] reset IsThisRendererActing correctly (#16042) //<Sunil Pai>//
- **[bd846459d](https://github.com/facebook/react/^Cmmit/bd846459d )**: [fail] Only warn on unacted effects for strict / non sync modes (#16041) //<Sunil Pai>//
- **[6b946ad9d](https://github.com/facebook/react/^Cmmit/6b946ad9d )**: [Flare] Add more functionality to Scroll event resonder (#16036) //<Dominic Gannaway>//
- **[a457e02ae](https://github.com/facebook/react/^Cmmit/a457e02ae )**: allow nested `act()`s from different renderers (#16039) //<Sunil Pai>//
- **[a865e4a64](https://github.com/facebook/react/^Cmmit/a865e4a64 )**: Clone a custom hook node before use (#16019) //<Anton Korzunov>//
- **[6cf2234a5](https://github.com/facebook/react/^Cmmit/6cf2234a5 )**: [Flare] Do not block mouse presses on scroll (#16033) //<Dominic Gannaway>//
- **[5cb8f6f34](https://github.com/facebook/react/^Cmmit/5cb8f6f34 )**: Add tail="collapsed" option to SuspenseList (#16007) //<Sebastian Markbåge>//
- **[46bd11ac3](https://github.com/facebook/react/^Cmmit/46bd11ac3 )**: Flush sync bug (#16027) //<lunaruan>//
- **[933c664ad](https://github.com/facebook/react/^Cmmit/933c664ad )**: SuspenseList Optimizations (#16005) //<Sebastian Markbåge>//
- **[fbbbea16e](https://github.com/facebook/react/^Cmmit/fbbbea16e )**: fix word async -> concurrent (#15844) //<Heaven>//
- **[eb2ace128](https://github.com/facebook/react/^Cmmit/eb2ace128 )**: [Flare] Bring Flare support to React Native Fabric (#15887) //<Dominic Gannaway>//
- **[9b0bd4355](https://github.com/facebook/react/^Cmmit/9b0bd4355 )**: [Flare] Re-label Flare flag (#16014) //<Dominic Gannaway>//
- **[8b88ac259](https://github.com/facebook/react/^Cmmit/8b88ac259 )**: [Flare] Remove event targets including TouchHitTarget (#16011) //<Dominic Gannaway>//
- **[f11540926](https://github.com/facebook/react/^Cmmit/f11540926 )**: Handle changes at module boundaries (#16002) //<Dan Abramov>//
- **[915dfe697](https://github.com/facebook/react/^Cmmit/915dfe697 )**: Slightly improve performance of hydration. (#15998) //<Benedikt Meurer>//
- **[824e9bec7](https://github.com/facebook/react/^Cmmit/824e9bec7 )**: [Flare] Fix issues with touch + pointer interactions (#15997) //<Dominic Gannaway>//
- **[dd93357aa](https://github.com/facebook/react/^Cmmit/dd93357aa )**: [Flare] Move click handling back into target phase (#15993) //<Dominic Gannaway>//
- **[4d307de45](https://github.com/facebook/react/^Cmmit/4d307de45 )**: Prefix mock Scheduler APIs with _unstable (#15999) //<Andrew Clark>//
- **[9b55bcfc6](https://github.com/facebook/react/^Cmmit/9b55bcfc6 )**: [Flare] Add Hooks to event modules (#15953) //<Brandon Dail>//
- **[20da1dae4](https://github.com/facebook/react/^Cmmit/20da1dae4 )**: Fix error logging in getDerivedStateFromProps (#15797) //<Ricky>//
- **[6088a201e](https://github.com/facebook/react/^Cmmit/6088a201e )**: [Flare] Fix Press scroll cancellation handling (#15983) //<Dominic Gannaway>//
- **[fd601fb21](https://github.com/facebook/react/^Cmmit/fd601fb21 )**: [Flare] Move all event responders to dom directory (#15981) //<Dominic Gannaway>//
- **[827cbc4d0](https://github.com/facebook/react/^Cmmit/827cbc4d0 )**: Rename StatelessComponent to FunctionComponent in react-is/README.md (#15963) //<Veniamin Krol>//
- **[d48db594e](https://github.com/facebook/react/^Cmmit/d48db594e )**: eslint-plugin-react-hooks@1.6.1 //<Dan Abramov>//
- **[7439b48cf](https://github.com/facebook/react/^Cmmit/7439b48cf )**: Add explicit support for ESLint 6.0.0 (#15974) //<Thomas Broyer>//
- **[fce15f14d](https://github.com/facebook/react/^Cmmit/fce15f14d )**: don't fire missing act() warnings for react-art (#15975) //<Sunil Pai>//
- **[20f354696](https://github.com/facebook/react/^Cmmit/20f354696 )**: [Flare] Ensure Press event hook does not execute side-effects (#15976) //<Dominic Gannaway>//
- **[d420d2ccb](https://github.com/facebook/react/^Cmmit/d420d2ccb )**: [Fresh] Retry failed roots on refresh (#15966) //<Dan Abramov>//
- **[04b77c630](https://github.com/facebook/react/^Cmmit/04b77c630 )**: followup to #15763, fix failing test in ReactDOMTracing-test (#15972) //<Sunil Pai>//
- **[e1c5e8720](https://github.com/facebook/react/^Cmmit/e1c5e8720 )**: warn if passive effects get queued outside of an act() call. (#15763) //<Sunil Pai>//
- **[39b97e8eb](https://github.com/facebook/react/^Cmmit/39b97e8eb )**: Report refreshed families to the caller (#15957) //<Dan Abramov>//
- **[d271df5c9](https://github.com/facebook/react/^Cmmit/d271df5c9 )**: Use function expression for custom Hook signature argument (#15956) //<Dan Abramov>//
- **[4189f712c](https://github.com/facebook/react/^Cmmit/4189f712c )**: [Scheduler] Increase max frame length to 300 //<Andrew Clark>//
- **[595c9414b](https://github.com/facebook/react/^Cmmit/595c9414b )**: [Scheduler] Fix navigator.isInputPending call //<Andrew Clark>//
- **[e7fcfe104](https://github.com/facebook/react/^Cmmit/e7fcfe104 )**: [scheduler] Put isPendingInput behind a flag (#15962) //<Andrew Clark>//
- **[6568a7993](https://github.com/facebook/react/^Cmmit/6568a7993 )**: [Scheduler] requestPaint (#15960) //<Andrew Clark>//
- **[8d4ddd33a](https://github.com/facebook/react/^Cmmit/8d4ddd33a )**: [Scheduler] Yield less if there's no pending input (#15959) //<Andrew Clark>//
- **[d77d12510](https://github.com/facebook/react/^Cmmit/d77d12510 )**: Expire rendering the tail of SuspenseList after a timeout (#15946) //<Sebastian Markbåge>//
- **[dc298fdf9](https://github.com/facebook/react/^Cmmit/dc298fdf9 )**: [Flare] Refinements to useEvent hook (#15955) //<Dominic Gannaway>//
- **[696609d49](https://github.com/facebook/react/^Cmmit/696609d49 )**: [Fiber] Clear down dependencies during detachFiber (#15947) //<Dominic Gannaway>//
- **[a5ed2f98f](https://github.com/facebook/react/^Cmmit/a5ed2f98f )**: [Flare] Guard against stateNode being null (#15952) //<Dominic Gannaway>//
- **[34ce57ae7](https://github.com/facebook/react/^Cmmit/34ce57ae7 )**: [Flare] Refine flow type annotations (#15950) //<Dominic Gannaway>//
- **[4f92fbce5](https://github.com/facebook/react/^Cmmit/4f92fbce5 )**: [Flare] Move createEvent back to React object (#15943) //<Dominic Gannaway>//
- **[175111de7](https://github.com/facebook/react/^Cmmit/175111de7 )**: Lazily initialize dependencies object (#15944) //<Andrew Clark>//
- **[720db4cbe](https://github.com/facebook/react/^Cmmit/720db4cbe )**: [Flare] Add useEvent hook implementation (#15927) //<Dominic Gannaway>//
- **[6ff4c9de1](https://github.com/facebook/react/^Cmmit/6ff4c9de1 )**: [Flare] Press: fix stale deactivation region state (#15931) //<Nicolas Gallagher>//
- **[7a4c3e3b7](https://github.com/facebook/react/^Cmmit/7a4c3e3b7 )**: Make global names more obscure (#15941) //<Dan Abramov>//
- **[270dc2e4d](https://github.com/facebook/react/^Cmmit/270dc2e4d )**: Add forwards and backwards options to SuspenseList (#15918) //<Sebastian Markbåge>//
- **[5368f7316](https://github.com/facebook/react/^Cmmit/5368f7316 )**: [Flare] Fix keyboard keyup regression (#15938) //<Dominic Gannaway>//
- **[3d0af2aea](https://github.com/facebook/react/^Cmmit/3d0af2aea )**: Don't consider require-like calls to be likely HOCs (#15940) //<Dan Abramov>//
- **[d4f384d25](https://github.com/facebook/react/^Cmmit/d4f384d25 )**: [Fresh] Throw in prod and change annotation (#15939) //<Dan Abramov>//
- **[ff91bfa58](https://github.com/facebook/react/^Cmmit/ff91bfa58 )**: [act] reset scope depth on synchronous errors (#15937) //<Sunil Pai>//
- **[e61c9e0a2](https://github.com/facebook/react/^Cmmit/e61c9e0a2 )**: [Flare] Fix Press retention state regression (#15936) //<Dominic Gannaway>//
- **[76864f7ff](https://github.com/facebook/react/^Cmmit/76864f7ff )**: Add SuspenseList Component (#15902) //<Sebastian Markbåge>//
- **[e9d0a3ff2](https://github.com/facebook/react/^Cmmit/e9d0a3ff2 )**: [Fresh] Track mounted roots via DevTools Hook (#15928) //<Dan Abramov>//
- **[35ef78de3](https://github.com/facebook/react/^Cmmit/35ef78de3 )**: [Scheduler] Integrated timers (#15911) //<Andrew Clark>//
- **[3af91eb8c](https://github.com/facebook/react/^Cmmit/3af91eb8c )**: [Scheduler] Use continuation pattern for posting host callback (#15910) //<Andrew Clark>//
- **[b62ae1642](https://github.com/facebook/react/^Cmmit/b62ae1642 )**: [Flare] Rename createEventComponent -> createEvent (#15929) //<Dominic Gannaway>//
- **[f4e1ac8ca](https://github.com/facebook/react/^Cmmit/f4e1ac8ca )**: [Flare] Press events include defaultPrevented (#15916) //<Nicolas Gallagher>//
- **[4a7a39b59](https://github.com/facebook/react/^Cmmit/4a7a39b59 )**: [Flare] Add RN build step for ReactTypes (#15926) //<Dominic Gannaway>//
- **[0bd755114](https://github.com/facebook/react/^Cmmit/0bd755114 )**: Remove mention of Prepack (#15922) //<Christoph Nakazawa>//
- **[689beef6f](https://github.com/facebook/react/^Cmmit/689beef6f )**: [Flare] Move unstable_createEventComponent to ReactDOM (#15890) //<Dominic Gannaway>//
- **[98454371a](https://github.com/facebook/react/^Cmmit/98454371a )**: Construct Error at invariant call site for clearer stack traces (#15877) //<Moti Zilberman>//
- **[f97b95166](https://github.com/facebook/react/^Cmmit/f97b95166 )**: [Flare] add disableContextMenu to Press (#15909) //<Nicolas Gallagher>//
- **[cd98e63b4](https://github.com/facebook/react/^Cmmit/cd98e63b4 )**: [Fresh] Fall back to Map/Set if Weak equivalents are not available (#15907) //<Dan Abramov>//
- **[a3c5b1fb8](https://github.com/facebook/react/^Cmmit/a3c5b1fb8 )**: [Fresh] Rename findHostNodesForHotUpdate to findHostInstancesForHotUpdate (#15904) //<Dan Abramov>//
- **[7985bf7d5](https://github.com/facebook/react/^Cmmit/7985bf7d5 )**: Remove outdated test renderer comments (#15898) //<Sebastian Markbåge>//
- **[f0156766d](https://github.com/facebook/react/^Cmmit/f0156766d )**: [Fresh] react-fresh => react-refresh (#15888) //<Dan Abramov>//
- **[801feed95](https://github.com/facebook/react/^Cmmit/801feed95 )**: Interaction tracing works across hidden and SSR hydration boundaries (#15872) //<Brian Vaughn>//
- **[661562fc5](https://github.com/facebook/react/^Cmmit/661562fc5 )**: Fix outdated test comments (#15892) //<Andrew Clark>//
- **[788da69b7](https://github.com/facebook/react/^Cmmit/788da69b7 )**: [Suspense] Fix bad loading state not being delayed (#15891) //<Andrew Clark>//
- **[353e0ee47](https://github.com/facebook/react/^Cmmit/353e0ee47 )**: [Flare] remove stopLocalPropagation option + modify responder ownership (#15889) //<Dominic Gannaway>//
- **[a146c1f9e](https://github.com/facebook/react/^Cmmit/a146c1f9e )**: [Flare] Refactor of Press to fix various issues (#15878) //<Dominic Gannaway>//
- **[de7a09c1e](https://github.com/facebook/react/^Cmmit/de7a09c1e )**: [Fresh] Make transform resilient to plugin order (#15883) //<Dan Abramov>//
- **[2fe8fd290](https://github.com/facebook/react/^Cmmit/2fe8fd290 )**: [Suspense] Use style.setProperty to set display (#15882) //<Andrew Clark>//
- **[e91dd70ba](https://github.com/facebook/react/^Cmmit/e91dd70ba )**: Remove disableYielding feature flag (#15654) //<Andrew Clark>//
- **[4d949d764](https://github.com/facebook/react/^Cmmit/4d949d764 )**: [React Native] Replace touch discrepancy errors to warnings (#15866) //<Timothy Yung>//
- **[45acbdc0b](https://github.com/facebook/react/^Cmmit/45acbdc0b )**: [Flare] Unsure root events are removed on contextmenu (#15862) //<Dominic Gannaway>//
- **[198ed661c](https://github.com/facebook/react/^Cmmit/198ed661c )**: [Suspense] Use !important to hide Suspended nodes (#15861) //<Andrew Clark>//
- **[191920605](https://github.com/facebook/react/^Cmmit/191920605 )**: [Fresh] Implement missing features (#15860) //<Dan Abramov>//
- **[c403ae4d3](https://github.com/facebook/react/^Cmmit/c403ae4d3 )**: [Flare] Move Press root event removal till click phase (#15854) //<Dominic Gannaway>//
- **[f4cd7a38d](https://github.com/facebook/react/^Cmmit/f4cd7a38d )**:  [Flare] Listen to document.body + add stopPropagation to Press (#15853) //<Dominic Gannaway>//
- **[425473f43](https://github.com/facebook/react/^Cmmit/425473f43 )**: [Flare] Improve runtime performance of hit target intersection (#15836) //<Dominic Gannaway>//
- **[def56c979](https://github.com/facebook/react/^Cmmit/def56c979 )**: [Fresh] Capture Hook signatures lazily on first render (#15832) //<Dan Abramov>//
- **[8cfcfe0fc](https://github.com/facebook/react/^Cmmit/8cfcfe0fc )**: [Flare] Fix ES6 issues with IE11 (#15834) //<Dominic Gannaway>//
- **[d0e041aee](https://github.com/facebook/react/^Cmmit/d0e041aee )**: [Fresh] Support classes by force-remounting them on edit (#15801) //<Dan Abramov>//
- **[73c27d8b4](https://github.com/facebook/react/^Cmmit/73c27d8b4 )**: [Flare] Add basic Scroll event responder module (#15827) //<Dominic Gannaway>//
- **[c72dceffb](https://github.com/facebook/react/^Cmmit/c72dceffb )**: [Flare] Small Swipe/Drag fixes (#15825) //<Dominic Gannaway>//
- **[6aaa43708](https://github.com/facebook/react/^Cmmit/6aaa43708 )**: Rename ReactFeatureFlags to remove the `.fb` suffix. (#15826) //<Christoph Nakazawa>//
- **[843a59ab6](https://github.com/facebook/react/^Cmmit/843a59ab6 )**: [React Native] Remove eventTypes from ReactNativeBridgeEventPlugin (#15802) //<Ricky>//
- **[7b28ad119](https://github.com/facebook/react/^Cmmit/7b28ad119 )**: [Flare] EventPriority enum (#15823) //<Andrew Clark>//
- **[d707a7579](https://github.com/facebook/react/^Cmmit/d707a7579 )**: nit: a quick copy edit for an act() message/comment (#15805) //<Sunil Pai>//
- **[cfb79ee5b](https://github.com/facebook/react/^Cmmit/cfb79ee5b )**: [Flare] Fix isTouchEvent (#15824) //<Dominic Gannaway>//
- **[6b5deeed5](https://github.com/facebook/react/^Cmmit/6b5deeed5 )**: [Events] Add support for events that are both user-blocking and continuous (#15811) //<Andrew Clark>//
- **[8d4fb132e](https://github.com/facebook/react/^Cmmit/8d4fb132e )**: [Flare] Fix nativeEvent.x/y for older browsers (#15820) //<Dominic Gannaway>//
- **[2534c0c92](https://github.com/facebook/react/^Cmmit/2534c0c92 )**: [Flare] Add event position properties to Hover responder (#15819) //<Dominic Gannaway>//
- **[dd43cb5fb](https://github.com/facebook/react/^Cmmit/dd43cb5fb )**: [Flare] Fix isPressWithinResponderRegion logic (#15808) //<Nicolas Gallagher>//
- **[4f6cab547](https://github.com/facebook/react/^Cmmit/4f6cab547 )**: [Flare] Ignore keyboard interactions on text input children (#15810) //<Nicolas Gallagher>//
- **[fa1e8df11](https://github.com/facebook/react/^Cmmit/fa1e8df11 )**: chore: use jest-serializer-raw for react-fresh snapshots (#15806) //<Simen Bekkhus>//
- **[07da821bf](https://github.com/facebook/react/^Cmmit/07da821bf )**: [react-native] Rewrite Haste imports in RN shims and add .fb.js extension (#15786) //<James Ide>//
- **[a383c4678](https://github.com/facebook/react/^Cmmit/a383c4678 )**: [ESLint] don't warn for Flow type variables (#15804) //<Jordan Rome>//
- **[5763f1d4c](https://github.com/facebook/react/^Cmmit/5763f1d4c )**: [Events] Nested discrete events across systems //<Andrew Clark>//
- **[7aa35ceae](https://github.com/facebook/react/^Cmmit/7aa35ceae )**: Fix casing of shouldflushDiscreteUpdates //<Andrew Clark>//
- **[91635dd48](https://github.com/facebook/react/^Cmmit/91635dd48 )**: Switch to "discrete" and "continuous" terminology //<Andrew Clark>//
- **[73c380fca](https://github.com/facebook/react/^Cmmit/73c380fca )**: WorkPhase -> ExecutionContext //<Andrew Clark>//
- **[88b396382](https://github.com/facebook/react/^Cmmit/88b396382 )**: [Flare] Remove deprecated keypress event (#15795) //<Nicolas Gallagher>//
- **[63fe08eef](https://github.com/facebook/react/^Cmmit/63fe08eef )**: React Events: allow Tab+Alt on Mac in Focus responder (#15679) //<Mateusz Burzyński>//
- **[113497cc0](https://github.com/facebook/react/^Cmmit/113497cc0 )**: [Suspense] Change Suspending and Restarting Heuristics (#15769) //<Sebastian Markbåge>//
- **[3b2302253](https://github.com/facebook/react/^Cmmit/3b2302253 )**: Fix sizebot (#15771) //<Andrew Clark>//
- **[0f7cc2ba8](https://github.com/facebook/react/^Cmmit/0f7cc2ba8 )**: React Events: check window before using navigator (#15768) //<Nicolas Gallagher>//
- **[2670bc340](https://github.com/facebook/react/^Cmmit/2670bc340 )**: React Events: support legacy browser Spacebar key value (#15766) //<Nicolas Gallagher>//
- **[9aad17d60](https://github.com/facebook/react/^Cmmit/9aad17d60 )**: using the wrong renderer's act() should warn (#15756) //<Sunil Pai>//
- **[1cc3bba00](https://github.com/facebook/react/^Cmmit/1cc3bba00 )**: Parallelizes the build script across multiple processes (#15716) //<Andrew Clark>//
- **[112168f31](https://github.com/facebook/react/^Cmmit/112168f31 )**: Lint rule for unminified errors (#15757) //<Andrew Clark>//
- **[142cf56cb](https://github.com/facebook/react/^Cmmit/142cf56cb )**: [Flare] Adds onContextMenu and fixes some contextmenu related issues (#15761) //<Dominic Gannaway>//
- **[556cc6fe1](https://github.com/facebook/react/^Cmmit/556cc6fe1 )**: [Fresh] Generate signatures for Hooks (#15733) //<Dan Abramov>//
- **[b74fa9868](https://github.com/facebook/react/^Cmmit/b74fa9868 )**: Clean up (#15755) //<Sebastian Markbåge>//
- **[d915a4c1f](https://github.com/facebook/react/^Cmmit/d915a4c1f )**: [Suspense] Add Batched Mode variant to fuzz tester (#15734) //<Andrew Clark>//
- **[401065fe5](https://github.com/facebook/react/^Cmmit/401065fe5 )**: Adds test for #15732. (#15747) //<Caleb Meredith>//
- **[287ef30bb](https://github.com/facebook/react/^Cmmit/287ef30bb )**: [Flare] Deeply prevent default on anchor elements (#15750) //<Dominic Gannaway>//
- **[a97b5c07b](https://github.com/facebook/react/^Cmmit/a97b5c07b )**: [Flare] More fixes for getAbsoluteBoundingClientRect (#15746) //<Dominic Gannaway>//
- **[393924879](https://github.com/facebook/react/^Cmmit/393924879 )**: [Fresh] Babel plugin now handles HOCs + add integration tests (#15724) //<Dan Abramov>//
- **[8af1f8792](https://github.com/facebook/react/^Cmmit/8af1f8792 )**: Rename ReactFiberScheduler -> ReactFiberWorkLoop and extract throwException from Unwind (#15725) //<Sebastian Markbåge>//
- **[399cd0d16](https://github.com/facebook/react/^Cmmit/399cd0d16 )**: Set up cron job to run fuzz tester (#15718) //<Andrew Clark>//
- **[025b07b61](https://github.com/facebook/react/^Cmmit/025b07b61 )**: [Flare] Ensure getAbsoluteBoundingClientRect aligns with offsetParent (#15720) //<Dominic Gannaway>//
- **[61f62246c](https://github.com/facebook/react/^Cmmit/61f62246c )**: [react-native] Use path-based imports instead of Haste for the RN renderer (#15604) //<James Ide>//
- **[b962adfc2](https://github.com/facebook/react/^Cmmit/b962adfc2 )**: [Flare] event component displayName is now mandatory (#15717) //<Dominic Gannaway>//
- **[5c2124fc7](https://github.com/facebook/react/^Cmmit/5c2124fc7 )**: [Fresh] Initial Babel plugin implementation (#15711) //<Dan Abramov>//
- **[b9ebc37c5](https://github.com/facebook/react/^Cmmit/b9ebc37c5 )**: Fix Flow (#15710) //<Dominic Gannaway>//
- **[a25a793fe](https://github.com/facebook/react/^Cmmit/a25a793fe )**: [Flare] update getEventCurrentTarget to use fiber tree (#15708) //<Dominic Gannaway>//
- **[b5dff62fa](https://github.com/facebook/react/^Cmmit/b5dff62fa )**: [Flare] Account for fixed elements in getAbsoluteBoundingClientRect (#15707) //<Dominic Gannaway>//
- **[f50f9ba5d](https://github.com/facebook/react/^Cmmit/f50f9ba5d )**: Fix ReactFiberNewContext spelling (#15692) //<Maksim Markelov>//
- **[e180f656f](https://github.com/facebook/react/^Cmmit/e180f656f )**: Flare: change flushDiscreteUpdates invariant to warning (#15702) //<Dominic Gannaway>//
- **[7829d8cf9](https://github.com/facebook/react/^Cmmit/7829d8cf9 )**: Fix missing return pointer assignment (#15700) //<Andrew Clark>//
- **[d7afe23f1](https://github.com/facebook/react/^Cmmit/d7afe23f1 )**: Rename "loading" to "busy" in SuspenseConfig API (#15699) //<Sebastian Markbåge>//
- **[ef4ac42f8](https://github.com/facebook/react/^Cmmit/ef4ac42f8 )**: [Flare] Update interactiveUpdates flushing heuristics (#15687) //<Dominic Gannaway>//
- **[6d4f85b61](https://github.com/facebook/react/^Cmmit/6d4f85b61 )**: [Fresh] Set up infra for runtime and Babel plugin (#15698) //<Dan Abramov>//
- **[121acae09](https://github.com/facebook/react/^Cmmit/121acae09 )**: Flare: simplify dispatchEvent discrete argument (#15694) //<Dominic Gannaway>//
- **[a398cbd5a](https://github.com/facebook/react/^Cmmit/a398cbd5a )**: Flare: update invalid accessor warnings + add no-ops (#15693) //<Dominic Gannaway>//
- **[9c9ea9485](https://github.com/facebook/react/^Cmmit/9c9ea9485 )**: flush only on exiting outermost act() (#15682) //<Sunil Pai>//
- **[50b50c26f](https://github.com/facebook/react/^Cmmit/50b50c26f )**: Inform DevTools of commit priority level (#15664) //<Brian Vaughn>//
- **[0bd9b5d00](https://github.com/facebook/react/^Cmmit/0bd9b5d00 )**: [Fresh] Support re-rendering lazy() without losing state (#15686) //<Dan Abramov>//
- **[ec38def44](https://github.com/facebook/react/^Cmmit/ec38def44 )**: [Fresh] Don't traverse remounted trees (#15685) //<Dan Abramov>//
- **[5731e522d](https://github.com/facebook/react/^Cmmit/5731e522d )**: [Fresh] Support lazy() and add Suspense tests (#15681) //<Dan Abramov>//
- **[31487dd82](https://github.com/facebook/react/^Cmmit/31487dd82 )**: [Fresh] Set up initial scaffolding (#15619) //<Dan Abramov>//
- **[9c6de716d](https://github.com/facebook/react/^Cmmit/9c6de716d )**: Add withSuspenseConfig API (#15593) //<Sebastian Markbåge>//
- **[1160b3769](https://github.com/facebook/react/^Cmmit/1160b3769 )**: Event API: Add responder allowMultipleHostChildren flag (#15646) //<Dominic Gannaway>//
- **[95e06ac3d](https://github.com/facebook/react/^Cmmit/95e06ac3d )**: Event API: isTargetWithinEventResponderScope on unmounted event components (#15672) //<Dominic Gannaway>//
- **[d278a3ff8](https://github.com/facebook/react/^Cmmit/d278a3ff8 )**: `act()` - s / flushPassiveEffects / Scheduler.unstable_flushWithoutYielding (#15591) //<Sunil Pai>//
- **[aad5a264d](https://github.com/facebook/react/^Cmmit/aad5a264d )**: Event API: ensure calculateResponderRegion accounts for page offset (#15671) //<Dominic Gannaway>//
- **[bb89b4eac](https://github.com/facebook/react/^Cmmit/bb89b4eac )**: Bail out of updates in offscreen trees (#15666) //<Dan Abramov>//
- **[4bf88ddec](https://github.com/facebook/react/^Cmmit/4bf88ddec )**: Fix <embed> not triggering onLoad (#15614) //<Andrew Cherniavskii>//
- **[f961050a3](https://github.com/facebook/react/^Cmmit/f961050a3 )**: Always flushPassiveEffects before rendering //<Andrew Clark>//
- **[b899819e7](https://github.com/facebook/react/^Cmmit/b899819e7 )**: Use dynamic flag in test renderer in www (#15662) //<Andrew Clark>//
- **[d34b457ce](https://github.com/facebook/react/^Cmmit/d34b457ce )**: Feature flag to revert #15650 (#15659) //<Andrew Clark>//
- **[668fbd651](https://github.com/facebook/react/^Cmmit/668fbd651 )**: Fix serial passive effects (#15650) //<Andrew Clark>//
- **[b0657fde6](https://github.com/facebook/react/^Cmmit/b0657fde6 )**: Event API: ensure getFocusableElementsInScope handles suspended trees (#15651) //<Dominic Gannaway>//
- **[8af90c897](https://github.com/facebook/react/^Cmmit/8af90c897 )**: Add test for nested avoided boundaries (#15636) //<Sebastian Markbåge>//
- **[af19e2eb2](https://github.com/facebook/react/^Cmmit/af19e2eb2 )**: Event API: adds pointerType to Focus events (#15645) //<Dominic Gannaway>//
- **[cc24d0ea5](https://github.com/facebook/react/^Cmmit/cc24d0ea5 )**: Invariant that throws when committing wrong tree (#15517) //<Andrew Clark>//
- **[83fc258f2](https://github.com/facebook/react/^Cmmit/83fc258f2 )**: Remove <ConcurrentMode /> (#15532) //<Andrew Clark>//
- **[283ce5320](https://github.com/facebook/react/^Cmmit/283ce5320 )**: Add ReactDOM.unstable_createSyncRoot (#15504) //<Andrew Clark>//
- **[862f499fa](https://github.com/facebook/react/^Cmmit/862f499fa )**: Add Batched Mode (#15502) //<Andrew Clark>//
- **[fec74f99d](https://github.com/facebook/react/^Cmmit/fec74f99d )**: Event API: ensure preventDefault works for nested targets (#15633) //<Dominic Gannaway>//
- **[edfedf3ae](https://github.com/facebook/react/^Cmmit/edfedf3ae )**: Fork ReactSharedInternals for UMD builds (#15617) //<Andrew Clark>//
- **[39ef609e7](https://github.com/facebook/react/^Cmmit/39ef609e7 )**: Update test to fix CI //<Andrew Clark>//
- **[5b6eb55e1](https://github.com/facebook/react/^Cmmit/5b6eb55e1 )**: Remove scheduler from React package dependencies (#15616) //<Andrew Clark>//
- **[0803d2247](https://github.com/facebook/react/^Cmmit/0803d2247 )**: Don't consider "Never" expiration as part of most recent event time (#15606) //<Sebastian Markbåge>//
- **[90f54d77f](https://github.com/facebook/react/^Cmmit/90f54d77f )**: Event API: add follow up event unwind test (#15612) //<Dominic Gannaway>//
- **[91a044e31](https://github.com/facebook/react/^Cmmit/91a044e31 )**: Event API: add key modifiers to Press events (#15611) //<Dominic Gannaway>//
- **[3d8b836e2](https://github.com/facebook/react/^Cmmit/3d8b836e2 )**: Event API: ensure we pop context for event system fibers (#15599) //<Dominic Gannaway>//
- **[e33e32db0](https://github.com/facebook/react/^Cmmit/e33e32db0 )**: Event API: normalize event timeStamp property to be in event system (#15598) //<Dominic Gannaway>//
- **[3669b9010](https://github.com/facebook/react/^Cmmit/3669b9010 )**: Event API: add more warnings for responder based events (#15597) //<Dominic Gannaway>//
- **[05d08500b](https://github.com/facebook/react/^Cmmit/05d08500b )**: Experimental Event API: Press event properties (#15586) //<Dominic Gannaway>//
- **[51e66cf9f](https://github.com/facebook/react/^Cmmit/51e66cf9f )**: Experimental Event API: reduce code size of event modules (#15590) //<Dominic Gannaway>//
- **[8abf243b8](https://github.com/facebook/react/^Cmmit/8abf243b8 )**: Ensure touch events are properly handled for pageX and pageY (#15587) //<Dominic Gannaway>//
- **[c7398f339](https://github.com/facebook/react/^Cmmit/c7398f339 )**: Add Suspense Boundary Context (and unstable_avoidThisFallback) (#15578) //<Sebastian Markbåge>//
- **[f9e60c8a1](https://github.com/facebook/react/^Cmmit/f9e60c8a1 )**: Warn when suspending at wrong priority (#15492) //<Andrew Clark>//
- **[89d8d1435](https://github.com/facebook/react/^Cmmit/89d8d1435 )**: Add React.unstable_createEventComponent (#15580) //<Nicolas Gallagher>//
- **[6da04b5d8](https://github.com/facebook/react/^Cmmit/6da04b5d8 )**: Fix interaction tracing for batched update mounts (#15567) //<Brian Vaughn>//
- **[d38cfd452](https://github.com/facebook/react/^Cmmit/d38cfd452 )**: Ensure TouchHitTarget element is server side rendered with hit slop (#15385) //<Dominic Gannaway>//
- **[2e5d1a8b9](https://github.com/facebook/react/^Cmmit/2e5d1a8b9 )**: React Events: fix cancel events for Press (#15563) //<Nicolas Gallagher>//
- **[307e0a7d7](https://github.com/facebook/react/^Cmmit/307e0a7d7 )**: React Events: cancel onLongPress for large enough moves (#15562) //<Nicolas Gallagher>//
- **[339366c46](https://github.com/facebook/react/^Cmmit/339366c46 )**: Event API: Support press reentry for pointer events (#15560) //<Dominic Gannaway>//

Changelog:
[General][Changed] - React sync for revisions ec6691a...55bc393

Reviewed By: yungsters

Differential Revision: D16555458

fbshipit-source-id: 2d71da52992fbb05b682247cfee20385d70a681b
2019-07-30 13:20:01 -07:00
Samuel Susla bd2b7d6c03 Fix onDismiss in Modal
Summary:
# Disclaimer:
I might be missing something as the solution I implemented here seems like something that was considered by original author. If this solution isn't good, I have a plan B.

# Problem:
`onDismiss` prop isn't being called once the modal is dismissed, this diff fixes it.

Also I've noticed that `onDismiss` is meant to only work on iOS, why is that? By landing this diff, it'll be called on Android as well so we need to change the docs (https://facebook.github.io/react-native/docs/modal.html#ondismiss).

## Video that shows the problem
Following code is in playground.js P70222409 which just increments number everytime onDismiss is called

{F166303269}

Reviewed By: shergin

Differential Revision: D16109536

fbshipit-source-id: 3fba56f5671912387b217f03b613dffd89614c9d
2019-07-29 11:19:30 -07:00
Spencer Ahrens 5ec382d1be New `useWindowDimensions` hook to replace most `Dimensions` usage
Summary:
Automatically provides and subscribes to dimension updates - super easy usage:
```
function MyComponent(props: Props) {
  const {width, height, scale, fontScale} = useWindowDimensions();
  return <Text ...
};
```

Only window for now - it's what people want 99% of the time, so we'll just shovel out a pit of success for them...

There are still cases where `Dimensions` is needed outside of React component render functions, like in GraphQL variables, so we need to keep the existing module.

Reviewed By: zackargyle

Differential Revision: D16525189

fbshipit-source-id: 0a049fb3be8d92888a8a69e3898d337b93422a09
2019-07-29 11:09:44 -07:00
Dan Abramov ebb3243907 Update refs on remount
Summary:
This fixes a bug where a ref to a class would get nulled after the class is edited. Now it's appopriately updated.

This is technically a partial sync on top of my last cherry-picked one. It only picks up this commit: 9914a19190. The changes are DEV-only and only affect Fast Refresh.

Reviewed By: motiz88

Differential Revision: D16543751

fbshipit-source-id: c1fc393e78d0e13070721037d16734c9ece38bc9
2019-07-29 10:32:46 -07:00
Moti Zilberman 77125a1ac3 Use Metro support for auto-collapsing internal stack frames (#25839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25839

Changes `ExceptionsManager` to respect the `collapse` field in each symbolicated stack frame returned from Metro. This is ultimately driven by a Metro config option (which will have a default set in https://github.com/react-native-community/cli/pull/596).

This is part of a redesign of work done originally in https://github.com/facebook/react-native/pull/24662.

Reviewed By: cpojer

Differential Revision: D16500277

fbshipit-source-id: b0b035618cb000935a555796523637b5f0a688d3
2019-07-29 07:44:56 -07:00
Mats Byrkjeland bb623e6983 Allow Animation EndResult callback to return Promise (#25793)
Summary:
I am sending an asynchronous function as callback to the `.start` method of `Animation.parallel([...]).start(callback)`. Flow does not like this, as the `EndCallback` type is saying that these callbacks must return `void`. Since my callback returns `Promise<void>` this results in an error.

Does it really matter what the callback returns?

## Changelog

[General] [Changed] - Make Animation EndCallback type allow any return value
Pull Request resolved: https://github.com/facebook/react-native/pull/25793

Test Plan: I have run `yarn flow`, which reported no errors.

Reviewed By: cpojer

Differential Revision: D16515465

Pulled By: osdnk

fbshipit-source-id: 420d29d262b65471e6e1ad4b5a126bf728336260
2019-07-26 03:50:28 -07:00
Christoph Nakazawa 179889704b Fall back to `JSON.stringify` in `console.log` if Symbol is unavailable
Summary: Symbol is not available in older versions of JSON resulting in crashes in `prettyFormat` because we are using a clowny transform.

Reviewed By: sebmck

Differential Revision: D16501208

fbshipit-source-id: 9952bf4993ae05335707cd386f9aa4bbc14b7564
2019-07-25 15:32:06 -07:00
Ramanpreet Nara b771e20ee9 Deprecate RCTExport
Summary: This diff renames `RCTExport` to `DEPRECATED_RCTExport`. I'll deal with the repercussions of this change in subsequent diffs.

Reviewed By: fkgozali

Differential Revision: D16468382

fbshipit-source-id: 571abbefbf68b03e351327cb52835cce2dfbc8bb
2019-07-25 15:04:04 -07:00
James Treanor ca9e108110 Remove 's.static_framework = true' requirement for podspec (#25816)
Summary:
As part of the fix for https://github.com/facebook/react-native/issues/25349 I added `s.static_framework = true` to each podspec in repo (see https://github.com/facebook/react-native/pull/25619#discussion_r306993309 for more context).

This was required to ensure the existing conditional compilation with `#if RCT_DEV` and `__has_include` still worked correctly when `use_frameworks!` is enabled.

However, fkgozali pointed out that it would be ideal if we didn't have this requirement as it could make life difficult for third-party libraries.

This removes the requirement by moving `React-DevSupport.podspec` and `React-RCTWebSocket.podspec` into `React-Core.podspec` as subspecs. This means the symbols are present when `React-Core.podspec` is built dynamically so `s.static_framework = true` isn't required.

This means that any `Podfile` that refers to `React-DevSupport` or `React-RCTWebSocket` will need to be updated to avoid errors.

## Changelog

I don't think this needs a changelog entry since its just a refinement of https://github.com/facebook/react-native/pull/25619.
Pull Request resolved: https://github.com/facebook/react-native/pull/25816

Test Plan:
Check `RNTesterPods` still works both with and without `use_frameworks!`:

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: hramos

Differential Revision: D16495030

Pulled By: fkgozali

fbshipit-source-id: 2708ac9fd20cd04cb0aea61b2e8ab0d931dfb6d5
2019-07-25 11:46:43 -07:00
Christoph Nakazawa abd7faf354 Use prettyFormat for Metro logging
Summary: Right now we are using `JSON.stringify` which is very lossy with regards to JavaScript data types like functions, `undefined`, NaN and others. This diff switches the logging on the client side to use `prettyFormat` which is part of Jest. It allows to handle much richer log messages.

Reviewed By: gaearon

Differential Revision: D16458775

fbshipit-source-id: e1d2c125eb8357a9508521aa15510cb4f30a7fa9
2019-07-25 01:24:55 -07:00
James Treanor 8131b7bb7b CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.

It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.

The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .

There are still a few breaking changes which I hope will be acceptable:

- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.

Still to do:

- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �

## Changelog

[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619

Test Plan:
### FB

```
buck build catalyst
```

### Sample Project

Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.

### RNTesterPods

`RNTesterPodsPods` can now work with or without `use_frameworks!`.

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: PeteTheHeat

Differential Revision: D16465247

Pulled By: PeteTheHeat

fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-24 23:27:09 -07:00
Ramanpreet Nara 76ff31616e Add NativeModule Spec for PushNotificationManager
Summary: In OSS, we only had an iOS implementation of this NativeModule. Internally, we have several different Android implementations. The iOS and the Android implementations don't have the same APIs. So, I didn't name this Spec generically `NativePushNotificationManager`.

Reviewed By: mdvacca

Differential Revision: D16390844

fbshipit-source-id: 97b53042892f80089fc8cf5e1c8a06bd49696594
2019-07-24 15:24:50 -07:00
Ramanpreet Nara ccde2fda6a Add NativeModule Spec for StatusBarManager
Summary: This diff introduces NativeStatusBarManager.

Reviewed By: mdvacca

Differential Revision: D16371384

fbshipit-source-id: a5485f8dec53a8f3f5bd22ad76e9f8ee0fc56f4c
2019-07-24 15:24:49 -07:00
Dan Abramov 5e960e30eb Don't show warnings unless we managed to connect
Summary:
On iOS we don't call `HMRClient.setup()` when Metro is off. So we don't bump into any odd cases.

But on Android, we do call `HMRClient.setup()` even if Metro is off. As a result, we might show a warning about Metro not running to a native engineer who doesn't care (because they don't intend to work on JS).

We could fix this on Android on the native side. And we probably should.

But we can also strengthen it here. The idea is that we should only show warnings about disconnecting from Metro *if we ever managed to successfully connect in the first place*. Otherwise, we can assume that you didn't mean to connect.

If the user is trying to determine the source of the problem, they can still do a full Refresh (on iOS this will show a message about needing Metro, on Android it would show a redbox). So this diff makes the disconnected behavior closer to how it worked before Fast Refresh.

Reviewed By: sahrens

Differential Revision: D16460439

fbshipit-source-id: bf962ff34c25d9734d9668dd583591acacb98253
2019-07-24 11:11:46 -07:00
Dan Abramov 2a3ac0429b Tweak messages and fix the warning condition
Summary:
Two changes:

1. If you're connected at startup, and then disconnect, we're supposed to show a yellow box. Looks like we weren't doing it for a few days because the field we were checking has turned into a method.

2. I changed the wording back to remove "Metro" since the packager may be Haul, for example. So I'm just calling it "development server". Does that seem reasonable? I also removed mentions of Fast Refresh since it's not actually relevant to the problem.

Reviewed By: cpojer

Differential Revision: D16459080

fbshipit-source-id: c9c1f19718d522c745e4107a3e7e3a6c63f82642
2019-07-24 11:11:46 -07:00
Peter Argany 8a80d613f5 Deprecate RCTImageLoader category of RCTBridge [2/N]
Summary: We no longer want to access RCTImageLoader from the bridge.

Reviewed By: shergin

Differential Revision: D16389383

fbshipit-source-id: 8e006bf0e2e2651f3ac036c09e589213ac9d29f9
2019-07-24 10:51:13 -07:00
Christoph Nakazawa 81ec2112a1 Use HMRClient to send console logs to Metro
Summary:
This change switches the sending of log messages to Metro from HTTP over to WebSocket. This is what I should have done from the beginning *however* I only spent very little time on this initially, didn't realize that it would be a popular feature *and* we didn't have a persistent WebSocket connection on the client before that was always on. Together with D16442656 we can finally make this happen!

This change:
* Changes the `fetch` call to `HMRClient.log`
* Removes the middleware and integrates logging with `HmrServer` directly in Metro.
* Simplifies the logging logic as WebSockets guarantee messages are processed in order.

This also fixes an issue makovkastar identified when using the `MessageQueue` spy: because we send messages back and forth over the bridge, using `console.log` within `MessageQueue`'s spy method will actually cause an infinite logging loop. This is the proper solution to that problem instead of hacking around it using custom headers.

Note: in a follow-up we will rename these modules to drop the `HMR` prefix. We have not come up with a better name yet and are open to ideas.

Reviewed By: sebmck

Differential Revision: D16458499

fbshipit-source-id: 4c06acece1fef5234015c877354fb730b155168c
2019-07-24 08:11:34 -07:00
Dan Abramov 8b5ed7abdd Fixing error on first mount should fall back to reload
Summary:
This updates `react-refresh` to 0.3.0 which brings a new feature: we can now detect if the root fails on _the initial mount_. In that case we currently can't recover with Fast Refresh because we don't know which element to retry mounting. (In the future, we can lift this limitation, but it would require more changes in React renderer.)

Before this diff, after you fix an error on initial mount, you would see a blank screen (because nothing managed to mount).

After this diff, after you fix an error on initial mount, you would fall back to a full reload.

This diff doesn't affect errors on updates. We can recover from those, just like before.

Reviewed By: cpojer

Differential Revision: D16440836

fbshipit-source-id: 4a414202a9eab894acd7baa0525c25ff003dd323
2019-07-23 16:19:15 -07:00