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

4662 Коммитов

Автор SHA1 Сообщение Дата
Kevin Gozali 4c69ccd0fb Revert D13860038: [react-native][PR] Add ability to control scroll animation duration for Android
Differential Revision:
D13860038

Original commit changeset: f06751d063a3

fbshipit-source-id: 5d89137aed0d549004e790068c1e4998ebccdaf1
2019-01-29 18:00:54 -08:00
Shaun Stanworth 745484c892 Remove height styling when keyboard closed (#16965)
Summary:
Closes #13754

Fixing previously reported bug #13754

Video here https://imgur.com/a/3IgqP

[GENERAL] [BUGFIX] [KeyboardAvoidingView] - Correct height behaviour when keyboard closed
Pull Request resolved: https://github.com/facebook/react-native/pull/16965

Differential Revision: D13860208

Pulled By: cpojer

fbshipit-source-id: 9ae7f81fd24999518a6ae85016d4f75dac3c4274
2019-01-29 07:31:47 -08:00
Michał Osadnik 7e8b810499 Add ability to control scroll animation duration for Android (#22884)
Summary:
Motivation:
----------
This is one of the more sought after feature requests for RN:
react-native.canny.io/feature-requests/p/add-speed-attribute-to-scrollto

This PR adds the support to add a "duration" whenever using "scrollTo" or "scrollToEnd" with
a scrollView. Currently this only exists for Android as the iOS implementation will be somewhat more involved.

This PR is also backwards compatible and does not yet deprecate the "animated" boolean. It may not make sense to ever deprecate "animated", as it could be the flag that is used when devs want the system default duration (which is 250ms for Android). I'm not sure what it is for iOS. It would simplify things to remove "animated", though.
Pull Request resolved: https://github.com/facebook/react-native/pull/22884

Differential Revision: D13860038

Pulled By: cpojer

fbshipit-source-id: f06751d063a33d7046241c95348b6abbb327d36f
2019-01-29 07:18:09 -08:00
danibonilha 7ff9456f2e - create missing AndroidDrawable flow types in ViewPropTypes.js. (#23192)
Summary:
Related to #22100

Enhance last ViewPropTypes flow types.

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

[GENERAL] [ENHANCEMENT] [ViewPropTypes.js] - Enhance Flow types definitions
Pull Request resolved: https://github.com/facebook/react-native/pull/23192

Differential Revision: D13858907

Pulled By: cpojer

fbshipit-source-id: 3633eb019eca2076bb68393b09d06555876f2c48
2019-01-29 00:10:03 -08:00
Albert Sun ec9fe48819 Back out "[react-native][PR] [fix] Fixing overscrolling issue on Virtualized List"
Summary:
Reverting this change since it broke some initial scroll positions. It seems the proper API to use to limit overscrolling should be overScrollMode='never'

Original commit changeset: 2ec5787218ec

Reviewed By: olegbl

Differential Revision: D13845053

fbshipit-source-id: 673aa529ef5171f26ce138573ee36f31f5d9799e
2019-01-28 11:55:32 -08:00
Bruno Nallis Villanova a159a33c02 Added: informational error message on getting Android drawable folder… (#17751)
Summary:
… suffix for asset

Better informational error message on getting Android drawable folder suffix error using the asset name scale.

<!--
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I've got an not well described error when trying to bundle my React Native project package.

You can test the React Native bundle command like this:

node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --reset-cache --entry-file index.android.js --bundle-output /project/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /project/android/app/build

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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/17751

Differential Revision: D13840597

Pulled By: cpojer

fbshipit-source-id: f755ef665b76ce3dd9c96e575fbc71e9aaf43a44
2019-01-28 09:10:33 -08:00
Connor McEwen 11df0eae5f Add rejectResponderTermination prop to TextInput (#16755)
Summary:
This is a new attempt to get #11251 merged. I just cherry-picked the relevant commits. TextInputs are set to always ignore responder termination requests, which is not desirable when they are enclosed inside a swipeable area like a ListView

Create a TextInput inside a ListView and set the `rejectResponderTermination` prop to false. Otherwise, all TextInputs should have the same behavior they do now.

[IOS] [ENHANCEMENT] [TextInput] - Add `rejectResponderTermination` prop to to TextInput. This enables TextInputs inside Swipeables to function properly.
Pull Request resolved: https://github.com/facebook/react-native/pull/16755

Differential Revision: D7846365

Pulled By: cpojer

fbshipit-source-id: eb21140061ae1f475fbd83fc63a23819e931787d
2019-01-28 07:30:39 -08:00
Rafael Lincoln 5a87093e1a Fix Warnings in Xcode (#23184)
Summary:
His PR is related to #22609

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

[IOS][Changed] - Fix warning in RCTImage
[IOS][Changed] - Fix warning in RCTNetwork
Pull Request resolved: https://github.com/facebook/react-native/pull/23184

Differential Revision: D13838680

Pulled By: cpojer

fbshipit-source-id: 698303e44bb85a4819abff7d71e0b75936c09dc8
2019-01-28 03:57:42 -08:00
zhongwuzw d0cd3cae13 Add ImageIO related C nullable check to prevent crash (#23186)
Summary:
Changelog:
----------

[iOS] [Fixed] - Add ImageIO related C nullable check to prevent crash
Pull Request resolved: https://github.com/facebook/react-native/pull/23186

Differential Revision: D13838590

Pulled By: cpojer

fbshipit-source-id: 14bfa826ce75c32129e6a980a04bb85fb35411a0
2019-01-28 03:36:57 -08:00
Dustin Savery 4d5f85ed42 Fixing overscrolling issue on Virtualized List (#23181)
Summary:
Changelog:
----------
[iOS][fixed] Fixed overscroll behavior on iOS virtualized lists (Fixes #18098)
Pull Request resolved: https://github.com/facebook/react-native/pull/23181

Differential Revision: D13838579

Pulled By: cpojer

fbshipit-source-id: 2ec5787218ecca0e01aaf31bfbb7d630cf9f1f09
2019-01-28 03:26:12 -08:00
TranLuongTuanAnh 46f3285a3f Fix issue #21065 getInspectorDataForViewTag is not a function (#21237)
Summary:
Fix renderer.getInspectorDataForViewTag is not a function when try Toggle Inspector

Fixes #21065

Release Notes:
--------------
[BUGFIX] [MINOR] [/react-native/Libraries/Inspector/Inspector.js]
Pull Request resolved: https://github.com/facebook/react-native/pull/21237

Differential Revision: D13838339

Pulled By: cpojer

fbshipit-source-id: 363a4beba211e7868395578c7941cbda119bc753
2019-01-28 02:00:18 -08:00
Ben Newman 90850cace9 Critical improvements for Map and Set polyfills.
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21492

Differential Revision: D10288094

Pulled By: cpojer

fbshipit-source-id: b1ca7344dda3043553be6945614b439a0f42a46a
2019-01-28 01:52:14 -08:00
zhongwuzw dd8f5de06f Fix small typo in comments of reactDecodedImageBytes (#23165)
Summary:
Changelog:
----------

[iOS] [Fixed] - Fix small typo in comments of reactDecodedImageBytes
Pull Request resolved: https://github.com/facebook/react-native/pull/23165

Differential Revision: D13832344

Pulled By: cpojer

fbshipit-source-id: d17150e65c6ecce5cd2b7cd324be4c4d45edc357
2019-01-26 11:51:16 -08:00
yushimatenjin 2ed1bb2e01 Flow strict-local in TimePickerAndroid.android.ios.js (#22714)
Summary:
Related to #22100

Enhance TimePickerAndroid flow types.
Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.ios.js.

All flow tests succeed.

[General] [Changed] - Enhance Flow types definitions
Pull Request resolved: https://github.com/facebook/react-native/pull/22714

Differential Revision: D13817142

Pulled By: cpojer

fbshipit-source-id: 9d0f0b0629966a60d77b73ba8a6bba4e1a4e2337
2019-01-25 06:27:21 -08:00
zhongwuzw 103880b3c6 Add image bytes property of UIImage (#22731)
Summary:
* Added a `reactDecodedImageBytes` property of `UIImage`, to give the chances if user wants to do custom memory calculation.
* Fixes wrong calculation of GIF decoded image bytes.

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

[iOS] [Fixed] - Fixes image decoded bytes calculation
Pull Request resolved: https://github.com/facebook/react-native/pull/22731

Differential Revision: D13817094

Pulled By: cpojer

fbshipit-source-id: ddc793d4734cba4e36f53b634bd3655883922c19
2019-01-25 03:26:32 -08:00
Peter Argany 527fc9d192 Globally disable LayoutAnimation during Snapshot Tests
Summary: LayoutAnimation is one source of flakiness in SSTs. Disable it globally in the SST apps.

Reviewed By: ejanzer

Differential Revision: D13791987

fbshipit-source-id: 0ebfd79fb31d235680c0d84f4b06d5a98c35260a
2019-01-24 15:24:59 -08:00
Steven Goff 67e7f16944 Feature/action sheet destructive button indexes (#18254)
Summary:
This is a recreation of #13924, rebased on top of master, as the former PR wasn't re-reviewed and automatically closed by the bot.

iOS [Action Sheets docs](https://developer.apple.com/ios/human-interface-guidelines/ui-views/action-sheets/) say

> Make destructive choices prominent. Use red for buttons that perform destructive or dangerous actions, and display these buttons at the top of an action sheet.

Currently ActionSheetIOS's showActionSheetWithOptions only supports a single destructive button via the prop `destructiveButtonIndex`.

This PR maintains backwards compatibility with `destructiveButtonIndex` while simultaneously supporting `destructiveButtonIndexes` allowing developers to pass an array of destructive indexes

```js
ActionSheetIOS.showActionSheetWithOptions({
  options: ['one', 'two', 'three'],
  destructiveButtonIndexes: [0, 1],
}, () => {});
```
<img width="282" alt="actionsheet" src="https://cloud.githubusercontent.com/assets/3091143/25963211/1c211a16-3646-11e7-9b7c-c9a2dbea7832.png">

Some additional tests, all working as expected (item only red if it is a matching index).

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: [0, 19],
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: [],
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: undefined,
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: [0, 5, 0, 0],
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: [0, 5, 0, 0, 'non numeric', 12.34],
    }, () => {});
```

The following will crash the app but I believe this is expected

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: 'not an array',
    }, () => {});
```

```js
    ActionSheetIOS.showActionSheetWithOptions({
      options: ['one', 'two', 'three'],
      destructiveButtonIndexes: null,
    }, () => {});
```

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.
Pull Request resolved: https://github.com/facebook/react-native/pull/18254

Differential Revision: D13680516

Pulled By: hramos

fbshipit-source-id: ac183cdcf5e1daef8e3c584dcf6a921bbecad475
2019-01-24 12:29:49 -08:00
Rafael Melo e4d7fc06cb Fixed string ref which was causing alert on react <Strictmode> (#23146)
Summary:
Changelog:
----------
[General] [Fixed] - After using React's `<StricMode>` it was discovered that a string ref was set, which is bad practice.
Pull Request resolved: https://github.com/facebook/react-native/pull/23146

Differential Revision: D13802397

Pulled By: cpojer

fbshipit-source-id: c2744877b25ad59eb1e4e9ce48a45e762f227b56
2019-01-24 08:28:47 -08:00
Varun Gupta ad52f52624 Fix SwipeableActionButton styling. (#23113)
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:

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

Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.

[General] [Fixed] - Same style was applied twice to SwipeableQuickActionButton in a recent commit causing problems with the buttons layout.
Pull Request resolved: https://github.com/facebook/react-native/pull/23113

Differential Revision: D13781896

Pulled By: cpojer

fbshipit-source-id: 659ddaed32b6a1e90080344ea3b0b42088fd9783
2019-01-23 04:10:13 -08:00
zhongwuzw 9672c2e245 Add CF_RETURNS_NOT_RETAINED annotate for Objective-C method which returns Core Foundation object (#23122)
Summary:
Changelog:
----------

[iOS][Fixed] - Add CF_RETURNS_NOT_RETAINED annotate for Objective-C method which returns Core Foundation object
Pull Request resolved: https://github.com/facebook/react-native/pull/23122

Differential Revision: D13781898

Pulled By: cpojer

fbshipit-source-id: 5953fa24a3d06766affdcabdec96bd43c062bf1b
2019-01-23 04:05:56 -08:00
zhongwuzw 25f7b0e878 Fix SectionList layout of RNTester on iOS (#23119)
Summary:
Changelog:
----------

[iOS] [Fixed] - Fix SectionList layout of RNTester on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/23119

Differential Revision: D13781561

Pulled By: cpojer

fbshipit-source-id: 9cc89c76a4139fe419c61a55b02a8a2992e76f4e
2019-01-23 03:01:37 -08:00
SHANKS 5ed31ce524 Fix RCTImageLoader multi thread crash (#22746)
Summary:
Fix crash similar to #22410
react-native: 0.51.0
react: 16.0.0

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

[iOS] [Changed] - Use onw serial queue to execute invalidate and send request action in RCTHTTPRequestHandler.mm.

Message:
--------

```
- (void)invalidate
{
  [_session invalidateAndCancel];
  _session = nil;
}

- (NSURLSessionDataTask *)sendRequest:(NSURLRequest *)request
                         withDelegate:(id<RCTURLRequestDelegate>)delegate
{
  // Lazy setup
  if (!_session && [self isValid]) {
    NSOperationQueue *callbackQueue = [NSOperationQueue new];
    callbackQueue.maxConcurrentOperationCount = 1;
    callbackQueue.underlyingQueue = [[_bridge networking] methodQueue];
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
    [configuration setHTTPShouldSetCookies:YES];
    [configuration setHTTPCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
    [configuration setHTTPCookieStorage:[NSHTTPCookieStorage sharedHTTPCookieStorage]];
    _session = [NSURLSession sessionWithConfiguration:configuration
                                             delegate:self
                                        delegateQueue:callbackQueue];

    std::lock_guard<std::mutex> lock(_mutex);
    _delegates = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory
                                           valueOptions:NSPointerFunctionsStrongMemory
                                               capacity:0];
  }

  NSURLSessionDataTask *task = [_session dataTaskWithRequest:request];
  {
    std::lock_guard<std::mutex> lock(_mutex);
    [_delegates setObject:delegate forKey:task];
  }
  [task resume];
  return task;
}

```

now the invalidate function is called by the RCTBridge.invalidate->RCTCxxBridge.invalidate->[moduleData.instance invalidate] , this is on the "com.facebook.react.HTTPRequestHandlerQueue".
the sendRequest:withDelegate function is called by RCTImageLoader and is on the  "com.facebook.react.imageLoaderURLRequestQueue".

when one thread step in invalidate and execute [_session invalidateAndCancel] and the another thread step in sendRequest:withDelegate and execute [_session dataTaskWithRequest:request], the _session is invalidate, so there will be a crash "Task created in a session that has been invalidated"
Pull Request resolved: https://github.com/facebook/react-native/pull/22746

Differential Revision: D13781512

Pulled By: cpojer

fbshipit-source-id: bd5fd1edf593e2bcdcc18596a29e906882bac8a4
2019-01-23 02:50:57 -08:00
VisibleMarkov 5503355a0d ActivityIndicator (#23104)
Summary:
PR Related to: #22990

Changelog:
[Android][Changed] - All the imports connected to requireNativeComponent in ActivityIndicator was moved to  a seperate file.
Pull Request resolved: https://github.com/facebook/react-native/pull/23104

Differential Revision: D13781451

Pulled By: cpojer

fbshipit-source-id: 7204976d59a96abdaa81cdd7fd54fd001f7d1ee9
2019-01-23 02:31:55 -08:00
jesse 67ad72fa3c Add types to RCTSnapshotNativeComponent (#23111)
Summary:
Changelog:
----------
[iOS][Changed] - added types to RCTSnapshotNativeComponent.js, as mentioned in #22990
Pull Request resolved: https://github.com/facebook/react-native/pull/23111

Differential Revision: D13781429

Pulled By: cpojer

fbshipit-source-id: 7efffe150fd29cbfbb3a6b8f13e38295f83acb3c
2019-01-23 02:18:10 -08:00
Rafael Lincoln 70227fec66 RCTTabBar (#23118)
Summary:
His PR is related to #22990

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

[IOS][Changed] - move the call to requireNativeComponent from TabBarIOS.ios.js to RCTTabBarNativeComponent.js
Pull Request resolved: https://github.com/facebook/react-native/pull/23118

Differential Revision: D13781428

Pulled By: cpojer

fbshipit-source-id: 3034c7db127a992c5757d70e22d98ee9acf4847b
2019-01-23 02:03:22 -08:00
Christoph Nakazawa f66e8ebf51 Fixes #issue18098 SectionList scrollToLocation (#21577)
Summary:
Fixes #18098
Pull Request resolved: https://github.com/facebook/react-native/pull/21577

Differential Revision: D13761884

Pulled By: cpojer

fbshipit-source-id: a096d69c589815d00754427fb575de0d8d0b595f
2019-01-22 07:27:10 -08:00
James Reggio 01f1780314 Expose static methods to manipulate the StatusBar stack imperatively (#21206)
Summary:
This PR exposes three static methods (`pushStackEntry`, `popStackEntry`, and `replaceStackEntry`) on StatusBar that enable imperative manipulation of the StatusBar style within the stack established by mounted StatusBar components.

Motivation:
----------

The StatusBar **component** provides a sensible API for manipulating that StatusBar style: every time a StatusBar component is mounted, its props are pushed onto a stack, and the props from the most recently mounted component are applied.

However, there are some scenarios where you may need to manipulate the StatusBar style from imperative code — particularly when invoking imperative third-party APIs that cause UI to appear. (For example, a user feedback utility or bug reporter that launches a full-screen modal.)

In modern iOS development, `UIViewControllerBasedStatusBarAppearance` is typically set to `YES`, which allows the third-party UIViewController to specify its preferred status bar style. However, as has been discussed at length in #11710, React Native has disabled this setting, which means that either the app's code or the third-party's React Native wrapper needs to manually manipulate React Native's StatusBar API to achieve the desired outcome.

The existing imperative StatusBar APIs are not a good fit for these needs because they simply overwrite the existing StatusBar styles, and provide no means of reverting StatusBar style changes when the third-party UI is dismissed.

To improve upon this situation, this PR makes it possible to call `StatusBar.pushStackEntry` before launching the third-party UI, wait for the UI to dismiss, and then call `StatusBar.popStackEntry` (supplying the token returned from the push call).

I've featured the new stack-based imperative methods in the documentation, but stopped short of explicitly deprecating the older imperative methods — though I can think of no reason not to deprecate them. Feedback is welcome on this point.

Release Notes:
--------------

[GENERAL] [ENHANCEMENT] [StatusBar] - Add static methods to manipulate StatusBar stack imperatively

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

Differential Revision: D9945247

Pulled By: cpojer

fbshipit-source-id: ec118268cff5b47e87be81d0b9e1728ecc3a9b02
2019-01-22 07:12:04 -08:00
Mido 638d672abc Added groupCollapsed polyfill (#21457)
Summary:
`groupCollapsed` is used to group logs but collapsed which is very useful when the console has many logs (e.g. when using `redux-logger`).

For developers who prefer to debug iOS apps using Safari JSC, the `groupCollapsed` was not polyfilled.

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

Differential Revision: D13761796

Pulled By: cpojer

fbshipit-source-id: e7c4f1ff4728c6a7f6ffd6cc629f7fbc1aa67e87
2019-01-22 07:05:22 -08:00
xianglinhe 47e77682d4 Update EventEmitter.js (#23047)
Summary:
added protection for emit() because subscription.listener may have been removed during event loop

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

[GENERAL][FIX] Avoid crash when subscription listener may have been removed during event loop
Pull Request resolved: https://github.com/facebook/react-native/pull/23047

Differential Revision: D13761725

Pulled By: cpojer

fbshipit-source-id: 0753b780067bd712cd43caf63020c3f0d6ea9f52
2019-01-22 06:08:46 -08:00
VisibleMarkov ec488dcf63 AndroidViewPagers.js (#22995)
Summary:
[Android][Changed] - All the imports connected to `requireNativeComponent` in `ViewPager` was moved to  a separate file.
Issue in focus: #22990
Pull Request resolved: https://github.com/facebook/react-native/pull/22995

Differential Revision: D13760459

Pulled By: cpojer

fbshipit-source-id: fca1633ce933ea4909ef81d7bbe8123d654e24fb
2019-01-22 05:55:50 -08:00
RCiesielczuk f2ab0ebdbb RCTProgressView (#23077)
Summary:
Created a standalone JS file for the `RCTProgressView` native component.

This PR is part of #22990.

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

[iOS] [Changed] - Created a standalone JS file for the `RCTProgressView` native component
Pull Request resolved: https://github.com/facebook/react-native/pull/23077

Differential Revision: D13760036

Pulled By: cpojer

fbshipit-source-id: 0f449528b28fde089d9c6b0eb9b752dee3a85af6
2019-01-22 05:49:36 -08:00
OdaDaisuke 7e82e45e94 RCTSlider (#23048)
Summary:
Changelog:

[iOS] [Changed] - Deal with #22990. Move `requireNativeComponent` to a separate file.
Pull Request resolved: https://github.com/facebook/react-native/pull/23048

Differential Revision: D13760373

Pulled By: cpojer

fbshipit-source-id: ff8cc9d468dc3bac55fc3d4156ad695dcdd10ab8
2019-01-22 05:44:54 -08:00
Rafael Lincoln bf27799ba8 ProgressBarAndroid (#23068)
Summary:
his PR is related to #22990

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

[Android][Changed] - move the call to requireNativeComponent from ProgressBarAndroid.android.js to ProgressBarAndroidNativeComponent.js
Pull Request resolved: https://github.com/facebook/react-native/pull/23068

Differential Revision: D13760445

Pulled By: cpojer

fbshipit-source-id: b74ff42c6f207803de70be549a13487d59125a66
2019-01-22 02:48:35 -08:00
Chi-AnTai 6c18069a28 RCTPicker (#22996)
Summary:
[iOS] [Changed] - As #22990 said, move requireNativeComponent to a separate file.
I am not familiar with flow, I try to follow the https://pastebin.com/RFpdT76V example but I am not sure I have done it right.
Pull Request resolved: https://github.com/facebook/react-native/pull/22996

Differential Revision: D13697082

Pulled By: cpojer

fbshipit-source-id: c0c87a8e1a7f0553da994aba230f69b496140200
2019-01-22 02:12:42 -08:00
seansy e011c4c0e2 Fixes 'Invalid render range' crash (#22847)
Summary:
When a list is updated to have fewer items and the user immediately
scrolls, the `ViewabilityHelper` `computeViewableItems` can be invoked
from the scroll and cause a crash.

This side effect *should* be relatively minor; the ViewabilityHelper shouldn't
cause a crash, as it generally would be used for analytics to see what users are viewing. I suggest changing this to a warning instead of a crash.  Other react-native developers seem to [also be getting this occasionally](https://github.com/facebook/react-native/issues/20289).

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

[General] [Fixed] - `Invalid render range` crash changed to warning when viewability helper detects an anomaly in list data.
Pull Request resolved: https://github.com/facebook/react-native/pull/22847

Differential Revision: D13750031

Pulled By: cpojer

fbshipit-source-id: 053d2baad208d1efe5b18b07ab10226032e665b8
2019-01-21 01:58:54 -08:00
Jordan Brown be51dbc214 @allow-large-files [flow] Bump xplat/js to 0.91 and remove unused suppressions
Summary: Upgrades flow in xplat/js to 0.91. This diff also adds and removes suppressions.

Reviewed By: samwgoldman

Differential Revision: D13720697

fbshipit-source-id: 1bf8830ce286db92277476a2d2404cf0c0dddca2
2019-01-18 14:47:53 -08:00
doniyor2109 3144299b5a RCTInputAccessoryView (#23050)
Summary:
Created Standalone JS file for RCTInputAccessoryView native component #22990

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

[iOS] [Changed] - Created Standalone JS file for RCTInputAccessoryView native component
Pull Request resolved: https://github.com/facebook/react-native/pull/23050

Differential Revision: D13735644

Pulled By: TheSavior

fbshipit-source-id: 64b091957b38cb11d804582f185d5cb0c6754af3
2019-01-18 11:26:33 -08:00
Kudo Chien 6a3d9c06ce Fix Picker.onValueChange on Android sometimes not fired due to race condition (#22821)
Summary:
Changelog:
----------

[Android] [Fixed] - Fix Picker.onValueChange sometimes not fired due to race condition. Fixes #15556

Root Cause:
------------

Please check my code snippet at https://snack.expo.io/kudochien/android-picker-issue
and try to select different items on Picker to see if console.log() hit.
If calling setState() with some latency, e.g. setTimeout() or changes from redux,
the second time changing picker item on UI, the onValueChange() will be not fired.

The root cause comes from the `forceUpdate` in PickerAndroid.android.js.
If user's setState() update comes after forceUpdate(), the flow will be:
1. First time select picker item
2. onValueChange + forceUpdate
3. user's setState() + componentDidUpdate + setNativeProps({ selected: ... })
4. mSuppressNextEvent = true
5. Second time select picker item
6. Since mSuppressNextEvent is true, the onValueChange will not be fired.

Solution:
---------

Like other controlled components, disable change listener during setup values from JS.
Android Spinner `setSelection(int position)` is asynchronous call, i.e. will fire onItemSelected in next run loop and is not suitable for us.
`setSelection(int position, boolean animate)`, however, is synchronous call which I used.

Some more references about setSelection:
https://stackoverflow.com/a/43512925/2590265
http://androidxref.com/8.1.0_r33/xref/frameworks/base/core/java/android/widget/AbsSpinner.java#276
The two arguments version will use `setSelectionInt()` which set mBlockLayoutRequests as true to prevent onItemSelected call from next layout().

I also moved the setOnItemSelectedListener() call after onLayout to prevent onValueChange() during intialization.
Pull Request resolved: https://github.com/facebook/react-native/pull/22821

Differential Revision: D13731979

Pulled By: cpojer

fbshipit-source-id: e06bd9aa62463b66c8f3fd7214485898d5375054
2019-01-18 08:12:12 -08:00
Jordan Brown 2191c9ed58 remove unused suppressions in xplat
Summary:
Removes unused suppressions before deploying 0.91. See D13708161 for more context on why these couldn't be removed before.

I will follow up with 2 more diffs:
1. A diff that bumps the flow version in xplat and removes unused suppressions
2. A diff that adds new suppressions for 0.91

Reviewed By: samwgoldman

Differential Revision: D13720219

fbshipit-source-id: b07dd163962fed7ff27ce3e0a4a73a71c51965d9
2019-01-18 06:44:05 -08:00
Heinrich Tremblay a828db6911 AndroidDrawerLayout (#23036)
Summary:
Changelog:
----------

[Android] [Changed] - As mentioned in #22990, I have moved native components required by DrawerLayoutAndroid.android.js into separate files and added Flow Typing.

Question
----------
I have two questions.

It is not included in the files mentioned by #22990 [comment](https://github.com/facebook/react-native/issues/22990#issue-399165354). Perhaps we should be adding knowledge of that type to the codegen since it is quite complicated, what do you think TheSavior?

The `Props` type include `renderNavigationView: () => React.Element<any>,` and `children?: React.Node,`. Therefore I added `const React = require('React');` to the file, is it ok?
Pull Request resolved: https://github.com/facebook/react-native/pull/23036

Differential Revision: D13710035

Pulled By: cpojer

fbshipit-source-id: 671423b76c3b443d85e4b63d05d6253dbd33b29c
2019-01-18 03:48:14 -08:00
jesse b864b6cf3e AndroidSwipeRefreshLayout (#23039)
Summary:
Changelog:
----------

[iOS] [Changed] - moved RCTRefreshControl from RefreshControl as a separate component, as mentioned in #22990
[Android] [Changed] - moved AndroidSwipeRefreshLayout from RefreshControl as a separate component, as mentioned in #22990
Pull Request resolved: https://github.com/facebook/react-native/pull/23039

Reviewed By: rickhanlonii

Differential Revision: D13710076

Pulled By: cpojer

fbshipit-source-id: 332520b74d6fc73e50dbe511dae22f82015c2d3a
2019-01-18 02:19:52 -08:00
nd-02110114 007e00fa70 RCTModalHostView (#23030)
Summary:
This PR is related to #22990

Changelog:
----------
[iOS] [Changed] - move the call to requireNativeComponent from Modal.js to RCTModalHostViewNativeComponent.js
Pull Request resolved: https://github.com/facebook/react-native/pull/23030

Differential Revision: D13710032

Pulled By: cpojer

fbshipit-source-id: 822284a639f38721442c67ceff98fc99495c31b9
2019-01-17 02:41:59 -08:00
Sam Goldman 2c7895706d @allow-large-files Deploy Flow v0.90 to xplat/js
Reviewed By: dsainati1

Differential Revision: D13708161

fbshipit-source-id: b83dab505f2739bf4bc5077936e71ebd1800eaf4
2019-01-16 21:55:02 -08:00
Jeff Held c93edb5ffd Apply thumbTintColor to Sliders on iOS (#22177)
Summary:
Applies the `thumbTintColor` prop to Sliders on iOS (which has been supported since iOS 5.0). Updates other documentation so that it is not labeled as Android-only, including the RNTester app
Pull Request resolved: https://github.com/facebook/react-native/pull/22177

Differential Revision: D13695554

Pulled By: hramos

fbshipit-source-id: 250f6574b193a37b3cd237bcf42612c3e91bf813
2019-01-16 15:13:43 -08:00
John.Yang 378892bc0d RCTSegmentedControl (#23000)
Summary:
Changelog:
----------

[iOS] [Changed] -  follow #22990, move the call to requireNativeComponent from `SegmentedControlIOS.ios.js` to `RCTSegmentedControlNativeComponent.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/23000

Differential Revision: D13697168

Pulled By: TheSavior

fbshipit-source-id: 83a66279d2fcd5a29d2ebc9cf5b5273947d96281
2019-01-16 14:00:00 -08:00
Daiki Ihara 3a70bf16e8 ToolbarAndroid (#23009)
Summary:
[Android] [Changed] - create standalone JS file for ToolbarAndroid, as part of #22990

I have a question.

`ToolbarAndroid` component use 2 types from other files.
They are not included files mentioned by https://github.com/facebook/react-native/issues/22990#issue-399165354.
One type `ColorValue` is very simple and I'll copy it.
But `ImageSource` type is a bit complicated I think it wolud be better to add to the codegen.
How do you think about it? TheSavior
Update: -> solved 👍

----------
- [x] yarn lint
- [x] yarn flow-check-android
- [x] yarn flow
- [x] yarn test
Pull Request resolved: https://github.com/facebook/react-native/pull/23009

Differential Revision: D13697524

Pulled By: TheSavior

fbshipit-source-id: 72ce43e1510be0986a3798d795f07ab176bd2a92
2019-01-16 13:53:53 -08:00
Nick Bell 5f3afb9fe5 #22990 add RCTDatePickerNativeComponent types (#23013)
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:

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

[iOS] [Changed] - As mentioned in #22990, I have moved native components required by DatePickerIOS.ios.js into separate files and added Flow Typing.
Pull Request resolved: https://github.com/facebook/react-native/pull/23013

Differential Revision: D13697591

Pulled By: TheSavior

fbshipit-source-id: 5aec5a2270cbfc708f3e3a67662abd8071f1333f
2019-01-16 13:41:48 -08:00
Leko d0ba9ce712 RCTMaskedView (#23001)
Summary:
This pull request is part of https://github.com/facebook/react-native/issues/22990.

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

[iOS] [Changed] - Split RCTMaskedView into RCTMaskedViewNativeComponent.
Pull Request resolved: https://github.com/facebook/react-native/pull/23001

Differential Revision: D13697245

Pulled By: TheSavior

fbshipit-source-id: 16af0b394ae32cd3c4992c2cd5ea2d3c140755b3
2019-01-16 13:34:17 -08:00
jesse 462cb10949 AndroidDropdownPicker and AndroidDialogPicker (#22999)
Summary:
Changelog:
----------

[Android] [Changed] - As mentioned in #22990, I have moved native components required by PickerAndroid.android.js into separate files and added Flow Typing.
Pull Request resolved: https://github.com/facebook/react-native/pull/22999

Differential Revision: D13697130

Pulled By: TheSavior

fbshipit-source-id: 42da73d82cca45fefa066871eed5a637811643c8
2019-01-16 13:27:08 -08:00
Leko 35823ec416 RCTTabBarItem (#23004)
Summary:
This pull request is part of https://github.com/facebook/react-native/issues/22990.

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

[iOS] [Changed] - Split RCTTabBarItem into RCTTabBarItemNativeComponent.
Pull Request resolved: https://github.com/facebook/react-native/pull/23004

Reviewed By: TheSavior

Differential Revision: D13690820

Pulled By: rickhanlonii

fbshipit-source-id: 522e55ee74a797a3930edf6821c6d8f72511cd2b
2019-01-16 13:15:14 -08:00
Maxime Nory 28230939c9 RCTSafeAreaView (#23006)
Summary:
Part of #22990

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

[iOS] [Changed] - Create individual `RCTSafeAreaViewNativeComponent` JS file from `SafeAreaView` with flow typing.
Pull Request resolved: https://github.com/facebook/react-native/pull/23006

Reviewed By: TheSavior

Differential Revision: D13690683

Pulled By: rickhanlonii

fbshipit-source-id: 7928fabf0264a6269a41148432f604e82d9b3920
2019-01-16 13:10:52 -08:00
nd-02110114 eb171d272d AndroidCheckBox (#23003)
Summary:
This PR is related to #22990

Changelog:
----------
[Android][Changed]  - move the call to requireNativeComponent from `Checkbox.android.js` to `AndroidCheckBoxNativeComponent.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/23003

Reviewed By: TheSavior

Differential Revision: D13690827

Pulled By: rickhanlonii

fbshipit-source-id: 08bc83a7f097414b5c833a3b43715e5aec277d65
2019-01-16 13:03:24 -08:00
Julian Hundeloh 35e7fdd79d feat: expose AnimatedEvent (#22984)
Summary:
Some third party components rely on the `AnimatedEvent` as a type (see https://github.com/kmagiera/react-native-gesture-handler/blob/master/Swipeable.js#L9). In order to not rely on a path which could change at any time it would be great to expose it.

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

[General][added] - Expose AnimatedEvent
Pull Request resolved: https://github.com/facebook/react-native/pull/22984

Differential Revision: D13682678

Pulled By: cpojer

fbshipit-source-id: 2f2b228e3f49e6afe623fd551220ef2147e79550
2019-01-16 07:04:11 -08:00
Matt Hargett 63038500a2 Flesh out the URL polyfill a bit more (#22901)
Summary:
This expands functionality of URL minimally so Apollo Server can run in React Native contexts. Add explicit-fail getters so undefined values won't get generated from the otherwise missing implemenation.

Use of URL in apollo-server here: 458bc71ead/packages/apollo-datasource-rest/src/RESTDataSource.ts (L79)

Credit to my colleague dysonpro for debugging the issue and providing the initial working stub implementation.

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

Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.

[INTERNAL] [ENHANCEMENT] - Support construction, toString(), and href() of URL objects.
Pull Request resolved: https://github.com/facebook/react-native/pull/22901

Differential Revision: D13690954

Pulled By: cpojer

fbshipit-source-id: 7966bc17be8af9bf656bffea5d530b1e626acfb3
2019-01-16 05:31:55 -08:00
Alejandro c93f683984 - Create individual RCTSnapshotNativeComponent JS fil… (#23012)
Summary:
Part of #22990

Changelog:
----------
[iOS] [Changed] - Create individual ```RCTSnapshotNativeComponent``` JS file from ```SnapshotViewIOS```
Pull Request resolved: https://github.com/facebook/react-native/pull/23012

Differential Revision: D13683566

Pulled By: PeteTheHeat

fbshipit-source-id: d7a030dd59e9c5dd88f7ddd92734486063c5f450
2019-01-15 17:05:43 -08:00
chrisnojima 728a35fcf2 fix incorrect type which makes animated gifs not loop forever on device (#22987)
Summary:
https://github.com/facebook/react-native/issues/22985

This 1 liner fixes the animation looping being broken on ios devices. The original source of the bug is here: https://github.com/facebook/react-native/commit/95ef882#diff-e57b12f931820d7e0949e5cbb2701dcfR35

We set the value to a special large float, and assign it to repeatCount which is also a float, so this should be a float.

Changelog:

[iOS] [Fixed] - Fix animated GIFs not looping forever
Pull Request resolved: https://github.com/facebook/react-native/pull/22987

Differential Revision: D13682645

Pulled By: hramos

fbshipit-source-id: 96b0602b418e3ebe369427a24777cd4374ac5d48
2019-01-15 16:45:56 -08:00
Eli White 8f1003fb9f Set up buck to generate native code for rncore
Summary:
Refactoring the codegen buck target from being used just for testing to a way that can be depended on for the real fabric target to replace the existing component code.

After this change, we can build a target for react native to use the codegen to create the native files for Switch. A follow up diff will be necessary to hook this up and actually replace the native files for switch.

Reviewed By: mdvacca

Differential Revision: D13662363

fbshipit-source-id: 599dd9ed9ca24ffb5c5784396f4bee7457d94d6d
2019-01-15 15:50:04 -08:00
Thibault Malbranche f76164f88a Added WebView deprecation warning (#22980)
Summary:
Changelog:
----------

Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.

[General] [Deprecated] - Deprecation warning for WebView as it has been extracted from core.
Pull Request resolved: https://github.com/facebook/react-native/pull/22980

Differential Revision: D13664505

Pulled By: hramos

fbshipit-source-id: 0cfc06015e77c52bed9eeebd97c8cbca6eacd8ce
2019-01-14 16:53:02 -08:00
Alexander Vasyuk 73434e6cba Fixing T38936345 -Opening creative tools from home or creation flow shows a red screen
Summary:
As title.
Offending diff: D13593314

Reviewed By: furdei

Differential Revision: D13620173

fbshipit-source-id: 2749dc6b3925af65d46a256c51e8309ec4bc3140
2019-01-14 10:50:36 -08:00
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