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

4753 Коммитов

Автор SHA1 Сообщение Дата
Ramanpreet Nara ca70e8e469 Improve ScrollView docs and types
Summary: I was reading through the ScrollView code and realized that the documentation was incomplete, and some of the flow types were wrong.

Reviewed By: yungsters

Differential Revision: D13583133

fbshipit-source-id: 11c495681e9671e078e4d2c9df76c25b04558696
2019-01-14 09:14:33 -08:00
Arthur Lee 6c501eb666 Fix status bar default on Android
Summary: On Android, the status bar color is not always black by default. The existing code causes the status bar to revert to black once the last `<StatusBar>` component is unmounted from the "stack". This diff reverts the bar background color to what it was before, instead of assuming black.

Reviewed By: yungsters

Differential Revision: D13368136

fbshipit-source-id: ef0154f776607b57bb9400b72d521f5f485b0075
2019-01-10 14:53:22 -08:00
Joshua Gross 630e9faf74 Fix permissions regression in RCTCameraRollManager
Summary:
In the past (pre D13593314), ALAssetsLibrary camera operations would pop up a permissions dialogue when appropriate and block until the user responded to the dialogue. The calls that we're now using with PHPhotoLibrary immediately return if we don't have permission to access the photo library or haven't asked before, and then asynchronously pop up a permissions dialogue, causing every first photo interaction to fail. Instead we now explicitly check for permissions or request
permissions before any operations.

Reviewed By: PeteTheHeat

Differential Revision: D13620079

fbshipit-source-id: e1befc0ddaec2c1b3334e361f5ae3a3efc5da71d
2019-01-10 13:10:28 -08:00
Brian Shin 5c0b9071e7 Remove PlatformOS from RN
Summary: The existence of this file was confusing many in open source (5ee27ff755) and is no longer needed internally. Delete this file to remove the fork.

Reviewed By: fkgozali

Differential Revision: D13625760

