Skip to content

Commit cd6c2fa

Browse files
authored
Merge pull request #766 from facebook/main
0.73 sync 1029
2 parents dc5bd29 + 0c6ed62 commit cd6c2fa

File tree

75 files changed

+982
-736
lines changed

Some content is hidden

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

75 files changed

+982
-736
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ Docusaurus keeps track of the list of versions for the site in the `website/vers
121121

122122
#### Cutting a new version
123123

124+
##### After RC
125+
126+
The React Native website lints and typechecks documents in "next". The version of React Native used by the linter should be updated before a release for consistency and to catch any documents/examples where APIs have changed.
127+
128+
This can be done by updating the `package.json` and configuration files in `script/lint-examples` the same way a React Native application would be updated. The diff of these files can be seen using a tool like [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.71.0).
129+
130+
##### After Release
131+
124132
1. `cd react-native-website` to go into the project root.
125133
1. `cd website` to go into the website portion of the project.
126134
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.

docs/_getting-started-linux-android.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ While you can use any editor of your choice to develop your app, you will need t
99

1010
<h3>Node</h3>
1111

12-
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 16 or newer.
12+
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 18 or newer.
1313

1414
<h3>Java Development Kit</h3>
1515

@@ -39,7 +39,7 @@ Android Studio installs the latest Android SDK by default. Building a React Nati
3939

4040
To do that, open Android Studio, click on "Configure" button and select "SDK Manager".
4141

42-
> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
42+
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
4343
4444
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 13 (Tiramisu)` entry, then make sure the following items are checked:
4545

@@ -66,7 +66,7 @@ export PATH=$PATH:$ANDROID_HOME/platform-tools
6666
6767
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`.
6868

69-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
69+
> 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**.
7070
7171
<h3>Watchman</h3>
7272

docs/_getting-started-macos-android.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ brew install node
1616
brew install watchman
1717
```
1818

19-
If you have already installed Node on your system, make sure it is Node 16 or newer.
19+
If you have already installed Node on your system, make sure it is Node 18 or newer.
2020

2121
[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.
2222

@@ -64,7 +64,7 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
6464

6565
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png)
6666

67-
> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
67+
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
6868
6969
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 13 (Tiramisu)` entry, then make sure the following items are checked:
7070

@@ -89,7 +89,7 @@ export PATH=$PATH:$ANDROID_HOME/platform-tools
8989

9090
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`.
9191

92-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
92+
> 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**.
9393
9494
<h3>React Native Command Line Interface</h3>
9595

docs/_getting-started-macos-ios.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ brew install node
1616
brew install watchman
1717
```
1818

19-
If you have already installed Node on your system, make sure it is Node 16 or newer.
19+
If you have already installed Node on your system, make sure it is Node 18 or newer.
2020

2121
[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.
2222

@@ -36,6 +36,8 @@ You will also need to install the Xcode Command Line Tools. Open Xcode, then cho
3636

3737
To install a simulator, open **Xcode > Settings... (or Preferences...)** and select the **Platforms (or Components)** tab. Select a simulator with the corresponding version of iOS you wish to use.
3838

39+
If you are using Xcode version 14.0 or greater than to install a simulator, open **Xcode > Settings > Platforms** tab, then click "+" icon and select **iOS…** option.
40+
3941
#### CocoaPods
4042

4143
[CocoaPods](https://cocoapods.org/) is one of the dependency management system available for iOS. CocoaPods is a Ruby [gem](https://en.wikipedia.org/wiki/RubyGems). You can install CocoaPods using the version of Ruby that ships with the latest version of macOS.

docs/_getting-started-windows-android.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Open an Administrator Command Prompt (right click Command Prompt and select "Run
2121
choco install -y nodejs-lts microsoft-openjdk17
2222
```
2323

24-
If you have already installed Node on your system, make sure it is Node 16 or newer. If you already have a JDK on your system, we recommend JDK17. You may encounter problems using higher JDK versions.
24+
If you have already installed Node on your system, make sure it is Node 18 or newer. If you already have a JDK on your system, we recommend JDK17. You may encounter problems using higher JDK versions.
2525

2626
> You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
2727
@@ -54,7 +54,7 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
5454

5555
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeWindows.png)
5656

