Skip to content

Commit 30bf039

Browse files
hramosfacebook-github-bot
authored andcommitted
Documentation updates
Summary: Tackling a handful of docs issues: - #12780 - #11227 - #2819 Closes #12867 Differential Revision: D4691083 Pulled By: hramos fbshipit-source-id: 9115315f2d6132e975901c9a0b784e9d41eeb49e
1 parent 014eef3 commit 30bf039

File tree

5 files changed

+44
-78
lines changed

5 files changed

+44
-78
lines changed

docs/GettingStarted.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,25 @@ one to start with, since the setup is a bit different.
6565

6666
## Installing Dependencies
6767

68-
You will need Node.js, Watchman, the React Native command line interface, and Xcode.
68+
You will need Node, Watchman, the React Native command line interface, and Xcode.
6969

7070
<block class="mac android" />
7171

7272
## Installing Dependencies
7373

74-
You will need Node.js, Watchman, the React Native command line interface, and Android Studio.
74+
You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio.
7575

76-
<block class="windows linux android" />
76+
<block class="linux android" />
7777

7878
## Installing Dependencies
7979

80-
You will need Node.js, the React Native command line interface, and Android Studio.
80+
You will need Node, the React Native command line interface, a JDK, and Android Studio.
81+
82+
<block class="windows android" />
83+
84+
## Installing Dependencies
85+
86+
You will need Node, the React Native command line interface, Python2, a JDK, and Android Studio.
8187

8288
<block class="mac ios android" />
8389