fbshipit-source-id: 1be1943471b67e914377c24d445568532e378385
2019-01-10 12:52:02 -08:00
Eli White a1dc92e6f0 Fix Flow type for onAccessibilityEscape
Summary: This was added in [this PR](https://github.com/facebook/react-native/pull/22047) with a non strict type

Reviewed By: yungsters

Differential Revision: D13617894

fbshipit-source-id: 849f83203556e2830ac725570c9053503377f4be
2019-01-10 11:25:51 -08:00
Ramanpreet Nara 0265ee199b Fix autoFocus
Summary: In D13408886, I landed a PR that broke the `autoFocus` prop. This diff fixes this prop by partially reveting some of the changes in that diff.

Reviewed By: TheSavior

Differential Revision: D13611258

fbshipit-source-id: 225b9b59b2500cfac092f13c273685aaeb599ab0
2019-01-09 15:31:43 -08:00
Eli White f40a04ae3a Remove $FlowFixMe on View
Summary: https://fb.workplace.com/groups/flow/permalink/2274899262558676/

Reviewed By: yungsters

Differential Revision: D13610629

fbshipit-source-id: 5d066ff50b056d5dde0fa5b99796e6846723f5cf
2019-01-09 12:25:31 -08:00
Eli White 2f32fea79a Remove LayoutStyle, ShadowStyle, TransformStyle in favor of just ViewStyleProp
Summary: We are working to remove additional types and eventually define everything at the top level as a public exported type of react-native. I was able to update callsites by just using ViewStyleProp in places that were expecting a prop of just one of these. It is a little bit weaker, but much simpler. If a callsite wants to only take margin, it should just take a margin prop instead of a LayoutStyle prop.

Reviewed By: rickhanlonii

Differential Revision: D13599460

fbshipit-source-id: 12c01bc58baa7f6acf33e0b8aab05dabb79c646b
2019-01-08 18:49:37 -08:00
Joshua Gross 8e9ce92f57 Un-revert D13513777: Replace ALAssets* with PHPhoto* in RCTCameraRoll
Summary: Replaced all deprecated ALAssets* references to roughly equivalent PHPhoto* references in RCTCameraRoll library. There are still some minor inconsistencies between iOS/Android and documentation that existed prior to this diff that need to be resolved after this.

Reviewed By: fkgozali

Differential Revision: D13593314

fbshipit-source-id: 6d3dc43383e3ad6e3dbe73d4ceceac1ba9261d9d
2019-01-07 16:15:44 -08:00
Luna Wei b5e6ae0fc4 Unify native props
Summary: Unify native props for Switch

Reviewed By: TheSavior, mdvacca

Differential Revision: D13563403

fbshipit-source-id: d219febf197bd024d1ef2acda9f42e40bdf39532
2019-01-07 15:39:21 -08:00
Kevin Gozali a3df286247 Move TurboModuleRegistry (JS) to github
Summary:
Moved the JS wrapper function to github. To access a TurboModule from JS:

```
export interface Spec extends TurboModule {
  +func1: () => number,
}

const module = TurboModuleRegistry.get<Spec>('SampleTurboModule');
```

This assumes:
* the binding on the native side has been installed properly, i.e. `global.__turboModuleProxy` needs to be installed properly.
* the module `SampleTurboModule` is registered properly in native.

More instructions will be provided later.

Reviewed By: yungsters

Differential Revision: D13584561

fbshipit-source-id: 50d29d88787f8d9caa7a3ee0d54d378db866515c
2019-01-04 16:19:43 -08:00
Ullrich Schäfer ac39795948 Fixing ActionSheetIOS position after rotation on tablet (#22738)
Summary:
There's been a bug on iOS and iPad that the position of an action sheet using UIActionController isn't updated if the position of its anchor view changes due to rotating the device. A common scenario would be, presenting an action sheet from a right bar button item. Rotating the device will most likely change the bar button's X coordinate. The action sheets arrow would still point to the old position due to how it has been implemented so far.

I used also reduced some code duplication between `-showActionSheetWithOptions` and `-showShareActionSheetWithOptions:` while at it.

Changelog:
----------

[iOS] [Fixed] - Action Sheet position after rotation on tablet
Pull Request resolved: https://github.com/facebook/react-native/pull/22738

Differential Revision: D13582810

Pulled By: PeteTheHeat

fbshipit-source-id: a93065284b02efc41ae7378465521330a828a126
2019-01-04 13:09:00 -08:00
Shen Junru 7de2f77d20 Fix expose originalConsole issue (#22844)
Summary:
The "originalConsole" expose is incorrect in the "polyfills/console.js"

Changelog:
----------

[GENERAL] [Fixed] - Fixed originalConsole expose issue
Pull Request resolved: https://github.com/facebook/react-native/pull/22844

Differential Revision: D13579480

Pulled By: cpojer

fbshipit-source-id: 1d3ad84d3560b757df23170924af9c7655738871
2019-01-04 00:04:05 -08:00
Rick Hanlon 2b883abc06 Codemod ImageStyleProp
Summary:
Created by running:

```
$ js1 codeshift rn-stylesheet-exports --component="Image" --prop="ImageStyleProp" ./
$ hg status -n --change . | xargs js1 prettier
```

drop-conflicts

Reviewed By: TheSavior

Differential Revision: D13565530

fbshipit-source-id: cc1ae4274db315bce607c2b62db786f87a2cfc21
2019-01-03 06:53:53 -08:00
Rick Hanlon 44a289cf26 Switch Text style to TextStyleProp
Summary: This diff switches `Text.style` from `DangerouslyImpreciseStyle` to `TextStyleProps` and fixes/ignores the related flow issues

Reviewed By: TheSavior

Differential Revision: D13568053

fbshipit-source-id: b4b6f8c22323faf9592ef13697043bb181c77423
2019-01-03 03:43:26 -08:00
zhongwuzw dd209bb789 Fix crash for web socket in some race conditions (#22439)
Summary:
Fixes #21086.
Fixes #6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: https://github.com/facebook/react-native/pull/22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
2019-01-01 17:55:29 -08:00
Ignacio Olaciregui 2c3f807ace Fix no shadow warnings (#22190)
Summary:
Fixes `no-shadow` eslint errors.
Pull Request resolved: https://github.com/facebook/react-native/pull/22190

Differential Revision: D13564238

Pulled By: cpojer

fbshipit-source-id: 96ba36b397088fa406e8f5781b1538a0b6804a8d
2019-01-01 17:13:15 -08:00
Ramanpreet Nara 0b1f74712f Fix DatePickerAndroid flow errors
Summary: This diff fixes errors in our internal call sites caused by D12919276.

Reviewed By: TheSavior

Differential Revision: D13489905

fbshipit-source-id: e149fb9b479172529c473108e10a2ff1d3066aa7
2018-12-26 12:03:45 -08:00
nd-02110114 60f3b53cef Flow strict in DatePickerAndroid.android.js, DatePickerAndroid.ios.js (#22106)
Summary:
Related to #22100

Turn Flow strict mode on for DatePickerAndroid

- [x] npm run prettier
- [ ] npm run flow-check-ios
- [ ] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/DatePickerAndroid/DatePickerAndroid.android.js] - Flow strict mode
[GENERAL] [ENHANCEMENT] [Components/DatePickerAndroid/DatePickerAndroid.ios.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22106

Reviewed By: TheSavior

Differential Revision: D12919276

Pulled By: RSNara

fbshipit-source-id: 79672b2894435ca3c9988fefee3685700a8d8936
2018-12-26 12:03:45 -08:00
Ramanpreet Nara 010e3302b8 Refactor ScrollResponder Mixin removal
Summary: In D13307775, ScrollView was changed into a `React.Component` subclass. The solution needed a few touchups, so I added them in this diff.

Reviewed By: TheSavior

Differential Revision: D13404191

fbshipit-source-id: cba2ddab1fb92a2cbb91b59ac9ae5b5d51d91eb8
2018-12-26 10:34:41 -08:00
Michał Pierzchała 221e2fe409 Remove mixins from ScrollView (#22374)
Summary:
As a part of https://github.com/facebook/react-native/pull/22301 it turned out that we need to first convert `ScrollView` to class component. As a first step to do so, here's removal of using `mixins` API, in favor of populating `_scrollResponder` field with `ScrollResponder.Mixin` (still used) methods.
Pull Request resolved: https://github.com/facebook/react-native/pull/22374

Reviewed By: TheSavior

Differential Revision: D13307775

Pulled By: RSNara

fbshipit-source-id: 16be1df8a0bf9ccc5cc32f3a017a1279f99268ed
2018-12-26 10:34:41 -08:00
empyrical 94456ed3d8 TextInput: Remove use of legacy context API (#22220)
Summary:
This removes the use of the legacy context API in `TextInput`.

Nothing in OSS appears to make use of the `focusEmitter`.
Pull Request resolved: https://github.com/facebook/react-native/pull/22220

Reviewed By: TheSavior

Differential Revision: D13408886

Pulled By: RSNara

fbshipit-source-id: 9ae597507ccc26a9bc944a44c1f51b91e73cd637
2018-12-26 09:58:33 -08:00
Diego Sanchez 193615a158 Revert D13513777: Replace ALAssets* with PHPhoto* in RCTCameraRoll
Differential Revision:
D13513777

Original commit changeset: 3f0c4ae25982

fbshipit-source-id: a3a868db96eb65415a5512974da1a2f695773065
2018-12-22 00:19:10 -08:00
Joshua Gross 8ce9b47626 Replace ALAssets* with PHPhoto* in RCTCameraRoll
Summary: Replaced all deprecated ALAssets* references to roughly equivalent PHPhoto* references in RCTCameraRoll library. There are still some minor inconsistencies between iOS/Android and documentation that existed prior to this diff that need to be resolved after this.

Reviewed By: fkgozali, PeteTheHeat

Differential Revision: D13513777

fbshipit-source-id: 3f0c4ae259823fae78eba875a6c259733715ab56
2018-12-21 23:13:50 -08:00
Valentin Shergin 1bd66d9aa9 RCTSurface: Calling `start` is now required to start the Surface
Summary:
So, it does not start itself automatically right after instantiation.
(Classic RCTSurface still kinda start itself automatically but only because start/stop concept is not implemented for this yet.)

Reviewed By: sahrens

Differential Revision: D13461294

fbshipit-source-id: 05430688f69a0d9bf75d03e6d25f02ccd5d3176a
2018-12-18 12:57:38 -08:00
Janic Duplessis c3caca9210 Make TextInput event prop types less strict (#22673)
Summary:
Similar to what was done here https://github.com/facebook/react-native/pull/22376

This allows using things like async functions with text input event props.

Changelog:
----------

[General] [Fixed] - Make TextInput event prop types less strict

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

Reviewed By: TheSavior

Differential Revision: D13492029

Pulled By: hramos

fbshipit-source-id: 84e1a776a7ac1ae7567fbf4105b2be9be330610e
2018-12-17 17:26:25 -08:00
glevi@fb.com 24f8d4d3db Deploy v0.89
Reviewed By: jbrown215

Differential Revision: D13457087

fbshipit-source-id: 9f01371ae3515990c5595f1eb2361174050066b8
2018-12-14 13:57:50 -08:00
Fred Liu 1a499f43b2 Enable removeClippedSubviews on Android only for improved scrolling performance
Summary: Android scrolling performance is very poor with this disabled. iOS has some KP with this enabled, so disable it for iOS.

Reviewed By: sahrens

Differential Revision: D13363494

fbshipit-source-id: efab77b5db9676dd0521ae4193465d45ac34dda3
2018-12-12 12:55:02 -08:00
Rick Hanlon 3bef4bddbf Measure responder region on first state transition
Summary:
This diff fixes a bug in Touchable and Pressability where a long delay setting would unwillingly trigger presses by the user.

The cause of this bug is that we were not calculating the responder region until _after_ the delay. If you were to lift up outside of the press rect _before_ we calculate the responder region, we wouldn't be able to calculate that you're outside of the region (i.e. never transitioned to an "out" state) and would register the press

The fix is to start the calculation as soon as you transition into the initial state, so the calculation is available by the time we need to check if you're in an out state

Reviewed By: TheSavior

Differential Revision: D13412934

fbshipit-source-id: 55d1c2a9e70d4e3ce268f92075d7d09dd842a81e
2018-12-11 22:40:49 -08:00
David Vacca d1b90ee9e2 Allow to toggle Android WebView HardwareAcceleration from JS
Summary:
This diff exposes a new prop for WebView in Android to disable HardwareAcceleration.
Disabling hardware acceleration is sometimes required to workaround chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=501901

Reviewed By: fkgozali

Differential Revision: D13425243

fbshipit-source-id: e3cd53c72d01f74624b60834496f3cc44076b6b5
2018-12-11 21:28:53 -08:00
Nat Mote aaa4a38fbc Upgrade to Flow v0.88.0
Summary:
allow-large-files

https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/#update-xplat-js

Reviewed By: samwgoldman

Differential Revision: D13418170

fbshipit-source-id: 91ab0d2788c1061b8c81a39f8a017eedea48abe2
2018-12-11 20:01:00 -08:00
Luis Flores f14edd8a0c Fix ListViewMock unique key error (#14894)
Summary:
Add key prop to renderHeader and renderFooter in ListViewMock.
Fix unique key error when using jest snapshots.

It closes #12762
Pull Request resolved: https://github.com/facebook/react-native/pull/14894

Reviewed By: TheSavior

Differential Revision: D13396721

Pulled By: cpojer

fbshipit-source-id: 5bbcb8157e3cd98fe07f2a037e1dbc06ab599c87
2018-12-10 17:13:54 -08:00
byronluk 6a483495c8 added utfsequence to react-native exports (#20955)
Summary:
Fixes #20935

Added UTFSequence module to React-Native exports. Put it under // APIs but I'm not certain if it belongs there.
Pull Request resolved: https://github.com/facebook/react-native/pull/20955

Differential Revision: D13396903

Pulled By: cpojer

fbshipit-source-id: 29cb2ee1431132bd7ca4973fecb0025cd6303a14
2018-12-10 17:10:23 -08:00
Marius Reimer ddc3471f88 set blob as default XMLHttpRequest header response type if supported (#22063)
Summary:
This is a problem that is discussed in issue #21092

Related issues: #21851 #19717

Found the code to eventually fix this issue [here](899b155746/fetch.js (L486))

- [x] Fetching an image locally and check if the blob is there, as well as its size > 0.

___
Help reviewers and the release process by writing your own release notes. See below for an example.

[GENERAL] [ENHANCEMENT] [whatwg-fetch] - set blob as default XMLHttpRequest header response type if supported
Pull Request resolved: https://github.com/facebook/react-native/pull/22063

Differential Revision: D13408797

Pulled By: cpojer

fbshipit-source-id: 9822d5a7e24bacd72838f3fc9a61b1a97b44484b
2018-12-10 16:59:20 -08:00
Ben Holcomb 6cc6f8f488 Revert D13402177: [react-native][PR] Map textContentType strings to Objective-C constants
Differential Revision:
D13402177

Original commit changeset: 55f4a2029cd3

fbshipit-source-id: b4871d10a9622f3312845a6682c482760e7e79e0
2018-12-10 13:05:12 -08:00
Levi Buzolic 077386a233 Map textContentType strings to Objective-C constants (#22579)
Summary:
Fixes #22578

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22579

Differential Revision: D13402177

Pulled By: shergin

fbshipit-source-id: 55f4a2029cd3ea1fb4834e9f56d2df5a05b31b4e
2018-12-10 12:11:51 -08:00
luckyzeng 3592122af3 Delete unused code in console.js (#20860)
Summary:
The isPrimitive method in [console.js](5c2720b089/Libraries/polyfills/console.js (L364)) is unused. It should be deleted.
Pull Request resolved: https://github.com/facebook/react-native/pull/20860

Differential Revision: D13396715

Pulled By: cpojer

fbshipit-source-id: ddfd828086106c997dcc77f5eae67adb6a0c1dfa
2018-12-10 05:48:32 -08:00
Christoph Nakazawa 78132a0ab8 Fix weird `createAnimatedComponent` babel/flow bug
Summary: There are some versions of babel 7's flow support that cause problems with property initializers. I changed this code to use class properties to fix the issue. See https://github.com/facebook/react-native/issues/20588

Reviewed By: TheSavior

Differential Revision: D13396959

fbshipit-source-id: a76266ac0c8a6a19a1c45f7136de4aba9c72581d
2018-12-10 00:39:06 -08:00
Rick Hanlon 9fdbf6029e Add e2e tests, bug fixes for testIDs (#22537)
Summary:
This PR adds e2e tests for the Picker and DatePicker components.

While writing these tests, I also found and fixed two bugs where we wern't passing the `testID` down to the native components, so detox couldn't look them up. This confirms what was mentioned by rotemmiz [here](https://github.com/wix/Detox/issues/798#issuecomment-401412276)
Pull Request resolved: https://github.com/facebook/react-native/pull/22537

Reviewed By: cpojer

Differential Revision: D13371307

Pulled By: rickhanlonii

fbshipit-source-id: a4dfcdb5913645bceca0c7353328eeb9ad0f6558
2018-12-07 14:54:42 -08:00
Tnarita0000 d2318c403f Remove var from Network/__tests__/XMLHttpRequest-test.js (#22195)
Summary:
Remove var from Network/__tests__/XMLHttpRequest-test.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/emitter] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22195

Differential Revision: D13374893

Pulled By: cpojer

fbshipit-source-id: 0d07599406c1195f2f98e17df98be7d42efdf664
2018-12-07 02:50:05 -08:00
Taylor123 f6d3a61677 default hitSlop values to 0 (#22281)
Summary:
Experienced a `TouchableOpacity` releasing the `PanResponder` without invoking `onPress` due to a missing a direction key in the `hitSlop` prop; The missing key caused the corresponding pressExpand to become NaN which causes `isTouchWithinActive` to become falsey, when it should be truthy.

If defaulting to 0 is undesired behavior, I'm happy to take a different approach.
Pull Request resolved: https://github.com/facebook/react-native/pull/22281

Differential Revision: D13374335

Pulled By: cpojer

fbshipit-source-id: f9d28e51b9d9c45aed42bea2df3d844a799fa827
2018-12-06 21:44:36 -08:00
Karan Thakkar de6cdc442d Rename RCTImageCacheDelegate -> RCTImageCache in code comment (#22406)
Summary:
Update reference to property in code comment in `RCTImageLoader`. There is no protocol named `RCTImageCacheDelegate` in the codebase. Its just `RCTImageCache` and it exists [here](f2894e58cf/Libraries/Image/RCTImageLoader.h (L22)).
Pull Request resolved: https://github.com/facebook/react-native/pull/22406

Differential Revision: D13373793

Pulled By: cpojer

fbshipit-source-id: b5edf18ebad626bf09648c079299e5acd14ba48a
2018-12-06 21:13:58 -08:00
ferrannp e8a6cb5e18 Android: Adding sendIntent on Linking module (#22302)
Summary:
This PR implements "Add a standardized way to send intents on Android" discussed in https://github.com/react-native-community/discussions-and-proposals/issues/34.
Pull Request resolved: https://github.com/facebook/react-native/pull/22302

Differential Revision: D13374186

Pulled By: cpojer

fbshipit-source-id: 2f0b9b9f46e99f382b6c35b1914e75df23a7fd74
2018-12-06 21:13:58 -08:00
gtebbutt cc4211c72f Restore TouchableHighlight and TouchableOpacity behaviour on TV platforms (#21478)
Summary:
Since #18470, the default focus behaviour of `TouchableHighlight` and `TouchableOpacity` has been missing on tvOS. This uses the new `touchableHandleFocus` and `touchableHandleBlur` functions to restore the behaviour. Fixes #21295.
Pull Request resolved: https://github.com/facebook/react-native/pull/21478

Differential Revision: D13372959

Pulled By: cpojer

fbshipit-source-id: a5fa9d45214ac48a14a6573ccf014bba1ee0a103
2018-12-06 21:09:25 -08:00
Christoph Nakazawa 2e5e9fa88a Move asset related modules into `metro-buck`
Summary:
These files are some of the few standalone files from the `local-cli` that are used internally. This diff copies them into the one place where they are used. Note that I am leaving the old files in `local-cli`. Even if they are unused, moving them would break flow (require module verification).

This diff also moves the `assetPathUtils` file into `Libraries/Image`, which is where it is used. This was previously part of D13337412 but I had to squash them to make buck happy.

Reviewed By: TheSavior

Differential Revision: D13337304

fbshipit-source-id: 2d501109ba7d4ba94ca7e8f2953258221947b90e
2018-12-06 20:15:46 -08:00
Doug Russell ee7c702308 Accessibility Escape
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/22047

Differential Revision: D13146179

Pulled By: cpojer

fbshipit-source-id: b8a089114a5deafee47dd482e484d413c8c39137
2018-12-06 19:44:21 -08:00
Christoph Nakazawa deb2a94568 Add Flow types for `Platform.select` [5/5]
Summary: This change adds type information for `Platform.select` to make sure things are properly typed. This is the last diff in a stack that actually enables the newly fixed/added annotations and it will only land once all the type errors (320+) are fixed.

Reviewed By: sahrens

Differential Revision: D13318805

fbshipit-source-id: af0475d1a2f1e5ace4d513be48827e3659bd7f62
2018-12-06 02:54:19 -08:00
Christoph Nakazawa 060bd73e4e Fix `Platform.select` related flow errors [3/N]
Summary: This diff adds or fixes type annotations on a variety of files around RN.

Reviewed By: sahrens

Differential Revision: D13318808

fbshipit-source-id: dc466938167fda1ed7d6c9423c6cafe8040602e6
2018-12-05 21:48:55 -08:00
Rick Hanlon c5b80062ea Fix ActivityIndicator snapshot test, add toMatchShallowSnapshot
Summary:
This diff adds a custom matcher which will wrap a given component and shallow render it, snapshotting the result with the formatting users will see when they do the same.

I also update the ActivityIndicator test to use this new strategy, and add an additional check that the displayName is set.

For context see:
- https://github.com/facebook/react-native/pull/21950
- https://github.com/rajivshah3/rn-broken-snapshot/blob/broken-example/__tests__/App.spec.js#L3
- https://github.com/facebook/react-native/issues/21937

Reviewed By: TheSavior

Differential Revision: D13326689

fbshipit-source-id: 8ed2302a8aad12962fa2498a46d2502ccfb5c737
2018-12-05 17:23:42 -08:00
Thomas BARRAS 9facd81894 Flow ViewPropTypes (#22504)
Summary:
Related to #22100

Enhance ViewPropTypes flow types.
- I had some troubles with a TODO left for `onResponderGrant` hence the return type.
- I wasn't able to properly type `nativeBackgroundAndroid` and `nativeForegroundAndroid` at the moment.
Pull Request resolved: https://github.com/facebook/react-native/pull/22504

Reviewed By: cpojer

Differential Revision: D13334024

Pulled By: TheSavior

fbshipit-source-id: cada236e0d716ae78cb663172e5315cf11c6406a
2018-12-04 19:32:36 -08:00
Ian Park c3b3eb7f73 Fix bug in comparison logic of object property (#22348)
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of #22308 issue. (Fixes #22308)
Pull Request resolved: https://github.com/facebook/react-native/pull/22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
2018-12-04 19:25:11 -08:00
hyochan 198eb02697 Fix ListEmptyComponent is rendered upside down when using inverted flag. (#21496)
Summary:
Fix ListEmptyComponent is rendered upside down when using inverted flag.

Fixes #21196
Pull Request resolved: https://github.com/facebook/react-native/pull/21496

Differential Revision: D13334437

Pulled By: hramos

fbshipit-source-id: b34a9a0a153862d3d5dbe410ab0a6c66a8cfcffd
2018-12-04 18:49:00 -08:00
Thomas BARRAS 7e4f92bc19 Flow TouchableWithoutFeedback (#22479)
Summary:
Related to #22100

Enhance TouchableWithoutFeedback with press and target event types.
There are still work to do to update `UNSAFE_componentWillReceiveProps` and `touchableGetHitSlop` to make Flow not complain about `DeprecatedEdgeInsetsPropType` inexact type.
Pull Request resolved: https://github.com/facebook/react-native/pull/22479

Reviewed By: RSNara

Differential Revision: D13310764

Pulled By: TheSavior

fbshipit-source-id: 9002e542378491fb800c8e81c63f4fbe125b563c
2018-12-04 17:06:05 -08:00
Baldy Lukasz 87b6533937 Duration cannot be less then 10ms (#21858)
Summary:
Related to: #21853

Fixes #21853
Pull Request resolved: https://github.com/facebook/react-native/pull/21858

Differential Revision: D13322060

Pulled By: hramos

fbshipit-source-id: 00a8de018fce6507aa131a11ba3e95d57044e683
2018-12-04 14:45:59 -08:00
Igor Mandrigin f77aa4eb45 Avoid using `-[UITextView setAttributedString:]` while user is typing (#19809)
Summary:
iOS-specific.
For languages with complex input (such as Japanese or Chinese), a user has to type multiple characters that are then merged into a single one.
If `-[UITextView setAttributedString:]` is used while the user is still typing, it resets the input and characters are not being treated as typed together.

This PR avoids calling this method if possible, replacing it by just copying the attributes if the string has not been changed. That preserves the state and user can continue to type Korean or Chinese characters.

Fixes #19339

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Essentially, the steps to reproduce are described in [the issue](https://github.com/facebook/react-native/issues/19339):

1. Type some Korean characters in TextInput, such as "하늘" (buttons `ㅎ`,`ㅏ`,`ㄴ`,`ㅡ`,`ㄹ`).
2. Then move the cursor to the beginning of the text, type "파란" (buttons `ㅍ`,`ㅏ`,`ㄹ`,`ㅏ`,`ㄴ`) this time.

**Behaviour before this fix (broken)**
Actual text: `ㅍㅏㄹㅏㄴ하늘`.
Expected text: `파란하늘`.
Characters aren't combined properly.

![ezgif com-resize](https://user-images.githubusercontent.com/466427/41613572-4256dda8-73f6-11e8-99a9-0ab833202b95.gif)

**Behaviour after this fix (correct)**
Actual text: `파란하늘`.
Expected text: `파란하늘`.
Characters are combined, the same behaviour is in vanilla iOS `UITextView`.

![input-with-fix](https://user-images.githubusercontent.com/466427/41613526-1aae2284-73f6-11e8-87f2-c1cef51cd83a.gif)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[IOS] [BUGFIX] [TextView] - Fix Korean/Chinese/Japanese input for multiline TextView on iOS.

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19809

Differential Revision: D13326614

Pulled By: shergin

fbshipit-source-id: 6a5cab3f7290f0f623a6f4c29353a573eb321b0b
2018-12-04 13:23:43 -08:00
gengjiawen 512676c65e Enable ci for windows (#22028)
Summary:
Enable ci for windows
appveyor pass.
https://github.com/facebook/react-native/pull/21835
 [GENERAL] [INTERNAL] [CI] - Enable ci for windows
Pull Request resolved: https://github.com/facebook/react-native/pull/22028

Differential Revision: D13318242

Pulled By: cpojer

fbshipit-source-id: be4b9b9fe6a4e21572f3d6c38b15a2acf8bb2662
2018-12-04 00:20:38 -08:00
Tim Yung 073ad6a036 React sync for revisions 3ff2c7c...6bf5e85
Summary:
@public
This sync includes the following changes:
- **[6bf5e8598](https://github.com/facebook/react/commit/6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (#14384) //<Brian Vaughn>//
- **[7a48c900b](https://github.com/facebook/react/commit/7a48c900b)**: Prevent a v8 deopt when profiling (#14383) //<Brian Vaughn>//
- **[f00c2755b](https://github.com/facebook/react/commit/f00c2755b)**: Removed unnecessary externals from Jest bundles (#14372) //<Brian Vaughn>//
- **[52bea95cf](https://github.com/facebook/react/commit/52bea95cf)**: Fixed scheduler setTimeout fallback (#14358) //<Brian Vaughn>//
- **[1d25aa578](https://github.com/facebook/react/commit/1d25aa578)**: [Fizz] New Server Rendering Infra (#14144) //<Sebastian Markbåge>//
- **[f1bf28160](https://github.com/facebook/react/commit/f1bf28160)**: Fix bug in cloneHook (#14364) //<Imre Osswald>//
- **[16e120438](https://github.com/facebook/react/commit/16e120438)**: [Fire] Add initial build infrastructure (#14359) //<Dan Abramov>//
- **[d14ba87b1](https://github.com/facebook/react/commit/d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298) //<Dan Abramov>//
- **[4f964f09c](https://github.com/facebook/react/commit/4f964f09c)**: Adding isMemo check to react-is package (#14313) //<Jinto Jose>//
- **[c2a2d8a53](https://github.com/facebook/react/commit/c2a2d8a53)**: Remove useMutationEffect (#14336) //<Sophie Alpert>//
- **[48f1e5b3c](https://github.com/facebook/react/commit/48f1e5b3c)**: Add a null type test for memo (#14325) //<chun shang>//
- **[f93f3402f](https://github.com/facebook/react/commit/f93f3402f)**: Make useEffect(async) warning more verbose (#14327) //<Dan Abramov>//
- **[ee3ef3a07](https://github.com/facebook/react/commit/ee3ef3a07)**: Fix regression: Errors not emitted in streams (#14314) //<Pelle Wessman>//
- **[33f6f5e53](https://github.com/facebook/react/commit/33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) //<Christoph Nakazawa>//
- **[686f1060a](https://github.com/facebook/react/commit/686f1060a)**: Publish a local release (canary or stable) to NPM (#14260) //<Brian Vaughn>//
- **[7475120ce](https://github.com/facebook/react/commit/7475120ce)**: Prevent deopts from modifying exports object in stable builds (#14309) //<Dan Abramov>//
- **[0c7189d92](https://github.com/facebook/react/commit/0c7189d92)**: Fix resolution of outer props with React.memo() (#14312) //<Dan Abramov>//
- **[14be29b2b](https://github.com/facebook/react/commit/14be29b2b)**: Add more test coverage for nested memo() (#14311) //<Dan Abramov>//
- **[dc0dd4bbf](https://github.com/facebook/react/commit/dc0dd4bbf)**: Use |0 to coerce to number (#14297) //<Dan Abramov>//
- **[dd8205cef](https://github.com/facebook/react/commit/dd8205cef)**: List ignored types instead of included types in the stack (#14308) //<Dan Abramov>//
- **[a9fdf8a32](https://github.com/facebook/react/commit/a9fdf8a32)**: Warn about reassigning this.props (#14277) //<Dan Abramov>//
- **[327cf0ee3](https://github.com/facebook/react/commit/327cf0ee3)**: Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291) //<Dan Abramov>//
- **[c954efa70](https://github.com/facebook/react/commit/c954efa70)**: Remove `import * as` pattern from the codebase (#14282) //<Sebastian Markbåge>//
- **[ccb14e270](https://github.com/facebook/react/commit/ccb14e270)**: Fix SSR useCallback in render phase (#14279) //<Dan Abramov>//
- **[0e9cb3f5d](https://github.com/facebook/react/commit/0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (#14276) //<Dominic Gannaway>//
- **[592676503](https://github.com/facebook/react/commit/592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275) //<Dominic Gannaway>//
- **[9b2fb24f9](https://github.com/facebook/react/commit/9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (#14218) //<Dominic Gannaway>//
- **[a22fabc2a](https://github.com/facebook/react/commit/a22fabc2a)**: Reduce scheduler serialization overhead (#14249) //<Jason Miller>//
- **[21d5f7d32](https://github.com/facebook/react/commit/21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (#14245) //<Andrew Clark>//
- **[8feeed10d](https://github.com/facebook/react/commit/8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>//
- **[5bce0ef10](https://github.com/facebook/react/commit/5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (#14234) //<Andrew Clark>//
- **[f55795c8e](https://github.com/facebook/react/commit/f55795c8e)**: Add regression test for #14188 (#14197) //<Dan Abramov>//
- **[b98adb648](https://github.com/facebook/react/commit/b98adb648)**: Simplify CSS shorthand property warning (#14183) //<Sophie Alpert>//
- **[f8bfd5868](https://github.com/facebook/react/commit/f8bfd5868)**: fix typo //<Sebastian Markbage>//
- **[961eb65b4](https://github.com/facebook/react/commit/961eb65b4)**: Use unique thread ID for each partial render to access Context (#14182) //<Sebastian Markbåge>//
- **[1a6ab1e9b](https://github.com/facebook/react/commit/1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (#14178) //<Sophie Alpert>//
- **[8ae867e6b](https://github.com/facebook/react/commit/8ae867e6b)**: Warn about conflicting style values during updates (#14181) //<Sophie Alpert>//
- **[d5e1bf07d](https://github.com/facebook/react/commit/d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (#14177) //<Brian Vaughn>//
- **[2dd4ba11e](https://github.com/facebook/react/commit/2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>//
- **[9cc631a53](https://github.com/facebook/react/commit/9cc631a53)**: Don't run danger on bad build (#14143) //<Sophie Alpert>//
- **[1034e26fe](https://github.com/facebook/react/commit/1034e26fe)**: Fix typos (#14124) //<Heaven>//
- **[5618da49d](https://github.com/facebook/react/commit/5618da49d)**: Fix comment typo (#14156) //<Bartosz Gordon>//
- **[9fb919945](https://github.com/facebook/react/commit/9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>//
- **[c174f8592](https://github.com/facebook/react/commit/c174f8592)**: Add fb build of ESLint plugin (#14165) //<Andrew Clark>//
- **[02e4848e3](https://github.com/facebook/react/commit/02e4848e3)**: Improved suspense support in ReactDOMServer (#14161) //<Alex Taylor>//
- **[4b163fee1](https://github.com/facebook/react/commit/4b163fee1)**: Remove errant return assignment (#14164) //<Andrew Clark>//
- **[e58ecda9a](https://github.com/facebook/react/commit/e58ecda9a)**: Suspense fuzz tester (#14147) //<Andrew Clark>//
- **[7fd1661f8](https://github.com/facebook/react/commit/7fd1661f8)**:  Don't warn if an unmounted component is pinged (#14158) //<Andrew Clark>//
- **[f9e9913f0](https://github.com/facebook/react/commit/f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (#14157) //<Andrew Clark>//
- **[7c560131b](https://github.com/facebook/react/commit/7c560131b)**: Adding logger pri (#14155) //<Nathan Schloss>//
- **[3d8bda70e](https://github.com/facebook/react/commit/3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (#13914) //<Minh Nguyen>//
- **[051272f20](https://github.com/facebook/react/commit/051272f20)**: Use Entry in `yarn build ...` Instead of Label (#14148) //<Sebastian Markbåge>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85

Reviewed By: bvaughn

Differential Revision: D13288288

fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
2018-12-03 16:29:53 -08:00
Janic Duplessis ff6a53de2a Make type of RefreshControl.onRefresh less strict (#22376)
Summary:
I think a common pattern is to use async functions with the onRefresh prop to reload data. I made the type `mixed` since we don't care about what the function returns. Could also be `void | Promise<void>` I haven't really seen a pattern for those in the codebase.
Pull Request resolved: https://github.com/facebook/react-native/pull/22376

Differential Revision: D13310372

Pulled By: TheSavior

fbshipit-source-id: 445f28cf2c37f9c937e72d76716002deaf9d9c94
2018-12-03 14:57:55 -08:00
Christoph Nakazawa 4148976a83 Use `invariant` instead of `fbjs/lib/invariant`
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.

Reviewed By: yungsters

Differential Revision: D13195941

fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
2018-12-03 00:07:02 -08:00
Eli White 0ef1bc3925 Move ToastAndroid to APIs, not Components
Summary:
This was in the wrong section

[Internal]

Reviewed By: yungsters

Differential Revision: D13285234

fbshipit-source-id: 1c3b3825a0f99028efe1f1f002d5519ad6ab4494
2018-11-30 23:21:36 -08:00
Salil Apte de759b949e Fixes animated gifs incorrectly looping/not stopping on last frame (#21999)
Summary:
Currently, if you load an animated gif using the standard `Image` component, it will not correctly respect the loop count property found in the Netscape App Extension block of the file. The issues are as follows:

1) If the App Extension isn't present, the animated gif loops indefinitely when it should not loop at all.
2) If the App Extension is present, the animated gif loops one less time than it should.

The other issue is that once the looping completes, the image doesn't pause at the last frame but instead, loops back to the beginning of the animation e.g. frame 1.

The fix does a few things:

1) If there is _no_ App Extension present, the image doesn't loop at all
2) If there _is_ an App Extension present, it loops the correct amount of times. For instance, if the loop count is 1, it means the gif should loop _once_ after it finishes playing, for a total of _two_ total loops.
3) Once the number of loops completes (assuming loop count isn't set to 0 which means infinite), the animation pauses on the last frame.
Pull Request resolved: https://github.com/facebook/react-native/pull/21999

Differential Revision: D13287005

Pulled By: hramos

fbshipit-source-id: f7210ad40e0e76c9ec454953b8a067569d3feaaa
2018-11-30 20:32:20 -08:00
Albert Sun 668341a294 Ensure RCTImageCache's DateFormatter is only allocated once
Summary: This change attempts to fix a crash within RCTImageCache's new dateWithHeaderString method. This is a speculative fix as there aren't any concrete repro steps.

Reviewed By: hramos

Differential Revision: D13278666

fbshipit-source-id: cdb69b1296c946d89e14c074329280994d87ddcd
2018-11-30 15:05:32 -08:00
Panagiotis Vekris ef2084c6bd 0.87.0 in xplat/js
Summary: allow-large-files

Reviewed By: samwgoldman

Differential Revision: D13230018

fbshipit-source-id: f07e2371a3b7382de0592cc7c7b20e7f4faa6889
2018-11-28 17:32:50 -08:00
nd-02110114 23845fb15c Flow strict in Picker.js, PickerIOS.ios.js, PickerAndroid.android.js (#22128)
Summary:
Related to #22100

Turn Flow strict mode on for Picker

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
Pull Request resolved: https://github.com/facebook/react-native/pull/22128

Differential Revision: D12946781

Pulled By: mmmulani

fbshipit-source-id: 4d3cb884dd8bf57a43ef8aec4491359e9874d182
2018-11-27 17:11:31 -08:00
Ramanpreet Nara db43aa8fc3 Implement getConstants()
Summary:
Instead of assigning all the constants exported by a NativeModule to the native module JavaScript object itself, we want to instead export a `getConstants()` method that can be used to access native module constants. This change simplifies the API of native modules. Eventually, we'll remove the ability to access constants as native module object properties alltogether, but that's comes later.

**Note**: I didn't need to make any cpp changes because `JSIExecutor::NativeModuleProxy::get` calls `JSINativeModules::getModule` (here: https://goo.gl/QwPDWF), which eventually calls `JSINativeModules::createModule`, which uses `global.__fbGenNativeModule` (here: https://goo.gl/pSxMgE), which is just an alias to `genModule` in `NativeModules` (here: https://goo.gl/u2wjCs).

Reviewed By: fkgozali

Differential Revision: D13207152

fbshipit-source-id: 375aab1346232819187a5d5b272b33c55992346a
2018-11-27 16:28:20 -08:00
Ramanpreet Nara ada7089066 Revert D13105396
Summary: D13105396 broke a few things, so I'm reverting it. See: https://fburl.com/toehyir8

Reviewed By: sahrens, mmmulani

Differential Revision: D13220491

fbshipit-source-id: 35594099eea7f40d2fb948ae2010db4babb7093d
2018-11-27 14:03:14 -08:00
Krzysztof Sroka d3f3bfa2a5 Added `persistentScrollbar` prop in ScrollView component (#22300)
Summary:
This PR is a follow-up from the closed [discussions-and-proposals PR](https://github.com/react-native-community/discussions-and-proposals/pull/39), that explains in more detail the rationale for adding this feature.
Pull Request resolved: https://github.com/facebook/react-native/pull/22300

Reviewed By: fkgozali

Differential Revision: D13121748

Pulled By: mdvacca

fbshipit-source-id: 899641be79bdb41fa6649df0772c602a5e09b3b9
2018-11-27 11:21:54 -08:00
Tim Yung 0c8db08f51 Switch: Improve Accessibility
Summary: On Android, `Switch` does not currently read its role as a "button". This fixes that and makes it consistent with iOS.

Reviewed By: sahrens

Differential Revision: D13136253

fbshipit-source-id: 0de5d54772d204168138cb2af7815cc458f72682
2018-11-27 09:46:21 -08:00
Rubén Norte 2ae559a2a4 eslint: Disable jasmine env and only enable jest env for test files
Summary:
Modified the ESLint configuration to only enable the Jest environment for files we consider now tests, which are files with the `-test.js` suffix under `__tests__`. Also enabled some globals for test helpers (any file under `__tests__`).

This will allow us to catch misspelled tests, while allowing test helpers to use most Jest APIs.

Also disabled the Jasmine environment so people stop using Jasmine APIs and we can rollout Circus soon.

Reviewed By: aaronabramov

Differential Revision: D13199591

fbshipit-source-id: 12a32cf5835630b9987452b0c33d3f8085001689
2018-11-27 03:51:02 -08:00
Michael Blanchard 53da585832 Fix: Add displayName to ActivityIndicator (#22417)
Summary:
Similar to #21950, this adds displayName to `ActivityIndicator`, so it displays the correct component name in snapshots instead of `Component`.

Fixes #21937 (a little bit more than it was already fixed).
Pull Request resolved: https://github.com/facebook/react-native/pull/22417

Differential Revision: D13205376

Pulled By: TheSavior

fbshipit-source-id: 21e71d4980d159a1f33d32d83346b48257ec21d4
2018-11-26 16:49:58 -08:00
Jonathan Lee 7fe3f90156 Back out "Add bounce method to TouchableBounce"
Summary: Reverting D13085800

Reviewed By: TheSavior

Differential Revision: D13110727

fbshipit-source-id: d5a6e7ff962a350b7cb7d7459abaf861a1387754
2018-11-26 10:51:58 -08:00
Rubén Norte ffa9036252 jest: rename tests to follow the new convention
Summary:
Renamed test files to match `-test.js`, so people can add test helpers without blacklisting.

Codemod code: P60365841

Script executed:

```
cd xplat/js
./scripts/node/node rename-script.js > result.txt
```

Reviewed By: mjesun

Differential Revision: D13185673

fbshipit-source-id: 87451635aa538c2c1d1886e75574d0e5c889596e
2018-11-26 10:30:12 -08:00
Christoph Nakazawa 1f8b46a2fc Clean up EventEmitter
Summary: As suggested by yungsters in D13138187

Reviewed By: mjesun

Differential Revision: D13192765

fbshipit-source-id: 8ab3dc74b3a9aaebf043bc3b5ed4f2590f480d10
2018-11-26 06:28:25 -08:00
Christoph Nakazawa cfef04e760 Remove fbjs/lib/emptyFunction from react-native
Summary: This removes `emptyFunction` usage from react-native.

Reviewed By: yungsters

Differential Revision: D13138187

fbshipit-source-id: eaa327884aac2cabb99024077e3407cb99c946d2
2018-11-26 06:28:25 -08:00
Christoph Nakazawa 2de01cb54d Inline `extractSingleTouch` from fbjs
Summary: There is only a single use of this function across RN, and one more use in a test file. I inlined this function in both places to reduce the dependency on fbjs.

Reviewed By: yungsters

Differential Revision: D13138137

fbshipit-source-id: 32660c965a975d17e236bdd13ff0b2a8d64751ee
2018-11-26 06:28:25 -08:00
Christoph Nakazawa f377926677 Remove isNode call from Map polyfill
Summary: There are no DOM Nodes in React Native so our Map polyfill does not need to consider that use case. I deleted the references to `isNode` and `IE. In case this is important for react-native-web, I suggest to shim the Map polyfill with an IE compatible one outside of react-native.

Reviewed By: yungsters

Differential Revision: D13138030

fbshipit-source-id: 661511ea03b4477bd55d0fdf5e485178fe59d96b
2018-11-26 06:28:24 -08:00
Christoph Nakazawa dc8246d56e Stop using Promise from fbjs
Summary: This module simply forwards to the `promise` module. I inlined the code to remove the dependency.

Reviewed By: yungsters

Differential Revision: D13137980

fbshipit-source-id: e3d6208068911711fc5f5378f2d5bb6ac38f2eb2
2018-11-26 06:28:24 -08:00
Olivier Corradi a686048794 Fix cookies not being sent after a redirected response (#22178)
Summary:
Fixes https://github.com/facebook/react-native/issues/19376

On iOS, the `HTTPShouldHandleCookies` boolean has no effect when custom cookies are set (see https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1415485-httpshouldhandlecookies?preferredLanguage=occ). Setting custom cookies prevents the cookies of a redirect response from being re-used in the subsequent request.
This is why issue https://github.com/facebook/react-native/issues/19376 is opened.
The fix is to intercept the redirect request, and to manually set the cookies. This effectively makes the Android and iOS behaviours converge.

Changelog:
----------
  [iOS] [Fixed] - Fix cookies not being sent on iOS after redirect
Pull Request resolved: https://github.com/facebook/react-native/pull/22178

Differential Revision: D13191961

Pulled By: shergin

fbshipit-source-id: 4445a2499034a9846c6d7c37c1f1b72c9fd30129
2018-11-25 23:00:01 -08:00
Le Xu c3dea894bd Back out "[react-native][PR] [flow-strict] Flow strict StatusBar"
Summary:
Original commit changeset: 27f69c6df3a8

This reverts D13103971

Differential Revision: D13185679

fbshipit-source-id: 0de9da31bd75786c7978e2c3860486ac37420342
2018-11-23 12:15:28 -08:00
mottox2 3649a503cf Flow TouchableNativeFeedback.android.js (#22176)
Summary:
Related to #22100

Turn Flow strict mode on for Libraries/Components/Touchable/TouchableNativeFeedback.android.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/22176

Reviewed By: TheSavior

Differential Revision: D13033239

Pulled By: RSNara

fbshipit-source-id: 57e89ce16040e6238e01e0437327db943a5f2581
2018-11-21 14:45:15 -08:00
Yu Watanabe 6fa997dd63 Flow strict StatusBar (#22282)
Summary:
Related to #22100

`Libraries/Components/StatusBar/StatusBar.js`
Enhance StatusBar with mergePropsStack and _defaultProps.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][StatusBar.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22282

Reviewed By: TheSavior

Differential Revision: D13103971

Pulled By: RSNara

fbshipit-source-id: 27f69c6df3a8a7792fcd595c0ff362943ccab8ca
2018-11-21 14:42:09 -08:00
Tnarita0000 c127000a7d Flow strict-local in TimePickerAndroid.android.js (#22188)
Summary:
Related to #22100 . I had this issue before(#22154 & #22172).

Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22188

Reviewed By: TheSavior

Differential Revision: D12972356

Pulled By: RSNara

fbshipit-source-id: 838604a791dfdc86bacf8b49f6c399920a3f57bc
2018-11-21 14:42:09 -08:00
Yosuke Saito fb4825a2c6 Flow strict ScrollResponder (#22181)
Summary:
Related to #22100

Enhance Flow types for Libraries/Components/ScrollResponder.js
Pull Request resolved: https://github.com/facebook/react-native/pull/22181

Reviewed By: TheSavior

Differential Revision: D13032699

Pulled By: RSNara

fbshipit-source-id: ca0ce178a96008a71016d033ee1154ad807d6599
2018-11-21 14:42:09 -08:00
Thomas BARRAS a97d104b44 Flow strict TouchableHighlight (#22173)
Summary:
Related to #22100

Enhance Flow types for TouchableOpacity specifying underlay functions and TvParallaxPropertiesType.
I had to export and enhance TvParallaxPropertiesType from TVViewPropTypes file. This does not break this other PR also using this exported type. #22146

There is still some work to do in order to turn flow to strict mode.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableHighlight.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export and enhance type
Pull Request resolved: https://github.com/facebook/react-native/pull/22173

Differential Revision: D13033441

Pulled By: RSNara

fbshipit-source-id: 26a38970923dc7e6c02c03da5d08483a3f1fbd36
2018-11-21 14:36:33 -08:00
Ramanpreet Nara da0b139b56 Improve Flow types
Summary:
Some of the flow types were incomplete. So, I referenced the code in  `~/fbsource/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/textinput/` and in `~/fbsource/xplat/js/react-native-github/Libraries/Text/TextInput/` to make the flow types more specific.

I also fixed internal breakages. To avoid having to sprinkle `$FlowFixMe`s everywhere, I had to refactor some types, and some code.

Reviewed By: TheSavior

Differential Revision: D13121871

fbshipit-source-id: 9796aafc861544baf52d7ade823ab1be2d3f12d1
2018-11-21 14:33:48 -08:00
Thomas BARRAS 35a65cd704 Flow strict TextInput (#22250)
Summary:
Related to #22100

Enhance TextInput with callback event types.
This is a first draft and I will need more help on this one. Flow checks are successful now but I am not sure types are accurate though.
Moreover I find my separation approach kind of dirty for callback event types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextInput.js] - Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.android.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.ios.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [XHRExampleFetch.js] - Fixing Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22250

Reviewed By: TheSavior

Differential Revision: D13104820

Pulled By: RSNara

fbshipit-source-id: 3fbb98d0ec2b62be676f71ae1053933d9c78485e
2018-11-21 14:33:48 -08:00
Thomas BARRAS 79274979b7 Flow strict TextProps (#22122)
Summary:
Related to #22100

Turn on Flow strict mode for TextProps.
I used ResponseHandlers type definition defined in Text.js.

I wanted to move ResponseHandlers type to TextProps and reuse it inside the file.
I know I could use $Shape<> to maybe keys but how do I elegantly maybe every values ?
Unless having a straightforward solution, I found it clearer to copy paste these types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextProps.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22122

Reviewed By: TheSavior

Differential Revision: D13055759

Pulled By: RSNara

fbshipit-source-id: 230b43c7c94d7f82f5727ad11541b0cb98bc5e3a
2018-11-21 14:27:25 -08:00
Thomas BARRAS 45c51835d6 Flow strict TouchableBounce (#22197)
Summary:
Related to #22100

Enhance TouchableBounce with press event types, callback and hitslop types.

There is still some work to do in order to turn flow to strict mode. (requireNativeComponent and render function)

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableBounce.js] - Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22197

Reviewed By: TheSavior

Differential Revision: D13032452

Pulled By: RSNara

fbshipit-source-id: b21140722ce924698aa15323602e2e3fc663dbb6
2018-11-21 14:24:55 -08:00
Adam Comella 70826dbafc iOS: Support inline view truncation (#21456)
Summary:
If text is truncated and an inline view appears after the truncation point, the user should not see the inline view. Instead, we have a bug such that the inline view is always visible at the end of the visible text.

This commit fixes this by marking the inline view as hidden if it appears after the truncation point.

This appears to be a regression. React Native used to have logic similar to what this commit is adding: 1e2a924ba6/Libraries/Text/RCTShadowText.m (L186-L192)

**Before fix**

Inline view (blue square) is visible even though it appears after the truncation point:

![image](https://user-images.githubusercontent.com/199935/46382038-d3a71200-c65d-11e8-8179-2ce4aad8d010.png)

The full text being rendered was:

```
<Text numberOfLines={1}>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna
  <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</Text>
```

**After fix**

Inline view is properly truncated:

![image](https://user-images.githubusercontent.com/199935/46382067-fdf8cf80-c65d-11e8-84ea-e2b71c229dae.png)

**Test Plan**

Tested that the inline view is hidden if it appears after the truncation point when `numberOfLines` is 1 and 2. Similarly, verified that the inline view is visible if it appears before the truncation point.

**Release Notes**

[IOS] [BUGFIX] [Text] - Fix case where inline view is visible even though it should have been truncated

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21456

Differential Revision: D10182991

Pulled By: shergin

fbshipit-source-id: a5bddddb1bb8672b61d4feaa04013a92c8224155
2018-11-20 00:11:56 -08:00
gazoudoudou 27cfba2882 Remove useless additionnal blur call (#22156)
Summary:
I noticed that the _onBlur method was not exactly similar to the _onFocus one in the TextInput component.

After digging, I found that the blurTextInput method in the TextInputState.js file was call twice in a raw instead of once when the textinput component should blur.

By removing this line, I fix this unecessary multiple call.
Pull Request resolved: https://github.com/facebook/react-native/pull/22156

Reviewed By: TheSavior

Differential Revision: D13105396

Pulled By: RSNara

fbshipit-source-id: 8e83461d8b288d8ee4047bc4a33c4480e193c349
2018-11-19 18:53:56 -08:00
empyrical bea3bb6956 DrawerLayoutAndroid: Convert to ES6 class (#21980)
Summary:
This pull requests converts `DrawerLayoutAndroid` from a `createReactClass`-based component to an ES6 class component, removing its use of `NativeMethodsMixin` and `prop-types` in the process.

Unfortunately this couldn't be moved over to a full `forwardRef` to the native component, because it has the methods `openDrawer` and `closeDrawer` as part of its API, and they can't be called directly on the native component. A `createRef`-based ref to the native component can be accessed from the `nativeRef` property of a `DrawerLayoutAndroid` instance if a native ref is needed.

The Flow types for callbacks have also been filled out.
Pull Request resolved: https://github.com/facebook/react-native/pull/21980

Reviewed By: TheSavior

Differential Revision: D12901951

Pulled By: RSNara

fbshipit-source-id: d35fa5f11b1059f49b466b52abeec902db1d22f7
2018-11-17 03:24:28 -08:00
Spencer Ahrens 6f34bc4016 Back out "reapply TextInput es6 conversion with fixes, attemps to fix"
Summary:
Back it out again. This time really not sure why this is breaking, but it seems to be production only. The error seems to be "RCTSinglelineTextInputView" was not found in the UIManager" but the relavent logic is not changed in this diff, just moved around, so unclear why it would trigger a failure.

Reverting to be safe. When we re-apply the diff, we'll need to test a full OTA to prod to verify the fix.

Reviewed By: blairvanderhoof

Differential Revision: D13108463

fbshipit-source-id: 5f877a0c1a08dc114ce45921d6d92bf619575977
2018-11-16 14:50:23 -08:00
Jonathan Lee 383ea9923a Add bounce method to TouchableBounce
Summary: Adds a `bounce` method that just bounces the element without invoking any callbacks.

Differential Revision: D13085800

fbshipit-source-id: 310b273b260c924fbde32bfad1de7226d068bd57
2018-11-16 12:03:29 -08:00
Panagiotis Vekris 8fb228f313 Flow v0.86.0 in xplat/js
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: yungsters

Differential Revision: D13081129

fbshipit-source-id: fbb0ccaf3c0a2f224a56f6f6ac6c26811ebba583
2018-11-16 10:43:16 -08:00
Spencer Ahrens 9ea1295179 reapply TextInput es6 conversion with fixes, attemps to fix
Summary: D10515754 reapplied by backing out D12989604 and then fixed by manually forwarding the instance methods to the host function instead of using `forwardRef`. This also removes the need for the $flowFixMe.

Reviewed By: TheSavior

Differential Revision: D13048482

fbshipit-source-id: ff2447aff123e0960eddaef645f7dc976a426e14
2018-11-15 20:51:52 -08:00
Spencer Ahrens a00940693e New TextInput-test that would have prevented S168585
Summary: Adds a basic test that would have prevented S168585. We should expand coverage of this and other components as well.

Reviewed By: TheSavior

Differential Revision: D13038064

fbshipit-source-id: 14cf4742efd53d7bca2a3f8d1c5c34ebc6227674
2018-11-15 20:51:52 -08:00
Enrico Bern Hardy Tanuwidjaja 4aeea4d2dc Changed front-facing camera so that it shows consistent image during capture and preview
Summary: Changed front-facing camera so that it shows consistent image during capture and preview

Reviewed By: mmmulani

Differential Revision: D13012715

fbshipit-source-id: 043cd9178fc49ef9e8e628a866dd8e52434f7306
2018-11-15 16:28:03 -08:00
Brian Vaughn aacb06c594 Fix React Native AsyncMode and DevTools
Summary:
Fixes two problems I uncovered with React Native:
1. `FBCore/Prelude` points to `React.unstable_AsyncMode` which is not defined. (This type was renamed to `React.unstable_ConcurrentMode` in React v16.6.0. **As a result** people in the "react_native:async_rendering" GK will no longer get runtime errors on app start.
2. Updates `react-devtools` and (more importantly) `react-devtools-core` to 3.4.2 to handle the React-internal tag/type refactoring that happened prior to the release of 16.6.0. **As a result** DevTools will no longer cause a runtime error when connected to React Native.

For the second change, I ran `js1 upgrade react-devtools -v ^3.4.2`

Reviewed By: sebmarkbage

Differential Revision: D13030590

fbshipit-source-id: 603f7f6259f282839039820bcdba4310064a7965
2018-11-15 09:26:01 -08:00
Stephy Ma 984eef8f9e Revert D12994045: Flow v0.86.0 in xplat/js [3/n]
Differential Revision:
D12994045

Original commit changeset: 04552bf081ba

fbshipit-source-id: 062b367b88a966a6efc895c99e9911f0ec0fe8ff
2018-11-14 23:04:04 -08:00
Panagiotis Vekris 43ad3a64e6 Flow v0.86.0 in xplat/js [3/n]
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: avikchaudhuri

Differential Revision: D12994045

fbshipit-source-id: 04552bf081ba742de58e80fba08f8280cb86b1c3
2018-11-14 22:13:27 -08:00
Brent Vatne 04085337bc Fix regression in StyleSheet.setStyleAttributePreprocessor (#22262)
Summary:
This regression was caused by 199c918 - property values are initialized to true rather than a string that matches the property name now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22262

Differential Revision: D13048839

Pulled By: hramos

fbshipit-source-id: 09471334c37f3930aae7e35066943f33f8e617e5
2018-11-13 23:38:01 -08:00
Kevin Gozali 339d9d3afb Guard Platform.isTesting under __DEV__
Summary: Testing is a __DEV__ time only, so let's optimize for prod bundles.

Reviewed By: ejanzer

Differential Revision: D13050583

fbshipit-source-id: a96e35e4d5f3bd09c235c11d4ece3e4d07882de7
2018-11-13 20:11:48 -08:00
Mehdi Mulani eebc8e230a NetInfo: try to solve crash with releasing _firstTimeReachability
Summary:
@public
We're seeing a crash on line 191 when we do `CFRelease(self->_firstTimeReachability);`. My thinking is that there's a race condition between the deallocation coming from calling `getCurrentConnectivity` twice in a row and the callback coming back.

Reviewed By: PeteTheHeat

Differential Revision: D12982772

fbshipit-source-id: d3d882a074b67a5e547e7f480f561fcaf8d79ec4
2018-11-12 10:45:34 -08:00
Alexandre Kirszenberg c787866d64 Clearer HMR error messages
Summary:
GraphNotFoundError: When the user moves the app to the background on Android, restarts the Metro server and reopens the app, since the client hasn't requested either a delta or a bundle, the graph cache of the server is empty and thus we can't compute an update for the client (what if changes happened when the metro server was down?).

RevisionNotFoundError: I didn't manage to reproduce that one. It could happen if two clients live side-by-side, requesting the exact same bundle. In the future, if we want to handle that case, we'll need to manage a list of clients listening to a single graph so that we don't try to update the same graph multiple times for a single file change.

Disconnection: Same as GraphNotFoundError, but happens when the user moves the app to the background on iOS.

Reviewed By: mjesun

Differential Revision: D12960939

fbshipit-source-id: 5ac1dc7fd12bad5e0ee8dfa5a21c112773454ee5
2018-11-12 08:49:22 -08:00
Emily Janzer 1850906e5e Use nativeQPLTimestamp for InitializeCore marker point
Summary: It seems like `nativePerformanceNow` might not be getting installed in time to be used by InitializeCore on Android. Using PerformanceLogger.currentTimestamp instead, which uses nativeQPLTimestamp (which is what we should be using anyway)

Reviewed By: alexeylang

Differential Revision: D12875187

fbshipit-source-id: 6eda5d2ed7948ba48c63f76b40b2014511c32494
2018-11-09 14:14:40 -08:00
Valentin Shergin d6236796b2 `Removing UIManager.measureViewsInRect()`
Summary:
It does not supported on Android and nobody uses it.
I could find only one use cases: Very old versin of `SectionList` library (4 years ago).

Reviewed By: sahrens

Differential Revision: D12972361

fbshipit-source-id: a5dfef5e877e996adec2d4941417b4a2e727cfb7
2018-11-08 22:22:46 -08:00
Eli White f386f831d2 Back out TextInput es6 conversion
Summary:
This was failing due to issues with refs, which we were able to fix and then finally due to some jest tests that were failing due to things being null that shouldn't be which I couldn't easily figure out. Reverting the stack until we can actually solve it, hopefully with additional tests.

This was created by running:

```
$ hg backout c2fe2c46e538
fetching tree '' b9bbfc1925c6daf85ba3227d12f177aca9c0c054, based on 4257c76aefa84aaa17279e65aa7ca1174f4401e7, found via 02368b670953
connected to hg015.frc2.facebook.com
60 trees fetched over 2.91s
fetching tree '' c3c304df13399f0f1a29a668242da454fc1d8a97, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via c2fe2c46e538
7 trees fetched over 0.03s
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
commit 4270328:50a65c5c2e27 backs out commit 4266783:c2fe2c46e538
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.57s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (50a65c5)]$ hg backout 02368b670953
fetching tree '' a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via bade4285eafb
connected to hg024.frc2.facebook.com
27 trees fetched over 3.21s
fetching tree '' 361548a090e81d18bab6f4fc16036c518cb4d7c1, based on a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, found via bade4285eafb
41 trees fetched over 0.10s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
8 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270329:dbaca0daf0ac backs out commit 4266782:02368b670953
14 files fetched over 7 fetches - (14 misses, 0.00% hit ratio) over 1.72s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (dbaca0d)]$ hg backout bade4285eafb
connected to hg030.frc2.facebook.com
fetching tree '' 1b4a17164fdbfcad40139e46da4a9bfa8aa8def3, based on 361548a090e81d18bab6f4fc16036c518cb4d7c1, found via 5cfb25344385
7 trees fetched over 0.06s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
20 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270330:2951740e5b32 backs out commit 4266781:bade4285eafb
33 files fetched over 14 fetches - (33 misses, 0.00% hit ratio) over 4.50s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (2951740)]$ hg backout 5cfb25344385
connected to hg035.frc2.facebook.com
merging react-native-github/Libraries/Components/TextInput/TextInput.js
0 files updated, 1 files merged, 2 files removed, 0 files unresolved
commit 4270331:fffb4629a397 backs out commit 4266780:5cfb25344385
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 4.03s
```

Reviewed By: yungsters

Differential Revision: D12989604

fbshipit-source-id: 703a7c9c1f5bdd710077e515bdff06fdb34502ec
2018-11-08 17:59:10 -08:00
Tim Yung 0cb59b5c23 React sync for revisions 4773fdf...3ff2c7c
Summary:
@public
This sync includes the following changes:
- **[3ff2c7ccd](https://github.com/facebook/react/commit/3ff2c7ccd)**: Invalid actualDuration+treeBaseDuration for hidden+suspended trees (#14065) //<Brian Vaughn>//
- **[5afa1c4ed](https://github.com/facebook/react/commit/5afa1c4ed)**: Tag MemoComponent with PerformedWork effectTag for DevTools Profiler (#14141) //<Brian Vaughn>//
- **[e27720d7f](https://github.com/facebook/react/commit/e27720d7f)**: [Synchronous Suspense] Reuse deletions from primary tree (#14133) //<Andrew Clark>//
- **[aa1ffe4e7](https://github.com/facebook/react/commit/aa1ffe4e7)**: Show deprecated context object warnings usage in ReactDOM server (#14033) //<Dominic Gannaway>//
- **[e3a7b9645](https://github.com/facebook/react/commit/e3a7b9645)**: Make react-debug-tools a private package //<Andrew Clark>//
- **[ba1984423](https://github.com/facebook/react/commit/ba1984423)**: Update bundle sizes for 16.6.1 release //<Andrew Clark>//
- **[b50e63ef5](https://github.com/facebook/react/commit/b50e63ef5)**: Updating package versions for release 16.6.1 //<Andrew Clark>//
- **[8f2c89e96](https://github.com/facebook/react/commit/8f2c89e96)**: Make react-debug-tools a private package //<Andrew Clark>//
- **[2aecbcd6f](https://github.com/facebook/react/commit/2aecbcd6f)**: "functional component" -> "function component" (#14123) //<locknono>//
- **[b4608dd24](https://github.com/facebook/react/commit/b4608dd24)**: Remove unused simulated flag parameter (#14127) //<Nadav Kaner>//
- **[3c69a1881](https://github.com/facebook/react/commit/3c69a1881)**: Recover from errors with a boundary in completion phase (#14104) //<Dan Abramov>//
- **[b020fb114](https://github.com/facebook/react/commit/b020fb114)**: Check correct commit phase props in fuzz tester (#14129) //<Andrew Clark>//
- **[b67c1a2ee](https://github.com/facebook/react/commit/b67c1a2ee)**: Add DEV-only checks for assumption about instance properties (#14128) //<Dan Abramov>//
- **[f777d196e](https://github.com/facebook/react/commit/f777d196e)**: Fix lazy() with defaultProps (#14112) //<Dan Abramov>//
- **[e4512991c](https://github.com/facebook/react/commit/e4512991c)**: Fix unhiding in IE11 (#14126) //<Sophie Alpert>//
- **[affb2b50c](https://github.com/facebook/react/commit/affb2b50c)**: Enable hooks in www test renderer, too //<Andrew Clark>//
- **[0a0f503d5](https://github.com/facebook/react/commit/0a0f503d5)**: Enable hooks in www build (#14116) //<Andrew Clark>//
- **[600651e68](https://github.com/facebook/react/commit/600651e68)**: Restore the Hooks dispatcher after using SSR (#14105) //<Dan Abramov>//
- **[e9a2ec915](https://github.com/facebook/react/commit/e9a2ec915)**: [suspense] Avoid double commit by re-rendering immediately and reusing primary children (#14083) //<Andrew Clark>//
- **[9d47143e8](https://github.com/facebook/react/commit/9d47143e8)**: Implement {,un}hideInstance on RN renderer (#14115) //<Sophie Alpert>//
- **[ebdb47d2c](https://github.com/facebook/react/commit/ebdb47d2c)**: DCE hooks code when flag is off (#14111) //<Sophie Alpert>//
- **[8b87ebf5b](https://github.com/facebook/react/commit/8b87ebf5b)**: Rename .internal tests that aren't using internals (#14109) //<Sophie Alpert>//
- **[da04058a9](https://github.com/facebook/react/commit/da04058a9)**: Use Function.prototype.apply in warningWithoutStack (#14107) //<Sophie Alpert>//
- **[fd1256a56](https://github.com/facebook/react/commit/fd1256a56)**: Add Debug Tools Package for Introspection of Hooks (#14085) //<Sebastian Markbåge>//
- **[b305c4e03](https://github.com/facebook/react/commit/b305c4e03)**: fix(react-dom): Fix crash during server render (#14103) //<Tiago Nunes>//
- **[d34d1c3ba](https://github.com/facebook/react/commit/d34d1c3ba)**: react-reconciler: Update README.md (#13953) //<Marcelo Jorge Vieira>//
- **[6c404d82a](https://github.com/facebook/react/commit/6c404d82a)**: Bugfix: Add back early return in setOffsets which was removed between 16.4.2 and 16.5.0. Fails in Edge in some scenarios. (#14095) //<einarq>//
- **[8eca0eff8](https://github.com/facebook/react/commit/8eca0eff8)**: chore(tests): don't rely on jest fake timers scheduling real timers (#14003) //<Simen Bekkhus>//
- **[293fed899](https://github.com/facebook/react/commit/293fed899)**: Warn for bad useEffect return value (#14069) //<Sophie Alpert>//
- **[ae196e84b](https://github.com/facebook/react/commit/ae196e84b)**: Rename inputsAreEqual to areHookInputsEqual & move it to shared (#14036) //<Mateusz Burzyński>//
- **[c898020e0](https://github.com/facebook/react/commit/c898020e0)**: Warn for forwardRef(memo(...)) (#14070) //<Sophie Alpert>//
- **[bf9fadfcf](https://github.com/facebook/react/commit/bf9fadfcf)**: [Hooks] Remove dispatch callbacks (#14037) //<Andrew Clark>//
- **[8c67bbf18](https://github.com/facebook/react/commit/8c67bbf18)**: [scheduler] Deadline object -> shouldYield (#14025) //<Andrew Clark>//
- **[e02086bfc](https://github.com/facebook/react/commit/e02086bfc)**: Warn about variable number of dependencies //<Andrew Clark>//
- **[b92cdef64](https://github.com/facebook/react/commit/b92cdef64)**: Rename ReactHooks test suite //<Andrew Clark>//
- **[6efbbe068](https://github.com/facebook/react/commit/6efbbe068)**: Prettier //<Sophie Alpert>//
- **[504576306](https://github.com/facebook/react/commit/504576306)**: Swap order of function member in hook union types //<Andrew Clark>//
- **[ddbfe2ed5](https://github.com/facebook/react/commit/ddbfe2ed5)**: Add ESLint rule for React Hooks //<Caleb Meredith>//
- **[acb489963](https://github.com/facebook/react/commit/acb489963)**: Clear effect tags from a fiber that suspends in non-concurrent mode //<Andrew Clark>//
- **[933b64710](https://github.com/facebook/react/commit/933b64710)**: Disable hook update callback (2nd arg to setState/dispatch) //<Andrew Clark>//
- **[5fc84efac](https://github.com/facebook/react/commit/5fc84efac)**: Skip updating effect tag when skipping effect //<Sophie Alpert>//
- **[9f34eb79a](https://github.com/facebook/react/commit/9f34eb79a)**: Add readContext to ReactPartialRendererHooks //<Alex Taylor>//
- **[f7cb9d2b2](https://github.com/facebook/react/commit/f7cb9d2b2)**: Warn about useContext(Consumer|Provider) //<Dan Abramov>//
- **[63cc7d2b3](https://github.com/facebook/react/commit/63cc7d2b3)**: Test useContext in pure, forwardRef, and PureComponent //<Dan Abramov>//
- **[3a7c6da8d](https://github.com/facebook/react/commit/3a7c6da8d)**: Make effects actually work with memo //<Sophie Alpert>//
- **[75a1c2e72](https://github.com/facebook/react/commit/75a1c2e72)**: The Lost Effect, chapter 3 //<Sophie Alpert>//
- **[55a4b1f37](https://github.com/facebook/react/commit/55a4b1f37)**: memo supports Hooks //<Sophie Alpert>//
- **[30aa4ad55](https://github.com/facebook/react/commit/30aa4ad55)**: The Lost Effect, chapter 2 //<Sophie Alpert>//
- **[b772e0e26](https://github.com/facebook/react/commit/b772e0e26)**: "functional component" -> "function component" in hooks error messages //<Sebastian Markbåge>//
- **[9e9e3970e](https://github.com/facebook/react/commit/9e9e3970e)**: Warn for Hook set-state on unmounted component //<Sophie Alpert>//
- **[6514697f0](https://github.com/facebook/react/commit/6514697f0)**: Make sure deletions don't stop passive effects //<Sophie Alpert>//
- **[dd019d34d](https://github.com/facebook/react/commit/dd019d34d)**: Add support for hooks to ReactDOMServer //<Alex Taylor>//
- **[11d0781ee](https://github.com/facebook/react/commit/11d0781ee)**: Defer useEffect until after paint //<Andrew Clark>//
- **[105f2de54](https://github.com/facebook/react/commit/105f2de54)**: Put hooks behind feature flag //<Andrew Clark>//
- **[7bee9fbdd](https://github.com/facebook/react/commit/7bee9fbdd)**: Initial hooks implementation //<Andrew Clark>//
- **[37c7fe0a5](https://github.com/facebook/react/commit/37c7fe0a5)**: Update createRoot warning message based on `enableStableConcurrentModeAPIs` (#14017) //<Rauno Freiberg>//
- **[95f98a187](https://github.com/facebook/react/commit/95f98a187)**: fix typo (#13955) //<Joseph>//
- **[e217f2f1a](https://github.com/facebook/react/commit/e217f2f1a)**: Updated comment for getEventModifierState (#13918) //<Patrick>//
- **[275e76e83](https://github.com/facebook/react/commit/275e76e83)**: Enable stable concurrent APIs flag for 16.7 alpha (#13928) //<Brian Vaughn>//
- **[8b97a9c36](https://github.com/facebook/react/commit/8b97a9c36)**: Update bundle sizes for 16.6.0 release //<Dan Abramov>//
- **[6c29eabf7](https://github.com/facebook/react/commit/6c29eabf7)**: Updating package versions for release 16.6.0 //<Dan Abramov>//
- **[d520b358d](https://github.com/facebook/react/commit/d520b358d)**: Revert all package versions to 16.5.2 state //<Dan Abramov>//
- **[8f1ec7649](https://github.com/facebook/react/commit/8f1ec7649)**: Bump versions to beta.0 //<Dan Abramov>//
- **[5055a83fa](https://github.com/facebook/react/commit/5055a83fa)**: Revert "Revert "Updating dependencies for react-noop-renderer"" //<Dan Abramov>//
- **[3e8b4a5b8](https://github.com/facebook/react/commit/3e8b4a5b8)**: Revert "Updating dependencies for react-noop-renderer" //<Brian Vaughn>//
- **[d8e03de4a](https://github.com/facebook/react/commit/d8e03de4a)**: [react-cache] Remove `cache` as argument to `read` (#13865) //<Andrew Clark>//
- **[fefa1269e](https://github.com/facebook/react/commit/fefa1269e)**: Revert accidentally committed existence check (#13931) //<Andrew Clark>//
- **[80a0c05ce](https://github.com/facebook/react/commit/80a0c05ce)**: Removed react-cache from the bundle list for now (#13930) //<BrianVaughn>//
- **[915e4eab5](https://github.com/facebook/react/commit/915e4eab5)**: Add "unstable_" prefix to react-cache and jest-react (#13929) //<Brian Vaughn>//
- **[cbbc2b6c4](https://github.com/facebook/react/commit/cbbc2b6c4)**: [Synchronous Suspense] Suspending a class outside concurrent mode (#13926) //<Andrew Clark>//
- **[4947fcd76](https://github.com/facebook/react/commit/4947fcd76)**: Fix lint (#13923) //<Sebastian Markbåge>//
- **[d75c69e0c](https://github.com/facebook/react/commit/d75c69e0c)**: Remove unstable_ prefix from Suspense (#13922) //<Sebastian Markbåge>//
- **[c8ef2feda](https://github.com/facebook/react/commit/c8ef2feda)**: Remove redundant word "the" (#13919) //<John Lin>//
- **[55444a6f4](https://github.com/facebook/react/commit/55444a6f4)**: Try rendering again if a timed out tree receives an update (#13921) //<Andrew Clark>//
- **[04c4f2fce](https://github.com/facebook/react/commit/04c4f2fce)**: [reconciler] ReactFiberNewContext import maxSigned31BitInt twice (#13857) //<yongningfu>//
- **[409e472fc](https://github.com/facebook/react/commit/409e472fc)**: Add flow types in ReactControlledComponent (#13669) //<Abdul Rauf>//
- **[663835a43](https://github.com/facebook/react/commit/663835a43)**: Add flow types in getEventModifierState (#13909) //<Abdul Rauf>//
- **[82710097f](https://github.com/facebook/react/commit/82710097f)**: Add flow types in getNodeForCharacterOffset (#13908) //<Abdul Rauf>//
- **[b753f76a7](https://github.com/facebook/react/commit/b753f76a7)**: Fix failing async tests in Node 10 //<Andrew Clark>//
- **[b5c0852fd](https://github.com/facebook/react/commit/b5c0852fd)**: Bump version to 16.6.0-beta.0 (#13906) //<Dan Abramov>//
- **[769b1f270](https://github.com/facebook/react/commit/769b1f270)**: pure -> memo (#13905) //<Dan Abramov>//
- **[8ecd4bd4f](https://github.com/facebook/react/commit/8ecd4bd4f)**: Add support for React.pure in ReactDOMServer (#13855) //<Alex Taylor>//
- **[15b11d23f](https://github.com/facebook/react/commit/15b11d23f)**: Allow arbitrary types to be wrapped in pure (#13903) //<Sebastian Markbåge>//
- **[e770af7a3](https://github.com/facebook/react/commit/e770af7a3)**: Add back accidentally deleted `break` to prevent fallthrough //<Andrew Clark>//
- **[95a313ec0](https://github.com/facebook/react/commit/95a313ec0)**: Unfork Lazy Component Branches (#13902) //<Sebastian Markbåge>//
- **[e16cdd5b1](https://github.com/facebook/react/commit/e16cdd5b1)**: Always bail out timed out children even if they receive an update (#13901) //<Andrew Clark>//
- **[7268d97d2](https://github.com/facebook/react/commit/7268d97d2)**: Centralize props memoization (#13900) //<Sebastian Markbåge>//
- **[0fc044679](https://github.com/facebook/react/commit/0fc044679)**: Class component can suspend without losing state outside concurrent mode (#13899) //<Andrew Clark>//
- **[36db53822](https://github.com/facebook/react/commit/36db53822)**: Bugfix for #13886 (#13896) //<Andrew Clark>//
- **[6938dcaac](https://github.com/facebook/react/commit/6938dcaac)**: SSR support for class contextType (#13889) //<Sebastian Markbåge>//
- **[fa65c58e1](https://github.com/facebook/react/commit/fa65c58e1)**: Add readContext to SSR (#13888) //<Sebastian Markbåge>//
- **[d9a3cc070](https://github.com/facebook/react/commit/d9a3cc070)**: React.lazy constructor must return result of a dynamic import (#13886) //<Andrew Clark>//
- **[d9659e499](https://github.com/facebook/react/commit/d9659e499)**: Lazy components must use React.lazy (#13885) //<Andrew Clark>//
- **[0648ca618](https://github.com/facebook/react/commit/0648ca618)**: Revert "React.pure automatically forwards ref" (#13887) //<Sophie Alpert>//
- **[4dd772ac1](https://github.com/facebook/react/commit/4dd772ac1)**: Prettier :( //<Andrew Clark>//
- **[98bab66c3](https://github.com/facebook/react/commit/98bab66c3)**: Fix lint //<Andrew Clark>//
- **[8ced545e3](https://github.com/facebook/react/commit/8ced545e3)**: Suspense component does not capture if `fallback` is not defined (#13879) //<Andrew Clark>//
- **[b738ced47](https://github.com/facebook/react/commit/b738ced47)**: Remove render prop option from Suspense (#13880) //<Andrew Clark>//
- **[55b827942](https://github.com/facebook/react/commit/55b827942)**: Strict mode and default mode should have same Suspense semantics (#13882) //<Andrew Clark>//
- **[dac9202a9](https://github.com/facebook/react/commit/dac9202a9)**: Hide timed-out children instead of deleting them so their state ispreserved (#13823) //<Andrew Clark>//
- **[4f0bd4590](https://github.com/facebook/react/commit/4f0bd4590)**: Replacement of old links, by the new ones of the documentation. (#13871) //<Pablo Javier D. A>//
- **[7685b55d2](https://github.com/facebook/react/commit/7685b55d2)**: Remove unstable_read() in favor of direct dispatcher call (#13861)//<Dan Abramov>//
- **[21a79a1d9](https://github.com/facebook/react/commit/21a79a1d9)**: [schedule] Call ensureHostCallbackIsScheduled without args (#13852) //<Trivikram Kamat>//
- **[9ea4bc6ed](https://github.com/facebook/react/commit/9ea4bc6ed)**: Fix false positive context warning when using an old React (#13850) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions 4773fdf...3ff2c7c

Reviewed By: sebmarkbage

Differential Revision: D12955345

fbshipit-source-id: db12076758fe85a519074ca4fe3aa5ede6f4fd49
2018-11-07 19:36:04 -08:00
Eli White e6a8dca6f7 TextInput add back propTypes
Reviewed By: yungsters

Differential Revision: D12969854

fbshipit-source-id: c2fe2c46e538f8b5e3ea46257aef70d00bf14364
2018-11-07 18:44:40 -08:00
Eli White 7e818aed9a Fixing TextInput related jest tests
Reviewed By: yungsters

Differential Revision: D10519823

fbshipit-source-id: 02368b670953a0275fa6495b0c73ef84403598cb
2018-11-07 18:44:40 -08:00
Eli White ad7d8f89ef Fix internal types on top of TextInput refactor
Summary:
Types were moved out of TextInput into TextInputTypes for better re-use. Fixing the internal callsites.

This isn't much of a worry externally because these types aren't exposed as part of the public API

Reviewed By: RSNara

Differential Revision: D10517066

fbshipit-source-id: bade4285eafb3d7ab5ab1e4b0730c22d45925509
2018-11-07 18:44:40 -08:00
empyrical 70e9e2665b TextInput: Remove PropTypes, NativeMethodsMixin; Convert to ES6 class (#21885)
Summary:
This pull requests converts `TextInput` to an ES6 class, and in the process removes its usage of `prop-types` and `NativeMethodsMixin`.

The code (and some relevant types) for the native components have been moved to `TextInputNativeComponent.js`.

The rest of the flow proptypes have been moved to `TextInputTypes.js`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21885

Reviewed By: RSNara

Differential Revision: D10515754

Pulled By: TheSavior

fbshipit-source-id: 5cfb25344385904b37a49582008c2a4b46db809d
2018-11-07 18:44:40 -08:00
Nurzhan Bakibayev bccc4548e4 console polyfill: pass unsupported messages to original console
Summary: Some console methods (like `groupCollapsed` or `clear`) are not supported by console.js polyfill and are not passed to the original console objects.

Reviewed By: sahrens

Differential Revision: D12900996

fbshipit-source-id: 1b2f487028e418ae934f631996eaaf63abdced82
2018-11-07 11:21:55 -08:00
Ignacio Olaciregui 41eb2da33b Fix inline styles warning in Libraries (#22161)
Summary:
Fixes `react-native/no-inline-styles` eslint warnings in the `Libraries` module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22161

Differential Revision: D12946899

Pulled By: TheSavior

fbshipit-source-id: c97ffa50dd90529dabf30a3d2cb09476acc568cb
2018-11-06 14:32:43 -08:00
Thomas BARRAS 69213eea95 Flow strict TouchableOpacity (#22146)
Summary:
Related to #22100

Enhance Flow types for TouchableOpacity specifying Touchable event types and TvParallaxPropertiesType.
I had to export TvParallaxPropertiesType from TVViewPropTypes file.
There are still 1 any left using requireNativeComponent and a dependency to `Touchable` that need to be addressed to turn Flow to strict mode.

I guess `Touchable` is a lot more work since there's no flow annotation and it's still good old Mixin.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableOpacity.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export type
Pull Request resolved: https://github.com/facebook/react-native/pull/22146

Reviewed By: TheSavior

Differential Revision: D12927044

Pulled By: RSNara

fbshipit-source-id: c63d805699dd58e2fbc4fd1df4ee0c9f87e2336a
2018-11-06 14:07:05 -08:00
Thomas BARRAS c03fc4087f Flow strict Slider (#22127)
Summary:
Related to #22100

Turn on Flow strict mode for Slider.
Enhanced event type and props callbacks type defs for Slider.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [Slider.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22127

Differential Revision: D12946817

Pulled By: TheSavior

fbshipit-source-id: 631391f70c04fddf0bfa6fec92f5cb769a555547
2018-11-06 13:55:03 -08:00
Naman Goel 7dd2b0b5ea Types for BackHandler
Summary: Improve types for BackHandler

Reviewed By: benjaffe

Differential Revision: D9838175

fbshipit-source-id: 839a5a695b468974aadb7bc0da1a23ef844fdd7f
2018-11-06 12:37:31 -08:00
nabettu 0a39cda39a Remove var in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js (#22126)
Summary:
Replaces the keywords var with let or const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22126

Differential Revision: D12929758

Pulled By: TheSavior

fbshipit-source-id: bee9dfb463d197458cb218f39274af5a4d16ce1f
2018-11-05 16:15:54 -08:00
nd-02110114 636e146c4a Flow strict in ViewPagerAndroid.android.js (#22134)
Summary:
Related to #22100

Turn Flow strict mode on for Libraries/Components/ViewPager/ViewPagerAndroid.android.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Components/ViewPager/ViewPagerAndroid.android.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22134

Differential Revision: D12930719

Pulled By: TheSavior

fbshipit-source-id: 9519f31b7af27f0497e42fd51f18c19be3692823
2018-11-05 15:29:17 -08:00
flowkraD f9050e0908 Flow strict DrawerLayout (#22152)
Summary:
Issue in focus: #22100

The only occurrence of `Object` was replaced with the appropriate flow type
A Lint error was encountered in `deepFreezeAndThrowOnMutationInDev-test.js` when running `npm run lint` and was fixed by running `yarn prettier`
Pull Request resolved: https://github.com/facebook/react-native/pull/22152

Differential Revision: D12930872

Pulled By: RSNara

fbshipit-source-id: f9706ed2e49d9ccedfa331594c886d2d3b615db5
2018-11-05 15:05:25 -08:00
soyanakagawa cc90c20bf6 Remove var in /Libralies/Experimental/IncrementalPresenter.js (#22144)
Summary:
Remove `var` declaration keyword in ` /Libralies/Experimental/IncrementalPresenter.js` .

- [x] Check `npm run flow`
- [x] Check `npm run flow-check-ios`
- [x] Check `npm run flow-check-android`
- [x] Check `npm run lint`

[GENERAL] [ENHANCEMENT] [Libralies/Experimental] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22144

Differential Revision: D12930731

Pulled By: TheSavior

fbshipit-source-id: 64d7689ffec1da14479bdd7106fdea9a3dbeaa42
2018-11-05 14:58:48 -08:00
Thomas BARRAS 6476151717 Flow strict StaticContainer (#22121)
Summary:
Related to #22100

Turn on Flow strict mode for StaticContainer.react
This component needed proper Props type definition. I went through the only component (`TabBarItemIOS.ios`) using this to try to know the most appropriate props.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [StaticContainer.react.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22121

Differential Revision: D12929646

Pulled By: TheSavior

fbshipit-source-id: 8826aa7bc83c854efdd71cdb4fba3d7ca98f2fce
2018-11-05 14:49:57 -08:00
ifsnow 0d4f627f42 Removed unnecessary code in Libraries/Text/Text.js (#22132)
Summary:
I don't think it's necessary to use spread properties (prevState) in `getDerivedStateFromProps`
Pull Request resolved: https://github.com/facebook/react-native/pull/22132

Differential Revision: D12929838

Pulled By: TheSavior

fbshipit-source-id: cdc4f9df8e2f0b2878aec605478144b3e08cea89
2018-11-05 14:22:38 -08:00
Victor Calvello ffd7195543 Remove unused styles (#22083)
Summary:
Removes unused styles.

NOTE: Lint rule `react-native/no-unused-styles` not added because of custom lint rule internally at Facebook that does this.
Pull Request resolved: https://github.com/facebook/react-native/pull/22083

Differential Revision: D12929443

Pulled By: TheSavior

fbshipit-source-id: d42b0be3db745e445447e65df3b78b61f53e4229
2018-11-05 13:57:47 -08:00
Thomas BARRAS 84c5416617 Flow type RefreshControl (#22119)
Summary:
Related to #22100

Enhance Flow types for RefreshControl specifying `onRefresh` props type.
There are still 2 `any` left using `requireNativeComponent` that need to be addressed to turn Flow to strict mode.

I went through `RCTRefreshControl` and `AndroidSwipeRefreshLayout` classes to understand where this method came from.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [RefreshControl.js] - Flow onRefresh type
Pull Request resolved: https://github.com/facebook/react-native/pull/22119

Differential Revision: D12919764

Pulled By: TheSavior

fbshipit-source-id: 9ba675be8dbce77d77972acb904fc13c68524831
2018-11-05 13:54:41 -08:00
nd-02110114 0ea95e70a3 remove createReactClass from SegmentedControlIOS.ios.js (#21888)
Summary:
Related to #21581 .
Removed createReactClass from the SegmentedControlIOS.ios.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21888

Reviewed By: TheSavior

Differential Revision: D12827447

Pulled By: RSNara

fbshipit-source-id: 74a91bcba131d9a34a136c6127459a40424a0738
2018-11-05 11:25:14 -08:00
nd-02110114 147c38a7f2 remove createReactClass from ToolbarAndroid/ToolbarAndroid.android.js (#21893)
Summary:
Related to #21581 .
Removed createReactClass from the Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21893

Reviewed By: TheSavior

Differential Revision: D12826971

Pulled By: RSNara

fbshipit-source-id: 3d3fb88a3c9faf3ef89e386ca0d41d939f5d14dd
2018-11-05 11:05:36 -08:00
Albert Sun 3a98318c91 Increase cache and file size limits
Summary: This change expands the limits to support a greater variety of scenarios.

Reviewed By: PeteTheHeat

Differential Revision: D12911841

fbshipit-source-id: a7c8eb6fece49dfe47b3ada98f55a02b43396ce8
2018-11-05 05:40:35 -08:00
Eric Samelson 54f7eb3424 Performance improvement for loading cached images on iOS (#20356)
Summary:
This PR increases the speed at which cached images are loaded and displayed on the screen. Images are currently cached in memory using RCTImageCache, but each time they are loaded, a round trip through RCTNetworking happens before RCTImageCache is even checked. This is likely so that RCTNetworking can handle the caching behavior required by the HTTP headers. However, this means that at the very least, images are read from disk each time they're loaded.

This PR makes RCTImageLoader check RCTImageCache _before_ sending a request to RCTNetworking. RCTImageCache stores a bit of information about the response headers so that it can respect Cache-Control fields without needing a roundtrip through RCTNetworking.

Here are a couple of graphs showing improved loading times before this change (blue) and after (red) with SDWebImage (yellow) as a baseline comparison. The increase is most evident when loading especially large (hi-res photo size) images, or loading multiple images at a time.
https://imgur.com/a/cnL47Z0

More performance gains can potentially be had by increasing the size limit of RCTImageCache: 1a6666a116/Libraries/Image/RCTImageCache.m (L39) but this comes at the tradeoff of being more likely to run into OOM crashes.
Pull Request resolved: https://github.com/facebook/react-native/pull/20356

Reviewed By: PeteTheHeat

Differential Revision: D12909121

Pulled By: alsun2001

fbshipit-source-id: 7f5e21928c53d7aa53f293b7f1b4ec5c99b5f0c2
2018-11-05 05:40:35 -08:00
nd-02110114 fbc5a4f5e6 Turn Flow strict mode on for KeyBoard (#22114)
Summary:
Related to #22100

Turn Flow strict mode on for KeyBoard

- [x] npm run prettier
- [ ] npm run flow-check-ios
- [ ] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/Keyboard/Keyboard.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22114

Differential Revision: D12920947

Pulled By: TheSavior

fbshipit-source-id: 8d72019efd4d30032ce4784764e5deb9c60e7b01
2018-11-04 23:05:54 -08:00
nd-02110114 3c0211b61a Turn Flow strict mode on for DatePickerIOS (#22105)
Summary:
Related to #22100

Turn Flow strict mode on for DatePickerIOS.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/DatePicker/DatePickerIOS.ios.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22105

Differential Revision: D12920939

Pulled By: TheSavior

fbshipit-source-id: aae5ca04d656abb1cf34168e12e44dd50f0a603c
2018-11-04 23:01:02 -08:00
mottox2 b01bf06dba Remove var in Libraries/Utilities/buildStyleInterpolator.js (#22112)
Summary:
Replaces the keywords var with const in Libraries/Utilities/buildStyleInterpolator.js
Pull Request resolved: https://github.com/facebook/react-native/pull/22112

Differential Revision: D12919286

Pulled By: TheSavior

fbshipit-source-id: bc39a1efc2c372365d95cd305cc6d915f030b209
2018-11-04 11:03:09 -08:00
ggtmtmgg 368518eff1 Remove var in Libraries/Utilities/MatrixMath.js (#22111)
Summary:
Replaces the keywords var with let in Libraries/Utilities/MatrixMath.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/MatrixMath.js] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22111

Differential Revision: D12919285

Pulled By: TheSavior

fbshipit-source-id: dca65d2da311b5c50ab6ce7338af1cc941fb7a33
2018-11-04 10:59:41 -08:00
yushimatenjin 3f069f3334 Remove var in Libraries/vendor/core/merge.js (#22108)
Summary:
Replaces the keywords var with const in Libraries/merge.js

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!

- [x]  Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/core] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22108

Differential Revision: D12919282

Pulled By: TheSavior

fbshipit-source-id: e3c8569c47c95ad3d1a061917c90185c2694c78f
2018-11-04 10:55:37 -08:00
watanabeyu e835c6dc50 Replace var to const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev-test.js (#22110)
Summary:
Replaces the keywords var to const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

- [x]  Check npm run flow
- [x]  Check npm run flow-check-ios
- [x]  Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js] - replace var
Pull Request resolved: https://github.com/facebook/react-native/pull/22110

Differential Revision: D12919284

Pulled By: TheSavior

fbshipit-source-id: 4a3a3f4c49665c538ed5f38f3cc2142d40ac4d55
2018-11-04 10:52:09 -08:00
Ignacio Olaciregui 6ebee18d13 Remove unused variables (#22097)
Summary:
Fix unused variable ESLint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22097

Differential Revision: D12919249

Pulled By: TheSavior

fbshipit-source-id: f680fa7277c58cf685e70dfb911753a30fe01c1d
2018-11-04 10:41:46 -08:00
empyrical 01b7c48852 Remove flow-strict from polyfillPromise (#22048)
Summary:
Flow is broken for a bunch of people and has been for the last few days. For some reason this isn't causing any builds to fail which we will need to look into. For now, this stops the bleeding.

I *think* this is because of case sensitivity differenes between Mac and where all of our CI machines run.
```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ Libraries/Core/polyfillPromise.js:21:33

Importing from an untyped module makes it any and is not safe! Did you mean to add // flow to the top of Promise?
(untyped-import)

     18│  * If you don't need these polyfills, don't use InitializeCore; just directly
     19│  * require the modules you need from InitializeCore for setup.
     20│  */
     21│ polyfillGlobal('Promise', () => require('Promise'));
     22│
```

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

Reviewed By: shergin

Differential Revision: D12918418

Pulled By: TheSavior

fbshipit-source-id: 9d9db1b3686eab906244180325c12ffcce92be8c
2018-11-04 01:56:39 -07:00
Tim Yung 6448f4e2f1 RN: Revert React 16.6 Sync
Summary:
There are some critical bugs that require further investigation in the most recent upgrade to React 16.6 (and ReactNativeRenderer changes).

This revision reverts the sync until these issues have been resolved.

Reviewed By: mdvacca

Differential Revision: D12918541

fbshipit-source-id: 5c1ada185851ba599f3c86387158a2b41f3dcf3e
2018-11-04 01:08:40 -07:00
Tnarita0000 cf70870caa Remove var in Libraries/emitter/* (#22087)
Summary:
Replaces the keywords var with const in Libraries/emitter/EventValidator.js

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/emitter] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22087

Differential Revision: D12918444

Pulled By: TheSavior

fbshipit-source-id: 630ccb283fd6c3118a22124a656038eac4a88599
2018-11-03 23:02:20 -07:00
Thomas BARRAS 499c195eba Flow strict ScrollViewMock (#22103)
Summary:
Related to #22100

Turn Flow strict mode on for ScrollViewMock.
This file used to declare jest var as `any` but jest module is already typed in root flow folder.

Note: I had to use a quick fix for polyfillPromise. See here #22101

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [ScrollViewMock.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22103

Differential Revision: D12918380

Pulled By: TheSavior

fbshipit-source-id: cd3aba47b1a43e76a7da09e15cc2d9cfcdf7f56d
2018-11-03 22:14:51 -07:00
MateusAndrade cc13a7367b Improving Modal `visible` prop check to handle undefined and null (#22072)
Summary:
Changing the the this.props.visible if to be ` if (!!this.props.visible === false)` . So passing undefined, or other values wont set the modal to be visible. Granting that anything that is not true, will set the modal to null on the render.

I make this this PR, because on the company that im working, we used a lot of RN. At the moment, we arent using anything like flow or TS. But to grant that the modals will only show if they are set visible to true i have changed the if made.

_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/22072

Differential Revision: D12918086

Pulled By: TheSavior

fbshipit-source-id: 8f9c63ac6fd56d83949bb8428ad7c5b7bf805c49
2018-11-03 18:44:53 -07:00
Ignacio Olaciregui b03b9d53af Fix duplicate function declaration in WebSockets (#22098)
Summary:
Fixes the only ESLint error pending to resolve. It was a duplicate `get` declaration.
Pull Request resolved: https://github.com/facebook/react-native/pull/22098

Differential Revision: D12918078

Pulled By: TheSavior

fbshipit-source-id: c738d6880241dbc1f1ddc06c2d4e52443c00768a
2018-11-03 18:41:24 -07:00
wd39 a09aca5bb0 Fix the comment for getSize in Image.android.js (#22092)
Summary:
A minor change to the comment in the Image.android.js file.
Pull Request resolved: https://github.com/facebook/react-native/pull/22092

Differential Revision: D12918066

Pulled By: TheSavior

fbshipit-source-id: f27c63241c9dde780c037edcbcdf4cc10d55d33e
2018-11-03 18:37:25 -07:00
Tim Yung 8b275a8b8d React sync for revisions 4773fdf...bf9fadf
Summary:
@public
This sync includes the following changes:
- **[bf9fadfcf](https://github.com/facebook/react/commit/bf9fadfcf)**: [Hooks] Remove dispatch callbacks (#14037) //<Andrew Clark>//
- **[8c67bbf18](https://github.com/facebook/react/commit/8c67bbf18)**: [scheduler] Deadline object -> shouldYield (#14025) //<Andrew Clark>//
- **[e02086bfc](https://github.com/facebook/react/commit/e02086bfc)**: Warn about variable number of dependencies //<Andrew Clark>//
- **[b92cdef64](https://github.com/facebook/react/commit/b92cdef64)**: Rename ReactHooks test suite //<Andrew Clark>//
- **[6efbbe068](https://github.com/facebook/react/commit/6efbbe068)**: Prettier //<Sophie Alpert>//
- **[504576306](https://github.com/facebook/react/commit/504576306)**: Swap order of function member in hook union types //<Andrew Clark>//
- **[ddbfe2ed5](https://github.com/facebook/react/commit/ddbfe2ed5)**: Add ESLint rule for React Hooks //<Caleb Meredith>//
- **[acb489963](https://github.com/facebook/react/commit/acb489963)**: Clear effect tags from a fiber that suspends in non-concurrent mode //<Andrew Clark>//
- **[933b64710](https://github.com/facebook/react/commit/933b64710)**: Disable hook update callback (2nd arg to setState/dispatch) //<Andrew Clark>//
- **[5fc84efac](https://github.com/facebook/react/commit/5fc84efac)**: Skip updating effect tag when skipping effect //<Sophie Alpert>//
- **[9f34eb79a](https://github.com/facebook/react/commit/9f34eb79a)**: Add readContext to ReactPartialRendererHooks //<Alex Taylor>//
- **[f7cb9d2b2](https://github.com/facebook/react/commit/f7cb9d2b2)**: Warn about useContext(Consumer|Provider) //<Dan Abramov>//
- **[63cc7d2b3](https://github.com/facebook/react/commit/63cc7d2b3)**: Test useContext in pure, forwardRef, and PureComponent //<Dan Abramov>//
- **[3a7c6da8d](https://github.com/facebook/react/commit/3a7c6da8d)**: Make effects actually work with memo //<Sophie Alpert>//
- **[75a1c2e72](https://github.com/facebook/react/commit/75a1c2e72)**: The Lost Effect, chapter 3 //<Sophie Alpert>//
- **[55a4b1f37](https://github.com/facebook/react/commit/55a4b1f37)**: memo supports Hooks //<Sophie Alpert>//
- **[30aa4ad55](https://github.com/facebook/react/commit/30aa4ad55)**: The Lost Effect, chapter 2 //<Sophie Alpert>//
- **[b772e0e26](https://github.com/facebook/react/commit/b772e0e26)**: "functional component" -> "function component" in hooks error messages //<Sebastian Markbåge>//
- **[9e9e3970e](https://github.com/facebook/react/commit/9e9e3970e)**: Warn for Hook set-state on unmounted component //<Sophie Alpert>//
- **[6514697f0](https://github.com/facebook/react/commit/6514697f0)**: Make sure deletions don't stop passive effects //<Sophie Alpert>//
- **[dd019d34d](https://github.com/facebook/react/commit/dd019d34d)**: Add support for hooks to ReactDOMServer //<Alex Taylor>//
- **[11d0781ee](https://github.com/facebook/react/commit/11d0781ee)**: Defer useEffect until after paint //<Andrew Clark>//
- **[105f2de54](https://github.com/facebook/react/commit/105f2de54)**: Put hooks behind feature flag //<Andrew Clark>//
- **[7bee9fbdd](https://github.com/facebook/react/commit/7bee9fbdd)**: Initial hooks implementation //<Andrew Clark>//
- **[37c7fe0a5](https://github.com/facebook/react/commit/37c7fe0a5)**: Update createRoot warning message based on `enableStableConcurrentModeAPIs` (#14017) //<Rauno Freiberg>//
- **[95f98a187](https://github.com/facebook/react/commit/95f98a187)**: fix typo (#13955) //<Joseph>//
- **[e217f2f1a](https://github.com/facebook/react/commit/e217f2f1a)**: Updated comment for getEventModifierState (#13918) //<Patrick>//
- **[275e76e83](https://github.com/facebook/react/commit/275e76e83)**: Enable stable concurrent APIs flag for 16.7 alpha (#13928) //<Brian Vaughn>//
- **[8b97a9c36](https://github.com/facebook/react/commit/8b97a9c36)**: Update bundle sizes for 16.6.0 release //<Dan Abramov>//
- **[6c29eabf7](https://github.com/facebook/react/commit/6c29eabf7)**: Updating package versions for release 16.6.0 //<Dan Abramov>//
- **[d520b358d](https://github.com/facebook/react/commit/d520b358d)**: Revert all package versions to 16.5.2 state //<Dan Abramov>//
- **[8f1ec7649](https://github.com/facebook/react/commit/8f1ec7649)**: Bump versions to beta.0 //<Dan Abramov>//
- **[5055a83fa](https://github.com/facebook/react/commit/5055a83fa)**: Revert "Revert "Updating dependencies for react-noop-renderer"" //<Dan Abramov>//
- **[3e8b4a5b8](https://github.com/facebook/react/commit/3e8b4a5b8)**: Revert "Updating dependencies for react-noop-renderer" //<Brian Vaughn>//
- **[d8e03de4a](https://github.com/facebook/react/commit/d8e03de4a)**: [react-cache] Remove `cache` as argument to `read` (#13865) //<Andrew Clark>//
- **[fefa1269e](https://github.com/facebook/react/commit/fefa1269e)**: Revert accidentally committed existence check (#13931) //<Andrew Clark>//
- **[80a0c05ce](https://github.com/facebook/react/commit/80a0c05ce)**: Removed react-cache from the bundle list for now (#13930) //<BrianVaughn>//
- **[915e4eab5](https://github.com/facebook/react/commit/915e4eab5)**: Add "unstable_" prefix to react-cache and jest-react (#13929) //<Brian Vaughn>//
- **[cbbc2b6c4](https://github.com/facebook/react/commit/cbbc2b6c4)**: [Synchronous Suspense] Suspending a class outside concurrent mode (#13926) //<Andrew Clark>//
- **[4947fcd76](https://github.com/facebook/react/commit/4947fcd76)**: Fix lint (#13923) //<Sebastian Markbåge>//
- **[d75c69e0c](https://github.com/facebook/react/commit/d75c69e0c)**: Remove unstable_ prefix from Suspense (#13922) //<Sebastian Markbåge>//
- **[c8ef2feda](https://github.com/facebook/react/commit/c8ef2feda)**: Remove redundant word "the" (#13919) //<John Lin>//
- **[55444a6f4](https://github.com/facebook/react/commit/55444a6f4)**: Try rendering again if a timed out tree receives an update (#13921) //<Andrew Clark>//
- **[04c4f2fce](https://github.com/facebook/react/commit/04c4f2fce)**: [reconciler] ReactFiberNewContext import maxSigned31BitInt twice (#13857) //<yongningfu>//
- **[409e472fc](https://github.com/facebook/react/commit/409e472fc)**: Add flow types in ReactControlledComponent (#13669) //<Abdul Rauf>//
- **[663835a43](https://github.com/facebook/react/commit/663835a43)**: Add flow types in getEventModifierState (#13909) //<Abdul Rauf>//
- **[82710097f](https://github.com/facebook/react/commit/82710097f)**: Add flow types in getNodeForCharacterOffset (#13908) //<Abdul Rauf>//
- **[b753f76a7](https://github.com/facebook/react/commit/b753f76a7)**: Fix failing async tests in Node 10 //<Andrew Clark>//
- **[b5c0852fd](https://github.com/facebook/react/commit/b5c0852fd)**: Bump version to 16.6.0-beta.0 (#13906) //<Dan Abramov>//
- **[769b1f270](https://github.com/facebook/react/commit/769b1f270)**: pure -> memo (#13905) //<Dan Abramov>//
- **[8ecd4bd4f](https://github.com/facebook/react/commit/8ecd4bd4f)**: Add support for React.pure in ReactDOMServer (#13855) //<Alex Taylor>//
- **[15b11d23f](https://github.com/facebook/react/commit/15b11d23f)**: Allow arbitrary types to be wrapped in pure (#13903) //<Sebastian Markbåge>//
- **[e770af7a3](https://github.com/facebook/react/commit/e770af7a3)**: Add back accidentally deleted `break` to prevent fallthrough //<Andrew Clark>//
- **[95a313ec0](https://github.com/facebook/react/commit/95a313ec0)**: Unfork Lazy Component Branches (#13902) //<Sebastian Markbåge>//
- **[e16cdd5b1](https://github.com/facebook/react/commit/e16cdd5b1)**: Always bail out timed out children even if they receive an update (#13901) //<Andrew Clark>//
- **[7268d97d2](https://github.com/facebook/react/commit/7268d97d2)**: Centralize props memoization (#13900) //<Sebastian Markbåge>//
- **[0fc044679](https://github.com/facebook/react/commit/0fc044679)**: Class component can suspend without losing state outside concurrent mode (#13899) //<Andrew Clark>//
- **[36db53822](https://github.com/facebook/react/commit/36db53822)**: Bugfix for #13886 (#13896) //<Andrew Clark>//
- **[6938dcaac](https://github.com/facebook/react/commit/6938dcaac)**: SSR support for class contextType (#13889) //<Sebastian Markbåge>//
- **[fa65c58e1](https://github.com/facebook/react/commit/fa65c58e1)**: Add readContext to SSR (#13888) //<Sebastian Markbåge>//
- **[d9a3cc070](https://github.com/facebook/react/commit/d9a3cc070)**: React.lazy constructor must return result of a dynamic import (#13886) //<Andrew Clark>//
- **[d9659e499](https://github.com/facebook/react/commit/d9659e499)**: Lazy components must use React.lazy (#13885) //<Andrew Clark>//
- **[0648ca618](https://github.com/facebook/react/commit/0648ca618)**: Revert "React.pure automatically forwards ref" (#13887) //<Sophie Alpert>//
- **[4dd772ac1](https://github.com/facebook/react/commit/4dd772ac1)**: Prettier :( //<Andrew Clark>//
- **[98bab66c3](https://github.com/facebook/react/commit/98bab66c3)**: Fix lint //<Andrew Clark>//
- **[8ced545e3](https://github.com/facebook/react/commit/8ced545e3)**: Suspense component does not capture if `fallback` is not defined (#13879) //<Andrew Clark>//
- **[b738ced47](https://github.com/facebook/react/commit/b738ced47)**: Remove render prop option from Suspense (#13880) //<Andrew Clark>//
- **[55b827942](https://github.com/facebook/react/commit/55b827942)**: Strict mode and default mode should have same Suspense semantics (#13882) //<Andrew Clark>//
- **[dac9202a9](https://github.com/facebook/react/commit/dac9202a9)**: Hide timed-out children instead of deleting them so their state ispreserved (#13823) //<Andrew Clark>//
- **[4f0bd4590](https://github.com/facebook/react/commit/4f0bd4590)**: Replacement of old links, by the new ones of the documentation. (#13871) //<Pablo Javier D. A>//
- **[7685b55d2](https://github.com/facebook/react/commit/7685b55d2)**: Remove unstable_read() in favor of direct dispatcher call (#13861)//<Dan Abramov>//
- **[21a79a1d9](https://github.com/facebook/react/commit/21a79a1d9)**: [schedule] Call ensureHostCallbackIsScheduled without args (#13852) //<Trivikram Kamat>//
- **[9ea4bc6ed](https://github.com/facebook/react/commit/9ea4bc6ed)**: Fix false positive context warning when using an old React (#13850) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions 4773fdf...bf9fadf

Reviewed By: arcanis

Differential Revision: D12850275

fbshipit-source-id: b6d5c61a044c970c04c2ff3370fa77222afd1eb1
2018-11-02 18:35:04 -07:00
Thomas BARRAS 81e5d64bfe Remove createReactClass from ProgressBarAndroidExample (#21874)
Summary:
Related to #21581

This PR was already opened here https://github.com/facebook/react-native/pull/21600 but seems to be inactive.

Remove createReactClass from ProgressBarAndroidExample.

- `yarn run flow` && `yarn run flow-check-android` succeed.
- RNTester app ProgressBarAndroidExample on Android.

[GENERAL] [ENHANCEMENT] [ProgressBarAndroidExample.android.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21874

Reviewed By: TheSavior

Differential Revision: D12827689

Pulled By: RSNara

fbshipit-source-id: 46c70ea67dddf5d928fe936a28ef4a0a929d127f
2018-11-02 12:14:29 -07:00
empyrical 28de61e9f0 CheckBox: Convert NativeMethodsMixin to forwardedRef, convert to class (#21585)
Summary:
This PR converts the use of `NativeMethodsMixin` in `CheckBox.android.js`, and converts it to an ES6-style class.
Pull Request resolved: https://github.com/facebook/react-native/pull/21585

Reviewed By: TheSavior

Differential Revision: D12827768

Pulled By: RSNara

fbshipit-source-id: c113c221335e61e015a20bbb6bcff5f9837f9022
2018-11-02 10:32:01 -07:00
Thomas BARRAS 14e1628ba8 Remove createReactClass from SwipeableRow (#21876)
Summary:
Related to #21581

Remove createReactClass from SwipeableRow.

- All flow tests succeed.
-RNTester > SwipeableFlatList, scroll, swipe left, swipe right
-RNTester > SwipeableListView, scroll, swipe left, swipe right

[GENERAL] [ENHANCEMENT] [SwipeableRow.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21876

Reviewed By: TheSavior

Differential Revision: D12828034

Pulled By: RSNara

fbshipit-source-id: df02ed14e72bf6b0ad3cff33076a6f40870266a8
2018-11-02 07:27:46 -07:00
Sam Goldman adc8a33fcf Deploy Flow v0.85 to xplat/js
Reviewed By: fishythefish

Differential Revision: D12898653

fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a
2018-11-02 00:28:28 -07:00
Fernando Ruiz efc9506a8e Modified declarations from vars to const (#22070)
Summary:
Replaces the keywords `var` with `const` in `Libraries/Lists/ListView/ListViewDataSource.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/22070

Differential Revision: D12895068

Pulled By: TheSavior

fbshipit-source-id: f191158396a0f03bb78942a57b08ec96348a9b32
2018-11-01 17:13:17 -07:00
Naman Goel 17fd1bceb5 Improved Types
Summary: Improves the types for Easing and bezier to make them script.

Differential Revision: D10346234

fbshipit-source-id: e941110c62f7dcd17b0d022497cf29e0935db5a3
2018-11-01 16:22:31 -07:00
Ignacio Olaciregui ae8ec39397 Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Evan Worley 136dfc8312 Flow strictifying AdsManagerAudienceImages.js
Reviewed By: gkz

Differential Revision: D10414273

fbshipit-source-id: 24c7e8955d78aeede8b0644cc9934e0b7fb5aa27
2018-11-01 09:52:41 -07:00
Adam Comella 798517a267 Fix relayout of inline views (#21968)
Summary:
If a view inside of an inline view became dirty (e.g. its top/left prop changed), its position would not update on screen. This is because Yoga didn't know the view needed to be relaid out because Yoga's dirty signal didn't propagate all the way up to the root.

The problem is that inline views don't have a parent in the Yoga tree causing Yoga's dirtiness signal propagation to get cut off early. The fix is, when an inline views gets dirty, mark the parent Text's Yoga node as dirty. This will cause Yoga's dirtiness signal to propagate all the way up to the root node.

Yoga has a hook to inform you when your node is marked as dirty: `YGNodeSetDirtiedFunc`. We leverage this to find out when an inline view's Yoga node gets dirtied.

React Native almost handled this case. Everything worked fine as long as the inline view was nested inside of a virtual text node like this:

```
<Text>
  <Text>
    <InlineView />
  </Text>
</Text>
```

However, the bug repros when the inline view is nested in a non-virtual text node:

```
<Text>
  <InlineView />
</Text>
```

The fix is to move the special dirtiness propagation logic from `RCTVirtualTextShadowView` to `RCTBaseTextShadowView`.

**Test Plan**

Created an inline view. Tested the following kinds of updates on the inline view's content:
  - Moved the content
  - Removed the content
  - Added the content

Tested this for an inline view that is directly inside of a text node as well as one that is nested under a virtual text node.

Here's the code I used for the inline view that moved its content after 2 seconds:

```
const RN = require('react-native');
const React = require('react');

export default class InlineView extends React.Component {
  constructor(props, context) {
    super(props, context);
    this.state = { posBottom: false };
  }

  componentDidMount() {
    super.componentDidMount && super.componentDidMount();
    setTimeout(() => { this.setState({ posBottom: true }); }, 2000);
  }

  render() {
    const pos = this.state.posBottom ? 25 : 0;
    const color = this.state.posBottom ? 'pink' : 'green';
    return (
      <RN.View style={{ width: 50, height: 50, backgroundColor: 'steelblue'}}>
        <RN.View style={{ width: 25, height: 25, top: pos, left: pos, backgroundColor: color }} />
      </RN.View>
    );
  }
}
```

**Release Notes**

[IOS] [BUGFIX] [Text] - Fix case where content of inline views didn't get relaid out

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21968

Differential Revision: D12873795

Pulled By: shergin

fbshipit-source-id: bbc9f5d3ef25063b0015cec8c4aaf2e41ecd60a8
2018-10-31 16:13:01 -07:00
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
Wen-Chien Chen 5803772017 Wrap measureLayoutRelativeToContainingList in try-catch to mitigate crash
Summary: This function sometimes causes an "Unable to find node on an unmounted component" crash during pagination for reasons that still need to be investigated; in the meanwhile, wrap this in a try-catch block to mitigate the crash.

Reviewed By: sahrens

Differential Revision: D12829971

fbshipit-source-id: bc9fe5b9b8c03430ff890bfbb27c39aa270c9eb7
2018-10-30 17:05:00 -07:00
Juuso Heikkinen cdbf719307 Bump fbjs-scripts to ^1.0.0 (#21880)
Summary:
This PR bumps also fbjs-scripts to latest version. Benefit is smaller node_modules and less deps to download as newer version doesn't depend on babel6 anymore.
Pull Request resolved: https://github.com/facebook/react-native/pull/21880

Differential Revision: D12832002

Pulled By: hramos

fbshipit-source-id: fa801aeb70a2f22be6f9c05cd6d981d0af0a0da9
2018-10-30 13:36:59 -07:00
nd-02110114 a06c0da828 Remove var in Libraries/Component (#22020)
Summary:
I removed `var` in Libraries/Component.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Component] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22020

Differential Revision: D12843058

Pulled By: TheSavior

fbshipit-source-id: 90723f3905191cbd29cb18474c700ac65f2503cd
2018-10-30 12:41:04 -07:00
Rajiv Shah 7a914fcef4 Fix View/Text displayName (#21950)
Summary:
Adds the displayName prop to `View` and `Text` components. Because these now use `React.forwardRef`, they were showing as `Component` instead of their actual names.

Thanks to ljharb for helping to pinpoint the source of the issue!

Fixes #21937
Pull Request resolved: https://github.com/facebook/react-native/pull/21950

Differential Revision: D12827060

Pulled By: TheSavior

fbshipit-source-id: d812cae14d53ad821ab5873e737db63ad1a989e3
2018-10-29 12:42:10 -07:00
Emily Janzer df2eaa9eb6 Modularize InitializeCore
Summary: Split up InitializeCore into a bunch of modules. The idea here is to make it easier for apps to just get the initialization logic they want and leave behind what they don't; for example, if you don't want the Map/Set polyfills, instead of requiring InitializeCore you can require the modules you want from it.

Reviewed By: yungsters

Differential Revision: D10842564

fbshipit-source-id: 3b12d54fddea8c4ee75886022338c214987a015c
2018-10-28 15:45:14 -07:00
Avik Chaudhuri 11552a7a7a @allow-large-files flow 0.84 xplat deploy
Reviewed By: samwgoldman

Differential Revision: D10851695

fbshipit-source-id: 951c628844bbbc7331d4e75f62485db88e5ba7c4
2018-10-25 18:16:30 -07:00
Emily Janzer 9687090b5b Add end point for initializecore
Summary: Instead of having a single point at the top of InitializeCore, let's just create a subspan for it. Initially I just wanted to use this point to track JS start time, but it'll be useful to see how long initializeCore takes, too.

Reviewed By: alexeylang

Differential Revision: D10521595

fbshipit-source-id: 3025c34ffab39b79efc966f0c0eb6f502c91c550
2018-10-25 16:15:19 -07:00
Eli White af4903ed73 Cleanup legacyImplementation code from FlatList
Summary:
This functionality was removed here: 636d01bbd0

This is just a step of cleanup

Reviewed By: yungsters

Differential Revision: D10515512

fbshipit-source-id: 6d24cc9c53c71924a82c67a4058585ee978de2d9
2018-10-24 14:22:54 -07:00
Matt Hargett 174644846d Add deprecation warnings for a few IOS components
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21901

Differential Revision: D10502816

Pulled By: TheSavior

fbshipit-source-id: 1890aa35251cff0ac2c15760ecd5aabeb7652558
2018-10-22 23:17:13 -07:00
Ramanpreet Nara 614d773e51 Refactor
Summary: I did a bit more refactoring to NetworkOverlay.

Reviewed By: TheSavior

Differential Revision: D10476158

fbshipit-source-id: da26251f8dfd12dd592da3ae5367efa37ec07669
2018-10-22 17:11:50 -07:00
alanfoster efa6016c0d Convert network overlay to use flatlist
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21837

Reviewed By: TheSavior

Differential Revision: D10449940

Pulled By: RSNara

fbshipit-source-id: 28dcd5906c64070ef50867425ae7517d391300e2
2018-10-22 17:11:50 -07:00
Emily Janzer a07de97754 Add point to InitializeCore
Summary: Adding perf marker point to the beginning of InitializeCore.

Reviewed By: TheSavior

Differential Revision: D10496350

fbshipit-source-id: 56c77414e0c31cf918377e95e3b0c236a5672e35
2018-10-22 16:13:25 -07:00
Eli White 0ceda1b0a5 Add back removal notice of BackAndroid
Summary:
This was deleted as part of 774cd73663

I forgot that we normally keep the getter at the bottom of the module with an invariant so that people get clearer messages when they upgrade.

Reviewed By: yungsters

Differential Revision: D10475667

fbshipit-source-id: fcc527cd8117a506096a910a602272e092b8672d
2018-10-22 11:46:03 -07:00
nd-02110114 2014ce49ed remove createReactClass from ProgressViewIOS.ios.js (#21887)
Summary:
Related to #21581 .
Removed createReactClass from the Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21887

Differential Revision: D10491704

Pulled By: RSNara

fbshipit-source-id: a38f87b9c151aaac8885edd22ce852ee2f2cf746
2018-10-22 10:34:35 -07:00
Rafael Oleza 2a7e02edf6 Fix polyfilling of regeneratorRuntime to avoid setting it to undefined in some situations
Summary:
This diff fixes an issue that caused the problem with `regeneratorRuntime` last Friday (more info: https://fb.facebook.com/groups/frontendsupport/permalink/2427883350560427/).

The root issue is that both `InitializeCore` and `FBInitializeCore` are included in the same bundle, this fix just prevents the bundle from being invalid once this happens..

*copied from: https://our.intern.facebook.com/intern/diff/D10444264/?transaction_id=595485237532887*

The way that `regeneratorRuntime` is polyfilled is not correct:

```
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});
```

Since a `require`d module is only evaluated once (no matter how many times it's required), defining (and calling) a getter for `global.regeneratorRuntime` twice will end up storing `undefined` to `global.regeneratorRuntime`.

There were no issues before this diff because the ordering of requires made things work by coincidence, e.g the following code will work:

```
// Set up regenerator for the first time
polyfillGlobal('regeneratorRuntime', () => {
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Set up regenerator for the second time. This will just override the previous getter (which has not even got executed so
// the `regenerator-runtime/runtime` module has not been evaluated yet.
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Now access regenerator
global.regeneratorRuntime;
```

But the following code won't work:

```
// Set up regenerator for the first time
polyfillGlobal('regeneratorRuntime', () => {
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Access regenerator. This will cause the previous getter to be called, and the `regenerator-runtime/runtime` module will get evaluated.
// Here, `global.regeneratorRuntime` will have a correct value.
global.regeneratorRuntime;

// Set up regenerator for the second time. This will define a new getter for `global.regeneratorRuntime`, which will delete `delete global.regeneratorRuntime`
// and return undefined (note that `require('regenerator-runtime/runtime');` is a noop since the module has been already evaluated).
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});
```

Reviewed By: fromcelticpark

Differential Revision: D10483975

fbshipit-source-id: 5b3ef6e11c4fc4f79e3857c1ade9e7bc2beb6a39
2018-10-22 07:29:05 -07:00
Tim Yung b51a1d5791 RN: Export ImageLoadEvent Type
Summary: Exports the `ImageLoadEvent` type so that components passing through the `onLoad` callback can be properly typed.

Reviewed By: TheSavior

Differential Revision: D10481050

fbshipit-source-id: f0a48163c6221087b0f9869c033c653316471af9
2018-10-21 00:43:53 -07:00
Ryan Dy 774cd73663 Remove BackAndroid, which has had a deprecation warning (#21866)
Summary:
Remove BackAndroid, which has had a deprecation warning and only forwarded to BackHandler since March 2018.

Test Plan
---------
React-native init bundle and RNTester bundle works.

Release Notes:
--------------
[ ANDROID  ] [ BREAKING ] [ BackAndroid ] - Deprecate BackAndroid since BackHandler should be used in its place.
Pull Request resolved: https://github.com/facebook/react-native/pull/21866

Differential Revision: D10472419

Pulled By: TheSavior

fbshipit-source-id: 3d76e1ce4c74bb783fee7fd8232bb366f2e7ea12
2018-10-19 16:02:48 -07:00
Héctor Ramos 47fb387455 Update copyright headers
Summary: Use MIT License copyright headers in JSI source code.

Reviewed By: axe-fb

Differential Revision: D10454031

fbshipit-source-id: d584073bb885fb7d977df1a45a6666ef6f52dcd6
2018-10-19 11:08:57 -07:00
Emily Janzer c95071e7d2 Remove explicit requires of Map and Set
Summary: Removing explicit requires of Map and Set (since those are polyfilled), and fixing resulting flow errors.

Reviewed By: yungsters

Differential Revision: D10350673

fbshipit-source-id: 2fefe8ed1ae1f2cc9e5b7923ad630e73eda9e856
2018-10-19 10:57:24 -07:00
Eli White 99471f87b9 Add deprecation notice to SwipeableListView
Summary: ListView is deprecated and SwipeableListView uses ListView. Thus, it is deprecated as well.

Reviewed By: RSNara

Differential Revision: D10437408

fbshipit-source-id: a08391d5b099e74b6ec179cd940ac404b2e702f4
2018-10-18 15:38:39 -07:00
Ramanpreet Nara 4d917c8207 Additional Flow changes to files that use this component
Summary:
This diff includes:
1. Touchups to the `CameraRollView` typings.
2. Typings for `CameraRollViewExmaple`.
3. Flow fixes for internal callsites.

Reviewed By: yungsters

Differential Revision: D10362686

fbshipit-source-id: 48bf3fba0566e9c5c062aee3342d669f6c143d9f
2018-10-18 12:28:28 -07:00
Ramanpreet Nara 8465094523 Remove createReactClass from CameraRollView
Summary:
Related to #21581

Remove createReactClass from CameraRollView.

Reviewed By: TheSavior

Differential Revision: D10351036

fbshipit-source-id: 394545ac143917e3b483dfc6186e5f45732c602a
2018-10-18 12:28:28 -07:00
Mehdi Mulani 67afaefa78 Remove previously scheduled NetInfo callbacks if they haven't fired
Summary:
@public
If you call NetInfo.getCurrentConnectivity multiple times in succession, we'll create a bunch of callbacks but lose them in the ether.
With this fix, we'll unschedule them before creating a new one, which should resolve some crashes we're seeing.

Reviewed By: PeteTheHeat

Differential Revision: D10409486

fbshipit-source-id: 6065b09fa626f7f06aed9bf0e278c0a6a6169f58
2018-10-18 12:15:44 -07:00
Marc Horowitz 3341adac40 Ensure HelloWorld xcodeproj template works
Summary: The only thing extra that we need to do is to include `JavaScriptCore.framework` inside the HelloWorld.xcodeproj file.

Reviewed By: hramos

Differential Revision: D9893035

fbshipit-source-id: 2a29d1fd645eafa2e09109ad14d09f812dfa2601
2018-10-18 01:06:25 -07:00
Eli White c95fdb0505 Don't use local alias in react-native-implementation
Summary: Nuclide's export detection for modules doesn't resolve local aliases. Lets just export the object directly.

Reviewed By: mostafaeweda

Differential Revision: D10443054

fbshipit-source-id: 880aa1eadff554903eb765d7104ecf3c3b72cbce
2018-10-17 22:24:34 -07:00
empyrical d6c8f189e7 Introduce 'setAndForwardRef' helper function (#21823)
Summary:
This PR introduces a new helper function called `setAndForwardRef`. It is intended to help with moving components that depend on `NativeMethodsMixin` off of `createReactClass`.

It allows for classes that depend on having a ref to a native component to be able to also forward the native component ref to user code.

Usage is like this:

```js
class MyView extends React.Component {
  _nativeRef = null;
  _setNativeRef = setAndForwardRef({
    getForwardedRef: () => this.props.forwardedRef,
    setLocalRef: ref => {
      this._nativeRef = ref;
    },
  });
  render() {
    return <View ref={this._setNativeRef} />;
  }
}
const MyViewWithRef = React.forwardRef((props, ref) => (
  <MyView {...props} forwardedRef={ref} />
));
module.exports = MyViewWithRef;
```
Pull Request resolved: https://github.com/facebook/react-native/pull/21823

Differential Revision: D10436673

Pulled By: TheSavior

fbshipit-source-id: 32e167bb3ea3234f08d5715168b0e61e4e035a7c
2018-10-17 22:00:21 -07:00
Emily Janzer 36507e4a3c Fix issue when inserting text at 0 when maxLength is set
Summary:
1. The user inserts a character ('0') at index 0. Because the range matches 0, 0, predictedText is set to that character that was inserted.
2. In textInputDidChange, it discovers a mismatch between the rendered text ('1234') and predicted text ('0')
3. This triggers textInputShouldChangeTextInRange to be called again with the 'new' text that it thinks was just added ('1234')
4. It goes to insert this text, but runs into the maxLength limit, so it gets truncated and then inserted.

(I'm not totally sure why only happens if maxLength is set - I need to look into that.)

One fix for this is to just get rid of the range check, but that'll regress #18374. I decided to just check and see if the rendered text is empty instead of checking the range where text could be inserted, since that seems like it should properly handle both cases.

Reviewed By: shergin

Differential Revision: D10392176

fbshipit-source-id: 84fb3b6cac9b0aa25b3c1a127d43f9cdc5a1c6a8
2018-10-16 19:44:28 -07:00
Thomas BARRAS 70b5eb3aa2 ListView requestAnimationFrame leak (#21802)
Summary:
Related to https://github.com/facebook/react-native/pull/21488
Disclaimer: I made this PR.

I think there's some requestAnimationFrame events that are not cleared on unmount because of bad use of `splice` method.

- All flow tests succeed.
- RNTester: iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.
- TODO: I'll write a load test for ListView

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21802

Differential Revision: D10391812

Pulled By: RSNara

fbshipit-source-id: 49f0b0a4641ec29bcb4cc04bd3bafb42b3842b69
2018-10-15 18:09:16 -07:00
Andy Huang 8a3a0ad2d0 Fix pull to refresh refresh component clipping on Android
Summary: Currently the pull to refresh icon on browse feed is super cut off on Android. Expose the progressViewOffset prop from FBPullToRefresh to support offsetting the PTR component to make the component more visible.

Reviewed By: yungsters

Differential Revision: D10274679

fbshipit-source-id: 1735c4d2d98523ccc3d1ec3733465028ae33df7b
2018-10-15 12:41:00 -07:00
Marshall Roch 7b150690b6 @allow-large-files [flow] update to v0.83
Reviewed By: fishythefish

Differential Revision: D10362346

fbshipit-source-id: 0f4cc9977cfaa947e3b23112dd1cf482642e2319
2018-10-13 01:32:48 -07:00
Tim Yung 8325e09e5c React sync for revisions d836010...4773fdf
Summary:
@public
This sync includes the following changes:
- **[4773fdf7c](https://github.com/facebook/react/commit/4773fdf7c)**: Deprecate findDOMNode in StrictMode (#13841) //<Sebastian Markbåge>//
- **[c9be16f5b](https://github.com/facebook/react/commit/c9be16f5b)**: [scheduler] Rename priority levels (#13842) //<Andrew Clark>//
- **[3b7ee2692](https://github.com/facebook/react/commit/3b7ee2692)**: Deprecate context object as a consumer and add a warning message (#13829) //<Dominic Gannaway>//
- **[8ca8a594e](https://github.com/facebook/react/commit/8ca8a594e)**: Error gracefully for unsupported SSR features (#13839) //<Dan Abramov>//
- **[4a635785f](https://github.com/facebook/react/commit/4a635785f)**: Fix User Timing oddities with Suspense, pure, and lazy (#13833) //<Dan Abramov>//
- **[a165cf747](https://github.com/facebook/react/commit/a165cf747)**: Renamed 4 Internal React Modules //<Nadia Osipova>//
- **[a68ca9a5b](https://github.com/facebook/react/commit/a68ca9a5b)**: React.pure automatically forwards ref (#13822) //<Sophie Alpert>//
- **[c73497c3c](https://github.com/facebook/react/commit/c73497c3c)**: Update bundle sizes for 16.6.0-alpha.8af6728 release //<Dan Abramov>//
- **[1a57dc668](https://github.com/facebook/react/commit/1a57dc668)**: Updating dependencies for react-noop-renderer //<Dan Abramov>//
- **[77f8dfd81](https://github.com/facebook/react/commit/77f8dfd81)**: Updating package versions for release 16.6.0-alpha.8af6728 //<Dan Abramov>//
- **[8af6728c6](https://github.com/facebook/react/commit/8af6728c6)**: Enable Suspense + rename Placeholder (#13799) //<Dan Abramov>//
- **[f47a958ea](https://github.com/facebook/react/commit/f47a958ea)**: Don’t add onclick listener to React root (#13778) //<Philipp>//
- **[b2cea9078](https://github.com/facebook/react/commit/b2cea9078)**: [scheduler] Eagerly schedule rAF at beginning of frame (#13785) //<Andrew Clark>//
- **[e2e7cb9f4](https://github.com/facebook/react/commit/e2e7cb9f4)**: [scheduler] add a test documenting current behavior (#13687) //<plievone>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions d836010...4773fdf

Reviewed By: acdlite

Differential Revision: D10350869

fbshipit-source-id: ea8ad4b5d914c870be1fc80aa1005b224d37f5e5
2018-10-12 17:44:56 -07:00
Ramanpreet Nara 62e0d508d6 Move createStrictShapeTypeChecker to deprecated
Summary:
Related to #21342

Move createStrictShapeTypeChecker to DeprecatedCreateStrictShapeTypeChecker.

Reviewed By: hramos

Differential Revision: D10341526

fbshipit-source-id: 30e7f22ae574af620ead9c1a0766f00611b282b6
2018-10-12 15:17:02 -07:00
empyrical 93e6ae1c0a ProgressViewIOS: Remove PropTypes and NativeMethodsMixin, convert to functional component (#21588)
Summary:
This PR converts `ProgressViewIOS` from a `createReactClass` component to a functional component, and removes the remaining proptypes. Its use of `NativeMethodsMixin` has been ported to a `forwardRef` to the native component.
Pull Request resolved: https://github.com/facebook/react-native/pull/21588

Reviewed By: hramos

Differential Revision: D10338888

Pulled By: RSNara

fbshipit-source-id: c49807e97a0e2cf774971d9aa5a8426f15a3e48d
2018-10-12 13:49:39 -07:00
Andrey Lunyov 7541655398 Do not use fbjs/emptyObject
Summary: Remove dependency on fbjs/emptyObject in React Native

Reviewed By: yungsters

Differential Revision: D10342631

fbshipit-source-id: 312bb545b66dd5b2132ca67bbaf91cc98a0c6c8a
2018-10-12 11:33:49 -07:00
Mehdi Mulani 4f757095a8 Avoid calling lazilyLoadView when running in the debugger
Summary:
@public
The Chrome debugger can't handle synchronous method calls, so we should avoid doing them.
Double wrapped the if with a DEV check so that it's removed when bundling in non-dev mode.

Reviewed By: fkgozali

Differential Revision: D10345056

fbshipit-source-id: 7a7a2c73f089693da5edafdf3ecf7a3e5d767e52
2018-10-12 09:03:28 -07:00
Albert Sun b4a532e1d1 Update comments to getViewManagerConfig() function name
Summary: This change updates the comments and warning to match the function name.

Reviewed By: achen1

Differential Revision: D10345724

fbshipit-source-id: 05b1c60703da97ed083d7de492559bafb46ad813
2018-10-11 14:01:48 -07:00
Eli White afa6d9ba7b Remove Subscribable.Mixin from React Native core
Summary: There are no longer any callsites to this in React Native so we can remove it from the repo!

Reviewed By: RSNara

Differential Revision: D10316313

fbshipit-source-id: bd63c823c56bb1914e4249d972e0ce503aa189f8
2018-10-10 17:33:14 -07:00
Radovan Šmitala 4b6f02ea75 Normalize scheme for URL on Android (#21561)
Summary:
Android requires lowercase for URL scheme. This commit d00bdb9bb8 fixed it but on React Native side.
Because it is Android specific, it should be fixed on Android side.

Android has method to normalize url scheme: https://developer.android.com/reference/android/net/Uri.html#normalizeScheme()
Pull Request resolved: https://github.com/facebook/react-native/pull/21561

Differential Revision: D10287868

Pulled By: hramos

fbshipit-source-id: f5e474164fdb2cfd49bd8ee51da17de3f1341a9c
2018-10-09 23:32:24 -07:00
nd-02110114 9965ea5a2e remove mixin on Libraries/Components/ScrollResponder.js (#21589)
Summary:
Related to #21485.
Removed Subscribable.Mixin from the Libraries/Components/ScrollResponder.js

 - [x] npm run prettier
 - [x] npm run flow-check-ios
 - [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Components/ScrollResponder.js] - remove Subscribable.Mixin dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21589

Differential Revision: D10275517

Pulled By: RSNara

fbshipit-source-id: 28af7f0944e978609a1b3be05b8a51557e67bc1b
2018-10-09 23:17:26 -07:00
Eli White 4a5221884f Remove MetroListView from SectionList
Reviewed By: yungsters

Differential Revision: D10251054

fbshipit-source-id: dc801817dfcf2722e4625178117006ab51e57255
2018-10-09 17:31:27 -07:00
Eli White 636d01bbd0 Remove legacyImplementation from FlatList and SectionList
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.

We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.

Reviewed By: yungsters

Differential Revision: D10245824

fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
2018-10-09 17:31:27 -07:00
Eli White e90f5fa263 Add Deprecation Warning to ListView
Summary: This component has long been deprecated in the docs. Adding a warning to the code.

Reviewed By: sahrens

Differential Revision: D10261155

fbshipit-source-id: 462ce30a97f35e52477cfc135fb50c976b56e9cb
2018-10-09 16:31:47 -07:00
Mehdi Mulani 751be26015 Allow UIManager to load native view managers lazily
Summary:
This adds a synchronous method that JS can call to load view managers.
Notably, we don't have an exact way to go from a JS name to the native view manager, so this naively adds 'Manager' to the end.

After lazily loading the view, it makes sure to cache all its values in native and JS, as further calls from JS will fail.

Reviewed By: PeteTheHeat

Differential Revision: D10204314

fbshipit-source-id: ebf42a85dcc467f3b4c5d6e18e49e04f9e8aa4f9
2018-10-09 14:16:20 -07:00
Julius Lundang bbb6a0754c � Improve Button component stylesheet; removed duplicate styles (#21535)
Summary:
Updated Button component inspiration. Refactored code takes advantage of Platform Specific Code, as we want to re-use as much code as possible.

1. Import Button component
2. Button should work the same

https://github.com/facebook/react-native/pull/19752

[GENERAL] [ENHANCEMENT] [Button] - Uses spread operator for platform specific code in creating styles
Pull Request resolved: https://github.com/facebook/react-native/pull/21535

Differential Revision: D10248048

Pulled By: TheSavior

fbshipit-source-id: 7260fa56f15b70b7c9499c8da418db7b2214b0dd
2018-10-08 23:35:23 -07:00
Richard Cann 31d6a69fc9 Removing TimerMixin on TextInput (#21522)
Summary:
Related to #21485.
Removed TimerMixin from Libraries/Components/TextInput/TextInput.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21522

Differential Revision: D10229669

Pulled By: RSNara

fbshipit-source-id: 45de331203eddce06b8fb7ddf4080869c07b6c55
2018-10-08 11:01:59 -07:00
Guilherme Varandas de416e7d06 Removing TimerMixin on SwipeableRow (#21499)
Summary:
Related to #21485.
Removed TimerMixin from the SwipeableRow component since it is currently not used.
Added a test case for `SwipeableRow` animation in the `SwipeableListViewSimpleExample`, by adding the `bounceFirstRowOnMount` prop, to check for any runtime issues with the setTimeout method.

- [x] `npm run prettier`
- [x] `npm run flow-check-ios`
- [x] `npm run flow-check-android`
- [x] runtime tests using `SwipeableFlatListExample` on Android and iOS
- [x] runtime tests using `SwipeableListViewSimpleExample` on Android and iOS

**RNTester steps**

- [x] Run RNTester.
- [x] Navigate to `SwipeableFlatListExample` and check if the `_animateBounceBack` animation executes when the `shouldBounceOnMount` props is passed.
- [x] Swipe the row and check if the events ran correctly
- [x] Navigate to `SwipeableListViewSimpleExample` and check if the `_animateBounceBack` animation executes when the `shouldBounceOnMount` props is passed.
- [x] Swipe the row and check if the events ran correctly

[GENERAL] [ENHANCEMENT] [Libraries/Experimental/SwipeableRow/SwipeableRow.js] - remove TimerMixin dependency
[GENERAL] [ENHANCEMENT] [RNTester/js/SwipeableListViewSimpleExample.js] - Add bounceFirstRowOnMount to guarantee the SwipeableRow correct behavior.
Pull Request resolved: https://github.com/facebook/react-native/pull/21499

Reviewed By: TheSavior

Differential Revision: D10218361

Pulled By: RSNara

fbshipit-source-id: c8e6d5ced4c1237e48bb4c43592016684b2c6360
2018-10-08 10:31:35 -07:00
Emily Janzer d279b7c74d Add point at beginning of InitializeCore
Summary: Also add an optional timestamp param to PerformanceLogger.markPoint() so you can backdate a point

Reviewed By: alexeylang

Differential Revision: D10149337

fbshipit-source-id: 6cc5f95b34b3293589e7cb41b99cee17bf128163
2018-10-05 18:33:59 -07:00
Tim Yung 7142e9b1c5 React sync for revisions ade5e69...d836010
Summary:
This sync includes the following changes:
- **[d83601080](https://github.com/facebook/react/commit/d83601080)**: Wrap retrySuspendedRoot using SchedulerTracing (#13776) //<Sophie Alpert>//
- **[40a521aa7](https://github.com/facebook/react/commit/40a521aa7)**: Terminology: Functional -> Function Component (#13775) //<Dan Abramov>//
- **[605ab10a4](https://github.com/facebook/react/commit/605ab10a4)**: Add envify transform to scheduler package (#13766) //<Michael Ridgway>//
- **[acc7f404c](https://github.com/facebook/react/commit/acc7f404c)**: Restart from root if promise pings before end of render phase (#13774) //<Andrew Clark>//
- **[cbc224028](https://github.com/facebook/react/commit/cbc224028)**: fix - small misspelling (#13768) //<Spencer Davies>//
- **[4eabeef11](https://github.com/facebook/react/commit/4eabeef11)**: Rename ReactSuspenseWithTestRenderer-test -> ReactSuspense-test //<Andrew Clark>//
- **[95a3e1c2e](https://github.com/facebook/react/commit/95a3e1c2e)**: Rename ReactSuspense-test -> ReactSuspenseWithNoopRenderer-test //<Andrew Clark>//
- **[96bcae9d5](https://github.com/facebook/react/commit/96bcae9d5)**: Jest + test renderer helpers for concurrent mode (#13751) //<Andrew Clark>//
- **[5c783ee75](https://github.com/facebook/react/commit/5c783ee75)**: Remove unreachable code (#13762) //<Heaven>//
- **[36c5d69ca](https://github.com/facebook/react/commit/36c5d69ca)**: Always warn about legacy context within StrictMode tree (#13760) //<Brian Vaughn>//
- **[3e9a5de88](https://github.com/facebook/react/commit/3e9a5de88)**: UMD react-cache build (#13761) //<Maksim Markelov>//
- **[8315a30b9](https://github.com/facebook/react/commit/8315a30b9)**: --save is no longer needed (#13756) //<Joe Cortopassi>//
- **[ce96e2df4](https://github.com/facebook/react/commit/ce96e2df4)**: Rename simple-cache-provider to react-cache (#13755) //<Andrew Clark>//
- **[c5212646f](https://github.com/facebook/react/commit/c5212646f)**: Removed extra typeof checks for contextType.unstable_read (#13736) //<Brian Vaughn>//
- **[806eebdae](https://github.com/facebook/react/commit/806eebdae)**: Enable getDerivedStateFromError (#13746) //<Brian Vaughn>//
- **[a0733fe13](https://github.com/facebook/react/commit/a0733fe13)**: pure (#13748) //<Andrew Clark>//
- **[4d17c3f05](https://github.com/facebook/react/commit/4d17c3f05)**: [scheduler] Improve naive fallback version used in non-DOM environments //<Andrew Clark>//
- **[469005d87](https://github.com/facebook/react/commit/469005d87)**: Revise `AttributeType` React Native Flow Type (#13737) //<Timothy Yung>//
- **[0dc0ddc1e](https://github.com/facebook/react/commit/0dc0ddc1e)**: Rename AsyncMode -> ConcurrentMode (#13732) //<Dominic Gannaway>//
- **[7601c3765](https://github.com/facebook/react/commit/7601c3765)**: Ensure "addEventListener" exists on "window" for "scheduler" package (#13731) //<Dominic Gannaway>//
- **[d0c0ec98e](https://github.com/facebook/react/commit/d0c0ec98e)**: Added a PureComponent contextType test (#13729) //<Brian Vaughn>//
- **[4b68a6498](https://github.com/facebook/react/commit/4b68a6498)**: Support class component static contextType attribute (#13728) //<Brian Vaughn>//
- **[f305d2a48](https://github.com/facebook/react/commit/f305d2a48)**: [scheduler] Priority levels, continuations, and wrapped callbacks (#13720) //<Andrew Clark>//
- **[970a34bae](https://github.com/facebook/react/commit/970a34bae)**: Bump babel-eslint and remove flow supressions (#13727) //<Brian Ng>//
- **[13965b4d3](https://github.com/facebook/react/commit/13965b4d3)**: Interaction tracking ref-counting bug fixes (WIP) (#13590) //<Brian Vaughn>//
- **[17e703cb9](https://github.com/facebook/react/commit/17e703cb9)**: Restore global window.event after event dispatching (#13688) (#13697) //<Sergei Startsev>//
- **[a775a767a](https://github.com/facebook/react/commit/a775a767a)**: Remove redundant logic (#13502) //<Heaven>//
- **[e1a067dea](https://github.com/facebook/react/commit/e1a067dea)**: Fix circular dependency in TracingSubscriptions (#13689) //<Maksim Markelov>//
- **[518812eeb](https://github.com/facebook/react/commit/518812eeb)**: Clarify comment (#13684) //<Heaven>//
- **[eeb817785](https://github.com/facebook/react/commit/eeb817785)**: Remove some old files from stats //<Dan>//
- **[7ea3ca1d1](https://github.com/facebook/react/commit/7ea3ca1d1)**: Rename schedule to scheduler (#13683) //<Dan Abramov>//
- **[bec2ddaf1](https://github.com/facebook/react/commit/bec2ddaf1)**: Update bundle sizes for 16.5.2 release //<Brian Vaughn>//
- **[4269fafb0](https://github.com/facebook/react/commit/4269fafb0)**: Updating package versions for release 16.5.2 //<Brian Vaughn>//
- **[4380f9ba1](https://github.com/facebook/react/commit/4380f9ba1)**: Revert "Updating package versions for release 16.6.0-alpha.0" //<Brian Vaughn>//
- **[72fad84e7](https://github.com/facebook/react/commit/72fad84e7)**: Revert "Updating dependencies for react-noop-renderer" //<Brian Vaughn>//
- **[c3fad5acf](https://github.com/facebook/react/commit/c3fad5acf)**: Revert "Update bundle sizes for 16.6.0-alpha.0 release" //<Brian Vaughn>//
- **[dd9120561](https://github.com/facebook/react/commit/dd9120561)**: Kepp calling peformWork consistent (#13596) //<Heaven>//
- **[42d12317a](https://github.com/facebook/react/commit/42d12317a)**: Update bundle sizes for 16.6.0-alpha.0 release //<Brian Vaughn>//
- **[489614c4f](https://github.com/facebook/react/commit/489614c4f)**: Updating dependencies for react-noop-renderer //<Brian Vaughn>//
- **[351c9015c](https://github.com/facebook/react/commit/351c9015c)**: Updating package versions for release 16.6.0-alpha.0 //<Brian Vaughn>//
- **[a210b5b44](https://github.com/facebook/react/commit/a210b5b44)**: Revert "Do not bind topLevelType to dispatch" (#13674) //<Dan Abramov>//
- **[1d8a75fef](https://github.com/facebook/react/commit/1d8a75fef)**: remove flow typings from Schedule.js (#13662) //<Alexey Raspopov>//
- **[d92114b98](https://github.com/facebook/react/commit/d92114b98)**: Resubmit: Fix updateWrapper causing re-render textarea, even though their data (#13643) //<Nathan Hunzaker>//
- **[0c9c591bf](https://github.com/facebook/react/commit/0c9c591bf)**: Do not bind topLevelType to dispatch (#13618) //<Nathan Hunzaker>//
- **[9f819a5ea](https://github.com/facebook/react/commit/9f819a5ea)**: [schedule] Refactor Schedule, remove React-isms (#13582) //<Andrew Clark>//
- **[9c961c0a2](https://github.com/facebook/react/commit/9c961c0a2)**: Fix some iframe edge cases (#13650) //<Jérôme Steunou>//
- **[8bc0bcabe](https://github.com/facebook/react/commit/8bc0bcabe)**: Add UMD production+profiling entry points (#13642) //<Brian Vaughn>//
- **[b488a5d9c](https://github.com/facebook/react/commit/b488a5d9c)**: Fix test comment typo (#13568) //<Heaven>//
- **[4bcee5621](https://github.com/facebook/react/commit/4bcee5621)**: Rename "tracking" API to "tracing" (#13641) //<Brian Vaughn>//
- **[72217d081](https://github.com/facebook/react/commit/72217d081)**: Update bundle sizes for 16.5.1 release //<Dan Abramov>//
- **[8b93a60c5](https://github.com/facebook/react/commit/8b93a60c5)**: Updating package versions for release 16.5.1 //<Dan Abramov>//
- **[ecbf7af40](https://github.com/facebook/react/commit/ecbf7af40)**: Enhance dev warnings for forwardRef render function (#13627) (#13636) //<Andres Rojas>//
- **[228240085](https://github.com/facebook/react/commit/228240085)**: Delete TapEventPlugin (#13630) //<Dan Abramov>//
- **[a079011f9](https://github.com/facebook/react/commit/a079011f9)**: ð Stop syncing the value attribute on inputs (behind a feature flag) (#13526) //<Nathan Hunzaker>//
- **[a7bd7c3c0](https://github.com/facebook/react/commit/a7bd7c3c0)**: Allow reading default feature flags from bundle tests (#13629) //<Dan Abramov>//
- **[d3bbfe09c](https://github.com/facebook/react/commit/d3bbfe09c)**: Fix IE version in comment //<Dan Abramov>//
- **[1b2646a40](https://github.com/facebook/react/commit/1b2646a40)**: Fix warning without stack for ie9 (#13620) //<Aliaksandr Manzhula>//
- **[e49f3ca08](https://github.com/facebook/react/commit/e49f3ca08)**:  honor displayName set on ForwardRef if available (#13615) //<Evan Jacobs>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ade5e69...d836010

Reviewed By: bvaughn

Differential Revision: D10118547

fbshipit-source-id: ecde7ada80331abdc8bd7d279e0f3dbe9acde071
2018-10-05 18:19:54 -07:00
Dani 9282c9de39 Remove TimerMixin from TouchableOpacity (#21520)
Summary:
Related to #21485
This PR removes TimerMixin from TouchableOpacity
Pull Request resolved: https://github.com/facebook/react-native/pull/21520

Differential Revision: D10223753

Pulled By: RSNara

fbshipit-source-id: fc02077de7e73ee968b7944c0178892825099063
2018-10-05 17:25:40 -07:00
Eli White 5bfa39ece0 Skip flaky Animated test
Summary:
This test is disabled internally and flaky in open source causing CI to fail. Skipping it for now.

Related to: https://github.com/facebook/react-native/issues/21517

Reviewed By: RSNara

Differential Revision: D10223498

fbshipit-source-id: 37a3798c0abb7de829bc5b59e02f23d8943da882
2018-10-05 15:03:15 -07:00
Thomas Carlson 6c20017152 Remove TimerMixin from TouchableWithoutFeedback (#21493)
Summary:
Related to #21485.
Removed `TimerMixin` from the `TouchableWithoutFeedback` component since it is currently not used.
Added tests cases for `TouchableWithoutFeedback` to check for any runtime issues.
Pull Request resolved: https://github.com/facebook/react-native/pull/21493

Differential Revision: D10219098

Pulled By: RSNara

fbshipit-source-id: d9517b2bd5b72b0450fa864f3556673ae3181552
2018-10-05 13:34:12 -07:00
Thomas BARRAS 8ceb1586ee Remove TimerMixin from ListView (#21488)
Summary:
Related to #21485

- Remove TimerMixin from ListView

- All flow tests succeed.
- RNTester: <ListView> iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.

TODO: I think a load test would be more relevant:
- Update props multiple times and scroll

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21488

Differential Revision: D10219088

Pulled By: RSNara

fbshipit-source-id: 946e4fc1319324c5bf4947a2060b18bebb6fc493
2018-10-05 12:20:24 -07:00
Eli White 3aa8f09b44 Deprecate legacyImplementation
Summary: The legacy implementation doesn't provide additional functionality and has a negative impact on performance and user experience. The legacyImplementation prop is deprecated and will be removed in a future release.

Reviewed By: yungsters

Differential Revision: D10212762

fbshipit-source-id: 9b3416434ba392827b538c984c7ab4bcbe156e60
2018-10-05 10:23:21 -07:00
danibonilha 0de99bc8f5 Split ViewAccessibility into DeprecatedViewAccessibility and rename r… (#21422)
Summary:
This PR splits and renames all references of ViewAccessibility to DeprecatedViewAccessibility
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21422

Reviewed By: yungsters

Differential Revision: D10132659

Pulled By: RSNara

fbshipit-source-id: 68c371230c69ed37c3e44bf8a36043adb04afc78
2018-10-05 10:03:10 -07:00
Eli White 7536c9bdee Fix Incremental children flow type
Summary: Incremental appears to be causing flow errors on Github master causing CI to fail.

Reviewed By: RSNara

Differential Revision: D10205146

fbshipit-source-id: b86c2d099a2041ab1429b9aacb78ff1b382dca41
2018-10-04 14:33:56 -07:00
Radek Czemerys 997f382adc Fix deprecation warning message in Switch
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21479

Differential Revision: D10205122

Pulled By: TheSavior

fbshipit-source-id: a7bbdae3b5dd6b47c4dc995e3c2e8e40abb64f13
2018-10-04 14:33:56 -07:00
Grégoire Rit fdfe4220e0 Update flow Props declaration in TouchableWithoutFeedBack for onFocus and onBlur (#21462)
Summary:
Simple fix to avoid thoses flow error when using Touchables with onFocus & onBlur.

```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/components/HomeMenu/MenuItem.js:32:8

Cannot create TouchableOpacity element because property onFocus is missing in object type [1] but exists in props [2].

     src/components/HomeMenu/MenuItem.js
      29│   render() {
      30│     const { text, style } = this.props
      31│     return (
 [2]  32│       <TouchableOpacity
      33│         hasTVPreferredFocus
      34│         style={style.item}
      35│         onFocus={() => this.onFocus()}
      36│         onPress={() => Alert.alert(`You pressed ${text}`)}
      37│       >
      38│         <ImageBackground source={separator} style={style.itemBackground}>
      39│           <Text style={style.text}>{text}</Text>
      40│         </ImageBackground>
      41│       </TouchableOpacity>
      42│     )
      43│   }
      44│ }

     node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js
 [1] 286│ }): any): React.ComponentType<Props>);
```
Pull Request resolved: https://github.com/facebook/react-native/pull/21462

Differential Revision: D10179260

Pulled By: TheSavior

fbshipit-source-id: e6c5d1136bdde36c8bcbd4df8897a390dcba8e82
2018-10-03 14:02:49 -07:00
Andrew Chen (Eng) 5be0dff433 Avoid view manager class loads (take 2)
Summary:
Second attempt at landing D9930713. Notes about the previous issue is mentioned as an inline comment below.

===========

We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: axe-fb

Differential Revision: D10118711

fbshipit-source-id: 78de8f34db364a64f5ce6af70e3d8691353b0d4d
2018-10-02 14:03:24 -07:00
Mehdi Mulani e7e63fd409 Dealloc first time RCTNetInfo reachability callback
Summary:
@public
We're seeing a crasher where `self` on line 54 isn't an `RCTNetInfo`. The timing looks related to D9798488, so my theory is that this class is being deallocated before it resolves, and thus causes a crash.

Reviewed By: PeteTheHeat

Differential Revision: D10127341

fbshipit-source-id: 94eaba7def6b118092adcf6b4cce841ccc7d0b59
2018-10-02 14:03:23 -07:00
JenLindsay 408207b356 Split ImageProps into DeprecatedPropTypes (#21411)
Summary:
Related to #21342

- Split ImageProps.js: moved propType declarations to DeprecatedImageProps.js
- Renamed ImageProps references to DeprecatedImageProps in Image.ios.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21411

Reviewed By: TheSavior

Differential Revision: D10146178

Pulled By: RSNara

fbshipit-source-id: 4db15eaaa8822e834af347d1927991dff1c427cb
2018-10-02 13:47:44 -07:00
Sam Goldman 8a4975051e Upgrade xplat/js to Flow v0.82
Reviewed By: yungsters

Differential Revision: D10139929

fbshipit-source-id: ae44a8af7cab28c4acfd7c97e636467e44adcf37
2018-10-01 22:23:18 -07:00
BingBing c1561ab441 iOS: fix the baseline issue when displaying a mixture of different-language characters (#19653)
Summary:
This fixes #19193

Characters of different languages may have different height and different baseline, even with a same font and same font-size. When they mixed together, iOS will adjust their baselines automatically, to display a suitable view of text.

The problem is the behavior of dealing with the text-style property 'lineHeight'.

It once to be a right way at version 0.52.3, to setting a base-line-offset attribute for the whole range of the string. However, in current version, it enumerated the string, and set a different  base-line-offset for different font-height characters.

And this behavior broke the baseline adjustment made by the iOS. It just make every character's baseline aligned to a same line. But it is not supposed to displaying characters of different languages like that. Chinese characters' baseline is the bottom of each, however, it is not for English characters.

So maybe it is the better way to give a same value of base-line-offset attribute for the whole string. And this PR just did that: found the biggest value of font-height in the text, and calculate the offset with that biggest value, then set to the whole string. This will keep the origin baseline adjustment for different languages' chars made by iOS.

Since I always got an error when running the snapshot test locally, I can't even pass the them with the unmodified code in master branch.

The error is "Nesting of \<View\> within \<Text\> is not currently supported."

After I comment all of the check of that error from the source code, I got a different snapshot from the reference ones. It seems that all components which will cause that error are not rendered in the reference images.

Since this PR changed the behavior of 'lineHeight' property, it's better to add a new snapshot case for the situation of different-language-characters' mixture. So maybe somebody could help me with that or maybe it should be a issue?

[IOS] [BUGFIX] [Text] - fix the baseline issue when displaying a mixture of different-language characters
Pull Request resolved: https://github.com/facebook/react-native/pull/19653

Differential Revision: D10140131

Pulled By: shergin

fbshipit-source-id: 646a9c4046d497b78a980d82a015168cf940646b
2018-10-01 21:19:40 -07:00
Ramanpreet Nara 07ac31eb3f Make Flow types more strict
Summary: Many of the optional types from the PR could have been made non-optional. I just made the change because it was simple enough to make and verify.

Reviewed By: TheSavior

Differential Revision: D10131969

fbshipit-source-id: b84693b5549708d7948fe3fd54295bc80be93790
2018-10-01 14:32:27 -07:00
Dishant Kaushik c8705330d7 InspectorPanel -> Delete PropTypes (#21392)
Summary:
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21392

Reviewed By: TheSavior

Differential Revision: D10129812

Pulled By: RSNara

fbshipit-source-id: 79e900b56eb043452ce8e13e998a9ad8d4443897
2018-10-01 14:32:27 -07:00
Ronaldo Lima 80066db654 Replace DeprecatedViewPropTypes.style for ViewStyleProp on IntegrationTestHarnessTest and InputAccessoryView (#21397)
Summary:
related #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21397

Reviewed By: TheSavior

Differential Revision: D10119623

Pulled By: RSNara

fbshipit-source-id: 16bdb3d5bf90c24b597bbc12fc416a50a0aa2bb1
2018-10-01 14:08:29 -07:00
Daiki Nishikawa b6b0fc1f27 Move and Rename custom propType definitions in LayoutPropTypes (#21370)
Summary:
related #21342

TODO
* move LayoutPropType.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedLayoutPropTypes.js] - Created.
[GENERAL] [ENHANCEMENT] [StyleSheetTypes.js] - add comments.
Pull Request resolved: https://github.com/facebook/react-native/pull/21370

Differential Revision: D10099715

Pulled By: RSNara

fbshipit-source-id: d0515fe0d56d9ed2fde50cc0bfb75b63aded1f5d
2018-10-01 12:19:15 -07:00
Thomas Carlson d6f3d37802 Rename and move ViewStylePropTypes (#21415)
Summary:
Related to #21342
* Renamed ViewStyleProps to DeprecatedViewStyleProps.
* Moved propType declaration to `react-native/Libraries/DeprecatedPropTypes`
*  ImageProps.js: moved propType declarations to DeprecatedImageProps.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/21415

Reviewed By: TheSavior

Differential Revision: D10119599

Pulled By: RSNara

fbshipit-source-id: 67674039a88dcd570973c7062f86ebdbd6987d28
2018-10-01 12:19:15 -07:00
Hyunjong Lee d00bdb9bb8 Resolve protocol http, https when not in lowercase (#21396)
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/21396

Differential Revision: D10119630

Pulled By: RSNara

fbshipit-source-id: d0fe193eee976b9b18a2eb467b5f3af48bd7d2de
2018-09-29 12:02:11 -07:00
Tim Yung ee034596fe FBJS: Upgrade to ^1.0.0
Summary: Upgrades all dependents of `fbjs` to the latest version.

Reviewed By: mjesun

Differential Revision: D10100661

fbshipit-source-id: 2e2af616cb2b5eab560872b6c6c60ed264e986b2
2018-09-29 03:17:27 -07:00
Ramanpreet Nara e7ddc59019 Renames of ImageSource, ImageStyle, and TextProps propTypes
Reviewed By: TheSavior

Differential Revision: D10101195

fbshipit-source-id: 5c8cde81f92cac87b6cfe3fc1a36c78e4862c5ff
2018-09-28 23:21:40 -07:00
nd-02110114 84f18341aa Move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js (#21387)
Summary:
related #21342

TODO
* move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedImageSourcePropType.js] - Created.
[GENERAL] [ENHANCEMENT] [DeprecatedImageStylePropTypes.js] - Created.
[GENERAL] [ENHANCEMENT] [DeprecatedTextPropTypes.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21387

Reviewed By: TheSavior

Differential Revision: D10099753

Pulled By: RSNara

fbshipit-source-id: c907af6d1549ee42de1a2e17f278998e8422110f
2018-09-28 23:21:38 -07:00
Emily Janzer e2210ab752 Fix flow in InitializeCore
Reviewed By: yungsters

Differential Revision: D10115867

fbshipit-source-id: be619b9d6fc30e318cbc0e0fc6e741d80dd94a4b
2018-09-28 17:16:55 -07:00
Andrew Chen (Eng) e082a61324 Revert D9930713: Avoid view manager class loads
Differential Revision:
D9930713

Original commit changeset: 4aa013f8398d

fbshipit-source-id: 1fed02b41fa9d91f54d1a19f710bdb666701a4a0
2018-09-28 15:20:35 -07:00
Fred Liu 6715268794 Revert D10100555: [react-native][PR] SwipeableRow: Remove PropTypes, convert to ES6 class
Differential Revision:
D10100555

Original commit changeset: ab350546f4fa

fbshipit-source-id: 7afd51aacceac209564c06462ae60c4a12cf4815
2018-09-28 10:48:02 -07:00
Spencer Ahrens ae4be91cac fix broken animation tests
Summary: UIAnimationDragCoefficient is 10.0 in tests for some reason, but we need it to be 1.0 for our tests.

Reviewed By: PeteTheHeat

Differential Revision: D10096375

fbshipit-source-id: 9acd042a3d87a9c6a253745fe48145f0442f6567
2018-09-28 09:17:17 -07:00
Tim Yung 199c918dbe RN: Fix `ReactNativeViewAttributes` Type Bugs
Summary: Fixes the runtime value of `ReactNativeStyleAttributes` to correctly map to `true` instead of strings (as returned by `keyMirror`).

Reviewed By: TheSavior

Differential Revision: D10057235

fbshipit-source-id: dc855cff3a114761098ed5176b2e6e25412481dc
2018-09-28 01:08:09 -07:00
Tim Yung e873809222 RN: Remove Prop Types from `LayoutAnimation`
Summary:
Removes the prop types from `LayoutAnimation` and refines the Flow types.

This also disables `LayoutAnimation.checkConfig` with a `console.error`.

Reviewed By: bvaughn

Differential Revision: D10057234

fbshipit-source-id: a386f3d7dd5deafa1d4681d1f49821821fda9a6a
2018-09-28 01:07:45 -07:00
Tim Yung d16ec74236 RN: Replace `ImageResizeMode` w/ Flow Type
Summary:
Replaces `ImageResizeMode` with a Flow type.

JavaScript enums provide little value when you have a type system.

Reviewed By: bvaughn, TheSavior

Differential Revision: D10057237

fbshipit-source-id: f108b60795a6d82a6786421e4ac72aeedc53bee8
2018-09-28 01:07:30 -07:00
empyrical 9104b04261 SwipeableFlatList, SwipeableQuickActions: Remove PropTypes (#21384)
Summary:
Part of: https://github.com/facebook/react-native/issues/21342

This PR removes the prop types for the components `SwipeableFlatList` and `SwipeableQuickActions`.

The props for `SwipeableFlatList` have been left as not $ReadOnly, because it needs the types in `Libraries/Lists/*` to also be cleaned up. A todo notice has been added.
Pull Request resolved: https://github.com/facebook/react-native/pull/21384

Differential Revision: D10099694

Pulled By: TheSavior

fbshipit-source-id: 424b900942c9a7889b664f351f79abee55923430
2018-09-28 00:19:28 -07:00
empyrical 16f06bcb80 SwipeableRow: Remove PropTypes, convert to ES6 class (#21386)
Summary:
Part of: https://github.com/facebook/react-native/issues/21342

This PR removes prop types from `SwipeableRow`, and converts it from a `createReactClass` to an ES6 class.
Pull Request resolved: https://github.com/facebook/react-native/pull/21386

Differential Revision: D10100555

Pulled By: TheSavior

fbshipit-source-id: ab350546f4fa6f1ed3fdeae07e342890af6d9a22
2018-09-28 00:19:27 -07:00
Dani d8b40cc541 Move and rename StyleSheetPropType to DeprecatedStyleSheetPropType (#21380)
Summary:
This PR moves and renames all references of StyleSheetPropType  to DeprecatedStyleSheetPropType
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21380

Differential Revision: D10098216

Pulled By: TheSavior

fbshipit-source-id: da8d927f87bd37cdabc315e0aa17b6ae208f7124
2018-09-27 23:04:20 -07:00
Guilherme Varandas f94d2ade86 Move and Rename propType definitions in ShadowPropTypesIOS (#21379)
Summary:
related #21342

move TransformPropTypes.js
fix flow error

- [x] yarn prettier
- [x] yarn flow-check-android
- [x] yarn flow-check-ios

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedShadowPropTypesIOS.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21379

Differential Revision: D10098750

Pulled By: TheSavior

fbshipit-source-id: f7f2e4bf7b837c00a14b1fbd930d1b29ffb63549
2018-09-27 19:46:45 -07:00
nd-02110114 c18458b394 Move and Rename custom propType definitions in ColorPropTypes (#21371)
Summary:
related #21342

TODO
* move ColorPropType.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedColorPropType.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21371

Reviewed By: RSNara

Differential Revision: D10087818

Pulled By: TheSavior

fbshipit-source-id: 48088b441699886eef1fff3aafc2ca6015455006
2018-09-27 17:33:40 -07:00
nd-02110114 00b1f93fae Remove PropTypes from ViewerPagerAndroid.android.js (#21347)
Summary:
related #21342

This is a first PR for this repo.
So, if there are any problem, please tell me 🙇

TODO
* delete props types
* apply read only interface

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
Pull Request resolved: https://github.com/facebook/react-native/pull/21347

Differential Revision: D10095503

Pulled By: TheSavior

fbshipit-source-id: fd1adb5edf19234ae8ae9f3fe732b03a521eb82b
2018-09-27 17:17:47 -07:00
Thomas BARRAS e3ae85d7c7 TVViewPropTypes, PlatformViewPropTypes, DeprecatedTVViewPropTypes (#21372)
Summary:
Related to #21342

- Split TVViewPropTypes
- PlatformViewPropTypes (dependencies) flow types and old prop-type definitions
- ViewStylePropTypes (dependencies) rm prop-type

Flow tests succeed

[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - rm prop-types
[GENERAL] [ENHANCEMENT] [PlatformViewPropTypes.android.js] - replace prop-types by Flow
[GENERAL] [ENHANCEMENT] [PlatformViewPropTypes.ios.js] - replace prop-types by Flow
[GENERAL] [ENHANCEMENT] [DeprecatedTVViewPropTypes.js] - old prop-types
Pull Request resolved: https://github.com/facebook/react-native/pull/21372

Differential Revision: D10095528

Pulled By: TheSavior

fbshipit-source-id: 4fc52ab194f680f95aabefedcbf119d6897672b7
2018-09-27 16:35:42 -07:00
Guilherme Varandas 0da7e8d9ae Move and Rename propType definitions in TransformPropTypes (#21375)
Summary:
related #21342

move TransformPropTypes.js
fix flow error

- [x] yarn prettier
- [x] yarn flow-check-android
- [x] yarn flow-check-ios

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedTransformPropTypes.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21375

Differential Revision: D10095453

Pulled By: TheSavior

fbshipit-source-id: fbf677a000e3c6c0bd31e915dcafbd2d561be6e3
2018-09-27 16:18:32 -07:00
Andrew Chen (Eng) 95174d4ea8 Avoid view manager class loads
Summary:
We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: TheSavior

Differential Revision: D9930713

fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
2018-09-27 16:03:24 -07:00
Andrew Chen (Eng) aac7c4d5d2 Refactor UIManager view manager accesses
Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
2018-09-27 16:03:22 -07:00
Timothy Kukulski 471e8c168a Add @flow to BackHandler
Summary:
Add flow to BackHandler
Fixed callsites

Reviewed By: TheSavior

Differential Revision: D8994015

fbshipit-source-id: 2b910f14b4462020a37a33a8bcff67cef07500a3
2018-09-27 15:47:42 -07:00
Ramanpreet Nara 39f6264a84 Fix internal flow typings
Summary: Fixing internal flow typings so that D10085505 can land.

Reviewed By: TheSavior

Differential Revision: D10090690

fbshipit-source-id: cace32332e85e9e9be243bcc49fba471ae1d2864
2018-09-27 14:32:21 -07:00
empyrical 0fb713909b SwipeableListView: Remove PropTypes (#21298)
Summary:
This PR removes the remaining proptypes from `SwipeableListView`, and cleans up its flow types a bit. Its RNTester example has also been cleaned up, and turned into an ES6 class.

`ListView`'s props have been exported so this can use it.
Pull Request resolved: https://github.com/facebook/react-native/pull/21298

Reviewed By: TheSavior

Differential Revision: D10085505

Pulled By: RSNara

fbshipit-source-id: 20300d582f33b83dfc13cc5ddc71de5ab44bb90b
2018-09-27 14:32:21 -07:00
Ramanpreet Nara f40e744b64 Fix internal flow problems
Summary: D10013265 introduces flow types for `PanResponder`. This diff fixes the facebook-internal flow errors that surface as a result.

Reviewed By: TheSavior

Differential Revision: D10035046

fbshipit-source-id: fbba3d61e68851dda2da4f8e98238e0fdb35a27e
2018-09-27 14:18:31 -07:00
empyrical 3f79b2a4e9 Add flow types to PanResponder (#21291)
Summary:
This PR adds flow types to the `PanResponder` module. It is part of my effort to flowtype the `Swipable*` classes.

A new `touchHistory` field had to be added to `SyntheticEvent` as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/21291

Reviewed By: TheSavior

Differential Revision: D10013265

Pulled By: RSNara

fbshipit-source-id: 3cd65a0eae41c756d1605e6771588d820f040e2a
2018-09-27 14:18:30 -07:00
Alexey Lang 77e6c5e7cf Support logging points from JS
Summary: We want to be able to log individual points from JS.

Reviewed By: ejanzer

Differential Revision: D10050400

fbshipit-source-id: eadd81a8cf70082998950c19a98c3de979eb148a
2018-09-27 12:27:17 -07:00
Jordan Brown 0ee23d0beb Remove unused suppressions in xplat/js
Summary:
There were approximately 350 unused suppressions in xplat/js when checking with .flowconfig.android

The flow team is partially responsible for this, since our release process hasn't changed since we added the flowconfig. In the diff beneath this one, I added the functionality necessary for us to not add any more unused suppressions. To test it, I made this diff. The steps were:

1. Start iOS server
2. Start android server
3. remove unused ios suppressions
4. remove unused android suppressions
5. add ios suppressions with site=react_native_ios_fb
6. add android suppressions with site=react_native_android_fb
7. remove unused ios suppressions. The ones that are unused are ones where an android comment was inserted as well, since the ios comment no longer is next to the error
8. add suppressions using ios flowconfig with site=react_native_fb
9. remove unused android suppressions. The unused ones are ones that were moved up when the cross-platform suppressions were inserted.

I'm going to make this into a script to make sure we don't contribute anymore unused suppressions from our side.

The controller you requested could not be found. nolint

Reviewed By: TheSavior

Differential Revision: D10053893

fbshipit-source-id: 7bee212062f8b2153c6ba906a30cf40df2224019
2018-09-27 11:47:04 -07:00
Richard Cann 236bb018ab StaticRenderer: Removed prop types (#21348)
Summary:
related #21342

 The `render` function, I was not able to specifically type since the props passed to it may vary. At the moment only `renderRow` function from ListView component is using StaticRenderer, and the type of the renderRow function is `Function`.
Let me know what your thoughts are on this. Thank you
Pull Request resolved: https://github.com/facebook/react-native/pull/21348

Differential Revision: D10084990

Pulled By: TheSavior

fbshipit-source-id: a87a8d4976c6ffaf83dc0fddc758869dbc2e2803
2018-09-27 11:17:47 -07:00