You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Restored the version lag caveat in the Getting Started, and updated the Upgrading guide to account for CRNA.
Additionally, updated the release versions page to account for the new release cycle (e.g. release candidates are encouraged).
Closes#14112
Differential Revision: D5112224
Pulled By: hramos
fbshipit-source-id: d544c5178484c27f1ed6dee3479bcd94e5e81982
Copy file name to clipboardExpand all lines: docs/GettingStarted.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,8 @@ Because you don't build any native code when using Create React Native App to cr
146
146
147
147
If you know that you'll eventually need to include your own native code, Create React Native App is still a good way to get started. In that case you'll just need to "[eject](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#ejecting-from-create-react-native-app)" eventually to create your own native builds. If you do eject, the "Building Projects with Native Code" instructions will be required to continue working on your project.
148
148
149
+
Create React Native App configures your project to use the most recent React Native version that is supported by the Expo client app. The Expo client app usually gains support for a given React Native version about a week after the React Native version is released as stable. You can check [this document](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) to find out what versions are supported.
150
+
149
151
If you're integrating React Native into an existing project, you'll want to skip Create React Native App and go directly to setting up the native build environment. Select "Building Projects with Native Code" above for instructions on configuring a native build environment for React Native.
150
152
151
153
<blockclass="native mac windows linux ios android" />
Copy file name to clipboardExpand all lines: docs/Upgrading.md
+39-38Lines changed: 39 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -1,61 +1,66 @@
1
1
---
2
2
id: upgrading
3
-
title: Upgrading
3
+
title: Upgrading to new React Native versions
4
4
layout: docs
5
5
category: Guides
6
6
permalink: docs/upgrading.html
7
-
banner: ejected
8
7
next: native-modules-ios
9
8
previous: understanding-cli
10
9
---
11
10
12
-
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools
13
-
and other goodies. Because React Native projects are essentially made up of an Android project, an
14
-
iOS project and a JavaScript project, all combined under an npm package, upgrading can be rather
15
-
tricky. But we try to make it easy for you. Here's what you need to do to upgrade from an older
16
-
version of React Native:
11
+
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used `create-react-native-app` or `react-native init` to create your project.
17
12
18
-
## Upgrade based on Git
13
+
## Create React Native App projects
19
14
20
-
**IMPORTANT:** You don't have to install the new version of React Native, it will be installed automatically.
15
+
Upgrading your Create React Native App project to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions in your `package.json` file. Please refer to [this document](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) to find out what versions are supported. You will also need to set the correct `sdkVersion` in your `app.json` file.
21
16
22
-
The module `react-native-git-upgrade` provides a one-step operation to upgrade the source files with
23
-
a minimum of conflicts. Under the hood, it consists in 2 phases:
17
+
See the [CRNA user guide](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#updating-to-new-releases) for up-to-date information about upgrading your project.
18
+
19
+
## Projects built with native code
20
+
21
+
<divclass="banner-crna-ejected">
22
+
<h3>Projects with Native Code Only</h3>
23
+
<p>
24
+
This section only applies to projects made with <code>react-native init</code> or to those made with Create React Native App which have since ejected. For more information about ejecting, please see the <a href="https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md" target="_blank">guide</a> on the Create React Native App repository.
25
+
</p>
26
+
</div>
27
+
28
+
Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.
29
+
30
+
### Upgrade based on Git
31
+
32
+
The module `react-native-git-upgrade` provides a one-step operation to upgrade the source files with a minimum of conflicts. Under the hood, it consists in 2 phases:
24
33
25
34
* First, it computes a Git patch between both old and new template files,
26
35
* Then, the patch is applied on the user's sources.
27
36
28
-
### 1. Install Git
29
-
Your project doesn't have to be handled by the Git versioning system (could be Mercurial, SVN or none)
30
-
but Git has to be installed and available in the `PATH`. You can download Git here:
31
-
https://git-scm.com/downloads
37
+
> **IMPORTANT:** You don't have to install the new version of the `react-native` package, it will be installed automatically.
38
+
39
+
#### 1. Install Git
32
40
33
-
### 2. Install the `react-native-git-upgrade` module
41
+
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to [install Git](https://git-scm.com/downloads) on your system in order to use `react-native-git-upgrade`. Git will also need to be available in the `PATH`.
34
42
35
-
It's a CLI tool and must be installed globally:
43
+
#### 2. Install the `react-native-git-upgrade` module
44
+
45
+
The `react-native-git-upgrade` module provides a CLI and must be installed globally:
36
46
37
47
```sh
38
48
$ npm install -g react-native-git-upgrade
39
49
```
40
50
41
-
### 3. Run the command
51
+
####3. Run the command
42
52
43
-
Run the command to start the process:
53
+
Run the following command to start the process of upgrading to the latest version:
44
54
45
55
```sh
46
56
$ react-native-git-upgrade
47
-
# Upgrade React Native to the latest version
48
-
49
-
# Or:
50
-
51
-
$ react-native-git-upgrade X.Y.Z
52
-
# Upgrade React Native to the X.Y.Z version
53
57
```
54
58
55
-
The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git
56
-
3-way merge have failed, depending on the version and how you modified your sources.
59
+
> You may specify a React Native version by passing an argument: `react-native-git-upgrade X.Y`
57
60
58
-
### 4. Resolve the conflicts
61
+
The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.
62
+
63
+
#### 4. Resolve the conflicts
59
64
60
65
Conflicted files include delimiters which make very clear where the changes come from. For example:
61
66
@@ -84,15 +89,13 @@ Conflicted files include delimiters which make very clear where the changes come
84
89
85
90
You can think of "ours" as "your team" and "theirs" as "the React Native dev team".
86
91
87
-
## Alternative
92
+
###Alternative
88
93
89
94
Use this only in case the above didn't work.
90
95
91
-
### 1. Upgrade the `react-native` dependency
92
-
93
-
Note the latest version of the `react-native` npm package from here (or use `npm info react-native` to check):
96
+
#### 1. Upgrade the `react-native` dependency
94
97
95
-
*https://www.npmjs.com/package/react-native
98
+
Note the latest version of the `react-native` npm package [from here](https://www.npmjs.com/package/react-native) (or use `npm info react-native` to check).
96
99
97
100
Now install that version of `react-native` in your project with `npm install --save`:
98
101
@@ -108,7 +111,7 @@ $ npm install --save react@R
108
111
# where R is the new version of react from the peerDependency warning you saw
109
112
```
110
113
111
-
### 2. Upgrade your project templates
114
+
####2. Upgrade your project templates
112
115
113
116
The new npm package may contain updates to the files that are normally generated when you
114
117
run `react-native init`, like the iOS and the Android sub-projects.
@@ -126,10 +129,8 @@ This will check your files against the latest template and perform the following
126
129
127
130
* If there is a new file in the template, it is simply created.
128
131
* If a file in the template is identical to your file, it is skipped.
129
-
* If a file is different in your project than the template, you will be prompted; you have options
130
-
to keep your file or overwrite it with the template version.
131
-
132
+
* If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
132
133
133
-
# Manual Upgrades
134
+
## Manual Upgrades
134
135
135
136
Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the [release notes](https://github.com/facebook/react-native/releases) when upgrading so that you can identify any manual changes your particular project may require.
// Note: Our Algolia DocSearch box supports version-specific queries. If you will be drastically changing the way versions are listed in this page, make sure https://github.com/algolia/docsearch-configs/blob/master/configs/react-native-versions.json is updated accordingly.
<p>React Native follows a monthly release train. Every month, a new branch created off master enters the <ahref="versions.html#rc">Release Candidate</a> phase, and the previous Release Candidate branch is released and considered <ahref="versions.html#latest">stable</a>.</p>
93
+
<p>
94
+
React Native follows a monthly release train. Every month, a new branch created off master enters the
95
+
{' '}
96
+
<ahref="versions.html#rc">
97
+
Release Candidate
98
+
</a>
99
+
{' '}
100
+
phase, and the previous Release Candidate branch is released and considered
101
+
{' '}
102
+
<ahref="versions.html#latest">stable</a>
103
+
.
104
+
</p>
105
+
<p>
106
+
If you have an existing project that uses React Native, read the release notes to learn about new features and fixes. You can follow
<p>This is the version that is configured automatically when you run <code>react-native init</code>. We highly recommend using the current version of React Native when starting a new project.</p>
90
-
<p>If you have an existing project that uses React Native, read the release notes to learn about new features and fixes. You can follow <ahref="/react-native/docs/upgrading.html">our guide to upgrade your app</a> to the latest version.</p>
136
+
<p>
137
+
This is the version that is configured automatically when you create a new project using
<p>For those who live on the bleeding edge. Only recommended if you're actively contributing code to React Native, or if you need to verify how your application behaves in an upcoming release.</p>
180
+
<p>
181
+
To see what changes are coming and provide better feedback to React Native contributors, use the latest release candidate when possible. By the time a release candidate is released, the changes it contains will have been shipped in production Facebook apps for over two weeks.
<p>You can find past versions of React Native <ahref="https://github.com/facebook/react-native/releases">on GitHub</a>. The release notes can be useful if you would like to learn when a specific feature or fix was released.</p>
127
-
<p>You can also view the docs for a particular version of React Native by clicking on the Docs link next to the release in this page. You can come back to this page and switch the version of the docs you're reading at any time by clicking on the version number at the top of the page.</p>
. The release notes can be useful if you would like to learn when a specific feature or fix was released.
215
+
</p>
216
+
<p>
217
+
You can also view the docs for a particular version of React Native by clicking on the Docs link next to the release in this page. You can come back to this page and switch the version of the docs you're reading at any time by clicking on the version number at the top of the page.
0 commit comments