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
Copy file name to clipboardExpand all lines: docs/hermes.md
+2-138Lines changed: 2 additions & 138 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,7 @@ Hermes is used by default by React Native and no additional configuration is req
15
15
## Bundled Hermes
16
16
17
17
React Native comes with a **bundled version** of Hermes.
18
-
We will be building a version of Hermes for you whenever we release a new version of React Native. This will make sure you're consuming a version of Hermes which is fully compatible with the version of React Native you're using.
19
-
20
-
Historically, we had problems with matching versions of Hermes with versions of React Native. This fully eliminates this problem, and offers users a JS engine that is compatible with the specific React Native version.
18
+
We building a version of Hermes for you whenever we release a new version of React Native. This will make sure you're consuming a version of Hermes which is fully compatible with the version of React Native you're using.
21
19
22
20
This change is fully transparent to users of React Native. You can still disable Hermes using the command described in this page.
23
21
You can [read more about the technical implementation on this page](/architecture/bundled-hermes).
@@ -88,136 +86,7 @@ yarn ios --mode Release
88
86
</TabItem>
89
87
</Tabs>
90
88
91
-
This will compile JavaScript to bytecode during build time which will improve your app's startup speed on device.
92
-
93
-
## Debugging JS on Hermes using Google Chrome's DevTools
94
-
95
-
Hermes supports the Chrome debugger by implementing the Chrome inspector protocol. This means Chrome's tools can be used to directly debug JavaScript running on Hermes, on an emulator or on a real, physical, device.
96
-
97
-
:::info
98
-
Note that this is very different with the deprecated "Remote JS Debugging" from the In-App Dev Menu documented in the [Debugging](debugging#remote-debugging) section, which actually runs the JS code on Chrome's V8 on your development machine (laptop or desktop) instead of connecting to the JS engine running the app on your device.
99
-
:::
100
-
101
-
Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://metrobundler.dev/docs/configuration). When running `yarn start` the address is written to stdout on startup.
102
-
103
-
Once you know where the Metro server is listening, you can connect with Chrome using the following steps:
104
-
105
-
1. Navigate to `chrome://inspect` in a Chrome browser instance.
106
-
107
-
2. Use the `Configure...` button to add the Metro server address (typically `localhost:8081` as described above).
108
-
109
-

110
-
111
-

112
-
113
-
3. You should now see a "Hermes React Native" target with an "inspect" link which can be used to bring up debugger. If you don't see the "inspect" link, make sure the Metro server is running. 
114
-
115
-
4. You can now use the Chrome debug tools. For example, to breakpoint the next time some JavaScript is run, click on the pause button and trigger an action in your app which would cause JavaScript to execute. 
116
-
117
-
## Enabling Hermes on Older Versions of React Native
118
-
119
-
Hermes is the default engine as of React Native 0.70. This section explains how to enable Hermes on older versions of React Native.
120
-
First, ensure you're using at least version 0.60.4 of React Native to enable Hermes on Android or 0.64 of React Native to enable Hermes on iOS.
121
-
122
-
If you have an existing app based on an earlier version of React Native, you will have to upgrade it first. See [Upgrading to new React Native Versions](/docs/upgrading) for how to do this. After upgrading the app, make sure everything works before trying to switch to Hermes.
123
-
124
-
:::caution Note for React Native compatibility
125
-
Each Hermes release is aimed at a specific RN version. The rule of thumb is to always follow [Hermes releases](https://github.com/facebook/hermes/releases) strictly.
126
-
Version mismatch can result in instant crash of your apps in the worst case scenario.
127
-
:::
128
-
129
-
:::info Note for Windows users
130
-
Hermes requires [Microsoft Visual C++ 2015 Redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
131
-
:::
132
-
133
-
### Android
134
-
135
-
Edit your `android/gradle.properties` file and make sure `hermesEnabled` is true:
136
-
137
-
```diff
138
-
# Use this property to enable or disable the Hermes JS engine.
139
-
# If set to false, you will be using JSC instead.
140
-
hermesEnabled=true
141
-
```
142
-
143
-
:::note
144
-
This property was added in React Native 0.71. If you can't find it in your `gradle.properties` file, please refer to the documentation for the corresponding React Native version you're using.
145
-
:::
146
-
147
-
Also, if you're using ProGuard, you will need to add these rules in `proguard-rules.pro` :
148
-
149
-
```
150
-
-keep class com.facebook.hermes.unicode.** { *; }
151
-
-keep class com.facebook.jni.** { *; }
152
-
```
153
-
154
-
Next, if you've already built your app at least once, clean the build:
155
-
156
-
```shell
157
-
$ cd android && ./gradlew clean
158
-
```
159
-
160
-
That's it! You should now be able to develop and deploy your app as usual:
0 commit comments