Skip to content

0.73 sync 1029 #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
59efc87
change file extension to ts in turbo modules creation guide (#3850)
groot007 Sep 17, 2023
ba59698
Fix link to standalone react-devtools (#3854)
Randall71 Sep 22, 2023
4d8a2e5
fix(getting started): update Android SDK path in Android Studio (#3856)
elias-pap Sep 22, 2023
111be97
Delist unmaintained Out-of-Tree Platforms (#3855)
gabrieldonadel Sep 22, 2023
4727e48
Added description to add simulator in Xcode version 14.0 or greater …
gyanendrasinghpanwar Sep 25, 2023
c5e9bab
Update debugger types in release test cases (#3858)
huntie Sep 26, 2023
ff4233d
Fix formatting (followup to #3858) (#3859)
huntie Sep 26, 2023
12a04bc
adjust SnackPlayer height and presentation (#3864)
Simek Oct 1, 2023
c7d2045
Update navigation.md to point to the documentation for the various na…
JuszJo Oct 3, 2023
5b5b8cb
update Docusaurus to beta release, versions page tweaks (#3865)
Simek Oct 6, 2023
f96410d
Bump postcss from 8.4.28 to 8.4.31 (#3871)
dependabot[bot] Oct 6, 2023
e4ba741
[docs] Reorganise docs sidebar (#3876)
huntie Oct 11, 2023
af27da0
fix: update the default value of textBreakStrategy to highQuality (#3…
aswin-s Oct 11, 2023
132fce2
Update network.md (#3886)
ewolfe Oct 16, 2023
5bec0c6
Improve instructions for enabling app transport security (#3878)
elibroftw Oct 17, 2023
f313771
Add section on updating linting tools (#3506)
NickGerleman Oct 17, 2023
97d99cf
Updating docs to reflect bumping node from 16 to 18 (#3748)
arushikesarwani94 Oct 17, 2023
8fc2377
refactor[react-devtools]: update docs for React DevTools (#3887)
hoxyq Oct 18, 2023
440a0a2
Bump @babel/traverse from 7.22.10 to 7.23.2 (#3891)
dependabot[bot] Oct 19, 2023
d872c42
[docs] Create "Debugging Release Builds" guide, consolidate existing …
huntie Oct 19, 2023
38b5ae9
Bump react-devtools-core from 4.28.0 to 4.28.4 (#3892)
dependabot[bot] Oct 21, 2023
f6360b2
[docs] Overhaul "Debugging Basics" guide (#3898)
huntie Oct 24, 2023
300b602
Fix a backlink on hermes-as-the-default (#3899)
Huxpro Oct 25, 2023
0094817
[docs] Add Other Debugging Methods guide (#3900)
huntie Oct 25, 2023
36caace
Recover debugging native code section (#3895)
tuliocll Oct 25, 2023
0c6ed62
[docs] Refresh React DevTools visuals, condense formatting (#3901)
huntie Oct 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ Docusaurus keeps track of the list of versions for the site in the `website/vers

#### Cutting a new version

##### After RC

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.

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).

##### After Release

1. `cd react-native-website` to go into the project root.
1. `cd website` to go into the website portion of the project.
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
Expand Down
6 changes: 3 additions & 3 deletions docs/_getting-started-linux-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ While you can use any editor of your choice to develop your app, you will need t

<h3>Node</h3>

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

<h3>Java Development Kit</h3>

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

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

> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks** → **Android SDK**.

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:

Expand All @@ -66,7 +66,7 @@ export PATH=$PATH:$ANDROID_HOME/platform-tools

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

> 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**.
> 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**.

<h3>Watchman</h3>

Expand Down
6 changes: 3 additions & 3 deletions docs/_getting-started-macos-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ brew install node
brew install watchman
```

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

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

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

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

> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks** → **Android SDK**.

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:

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

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

> 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**.
> 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**.

<h3>React Native Command Line Interface</h3>

Expand Down
4 changes: 3 additions & 1 deletion docs/_getting-started-macos-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ brew install node
brew install watchman
```

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

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

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

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.

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.

#### CocoaPods

[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.
Expand Down
6 changes: 3 additions & 3 deletions docs/_getting-started-windows-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Open an Administrator Command Prompt (right click Command Prompt and select "Run
choco install -y nodejs-lts microsoft-openjdk17
```

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.
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.

> You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).

Expand Down Expand Up @@ -54,7 +54,7 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK

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

> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks** → **Android SDK**.

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:

Expand Down Expand Up @@ -82,7 +82,7 @@ The SDK is installed, by default, at the following location:
%LOCALAPPDATA%\Android\Sdk
```

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

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

Expand Down
97 changes: 97 additions & 0 deletions docs/debugging-release-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
id: debugging-release-builds
title: Debugging Release Builds
---

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';

## Symbolicating a stack trace

If a React Native app throws an unhandled exception in a release build, the output may be obfuscated and hard to read.

```shell
07-15 10:58:25.820 18979 18998 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
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:
07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132161
07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132084
07-15 10:58:25.820 18979 18998 E AndroidRuntime: f@1:131854
07-15 10:58:25.820 18979 18998 E AndroidRuntime: anonymous@1:131119
```

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.**

You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](http://npmjs.com/package/metro-symbolicate).

### Enabling source maps

Source maps are required to symbolicate stack traces. Make sure that source maps are enabled within the build config for the target platform.

<Tabs groupId="platform" queryString defaultValue={constants.defaultPlatform} values={constants.platforms} className="pill-tabs">
<TabItem value="android">

:::info
On Android, source maps are **enabled** by default.
:::

To enable source map generation, ensure the following `hermesFlags` are present in `android/app/build.gradle`.

```groovy
react {
hermesFlags = ["-O", "-output-source-map"]
}
```

If done correctly you should see the output location of the source map during Metro build output.

```text
Writing bundle output to:, android/app/build/generated/assets/react/release/index.android.bundle
Writing sourcemap output to:, android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
```

</TabItem>
<TabItem value="ios">

:::info
On iOS, source maps are **disabled** by default. Use the following instructions to enable them.
:::

To enable source map generation:

- Open Xcode and edit the build phase "Bundle React Native code and images".
- Above the other exports, add a `SOURCEMAP_FILE` entry with the desired output path.

```diff
+ SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map";
WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
```

If done correctly you should see the output location of the source map during Metro build output.

```text
Writing bundle output to:, Build/Intermediates.noindex/ArchiveIntermediates/application/BuildProductsPath/Release-iphoneos/main.jsbundle
Writing sourcemap output to:, Build/Intermediates.noindex/ArchiveIntermediates/application/BuildProductsPath/Release-iphoneos/main.jsbundle.map
```

</TabItem>
</Tabs>

### Using `metro-symbolicate`

With source maps being generated, we can now translate our stack traces.

```shell
# Print usage instructions
npx metro-symbolicate

# From a file containing the stack trace
npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map < stacktrace.txt

# From adb logcat (Android)
adb logcat -d | npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
```

### Notes on source maps

- Multiple source maps may be generated by the build process. Make sure to use the one in the location shown in the examples.
- 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.
- If `metro-symbolicate` exits immediately with success, make sure the input comes from a pipe or redirection and not from a terminal.
Loading