| cbe3b51b | 31-May-2021 |
Kudo Chien <[email protected]> |
[dev-menu] Integrate javascript inspector (#13041)
# Why
To support hermes inspector in dev-menu
# How
## Add a menu item
in expo/expo-cli#3495, we added `/inspector` endpoint to dev-serve
[dev-menu] Integrate javascript inspector (#13041)
# Why
To support hermes inspector in dev-menu
# How
## Add a menu item
in expo/expo-cli#3495, we added `/inspector` endpoint to dev-server which supports querying or opening inspector.
and in this pr, we added a menu item to integrate the function.
## dev-menu and dev-launcher fixes
- dev-menu adds an extra EXDevMenuApp bundle which will make sources in inspector missing the target source code.
there is a workaround and see code comment for details.
- the debugging app will create a different connection to metro other than packager. to make dev-launcher works with a remote packager, we should also intercept the inspector connection.
# Test Plan
### BareExpo + JSC
1. use latest expo-cli to run `/path/to/expo-cli/packages/expo-cli/bin/expo.js start --dev-client`
2. expect to show the menu item in disabled state.
### BareExpo + Hermes
1. use latest expo-cli to run `/path/to/expo-cli/packages/expo-cli/bin/expo.js start --dev-client`
2. yarn add '[email protected]' # Fix inspecting crash issue
3. expect to show the menu item, clicking the item will open an inspector in chrome or edge.
4. expect in the inspector sources tab, there is BareExpo's javascript source code.
### BareSandbox + Hermes
1. use latest expo-cli to run `/path/to/expo-cli/packages/expo-cli/bin/expo.js start --dev-client`
2. yarn add '[email protected]' # Fix inspecting crash issue
3. Update `apps/bare-sandbox/android/app/build.gradle` to make `enableHermes: true`
4. adb reverse tcp:8081 --remove # make sure there is no localhost:8081 tunnel for inspector connection
5. expect to show the menu item, clicking the item will open an inspector in chrome or edge.
6. expect in the inspector sources tab, there is BareSandbox's javascript source code.
show more ...
|