Commit Graph

12883 Commits

Author SHA1 Message Date
Andrew Chen (Eng) 6404529b76 Added an Assertion that addRoot is called before completeRoot
Reviewed By: mdvacca

Differential Revision: D7127321

fbshipit-source-id: a8215fda0d854471bed9aa5476141dfffc4dc11c
2018-03-01 16:57:25 -08:00
David Vacca 22990c3ce7 Add extra information to error message reported when a ReactRawText is included as a child of a non Text component
Reviewed By: achen1

Differential Revision: D7120188

fbshipit-source-id: 553a26d04a62dceb86d791bcdcb3a5e16a12f64b
2018-03-01 16:57:25 -08:00
Andrew Chen (Eng) 3f85dc5337 Log java error messages from FabricUIManagerModule
Reviewed By: mdvacca

Differential Revision: D7126177

fbshipit-source-id: bafa6e2b3dabf39d2ca0d9a8830b877fc5ae97ec
2018-03-01 12:17:44 -08:00
David Vacca 9b3861c109 Fix unmount of ReactRootView for Fabric surfaces
Reviewed By: fkgozali

Differential Revision: D7114865

fbshipit-source-id: f0a1c47c983e610fe0dba3051ed8aa350ac052cc
2018-03-01 10:33:21 -08:00
David Vacca c0c388c8aa Adding simple View rendering support using FabricUIManager.
Reviewed By: achen1

Differential Revision: D7102725

fbshipit-source-id: d2878d036843ba01201c4df617680269b5f59039
2018-03-01 10:33:21 -08:00
David Vacca b5b0ee853e Adding configuration of Fabric inside ReactRootView.
Reviewed By: achen1

Differential Revision: D7102701

fbshipit-source-id: f655327372c42ad86042011a3af3ee693d14014a
2018-03-01 10:33:21 -08:00
David Vacca 6b45fb2cb1 Create UIManager interface and extract common classes in uimanager/common
Reviewed By: achen1

Differential Revision: D7102674

fbshipit-source-id: e14b6782ad102ec1c3d37988df4bbd4190511f09
2018-03-01 10:33:21 -08:00
Héctor Ramos b181b7797f Check PATENTS does not creep into files
Summary:
Some files have crept into the repo with the old license header. These are usually from PRs that were opened prior to the re-licensing of the project.

Let the script run, prior to fixing the errant files. The script outputs the following:

```
PATENTS crept into some new files?
 --- /dev/fd/63	2018-03-01 01:42:48.250153746 +0000
+++ /dev/fd/62	2018-03-01 01:42:48.250153746 +0000
@@ -1 +1,9 @@
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m
+ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java
+ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java
+ReactCommon/yoga/yoga/YGLayout.cpp
+ReactCommon/yoga/yoga/YGLayout.h
+ReactCommon/yoga/yoga/YGStyle.cpp
+ReactCommon/yoga/yoga/YGStyle.h
 scripts/circleci/check_license.sh
Exited with code 1
```

Fix the headers in these files and run the script again. No output, exit code 0.
Closes https://github.com/facebook/react-native/pull/18143

Reviewed By: sophiebits

Differential Revision: D7119356

Pulled By: hramos

fbshipit-source-id: d238e4d4a3ae320a2c8e625c2fa29690057a4814
2018-03-01 08:22:05 -08:00
Miguel Jimenez Esun 8a7f68e211 Remove optional parameter from server and enforce empty list everywhere
Reviewed By: jeanlauliac

Differential Revision: D6999448

fbshipit-source-id: 39a6b9333e3c3ec05bae5423fcc84ad17e1fdc06
2018-03-01 05:33:05 -08:00
Pritesh Nandgaonkar d174ab8a7a Change NaN with large number
Reviewed By: emilsjolander

Differential Revision: D6969537

fbshipit-source-id: bdc09eaf703e0d313ca65c25a4fb44c99203d9bf
2018-03-01 04:02:01 -08:00
Pritesh Nandgaonkar af9d6479e5 Make two separate yoga targets for QE
Reviewed By: emilsjolander

Differential Revision: D7059278

fbshipit-source-id: dd11b018edc8ea930d5eba09c6c01e349bb8b63c
2018-03-01 04:02:01 -08:00
Kevin Gozali 006b77f1ae iOS: pass fabric flag down to RCTRootView/RCTSurface for proper unmounting
Reviewed By: shergin

