Summary:
There is a bug with IP detection on Macs that have (1) multiple ethernet interfaces, (2) are using the second or third interface as their primary connection and (3) have extra loopback IPs configured (for example when running OpenVPN, running some Docker configurations or other more exotic applications). In those cases, automatic IP detection will falsely detect the IP as something like `127.94.0.1`, which will make it impossible to run debug builds from a physical device.
The underlying network configurations looks something similar to this (irrelevant parts omitted):
```
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet 127.94.0.1 netmask 0xff000000
nd6 options=201<PERFORMNUD,DAD>
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether xx:xx:xx:xx:xx:xx
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
Closes https://github.com/facebook/react-native/pull/13415
Differential Revision: D4859654
Pulled By: javache
fbshipit-source-id: 3c5d06201c48a2dfe1c274ff433423e5d7f2cded
Summary:
Adds functionality to be able to disable saving of form data and thereby disabling autocomplete in webview on Android. Can be used as a workaround for #13241
Manual testing that autocomplete is disabled when the property is set to true, and still enabled when it is unset or set to false.
Closes https://github.com/facebook/react-native/pull/13271
Differential Revision: D4858899
Pulled By: ericvicenti
fbshipit-source-id: 62738b0685e4c1958c8a32e184fa2fe4f711b336
Summary:
When running an app on a real iPhone in debug mode, I occasionally get issues when trying to load the js bundle and I suspect the issue is with xip.io (and it doesn't look like I'm the only one: https://github.com/facebook/react-native/issues/12786https://github.com/facebook/react-native/issues/9688#issuecomment-272591839). So I've added the ability to optionally disable the use of xip.io if an env variable `DISABLE_XIP` is set.
Add `export DISABLE_XIP=true` to the `Bundle React Native code and images` build phase. Run the app on a real iPhone and ensure that it can load the JS bundle from the host computers IP.
Closes https://github.com/facebook/react-native/pull/13326
Differential Revision: D4855719
Pulled By: ericvicenti
fbshipit-source-id: cb2e91291acadaa78ea302800b55c2e5388f6380
Summary:
If the new state depends on the previous state, if I remember correctly, it’s safer to use `setState()` with a function argument to ensure we’re not reading from an outdated `state`.
Thanks for submitting a PR! Please read these instructions carefully:
- [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.
The tutorial suggests to use `setState()` with an object argument when the new state depends on the previous state. In such situations, it’s preferable to use a function to ensure the previous state is up-to-date.
Updates documentation only, so there are no additional tests. Rendering the site.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure th
Closes https://github.com/facebook/react-native/pull/13358
Differential Revision: D4852404
Pulled By: hramos
fbshipit-source-id: 834759e16bcfbd5a8de71bf0c56f2b154f3321e1
Summary:
Resolves#13012
RCTPushNotificationManager uses startObserving to register for RCTRegisterUserNotificationSettings. According to the docs, the startObserving method won't be called until somebody subscribes to NotificationManagerIOS.
This means there is a scenario when the developer can call requestPermissions without subscribing to notifications first, but since RCTPushNotificationManager relies on NSNotificationCenter subscribtion, the result will never be returned.
When requesting permissions the promise will resolve:
`PushNotificationIOS.requestPermissions().then(console.log);` without the need for calling `PushNotificationIOS.addEventListener()` first.
Closes https://github.com/facebook/react-native/pull/13263
Differential Revision: D4851767
Pulled By: javache
fbshipit-source-id: 2be8621e072ae1086014594bc986ca5590b5eb61
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
If you have added code that should be tested, add tests.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
Closes https://github.com/facebook/react-native/pull/13385
Differential Revision: D4852068
Pulled By: hramos
fbshipit-source-id: ff193a7c90aa8b00c248575ae647f1fb14eb261f
Summary:
Motivation: Similar to https://github.com/facebook/react-native/pull/13242 - the application will crash with `[NSNull lastPathComponent]: unrecognized selector sent to instance` if a stack frame with no filename makes it to RCTRedBox.
Closes https://github.com/facebook/react-native/pull/13360
Differential Revision: D4848980
Pulled By: javache
fbshipit-source-id: dc506f2ba39c2d4d68982b56a6e765a19dc048b0
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [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.
I am just fixing typos in the docs.
proofreading
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]
Closes https://github.com/facebook/react-native/pull/13382
Differential Revision: D4851786
Pulled By: javache
fbshipit-source-id: 3cb67161653681c061d2e2b4a6a8c14527b8bd9b
Summary: It can be much more convenient instead of binding and setting `extraData` or what-not.
Reviewed By: blairvanderhoof
Differential Revision: D4829165
fbshipit-source-id: bb781fedc831059e7b5065ea4357955aed79beda
Summary:
If tracking is enabled and the sampling check passes on a scroll or layout event,
we compare the scroll offset to the layout of the rendered items. If the items don't cover
the visible area of the list, we fire an `onFillRateExceeded` call with relevant stats for
logging the event through an analytics pipeline.
The measurement methodology is a little jank because everything is async, but it seems directionally
useful for getting ballpark numbers, catching regressions, and tracking improvements.
Benchmark testing shows a ~2014 MotoX starts hitting the fill rate limit at about 2500 px / sec,
which is pretty fast scrolling.
This also reworks our frame rate stuff so we can use a shared `SceneTracking` thing and track blankness
globally.
Reviewed By: bvaughn
Differential Revision: D4806867
fbshipit-source-id: 119bf177463c8c3aa51fa13d1a9d03b1a96042aa
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [yes] Explain the **motivation** for making this change.
Using react-native library inside iOS app extension causes a compile error inside react native stating that usage of UIAlertView is not allowed inside iOS app extension and should use UIAlertController instead. I have updated the code to use UIAlertController based on the other instances of the UIAlertController usage in the react-native library
- [ partial ] Provide a **test plan** demonstrating that the code is solid.
This code should be launched when developers start the profiler from the React native debug menu. I am currently in process of upgrading my app from 0.34 to the latest react native ( aka app not in working state). Would appreciate if there is an alternative way for me to test this functionality out.
Just tried to create a new react-native project using "react-native init testproject" and upon running "react-native run-ios", I hit the following error a
Closes https://github.com/facebook/react-native/pull/13328
Differential Revision: D4844559
Pulled By: javache
fbshipit-source-id: e516ca57cb2abf2b09aa53abecb0fe60a40190b4
Summary: This removes the call to `HasteFS#matchFiles()`, that has linear complexity. Instead, we index all the files by directory from `HasteFS` once loaded, a linear operation. Then, we can filter files from a particular directory much quicker.
Reviewed By: davidaurelio
Differential Revision: D4826721
fbshipit-source-id: c31a0ed9a354dbc7f2dcd56179b859e491faa16c
Summary:
**Motivation**: Website documentation for the core Apple TV support.
Closes https://github.com/facebook/react-native/pull/13278
Differential Revision: D4839904
Pulled By: hramos
fbshipit-source-id: e8b78f3601915072c0d809b05b4b5ca61828f277
Summary:
React Native Playground has been sunset, so I've replaced the examples that previously used it with examples using [Snack](http://snack.expo.io/).
The examples are directly embedded and can be edited live to see updates. The code itself is also in the docs, so we can easily update the docs in one place and we don't have to actually go to a saved app on Snack and update it there.
Run it locally, go to the `Animations` section and the `Direct Manipulation` section.
![screen shot 2017-04-03 at 6 29 51 pm](https://cloud.githubusercontent.com/assets/90494/24638271/ff3ad044-189b-11e7-845d-24b2fb612d95.png)
Open it on your phone, notice that it falls back to just showing plain code.
<img src="https://cloud.githubusercontent.com/assets/90494/24638547/203ec8fc-189e-11e7-99c8-dfabff949f8d.PNG" width="250">
- Get rid of the Expo new user experience dialog that you see when you open a Snack -- is this a dealbreaker
Closes https://github.com/facebook/react-native/pull/13285
Differential Revision: D4828011
Pulled By: hramos
fbshipit-source-id: 684ad24a14deb72abb8587ffbb726d316f126d75
Summary:
What existing problem does the pull request solve?
According to this issue: https://github.com/facebook/react-native/issues/3468 , only `keyboardDidShow`and `keyboardDidHide` events are available on android at this moment.
I think this information should be displayed in the documentation since default `android:windowSoftInputMode` is `adjustResize`.
Closes https://github.com/facebook/react-native/pull/13155
Differential Revision: D4795828
Pulled By: hramos
fbshipit-source-id: 2c114f3040808a5cc3cdeb29b2067877df353620
Summary:
This PR adds support for configurable devEnabled option when building an android app. This is currently hardcoded.
The reason for making this configurable is this: I have an app that uses code-push and 3 buildConfigs. I want to have a debugging version which has `devEnabled = true`, then a staging version which has `devEnabled = false` (this version of the app is used internally for testing and should behave just like a release version of the app, and when the tests succeed the changes are promoted into the release version to the users out there, using code-push). The last version is a standard release version with `devEnabled = false`.
Currently, `devEnabled` is hardwired like this: `!targetName.toLowerCase().contains("release")` so by default my `staging` buildConfig will have `devEnabled = true` but I'd like it to be false.
With this PR it'd be possible to configure this as follows, while not breaking the current behavior.
`'devDisabledIn${productFlavor}${buildType}'`
`'devDisabledIn${buildType
Closes https://github.com/facebook/react-native/pull/11438
Differential Revision: D4630513
Pulled By: hramos
fbshipit-source-id: b6817cf4c144fc948f76785e9cb5f93a13a6a6a2
Summary: View tags are currently used for end-to-end test IDs. We'd like to overload the tag field with other information such as nativeID (for native refs) and transitionID (for shared element transitions) in the future. Added a key for testID's tag
Reviewed By: AaaChiuuu
Differential Revision: D4833045
fbshipit-source-id: c2f9371c9a3dbb2411e114f4f096f723ac3132c0