Skip to content

Commit b7b5fc8

Browse files
authored
[RNW] Create docs for 0.75 (facebook#4180)
1 parent 246bce3 commit b7b5fc8

File tree

176 files changed

+42156
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+42156
-14
lines changed

docs/react-native-gradle-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ nodeExecutableAndArgs = ["node"]
100100

101101
### `bundleCommand`
102102

103-
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](/docs/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
103+
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
104104

105105
```groovy
106106
bundleCommand = "ram-bundle"

website/blog/2021-03-12-version-0.64.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const MyComponent = props => {
5656
};
5757
```
5858

59-
More information about Inline Requires is available in the [Performance documentation](/docs/ram-bundles-inline-requires#inline-requires).
59+
More information about Inline Requires is available in the [Performance documentation](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires#inline-requires).
6060

6161
## View Hermes traces with Chrome
6262

website/static/_redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
/docs/new-architecture-app-renderer-android https://github.com/reactwg/react-native-new-architecture#guides
6565
/docs/new-architecture-app-modules-ios https://github.com/reactwg/react-native-new-architecture#guides
6666
/docs/new-architecture-app-renderer-ios https://github.com/reactwg/react-native-new-architecture#guides
67-
/docs/ram-bundles-inline-requires /docs/optimizing-javascript-loading
67+
https://reactnative.dev/docs/0.74/ram-bundles-inline-requires /docs/optimizing-javascript-loading
6868
/docs/next/ram-bundles-inline-requires /docs/next/optimizing-javascript-loading
6969

7070
# Architecture pages move to unversioned docs

website/versioned_docs/version-0.71/react-native-gradle-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ nodeExecutableAndArgs = ["node"]
100100

101101
### `bundleCommand`
102102

103-
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](/docs/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
103+
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
104104

105105
```groovy
106106
bundleCommand = "ram-bundle"

website/versioned_docs/version-0.72/react-native-gradle-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ nodeExecutableAndArgs = ["node"]
100100

101101
### `bundleCommand`
102102

103-
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](/docs/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
103+
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
104104

105105
```groovy
106106
bundleCommand = "ram-bundle"

website/versioned_docs/version-0.73/react-native-gradle-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ nodeExecutableAndArgs = ["node"]
100100

101101
### `bundleCommand`
102102

103-
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](/docs/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
103+
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
104104

105105
```groovy
106106
bundleCommand = "ram-bundle"

website/versioned_docs/version-0.74/react-native-gradle-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ nodeExecutableAndArgs = ["node"]
100100

101101
### `bundleCommand`
102102

103-
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](/docs/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
103+
This is the name of the `bundle` command to be invoked when creating the bundle for your app. That's useful if you're using [RAM Bundles](https://reactnative.dev/docs/0.74/ram-bundles-inline-requires). By default is `bundle` but can be customized to add extra flags as follows:
104104

105105
```groovy
106106
bundleCommand = "ram-bundle"
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
## Installing dependencies
2+
3+
You will need Node, the React Native command line interface, a JDK, and Android Studio.
4+
5+
While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.
6+
7+
<h3>Node</h3>
8+
9+
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 18 or newer.
10+
11+
<h3>Java Development Kit</h3>
12+
13+
React Native currently recommends version 17 of the Java SE Development Kit (JDK). You may encounter problems using higher JDK versions. You may download and install [OpenJDK](https://openjdk.java.net) from [AdoptOpenJDK](https://adoptopenjdk.net/) or your system packager.
14+
15+
<h3>Android development environment</h3>
16+
17+
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.
18+
19+
<h4 id="android-studio">1. Install Android Studio</h4>
20+
21+
[Download and install Android Studio](https://developer.android.com/studio/index.html). While on Android Studio installation wizard, make sure the boxes next to all of the following items are checked:
22+
23+
- `Android SDK`
24+
- `Android SDK Platform`
25+
- `Android Virtual Device`
26+
27+
Then, click "Next" to install all of these components.
28+
29+
> If the checkboxes are grayed out, you will have a chance to install these components later on.
30+
31+
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
32+
33+
<h4 id="android-sdk">2. Install the Android SDK</h4>
34+
35+
Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the `Android 14 (UpsideDownCake)` SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
36+
37+
To do that, open Android Studio, click on "Configure" button and select "SDK Manager".
38+
39+
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
40+
41+
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 14 (UpsideDownCake)` entry, then make sure the following items are checked:
42+
43+
- `Android SDK Platform 34`
44+
- `Intel x86 Atom_64 System Image` or `Google APIs Intel x86 Atom System Image`
45+
46+
Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that `34.0.0` is selected.
47+
48+
Finally, click "Apply" to download and install the Android SDK and related build tools.
49+
50+
<h4>3. Configure the ANDROID_HOME environment variable</h4>
51+
52+
The React Native tools require some environment variables to be set up in order to build apps with native code.
53+
54+
Add the following lines to your `$HOME/.bash_profile` or `$HOME/.bashrc` (if you are using `zsh` then `~/.zprofile` or `~/.zshrc`) config file:
55+
56+
```shell
57+
export ANDROID_HOME=$HOME/Android/Sdk
58+
export PATH=$PATH:$ANDROID_HOME/emulator
59+
export PATH=$PATH:$ANDROID_HOME/platform-tools
60+
```
61+
62+
> `.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
63+
64+
Type `source $HOME/.bash_profile` for `bash` or `source $HOME/.zprofile` to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
65+
66+
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
67+
68+
<h3>Watchman</h3>
69+
70+
Follow the [Watchman installation guide](https://facebook.github.io/watchman/docs/install#buildinstall) to compile and install Watchman from source.
71+
72+
> [Watchman](https://facebook.github.io/watchman/docs/install) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
73+
74+
<h2>Preparing the Android device</h2>
75+
76+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
77+
78+
Either way, you will need to prepare the device to run Android apps for development.
79+
80+
<h3>Using a physical device</h3>
81+
82+
If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions [here](running-on-device.md).
83+
84+
<h3>Using a virtual device</h3>
85+
86+
If you use Android Studio to open `./AwesomeProject/android`, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:
87+
88+
![Android Studio AVD Manager](/docs/assets/GettingStartedAndroidStudioAVD.png)
89+
90+
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **UpsideDownCake** API Level 34 image.
91+
92+
> We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
93+
94+
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
95+
96+
<h3>That's it!</h3>
97+
98+
Congratulations! You successfully set up your development environment.
99+
100+
<center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></img></center>
101+
102+
<h2>Now what?</h2>
103+
104+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
105+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
## Installing dependencies
2+
3+
You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio.
4+
5+
While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.
6+
7+
<h3>Node &amp; Watchman</h3>
8+
9+
We recommend installing Node and Watchman using [Homebrew](https://brew.sh/). Run the following commands in a Terminal after installing Homebrew:
10+
11+
```shell
12+
brew install node
13+
brew install watchman
14+
```
15+
16+
If you have already installed Node on your system, make sure it is Node 18 or newer.
17+
18+
[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.
19+
20+
<h3>Java Development Kit</h3>
21+
22+
We recommend installing the OpenJDK distribution called Azul **Zulu** using [Homebrew](https://brew.sh/). Run the following commands in a Terminal after installing Homebrew:
23+
24+
```shell
25+
brew install --cask zulu@17
26+
27+
# Get path to where cask was installed to double-click installer
28+
brew info --cask zulu@17
29+
```
30+
31+
After the JDK installation, add or update your `JAVA_HOME` environment variable in `~/.zshrc` (or in `~/.bash_profile`) .
32+
33+
If you used above steps, JDK will likely be located at `/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home`:
34+
35+
```shell
36+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
37+
```
38+
39+
The Zulu OpenJDK distribution offers JDKs for **both Intel and M1 Macs**. This will make sure your builds are faster on M1 Macs compared to using an Intel-based JDK.
40+
41+
If you have already installed JDK on your system, we recommend JDK 17. You may encounter problems using higher JDK versions.
42+
43+
<h3>Android development environment</h3>
44+
45+
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.
46+
47+
<h4 id="android-studio">1. Install Android Studio</h4>
48+
49+
[Download and install Android Studio](https://developer.android.com/studio/index.html). While on Android Studio installation wizard, make sure the boxes next to all of the following items are checked:
50+
51+
- `Android SDK`
52+
- `Android SDK Platform`
53+
- `Android Virtual Device`
54+
55+
Then, click "Next" to install all of these components.
56+
57+
> If the checkboxes are grayed out, you will have a chance to install these components later on.
58+
59+
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
60+
61+
<h4 id="android-sdk">2. Install the Android SDK</h4>
62+
63+
Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the `Android 14 (UpsideDownCake)` SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
64+
65+
To do that, open Android Studio, click on "More Actions" button and select "SDK Manager".
66+
67+
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png)
68+
69+
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
70+
71+
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 14 (UpsideDownCake)` entry, then make sure the following items are checked:
72+
73+
- `Android SDK Platform 34`
74+
- `Intel x86 Atom_64 System Image` or `Google APIs Intel x86 Atom System Image` or (for Apple M1 Silicon) `Google APIs ARM 64 v8a System Image`
75+
76+
Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that `34.0.0` is selected.
77+
78+
Finally, click "Apply" to download and install the Android SDK and related build tools.
79+
80+
<h4>3. Configure the ANDROID_HOME environment variable</h4>
81+
82+
The React Native tools require some environment variables to be set up in order to build apps with native code.
83+
84+
Add the following lines to your `~/.zprofile` or `~/.zshrc` (if you are using `bash`, then `~/.bash_profile` or `~/.bashrc`) config file:
85+
86+
```shell
87+
export ANDROID_HOME=$HOME/Library/Android/sdk
88+
export PATH=$PATH:$ANDROID_HOME/emulator
89+
export PATH=$PATH:$ANDROID_HOME/platform-tools
90+
```
91+
92+
Run `source ~/.zprofile` (or `source ~/.bash_profile` for `bash`) to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
93+
94+
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
95+
96+
<h2>Preparing the Android device</h2>
97+
98+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
99+
100+
Either way, you will need to prepare the device to run Android apps for development.
101+
102+
<h3>Using a physical device</h3>
103+
104+
If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions [here](running-on-device.md).
105+
106+
<h3>Using a virtual device</h3>
107+
108+
If you use Android Studio to open `./AwesomeProject/android`, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:
109+
110+
![Android Studio AVD Manager](/docs/assets/GettingStartedAndroidStudioAVD.png)
111+
112+
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **UpsideDownCake** API Level 34 image.
113+
114+
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
115+
116+
<h3>That's it!</h3>
117+
118+
Congratulations! You successfully set up your development environment.
119+
120+
<center><img src="/docs/assets/GettingStartedCongratulations.png" width="150"></img></center>
121+
122+
<h2>Now what?</h2>
123+
124+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
125+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).

0 commit comments

Comments
 (0)