Summary:
Our docs suggest using this babel plugin to remove console.log statements in production. Unfortunately, it does not actually work when you run it on a new React Native project, and the root cause is that the plugin does not handle all cases correctly. See discussion in https://github.com/facebook/react-native/issues/10412 . For now, we should just stop recommending that people use this plugin, because it doesn't work.
Closes https://github.com/facebook/react-native/pull/12315
Differential Revision: D4538567
Pulled By: hramos
fbshipit-source-id: f3ae1b9143130a05601907ee902a02fc0b2818b0
Summary:
ADB reverse link was broken, and the "release build" instructions did not work (--configuration doesn't exist.)
Closes https://github.com/facebook/react-native/pull/12312
Differential Revision: D4538302
Pulled By: hramos
fbshipit-source-id: 6d2e7ee07f9fad6080ed79bc8e0e4db11e6bbed3
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?
Comments with correct grammar are easier to read.
Closes https://github.com/facebook/react-native/pull/12313
Differential Revision: D4538229
Pulled By: hramos
fbshipit-source-id: 69978df3659f2d3e4f5b2ccb4ff6c33dc6b7e56b
Summary:
I think this update is Critical as I wanted to add a different module name to be the same as the Android module name. I simply lost 6 hours until I found out that the Macro does not accept String syntax. Almost drove me crazy. Please, at least do something about it. Thanks.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI
Closes https://github.com/facebook/react-native/pull/11634
Differential Revision: D4533312
Pulled By: lacker
fbshipit-source-id: 2c547f791ed76ba62e0c7e5cabc2830dbae34075
Summary:
Support for non-image assets like audio and video was added a while back
Closes https://github.com/facebook/react-native/pull/12053
Differential Revision: D4489209
Pulled By: mkonicek
fbshipit-source-id: 4e2bdf7ef07bcc8c563c055ed0a4fe5cc51bd0bc
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
I had tried fixing a broken link in a previous commit (#11453). My commit was merged, but it did not resolve the underlying problem. I have looked into how links should be formed for the docs and have fixed the original problem as well as updated all other links to be consistent.
Previous link formats:
- /docs/sample.html <-- broken link
- sample.html <-- broken link
- https://facebook.github.io/react-native/docs/sample.html <-- works
- /react-native/docs/sample.html <-- works
- docs/sample.html <-- works (permalink format)
This PR updates all links to the permalink format.
**Test plan (required)**
I ran the website locally and manually tested half of the links in each category. They all worked.
```
$ cd website
$ npm install && npm start
```
Closes https://github.com/facebook/react-native/pull/12064
Differential Revision: D4489153
Pulled By: mkonicek
fbshipit-source-id: bf0231d941ba147317595c3b3466dc579a887169
Summary:
There is only `timestamp `property in touch native event, `event.nativeEvent.timeStamp` is undefined.
Closes https://github.com/facebook/react-native/pull/11988
Differential Revision: D4489408
Pulled By: mkonicek
fbshipit-source-id: 0148a4107124438f345b8cb584e1832ba51b3a4b
Summary:
A simple correction of what looks like a copy-paste error in the writeup of NavigationExperimental.
Closes https://github.com/facebook/react-native/pull/12081
Differential Revision: D4482725
Pulled By: mkonicek
fbshipit-source-id: 8c7c6ad19ed96e3287b4d0ef809685b5201b4fc0
Summary:
Never a good idea to pipe a bash file from `http` into `sudo`. Using `https` mitigates some of this risk.
Closes https://github.com/facebook/react-native/pull/12090
Differential Revision: D4474065
fbshipit-source-id: 99d29ae112ae0edef5bd662d439b5da673c5c79f
Summary:
Add 'Android SDK Platform 23' to the check list when install the proper Android SDK.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.c
Closes https://github.com/facebook/react-native/pull/11744
Differential Revision: D4464520
Pulled By: hramos
fbshipit-source-id: 2cfabdadc8a94f35cbbd37d9dce46375e8b954c3
Summary:
Hi, here are some typo fixes in the documentation related to Android native modules:
* Add missing package and imports for the second part of the basic tutorial (register module)
* Add missing `public` keyword
* Remove incongruous word
Closes https://github.com/facebook/react-native/pull/11938
Differential Revision: D4439220
Pulled By: hramos
fbshipit-source-id: e7086fe384ed6238306abf0ee72c944fac53ad7b
Summary: Switch to using IS_TESTING on the Platform module. While IS_TESTING has to be explicitly set in the test harness, this makes it more usable and stops people from relying on brittle variables in the (larger) environment.
Reviewed By: fkgozali
Differential Revision: D4423661
fbshipit-source-id: 27a80867778b9374bcba67b69f9c93d32c0a74b0
Summary:
In the context of an app an image exists in three resolutions on the server: `thumb` (30px) `feed` (300px) `full` (900px). When looking at an individual item a user can come either from the feed, via a permalink or from other parts of the app. This allows a situation where the `feed` image might or might not already be loaded somewhere in the app. In the detail view I want to render `thumb` with a blur (to quickly display something), then the `feed` image if it exists to have something decent to display until `full` loads. However it is quite a waste to load the `feed` image if it isn't already in cache, and will slow down the time until `full` is loaded. It is possible to track the navigation from feed->detail and that the `feed` image has actually completed loading by the feed component however as component hierarchies grow this turns into quite a lot of prop passing and bad separation of concerns.
NSURLRequests accepts a [Cache Policy](https://developer.apple.com/reference/fo
Closes https://github.com/facebook/react-native/pull/10844
Differential Revision: D4425959
Pulled By: lacker
fbshipit-source-id: 679835439c761a2fc894f56eb6d744c036cf0b49
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Descriptions about class names are incorrect.
Closes https://github.com/facebook/react-native/pull/11898
Differential Revision: D4418957
fbshipit-source-id: fc7d0b61149ed9f850a436a35ad98f179b5e3e19
Summary:
This adds a hook to let you disable yellow box warnings. It's useful for native engineers who don't want to mess with JS but also for CI/testing, where the app operates mostly as a blackbox.
Depends on D4395091
Reviewed By: achen1
Differential Revision: D4395552
fbshipit-source-id: 4c3a9676caa975c537d1a4711d60aab2f404db15
Summary:
Sending global events with `eventDispatcher` has been [deprecated](d9737571c4) since 0.28, with a recommendation to subclass `RCTEventEmitter` instead, but there were no docs for this.
This updates the iOS native module to use the recommended way, and also documents the use of `stopObserving` and `startObserving`.
Tested and working in a real app.
cc nicklockwood
Closes https://github.com/facebook/react-native/pull/11792
Differential Revision: D4394626
fbshipit-source-id: 68b26d35944a521bf683a50ec1ab21f03b5e99d8
Summary:
Update docs to prevent build process from failing when collaborators do not have MYAPP_RELEASE_STORE_FILE in their env.
Build process often fails when following the existing documentation on setting the signingConfigs in build.gradle, as not all collaborators have the required ENV set in their gradle.properties
Closes https://github.com/facebook/react-native/pull/11716
Differential Revision: D4389150
Pulled By: hramos
fbshipit-source-id: 37941382950fac41f19d19317f49769588b135b4
Summary:
The command at line 90 does not work anymore, updated to reflect current revision.
Closes https://github.com/facebook/react-native/pull/11635
Differential Revision: D4389138
Pulled By: hramos
fbshipit-source-id: 4ac071ba2d47aa6bfbe7fb2ccaaf9800aa9e7e68
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
There was a small error in the documentation that referenced the unlink command as an example, when the code in the example was actually from the link command.
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of t
Closes https://github.com/facebook/react-native/pull/11746
Differential Revision: D4387025
fbshipit-source-id: 152adc4b5cc4b467d3cf2399d2273c31b10c4b64
Summary:
Added permission code to handle the user permission accepted or denied cases which causes potential app crashing if not handled. Only a small piece of code added to the guide to resolve an issue I was facing with permission.
The app that I was testing following the guide available, it was crashing showing permission denied error on the android monitor, and there was no step for how to resolve the issue. So I tried out a solution so thought would share it on the official Guide to help people who are stuck with the same issue.
Closes https://github.com/facebook/react-native/pull/11687
Differential Revision: D4377882
Pulled By: ericvicenti
fbshipit-source-id: a7db104c7c1b7e1fb2590c83118715840c17927b
Summary:
Doing this from web so won't be able to screenshot the results. (also inadvertently deleted a line, oh well...)
Closes https://github.com/facebook/react-native/pull/11625
Differential Revision: D4366928
Pulled By: mkonicek
fbshipit-source-id: 966a3d8b90dde49b1de06e0249df110245943825
Summary:
Local Maven repository for Support Libraries -> Android Support Repository
someone so moody
Closes https://github.com/facebook/react-native/pull/11360
Differential Revision: D4339960
Pulled By: lacker
fbshipit-source-id: 04e92d07413184e86fca3034a4a16a6e689da87e
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
Using `~` in the `.bashrc` or `.zshrc` fails inside of double quotes. By changing this to `$HOME` the path is exported correctly in all instances.
Explain the **motivation** for making this change. What existing problem does the pull request solve?
It corrects the path to the Android home location if SDK is installed via Android Studio. Using `~` for the home path is failing. By added `$HOME` you are guaranteed the correct path.
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Install Android Studio & SDK.
Set environment variable in `.bashrc` or `.zshrc` with `${HOME}/Library/Android/sdk` instead of `~/Library/Android/sdk`
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the p
Closes https://github.com/facebook/react-native/pull/11461
Differential Revision: D4327870
Pulled By: JoelMarcey
fbshipit-source-id: 903a84504f6288c73ac39a8f3b8800ededbdccf9
Summary:
The goal of this pull request is to make it easier for contributors to run Android tests locally, specifically the unit tests and integration tests. I added a bunch of checks to the local testing scripts that will warn you if your environment is misconfigured, and tell you how to fix it. I also updated the testing docs, so that the regular "Testing" page should be a decent resource to point people to when you are telling them "hey this pull request needs a test." Just Android, though, I haven't gotten to the iOS parts yet.
I also disabled a couple tests that seemed quite flaky while running on a local machine, and don't seem to be providing much value. In particular, the `TestId` test just hangs on my emulator a lot and has been flaky on CI in the past, so I removed about half of its test cases to make the sample app smaller. The testMetions test appears to be dependent on screen size so I commented it out.
Closes https://github.com/facebook/react-native/pull/11442
Differential Revision: D4323569
Pulled By: bestander
fbshipit-source-id: 9c869f3915d5c7cee438615f37986b07ab251f8c
Summary:
Small pull request
**motivation**
The doc 'Building React Native from source' is not up to date now.
While i try to build from the source my self, the gradle-download-task(2.0.0) will always fail to download boost zip with a failure of 403.
After i upgrade the gradle-download-task to 3.1.2, the download works well.
**Test plan (required)**
I tested to build the source myself, it works.
This is non-code update, it is document update, hope to help other people who get the same download failure.
**Code formatting**
Non-code update PR.
Closes https://github.com/facebook/react-native/pull/11298
Differential Revision: D4288387
fbshipit-source-id: 5e6feef1ea80f7e3feddcc7e4abf2b5cea82f08f
Summary:
The line
`Please make sure you export the correct path for 'ANDROID_HOME' if you did not install the Android SDK using Android Studio.`
was visible twice (one on top of another) in the docs when viewing linux instructions. I removed the block that set it visible on both linux and windows and incorporated it into the existing windows block.
Closes https://github.com/facebook/react-native/pull/11276
Differential Revision: D4269783
Pulled By: hramos
fbshipit-source-id: 423fca3219567cf96d91aefc43d1ddabb2403728
Summary:
*First PR to React Native.*
After performing a clean install of macOS Sierra on my machine I tried to get RN set up again and noticed that the link provided for installing Java (required by Android Studio) pointed to the [wrong location](https://www.java.com/en/download/mac_download.jsp). After some time researching I found the right package required by Android Studio [here](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
I tried looking for a more general link (as this points to the JDK version 8 and has a weird path: _jdk8-downloads-2133151.html_ - Sadly this was the best I could find.
I also looked through listed issues to try and find a previous attempt to fix this error but couldn't find any references, sorry if I missed anything.
**TL;DR:** JDK download link is incorrect, PR updates it to the correct one.
Closes https://github.com/facebook/react-native/pull/11201
Differential Revision: D4253304
Pulled By: hramos
fbshipit-source-id: be8ffe059bf60f5d7aa1876e5581b270187864c2
Summary:
I was running RN 0.31 on ArchLinux (kernel 4.7), and "react-native start"
was refusing to run on the default (and sometimes required, as I have
noticed) port. I tried executing the suggested lsof command, but that did not
work. Somewhere I found the lsof command I include in this commit, and that
worked (it was a node.js process). So I'm including it, since I found it
helpful.
Closes https://github.com/facebook/react-native/pull/9402
Reviewed By: lacker
Differential Revision: D4144400
Pulled By: hramos
fbshipit-source-id: 6203549455555efc59b7bab0a3ec23957d80b956
Summary:
The upgrading process based on Yeoman is a pain. For each file, Yeoman (or the brand new copyAndReplace solution a477aec) compares the newly generated content with the existing one and prompts the user if it differs, with very basic options: overwrite or skip.
I have digged into this problem and came with [rn-diff](https://github.com/ncuillery/rn-diff) (you may have read [this article](https://medium.com/ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.llvy2dym5)). This repository helps people to upgrade RN on their projects. An alternative upgrading process using `git apply` instead of Yeoman is described [here](https://github.com/ncuillery/rn-diff/blob/master/USAGE.md).
This PR is the integration of this process into the core. I got rid of the drawbacks mentioned in the link below in order to make it a clean, elegant, one-step operation.
This process is based on some Shell operations that:
- Generate the blank sources of both old and new versions
Closes https://github.com/facebook/react-native/pull/11110
Differential Revision: D4237107
Pulled By: mkonicek
fbshipit-source-id: 15e82e030b762415c925ccb2a62ddb354a6e18b9
Summary:
Adding documentation for the CLI for 2 reasons:
1. It's not immediately clear to most how the CLI is part of `react-native` and not the node module they installed. This begins clarifying.
2. I plan on adding some additional documentation to this section pending an upcoming PR I've discussed with Mike.
screen shot provided:
![image](https://cloud.githubusercontent.com/assets/997157/20574213/0640d026-b179-11e6-9bc1-4f507b2a195a.png)
Closes https://github.com/facebook/react-native/pull/11097
Differential Revision: D4237028
Pulled By: mkonicek
fbshipit-source-id: c1dc50fe1be7f6947a33ee6472b5862306888055
Summary:
The windows and linux block didn't have the command to install react-native-cli.
The command is the exact same as it is on macOS. It makes the guide a little confusing because it leaves out this critical step and it's difficult to understand whether or not this needed component was already indirectly installed in one of the other steps.
Closes https://github.com/facebook/react-native/pull/11135
Differential Revision: D4236984
Pulled By: mkonicek
fbshipit-source-id: dca237132df7d80b5a02eaf09faec53e13e005cb
Summary:
As said in #10944, there's not yet some good infos on how to profile the javascript.
I'm adding a mention to two ways of doing it (`react-addons-perf` and chrome profiler), feel free to correct me on this.
I almost added an example for `react-addons-perf` but I'm not sure what's the correct way to use. Here's the way I use it:
```javascript
import Perf from 'react-addons-perf';
....
componentDidMount() {
console.log('start perf tracking');
Perf.start();
setTimeout(() => {
console.log('stop perf tracking');
Perf.stop();
Perf.printExclusive();
}, 10000);
}
...
```
Closes https://github.com/facebook/react-native/pull/10974
Differential Revision: D4221630
Pulled By: mkonicek
fbshipit-source-id: 918f837b9c7169c3dd835e653c78159b801fb946