Differential Revision: D7119220

fbshipit-source-id: 7a822036e29e0d92f53a164acba2ab75e883b5c4
2018-02-28 20:17:37 -08:00
Kevin Gozali c20e0f94fe workaround android-only js module resolution issue
Summary: for some reason metro was not able to find js module with just .android.js variant. To workaround some build issue, added an empty .ios.js variant

Reviewed By: mdvacca

Differential Revision: D7115360

fbshipit-source-id: 40b95cf2efc4d3d599f39b88813469b6d78e7b48
2018-02-28 19:44:58 -08:00
Héctor Ramos 160578624a React sync for revisions a634e53...ab4280b
Reviewed By: bvaughn

Differential Revision: D7077686

fbshipit-source-id: de39027bef1f9d48802202555a5c765999d7bfe7
2018-02-28 19:44:58 -08:00
Héctor Ramos 4c82ce42ef Do not mention people, suggest labels
Summary:
GitHub notifications have been made noisier with these automatic mentions. We can rely on the automatic reviewer tags instead.

Also: suggest labels that may be used, based on release notes (the danger bot cannot add labels itself).
Closes https://github.com/facebook/react-native/pull/18138

Differential Revision: D7114654

Pulled By: hramos

fbshipit-source-id: 0d85879f937921543935d090c792ea09f53cb84a
2018-02-28 16:47:18 -08:00
Héctor Ramos dd187a2764 Simplify issue template
Summary:
Reduce the amount of text people have to read through when opening a new issue.
Closes https://github.com/facebook/react-native/pull/18140

Differential Revision: D7117467

Pulled By: hramos

fbshipit-source-id: 4e976adc44a283ab6d5729e5dd2eaa095871c009
2018-02-28 16:26:01 -08:00
Shoaib Meenai 0bc80e9a72 Use #include instead of #import
Reviewed By: compnerd

Differential Revision: D7114385

fbshipit-source-id: a443770910714aab1af3f3ac5e932f6aaf1afe99
2018-02-28 15:41:43 -08:00
Shoaib Meenai 0d03fddeca Use complete type with unique_ptr
Reviewed By: fromcelticpark

Differential Revision: D7114324

fbshipit-source-id: c9305c478ebe31ea35b590b861919fd42f56662d
2018-02-28 15:03:25 -08:00
Michael Lee 35583e52f4 Add header_namespace to handle cross-platform uses
Differential Revision: D7101683

fbshipit-source-id: 2a95cd1447d4cc5d796556e3281d08136cd130ff
2018-02-28 12:01:50 -08:00
David Vacca ddcd609a86 Refactor cloneWithNewChildren method
Reviewed By: achen1

Differential Revision: D7064266

fbshipit-source-id: 71ef5651893359a257c39a5943812853f8d0dbcd
2018-02-27 18:47:50 -08:00
Peter Argany 84ef7bc372 Added InputAccessoryView demo to RNTester [2/N]
Summary:
This is an example showing how to use an InputAccessoryView to build an iMessage-like sticky text input

https://youtu.be/89PGsSqtmQU

Reviewed By: sahrens

Differential Revision: D7048456

fbshipit-source-id: 90314a85f3662c2b21aababe2dd46ea5e406604a
2018-02-27 17:56:48 -08:00
Peter Argany 6d9fe455dc Fixed TVOS test failure caused by input accessory view change
Reviewed By: mmmulani

Differential Revision: D7103353

fbshipit-source-id: 7a1575eff0296017521fc8ca6fe384301849a73e
2018-02-27 17:56:48 -08:00
Alex Hinson 2dd2529b3a Add option to hide context menu for TextInput #17335
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.

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

Happy contributing!

-->

There is currently no way to disable to context menu that automatically appears over a TextInput. This is especially troublesome if you would like to disable the user from pasting text into certain fields. This PR adds a `contextMenuHidden` property to TextInput that will hide it.

I'm not sure if testing is necessary here. I would be happy to investigate further on how this would be tested, if deemed necessary!

https://github.com/facebook/react-native-website/pull/95

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

[FEATURE][TextInput] - Added `contextMenuHidden` property
Closes https://github.com/facebook/react-native/pull/18125

Differential Revision: D7101888

Pulled By: hramos