@@ -90,33 +96,41 @@ brew install node
9096
brew install watchman
9197
```
9298

93-
> [Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching
94-
changes in the filesystem. It is highly recommended you install it for better performance.
99+
If you have already installed Node on your system, make sure it is version 4 or newer.
100+
101+
[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
95102

96103
<block class="linux android" />
97104

98105
### Node
99106

100-
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node.js 4 or newer.
107+
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 4 or newer.
101108

102109
<block class='windows android' />
103110

104-
### Node
111+
### Node, Python2, JDK
105112

106-
We recommend installing Node.js and Python2 via [Chocolatey](https://chocolatey.org), a popular package manager for Windows. Open a Command Prompt as Administrator, then run:
113+
We recommend installing Node and Python2 via [Chocolatey](https://chocolatey.org), a popular package manager for Windows.
114+
115+
Android Studio, which we will install next, requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) which can be installed using Chocolatey.
116+
117+
Open a Command Prompt as Administrator, then run:
107118

108119
```
109120
choco install nodejs.install
110121
choco install python2
122+
choco install jdk8
111123
```
112124

125+
If you have already installed Node on your system, make sure it is version 4 or newer. If you already have a JDK on your system, make sure it is version 8 or newer.
126+
113127
> You can find additional installation options on [Node.js's Downloads page](https://nodejs.org/en/download/).
114128
115129
<block class="mac ios android" />
116130

117131
### The React Native CLI
118132

119-
Node.js comes with npm, which lets you install the React Native command line interface.
133+
Node comes with npm, which lets you install the React Native command line interface.
120134

121135
Run the following command in a Terminal:
122136

@@ -130,7 +144,7 @@ npm install -g react-native-cli
130144

131145
### The React Native CLI
132146

133-
Node.js comes with npm, which lets you install the React Native command line interface.
147+
Node comes with npm, which lets you install the React Native command line interface.
134148

135149
Run the following command in a Terminal:
136150

@@ -144,7 +158,9 @@ npm install -g react-native-cli
144158

145159
### Xcode
146160

147-
The easiest way to install Xcode 8 is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
161+
The easiest way to install Xcode is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
162+
163+
If you have already installed Xcode on your system, make sure it is version 8 or higher.
148164

149165
You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
150166

@@ -156,13 +172,15 @@ You will also need to install the Xcode Command Line Tools. Open Xcode, then cho
156172

157173
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
158174

159-
#### 1. Download and install Android Studio
175+
<block class="mac linux android" />
160176

161-
[Android Studio](https://developer.android.com/studio/install.html) provides the Android SDK and AVD (emulator) required to run and test your React Native apps.
177+
> Android Studio requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). Go ahead and install JDK 8 or newer if needed.
162178
163-
<block class="mac android" />
179+
<block class="mac linux windows android" />
180+
181+
#### 1. Download and install Android Studio
164182

165-
> Android Studio requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
183+
Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps. [Download Android Studio](https://developer.android.com/studio/index.html), then follow the [installation instructions](https://developer.android.com/studio/install.html). Choose `Custom` installation when prompted by the Setup Wizard, and proceed to the next step.
166184

167185
<block class="mac windows android" />
168186

docs/NativeModulesAndroid.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -283,60 +283,6 @@ measureLayout();
283283
284284
Native modules should not have any assumptions about what thread they are being called on, as the current assignment is subject to change in the future. If a blocking call is required, the heavy work should be dispatched to an internally managed worker thread, and any callbacks distributed from there.
285285
286-
### Sending Events to JavaScript
287-
288-
Native modules can signal events to JavaScript without being invoked directly. The easiest way to do this is to use the `RCTDeviceEventEmitter` which can be obtained from the `ReactContext` as in the code snippet below.
289-
290-
```java
291-
...
292-
private void sendEvent(ReactContext reactContext,
293-
String eventName,
294-
@Nullable WritableMap params) {
295-
reactContext
296-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
297-
.emit(eventName, params);
298-
}
299-
...
300-
WritableMap params = Arguments.createMap();
301-
...
302-
sendEvent(reactContext, "keyboardWillShow", params);
303-
```
304-
305-
JavaScript modules can then register to receive events by `addListenerOn` using the `Subscribable` mixin
306-
307-
```js
308-
import { DeviceEventEmitter } from 'react-native';
309-
...
310-
311-
var ScrollResponderMixin = {
312-
mixins: [Subscribable.Mixin],
313-
314-
315-
componentWillMount: function() {
316-
...
317-
this.addListenerOn(DeviceEventEmitter,
318-
'keyboardWillShow',
319-
this.scrollResponderKeyboardWillShow);
320-
...
321-
},
322-
scrollResponderKeyboardWillShow:function(e: Event) {
323-
this.keyboardWillOpenTo = e;
324-
this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);
325-
},
326-
```
327-
328-
You can also directly use the `DeviceEventEmitter` module to listen for events.
329-
330-
```js
331-
...
332-
componentWillMount: function() {
333-
DeviceEventEmitter.addListener('keyboardWillShow', function(e: Event) {
334-
// handle event.
335-
});
336-
}
337-
...
338-
```
339-
340286
### Getting activity result from `startActivityForResult`
341287
342288
You'll need to listen to `onActivityResult` if you want to get results from an activity you started with `startActivityForResult`. To do this, you must extend `BaseActivityEventListener` or implement `ActivityEventListener`. The former is preferred as it is more resilient to API changes. Then, you need to register the listener in the module's constructor,

docs/Performance.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The scroll events are dispatched to the JS thread, but their receipt is not nece
6666
### Running in development mode (`dev=true`)
6767

6868
JavaScript thread performance suffers greatly when running in dev mode.
69-
This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions.
69+
This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions. Always make sure to test performance in [release builds](docs/running-on-device.html#building-your-app-for-production).
7070

7171
### Using `console.log` statements
7272

@@ -80,8 +80,6 @@ Use the new [`FlatList`](docs/flatlist.html) or [`SectionList`](docs/sectionlist
8080
Besides simplifying the API, the new list components also have significant performance enhancements,
8181
the main one being nearly constant memory usage for any number of rows.
8282

83-
TODO: Link to blog post
84-
8583
### JS FPS plunges when re-rendering a view that hardly changes
8684

8785
If you are using a ListView, you must provide a `rowHasChanged` function that can reduce a lot of work by quickly determining whether or not a row needs to be re-rendered. If you are using immutable data structures, this would be as simple as a reference equality check.

docs/Troubleshooting.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ The React Native packager runs on port 8081. If another process is already using
1616

1717
Run the following command on a Mac to find the id for the process that is listening on port 8081:
1818

19-
`$ sudo lsof -i :8081`
19+
```
20+
$ sudo lsof -i :8081
21+
```
2022

2123
Then run the following to terminate the process:
2224

23-
`$ kill -9 <PID>`
25+
```
26+
$ kill -9 <PID>
27+
```
2428

2529
On Windows you can find the process using port 8081 using [Resource Monitor](https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows) and stop it using Task Manager.
2630

@@ -36,7 +40,7 @@ You will also need to update your applications to load the JavaScript bundle fro
3640

3741
### NPM locking error
3842

39-
If you encounter an error such as "npm WARN locking Error: EACCES" while using the React Native CLI, try running the following:
43+
If you encounter an error such as `npm WARN locking Error: EACCES` while using the React Native CLI, try running the following:
4044

4145
```
4246
sudo chown -R $USER ~/.npm
@@ -101,4 +105,3 @@ Issue caused by the number of directories [inotify](https://github.com/guard/lis
101105
```
102106
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
103107
```
104-

website/src/react-native/css/react-native.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,8 @@ input#algolia-doc-search:focus {
17011701
color: rgba(0, 0, 0, 0.4); }
17021702

17031703
.home-showcase-section .showcase img {
1704-
width: 110px;
1704+
width: 100px;
1705+
height: 100px;
17051706
border-radius: 20px; }
17061707

17071708
.showcaseHeader {

0 commit comments

Comments
 (0)