57-
> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
57+
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
5858
5959
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 13 (Tiramisu)` entry, then make sure the following items are checked:
6060

@@ -82,7 +82,7 @@ The SDK is installed, by default, at the following location:
8282
%LOCALAPPDATA%\Android\Sdk
8383
```
8484

85-
You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Appearance & Behavior****System Settings****Android SDK**.
85+
You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
8686

8787
Open a new Command Prompt window to ensure the new environment variable is loaded before proceeding to the next step.
8888

docs/debugging-release-builds.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
id: debugging-release-builds
3+
title: Debugging Release Builds
4+
---
5+
6+
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
7+
8+
## Symbolicating a stack trace
9+
10+
If a React Native app throws an unhandled exception in a release build, the output may be obfuscated and hard to read.
11+
12+
```shell
13+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
14+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: Process: com.awesomeproject, PID: 18979 07-15 10:58:25.820 18979 18998 E AndroidRuntime: com.facebook.react.common.JavascriptException: Failed, js engine: hermes, stack:
15+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132161
16+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132084
17+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: f@1:131854
18+
07-15 10:58:25.820 18979 18998 E AndroidRuntime: anonymous@1:131119
19+
```
20+
21+
In the above stack trace, entries like `p@1:132161` are minified function names and bytecode offsets. To debug these calls, we want to translate these into file, line, and function name, e.g. `AwesomeProject/App.js:54:initializeMap`. This is known as **symbolication.**
22+
23+
You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](https://npmjs.com/package/metro-symbolicate).
24+
25+
### Enabling source maps
26+
27+
Source maps are required to symbolicate stack traces. Make sure that source maps are enabled within the build config for the target platform.
28+
29+
<Tabs groupId="platform" queryString defaultValue={constants.defaultPlatform} values={constants.platforms} className="pill-tabs">
30+
<TabItem value="android">
31+
32+
:::info
33+
On Android, source maps are **enabled** by default.
34+
:::
35+
36+
To enable source map generation, ensure the following `hermesFlags` are present in `android/app/build.gradle`.
37+
38+
```groovy
39+
react {
40+
hermesFlags = ["-O", "-output-source-map"]
41+
}
42+
```
43+
44+
If done correctly you should see the output location of the source map during Metro build output.
45+
46+
```text
47+
Writing bundle output to:, android/app/build/generated/assets/react/release/index.android.bundle
48+
Writing sourcemap output to:, android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
49+
```
50+
51+
</TabItem>
52+
<TabItem value="ios">
53+
54+
:::info
55+
On iOS, source maps are **disabled** by default. Use the following instructions to enable them.
56+
:::
57+
58+
To enable source map generation:
59+
60+
- Open Xcode and edit the build phase "Bundle React Native code and images".
61+
- Above the other exports, add a `SOURCEMAP_FILE` entry with the desired output path.
62+
63+
```diff
64+
+ SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map";
65+
WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
66+
```
67+
68+
If done correctly you should see the output location of the source map during Metro build output.
69+
70+
```text
71+
Writing bundle output to:, Build/Intermediates.noindex/ArchiveIntermediates/application/BuildProductsPath/Release-iphoneos/main.jsbundle
72+
Writing sourcemap output to:, Build/Intermediates.noindex/ArchiveIntermediates/application/BuildProductsPath/Release-iphoneos/main.jsbundle.map
73+
```
74+
75+
</TabItem>
76+
</Tabs>
77+
78+
### Using `metro-symbolicate`
79+
80+
With source maps being generated, we can now translate our stack traces.
81+
82+
```shell
83+
# Print usage instructions
84+
npx metro-symbolicate
85+
86+
# From a file containing the stack trace
87+
npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map < stacktrace.txt
88+
89+
# From adb logcat (Android)
90+
adb logcat -d | npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
91+
```
92+
93+
### Notes on source maps
94+
95+
- Multiple source maps may be generated by the build process. Make sure to use the one in the location shown in the examples.
96+
- Make sure that the source map you use corresponds to the exact commit of the crashing app. Small changes in source code can cause large differences in offsets.
97+
- If `metro-symbolicate` exits immediately with success, make sure the input comes from a pipe or redirection and not from a terminal.

0 commit comments

Comments
 (0)