fbshipit-source-id: fe36603a3fbdcefbd644251a7ea894ac7e23e5b8
2018-02-27 17:32:24 -08:00
Héctor Ramos 247f32ff12 Increase n days before issue considered stale
Summary:
This repository has Probot's [Stale workflow](https://github.com/probot/stale) enabled. It is configured via the `.github/stale.yml` file.

In this PR, we increase number of days before an issue becomes stale to ~six months, and increase days until the same issue is closed after inactivity to ~2 months.

It also limits the stale bot to issues only.
Closes https://github.com/facebook/react-native/pull/18108

Differential Revision: D7105801

Pulled By: hramos

fbshipit-source-id: 23efd41f88c03cb6c0be3820a3b3ac67b3e4a6fe
2018-02-27 17:01:19 -08:00
Moti Zilberman 5898817fc1 Implement letterSpacing on Android >= 5.0
Summary:
`letterSpacing` is completely missing from RN Android at the moment.

I've reviewed the `letterSpacing` implementations in #13199, #13877 and #16801 (that all seem to have stalled) and managed to put together an improved one based on #13199, updated to merge cleanly post 6114f863c3, that resolves the [issues](https://github.com/facebook/react-native/pull/13199#issuecomment-354568863) I've identified with that code.

I believe this is the closest PR yet to a correct implementation of this feature, with a few caveats:

- As with the other PRs, this only works on Android >= 5.0 (silently falling back to no letter spacing on older versions). Is this acceptable for a RN feature, in general? Would a dev mode warning be desirable?
- The other PRs seem to have explored the space of potential solutions to the layout issue ([Android renders space _around_ glyphs](https://issuetracker.google.com/issues/37079859), iOS to the _right_ of each one) and come up empty, so I've opted to merely document the difference.
- I have neither updated nor tested the "Flat" UI implementation - everything compiles but I've taken [this comment](https://github.com/facebook/react-native/issues/12770#issuecomment-294052694) to mean there's no point in trying to wade through it on my own right now; I'm happy to tackle it if given some pointers.
- The implementation in `ReactEditText` is only there to handle the placeholder text, as `ReactBaseTextShadowNode` already affects the input control's contents correctly.
  - I'm not sure whether `<TextInput>` is meant to respect `allowFontScaling`; I've taken my cue here from `ReactTextInputManager.setFontSize()`, and used the same units (SP) to interpret the value in `ReactEditText.setLetterSpacingPt()`.
  - I'm not sure whether `<TextInput>` is even meant to support `letterSpacing` - it doesn't actually work on iOS. I'm not going to be able to handle the Objective-C side of this, not as part of this PR at least.
- I have not added unit tests to `ReactTextTest` - is this desirable? I see that some other props such as `lineHeight` aren't covered there (unless I'm not looking in the right place).
- Overall, I'm new to this codebase, so it's likely I've missed something not mentioned here.

Note comment re: unit tests above; RNTester screenshots follow.

| iOS (existing functionality, amended test) | Android (new functionality & test) |
| - | - |
| <img src=https://user-images.githubusercontent.com/2246565/34458459-c8d59498-edcb-11e7-8c8f-e7426f723886.png width=300> | <img src=https://user-images.githubusercontent.com/2246565/34458473-2a1ca368-edcc-11e7-9ce6-30c6d3a48660.png width=300> |

| iOS _(not implemented, test not in this branch)_ | Android (new functionality & test) |
| - | - |
| <img src=https://user-images.githubusercontent.com/2246565/34458481-6c60a36e-edcc-11e7-9af5-9734dd722ced.png width=300> | <img src=https://user-images.githubusercontent.com/2246565/34458486-8b3cdcf8-edcc-11e7-974b-25c6085fa674.png width=300> |

| iOS _(not implemented, test not in this branch)_ | Android (new functionality & test) |
| - | - |
| <img src=https://user-images.githubusercontent.com/2246565/34458492-d69a77be-edcc-11e7-896f-21212621dbee.png width=300> | <img src=https://user-images.githubusercontent.com/2246565/34458490-b3a1139e-edcc-11e7-88c8-79d4430d1514.png width=300> |

https://github.com/facebook/react-native-website/pull/105 - this docs PR is edited slightly from what's in `TextStylePropTypes` here; happy to align either one to the other after a review.

[ANDROID] [FEATURE] [Text] - Implemented letterSpacing
Closes https://github.com/facebook/react-native/pull/17398

Reviewed By: mdvacca

Differential Revision: D6837718

Pulled By: hramos

fbshipit-source-id: 5c9d49e9cf4af6457b636416ce5fe15315aab72c
2018-02-27 14:53:58 -08:00
Adam Burdette dbafc29e60 Fix #8615: NetInfo.isConnected for iOS
Summary:
This is fixing #8615. The problem was that, on initialization, the `_connectionType` variable was still set to its default value of `RCTConnectionTypeUnknown`. The exposed API method did nothing to determine this unless a subscription had be established and then the method would simply return the last reported value. Instead, the exposed oneshot API call now actually checks the connection status through the same methods as the subscription and updates RCTNetInfo’s values before returning.

In order to avoid reporting events without a subscription, a flag is set and unset on calls to start/stopObserving.

- start app
- observe the (in)correct reporting of the manual status
- change network status to offline
- press refresh
- observe the manual fetch
- start subscription
- change network status to online
- press refresh to show that the manual refresh works (only now working for current RN version)
- change network status to offline
- stop subscription
- change network status to online
- press refresh to show manual refresh does(n't) work without subscription
- start subscription to show it updates to current

Current Behavior: https://drive.google.com/file/d/1Ods6HORgp_vfm1mQVjGwhtH1D7issxjo/view?usp=sharing
Fixed Behavior: https://drive.google.com/file/d/11H1UOF33LeMGvXEOoapU62ARDSb7qoYv/view?usp=sharing

[IOS] [BUGFIX] [Libraries\Network\RCTNetInfo.m] - Fixed #8615, `iOS: NetInfo.isConnected returns always false`, by decoupling the fetch from the status of the subscription.
Closes https://github.com/facebook/react-native/pull/17397

Differential Revision: D7102771

Pulled By: hramos

fbshipit-source-id: ea11eb0b1a7ca641fc43da2fe172cf7b2597de4a
2018-02-27 14:16:20 -08:00
Koen Punt 2ad34075f1 Xcode 9 supports running multiple simulators
Summary:
Since Xcode 9 you can run multiple simultaneously. And since I believe React Native advocates using the latest version of Xcode, we can safely remove this constraint.

Updated the unit tests. Furthermore it can be found in the [Xcode release notes](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/WhatsNewXcode/xcode_9/xcode_9.html#//apple_ref/doc/uid/TP40004626-CH8-SW12) that multiple simulators are now supported.

This can be tested with the CLI by running `react-native run-ios` twice, but with a different `--simulator` flag, e.g.;

    react-native run-ios --simulator "iPhone SE"
    react-native run-ios --simulator "iPhone X"

[IOS] [ENHANCEMENT] [local-cli/runIOS/findMatchingSimulator.js] - Allow running multiple simulators
Closes https://github.com/facebook/react-native/pull/17284

Differential Revision: D7102790

Pulled By: hramos

fbshipit-source-id: 750e7039201e28a1feda2bec1e78144fd9deff98
2018-02-27 14:11:00 -08:00
Peter van der Zee 2dc559d1fb Add possibility to add custom plugin prefix
Summary: The problem with a fixed prefix is that babel 7 uses a scoped packages and every (standard) plugin is now part of that scope so the prefix is no longer `babel-plugin-` but instead `babel/plugin-`. There are more changes. This one will at least fix most of them.

Reviewed By: davidaurelio

Differential Revision: D7085102

fbshipit-source-id: b927998c611b71b3265e1cb3f6df537b14f9cb25
2018-02-27 13:16:59 -08:00
Julien K 6c353fd7e9 onPress animation with magnification
Summary:
Related to: #15454

Motivation: Improve tvOS feeling for TouchableHighlight

![changewithaniamtion](https://user-images.githubusercontent.com/7658664/29193477-b99b4a10-7e25-11e7-8b31-e0e4ca9d7720.gif)

- When you select the button he is focus and the underlay is show
- When you press the button, there is an animation, but after the animation, the focus is on the button and the underlay is show

Play with tvParallaxProperties on tvOS, test with and without patch just to see the actual behaviour
```
			<TouchableHighlight
						tvParallaxProperties={{
							enabled: true,
							shiftDistanceX: 0,
							shiftDistanceY: 0,
							tiltAngle: 0,
							magnification: 1.1,
                                                        pressMagnification: 1.0,
							pressDuration: 0.3,
						}}
						underlayColor="black"
						onShowUnderlay={() => (console.log("onShowUnderlay")}
						onHideUnderlay={() =>  (console.log("onHideUnderlay")}
						onPress={() =>  (console.log("onPress")}
					>
						<Image
							style={styles.image}
							source={ uri: 'https://www.facebook.com/images/fb_icon_325x325.png' }
						/>
					</TouchableHighlight>
```
Closes https://github.com/facebook/react-native/pull/15455

Differential Revision: D6887437

Pulled By: hramos

fbshipit-source-id: e18b695068bc99643ba4006fb3f39215b38a74c1
2018-02-27 13:10:02 -08:00
Héctor Ramos 1346bf8405 Timeout Android instrumentation steps
Summary:
Sporadically, the instrumentation tests step will timeout while waiting for the apk to install on the emulator. By adding a 5 minute timeout, the command will be retried in these cases, where hopefully the install will go through.

Test Plan

Tested on Circle.
Closes https://github.com/facebook/react-native/pull/18127

Differential Revision: D7101890

Pulled By: hramos

fbshipit-source-id: 4dcc77153d794e9747df58ea40c011bc316b6c83
2018-02-27 13:09:55 -08:00
Peter Argany 38197c8230 Support Input Accessory View (iOS Only) [1/N]
Reviewed By: mmmulani

Differential Revision: D6886573

fbshipit-source-id: 71e1f812b1cc1698e4380211a6cedd59011b5495
2018-02-27 11:09:30 -08:00
Héctor Ramos c87d03a8b2 Update danger token
Summary: Closes https://github.com/facebook/react-native/pull/18111

Differential Revision: D7099636

Pulled By: hramos

fbshipit-source-id: fc95ba83c34e0061c13fb831ea3496d7e8f3793a
2018-02-27 10:01:40 -08:00
Josh Hargreaves b60a727adb Fix crashes onKeyPress Android
Summary:
There appear to be two different types of crashes related to the recent addition of `onKeyPress` on Android introduce in `0.53`. This PR addresses the cause of both of them.

Firstly, it seems possible to get an `indexOutOfBoundsException` with some 3rd-party keyboards as observed in https://github.com/facebook/react-native/issues/17974 & https://github.com/facebook/react-native/issues/17922. I have simplified the backspace determining logic slightly, and also put in an explicit check for zero case so it is not possible to get an indexOutOfBoundsException & it should make sense in the context of the onKeyPress logic.

Secondly, it appears that `EditText#onCreateInputConnection` can return null. In this case, if we set `null` to be the target of our subclass of `ReactEditTextInputConnectionWrapper`, we will see the crashes as seen [here](https://github.com/facebook/react-native/issues/17974#issuecomment-368471737), whereby any of methods executed in the `InputConnection` interface can result in a crash. It's hard to reason about the state when `null` is returned from `onCreateInputConnection`, however I would might reason that any soft keyboard input cannot update the `EditText` with a `null` `input connection`, as there is no way of interfacing with the `EditText`. I'm am not sure, if there is a later point where we might return/set this input connection at a later point? As without the `InputConnection` onKeyPress will not work. But for now, this will fix this crash at least.

I have not managed to reproduce these crashes myself yet, but users have confirmed that the `indexOutOfBounds` exception is fixed with the 'zero' case and has been confirmed on the respective issues https://github.com/facebook/react-native/issues/17974#issuecomment-368471737.

For the `null` inputConnection target case, I have verified that explicitly setting the target as null in the constructor of `onCreateInputConnection` results in the same stack trace as the one linked. Here is also a [reference](https://github.com/stripe/stripe-android/pull/392/files#diff-6cc1685c98457d07fd4e2dd83f54d5bb) to the same issue closed with the same fix for another project on github.

It is also important to verify that the behavior of `onKeyPress` still functions the same after this change, which can be verified by running the RNTesterProject and the `KeyboardEvents` section in `InputText`.
The cases to check that I think are important to check are:
- Cursor at beginning of input & backspace
- Return key & return key at beginning of input
- Select text then press delete
- Selection then press a key
- Space key
- Different keyboard types

This should not be a breaking change.

 [ANDROID] [BUGFIX] [TextInput] - Fixes crashes with TextInput introduced in 0.53.
Closes https://github.com/facebook/react-native/pull/18114

Differential Revision: D7099570

Pulled By: hramos

fbshipit-source-id: 75b2dc468c1ed398a33eb00487c6aa14ae04e5c2
2018-02-27 10:01:40 -08:00
Jean Lauliac a759a44358 npmignore: ignore tests and fixtures
Summary:
This try to address #17672 and https://github.com/facebook/metro/issues/139. We should probably not include these folders in the released version of React Native, as they are used only for testing—am I incorrect?

cc MoOx, t4deu.

I ran:

```
npm pack
tar -t -f react-native-1000.0.0.tgz | less
```

Then verified that `__fixture__` was not part of the package.

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

[GENERAL] [BUGFIX] [.npmignore] - Do not publish test-specific files
Closes https://github.com/facebook/react-native/pull/18019

Differential Revision: D7098211

Pulled By: jeanlauliac

fbshipit-source-id: 0748ad8c064450bd2a9f4d6f49675a7f74fb300f
2018-02-27 08:42:14 -08:00
Kevin Gozali 28c694f25a iOS - expose C++ FabricUIManager to the bridge via a wrapper class
Reviewed By: shergin

Differential Revision: D7093253

fbshipit-source-id: 7317144ad2cb5b8903227c779798e1576f8de2c2
2018-02-27 08:42:14 -08:00
Kevin Gozali 52acbbdd62 iOS: adjusted JSI binding for C++ FabricUIManager
Reviewed By: sebmarkbage, shergin

Differential Revision: D7078631

fbshipit-source-id: 6df21e52d3941372a9845fdcf2aed777de7cb359
2018-02-27 08:42:14 -08:00
Jamie Curtis da84eba318 Catch exception and report it when making a network request with invalid URL on Android
Summary:
Currently if you invoke `fetch()` with an invalid URL ("aaa" for
example) you cannot catch the error in javascript since it's not
reported. Instead the entire app crashes.

Fixes #7436 and #18087

Hopefully.

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

-->

Fix using fetch on Android with user generated input.

Added relevant unit test

`./scripts/run-android-local-unit-tests.sh` all pass

[ANDROID] [BUGFIX] [fetch] - Allow "unexpected url" exception to be caught on Android when using fetch
<!--
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
-->
Closes https://github.com/facebook/react-native/pull/18103

Differential Revision: D7097110

Pulled By: hramos

fbshipit-source-id: 69144e8a0f7404d9bcc7c71a94650de36a48c84a
2018-02-27 04:39:01 -08:00
Sebastian Markbage 07334cb47b Clean up unused modules
Reviewed By: fkgozali

Differential Revision: D7092777

fbshipit-source-id: 619a78911f2857f1183597143aec86957f277f9e
2018-02-26 20:03:27 -08:00
Sebastian Markbage 84ad5d3d3c Explicitly handle null props in bindings
Reviewed By: fkgozali, mdvacca

Differential Revision: D7080813

fbshipit-source-id: 7c9706df719a39e11a3d99c2de38af992b62dabf
2018-02-26 19:46:51 -08:00
Spencer Ahrens 3756d41de1 Add testOnly_pressed to TouchableHighlight
Reviewed By: yungsters

Differential Revision: D7043098

fbshipit-source-id: 1df06df6820d81b37dc9a167a7931ed20df44f0f
2018-02-26 13:48:19 -08:00
Manman Ren ebbd4371c9 Mark ObjC methods that are called from React Native as dynamic.
Reviewed By: mmmulani

Differential Revision: D7087100

fbshipit-source-id: 18e5726e5b48e7b71fcaab19f6fe73be0cad6233
2018-02-26 12:24:17 -08:00
Ken Woo 3eee96ab86 Change React Native application layout check
Reviewed By: shergin

Differential Revision: D7076910

fbshipit-source-id: dc6df2dee886bbdf139d6e50192d621efad6d57e
2018-02-26 11:49:36 -08:00
Rafael Oleza bd30336d86 Bump metro@0.28.0
Reviewed By: davidaurelio

Differential Revision: D7085296

fbshipit-source-id: 76032af022d37a28976b33176f9a573e39861a39
2018-02-26 10:09:54 -08:00
David Vacca 62efff8ab8 Implement cloning for all ReactShadowNodes
Reviewed By: achen1

Differential Revision: D7063509

fbshipit-source-id: 90df8a3d2e6f2a4efa13f5eb0337b191b690bf8f
2018-02-26 09:04:48 -08:00
Miguel Jimenez Esun dabe8e0d01 Allow passing custom configs through the CLI ("js1 run")
Reviewed By: jeanlauliac

Differential Revision: D7081913

fbshipit-source-id: f5952599c840f2c65213bd2928b21f0c1d84f510
2018-02-26 03:48:43 -08:00
Tim Yung 80c18395e2 RN: Flow Type for `PressEvent`
Reviewed By: sahrens

Differential Revision: D7082716

fbshipit-source-id: 13e1730b0b2380ae6be63e2b36bb40b9a44a99f4
2018-02-25 23:27:00 -08:00
Tim Yung a817c64043 RN: Use `$ReadOnly` in CoreEventTypes
Reviewed By: sahrens

Differential Revision: D7082715

fbshipit-source-id: d2f7e280d02bbd8e7dcba2d38b719fa4f82ecb8b
2018-02-25 23:27:00 -08:00
siddhantsoni 16c9e5b715 Fix: Added scroll Bounds check in scrollToOffset method in RCTScrollView on iOS
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.

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

Happy contributing!

-->

The scrollToOffset method of RCTScrollView for iOS does not include bound check for the scroll offset provided to the method. This can cause the whole view to scroll out of screen if the offset provided is greater than the bounds of the View.
The same does not happen on Android, where the scroll halts once the last item of the scrollView is in the viewport.
I have added bounds check so the offset resets to the MaxOffset which makes sure the view does not scroll out of the viewport.

The issue can be observed in the following snack:
https://snack.expo.io/H1363Uo8f

![ezgif com-optimize 1](https://user-images.githubusercontent.com/16662518/36068270-2437ae88-0ef7-11e8-96dd-819b4ae0fd67.gif)

To test my changes I ran the code provided in the snack above with the react-native dependency pointing to my branch. As can be see in the video attached below, the scroll halts once it hits the end of the ScrollView even if the scroll offset provided is higher than the bounds of the ScrollView. It also does not scroll up for negative scroll offset.

![ezgif com-optimize](https://user-images.githubusercontent.com/16662518/36068130-9ae4f918-0ef3-11e8-8728-af7b2888bdb8.gif)

[IOS] [BUGFIX] [ScrollView] - Added bounds check to prevent ScrollView from scrolling to an offset which is out of bounds of the ScrollView for iOS.
Closes https://github.com/facebook/react-native/pull/17927

Differential Revision: D7014466

Pulled By: shergin

fbshipit-source-id: a817738d08e1057a4c70f43373132f88fa1461c4
2018-02-25 22:18:31 -08:00
Maxime Thirouin 59c7b2cfac Add missing mock for AppState (removeEventListener)
Summary:
I am testing with Jest a component that use [AppState.removeEventListener](https://facebook.github.io/react-native/docs/appstate.html#removeeventlistener) and I am currently facing a fatal error saying that `AppState.removeEventListener` is `undefined`.

Create a component that uses `AppState`, e.g.

```jsx
import React, { Component } from 'react';
import { AppState } from 'react-native';

class TestComponent extends Component {
  componentDidMount() {
    AppState.addEventListener('change', this.stateChangeListener);
  }
  componentWillUnmount() {
    AppState.removeEventListener('change', this.stateChangeListener);
  }
}
```

It should pass test using Jest (snapshots)

It's the continuation of #11199. This PR finish the mock for the native module `AppState`.

[ GENERAL  ]   [ BUGFIX      ]   [AppState] Add missing mock for Jest for `removeEventListener` method.
Closes https://github.com/facebook/react-native/pull/17908

Differential Revision: D7083144

Pulled By: shergin

fbshipit-source-id: eafa07f064f971c3d657f2ffc9c00766c0925bac
2018-02-25 22:18:30 -08:00
Ruben Bridgewater d2817f48a1 Use sync fs.mkdir
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.

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

Happy contributing!

-->

This ensures that errors are actually noticed in case it is not
possible to create the directory. This will also throw an error when used with the upcoming Node.js 10.x because there is no callback.

Refs: https://github.com/nodejs/node/pull/18668

[CLI][MINOR][local-cli/library/library.js] - Use sync fs.mkdir for error handling
<!--
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
-->
Closes https://github.com/facebook/react-native/pull/18084

Differential Revision: D7083122

Pulled By: shergin

fbshipit-source-id: a13b64e57860e1ab2c15e0c008211dc0dca3b2d2
2018-02-25 21:49:28 -08:00