History log of /expo/packages/@expo/cli/src/start/server/metro/inspector-proxy/device.ts (Results 1 – 8 of 8)
Revision Date Author Comments
# 8a424beb 11-Aug-2023 James Ide <[email protected]>

[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)

Why
---
Prettier 3 is out. Add support for it with this linter config.

**Note for reviewer:** the first commit is the one with th

[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)

Why
---
Prettier 3 is out. Add support for it with this linter config.

**Note for reviewer:** the first commit is the one with the actual
changes. The rest of this PR are changes to get the linter passing
(mostly autofix).

How
---
Update eslint-config-prettier and eslint-plugin-prettier. To address
deprecation warnings, also update typescript-eslint/parser and
typescript-eslint/eslint-plugin.
Because of an update to typescript-eslint/parser, we need to suppress
deprecation warnings (documented in a comment).

Regenerated test snapshots. Due to the upgraded dependencies, typecasts
and optional chaining are now auto-fixable by lint. This converts
warnings into autofixes.

Test Plan
---
`yarn test` in the linter config. Run `expotools check --all --fix-lint
--no-build --no-test --no-uniformity-check` to try this config on the
whole repo.

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 102b7a2a 05-Jul-2023 Cedric van Putten <[email protected]>

refactor(cli): drop extraneous source fetch workaround for `metro@<0.75.1` (#23259)

# Why

This was required for SDK 48, but with 49 we are using a newer Metro
that has this workaround built-in.

refactor(cli): drop extraneous source fetch workaround for `metro@<0.75.1` (#23259)

# Why

This was required for SDK 48, but with 49 we are using a newer Metro
that has this workaround built-in. ([see
commit](https://github.com/facebook/metro/commit/6690b393cc1812af02f8eb20853504f0a6188a83))

# How

- Dropped the `DebuggerScriptSource` handler
- Updated tests

# Test Plan

- Try debugging the code with the vscode extension

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 033ea1fc 04-Jul-2023 Cedric van Putten <[email protected]>

refactor(cli): disable inspector proxy inline source maps for vscode only (#23258)

# Why

With SDK 49, I noticed a multi-second delay in breakpoints getting
bound. This is likely due to [Metro in

refactor(cli): disable inspector proxy inline source maps for vscode only (#23258)

# Why

With SDK 49, I noticed a multi-second delay in breakpoints getting
bound. This is likely due to [Metro inlining sourcemaps as base64
strings](https://github.com/facebook/metro/commit/6690b393cc1812af02f8eb20853504f0a6188a83)
for tools like the chrome debugger. In practice, it generates a huge
base64 string that causes this delay when decoding in vscode.

# How

- Added `debuggerType` to connect to the inspector proxy as a certain
debugger type (e.g. `vscode` or `generic` <- default)
- Added override for `Debugger.scriptParsed` to disable inline
sourcemaps for vscode only.

# Test Plan

~~TBD, since this also requires an update in vscode-expo (add the
`type=vscode` as query param when connecting to the inspector proxy).~~

This is now included in `[email protected]`

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# f5fa30f6 16-Jun-2023 Cedric van Putten <[email protected]>

feature(cli): allow client-side device ids to reuse debugger sessions when restarting app (#22742)

# Why

After using the debugger for some time, I noticed a really annoying
behavior when the app

feature(cli): allow client-side device ids to reuse debugger sessions when restarting app (#22742)

# Why

After using the debugger for some time, I noticed a really annoying
behavior when the app crashes or is restarted manually. See
https://github.com/facebook/metro/issues/985 for more info.

# How

This adds support for client-side unique device identifiers, such as
"installation ids" or "device ids". Similarly to future support within
Metro: https://github.com/facebook/metro/pull/991

# Test Plan

See updated tests, and the test plan at
https://github.com/facebook/metro/pull/991

> - Create a new project, and enable building from source on both
Android & iOS
> - **android**: edit [this
file](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java#L282-L289)
in `node_modules/react-native` and add a hardcoded
`&device=testingandroid` query param.
> - **ios**: edit [this
file](https://github.com/facebook/react-native/blob/main/packages/react-native/React/DevSupport/RCTInspectorDevServerHelper.mm#L43-L53)
in `node_modules/react-naive` and add a hardcoded `&device=testingios`
query param.
> - Connect the debugger to the running app
> - Force close the app, which should cause a "reconnect" warning in the
debugger
> - Open the app again, and press "reconnect" in the debugger
> - _Due to the stable identifiers, the URL won't change and the above
scenario should work fine_

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

show more ...


# 03d43e7d 28-Mar-2023 Cedric van Putten <[email protected]>

feature(cli): add basic `Page.reload` support to reload the app from inspector (#21827)

# Why

This implements the `Page.reload` CDP event, to reload the app itself.

> Would be nice if there is

feature(cli): add basic `Page.reload` support to reload the app from inspector (#21827)

# Why

This implements the `Page.reload` CDP event, to reload the app itself.

> Would be nice if there is a way to send this to _JUST_ the device you
are inspecting. But not sure what socket connection that would be, don't
think it's the actual device socket in the inspector (that's inspector
messages only).

# How

- Provided the reference of `MetroBundlerDevServer` to the inspector
- Called `MetroBundlerDevServer.broadcastMessage('reload')`

# Test Plan

- Open chrome inspector (`j`)
- Anywhere in the inspector, press `cmd+r`

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 6d2ad561 28-Mar-2023 Cedric van Putten <[email protected]>

fix(cli): load `Debugger.getScriptSource` requests when using lan or tunnel (#21825)

# Why

This fixes the `Debugger.getScriptSource` responses in two different
ways.

1. For `metro@<0.75.1`, w

fix(cli): load `Debugger.getScriptSource` requests when using lan or tunnel (#21825)

# Why

This fixes the `Debugger.getScriptSource` responses in two different
ways.

1. For `metro@<0.75.1`, we use the custom `DebuggerScriptSourceHandler`
2. For `metro@>=0.75.1`, we can rely on just the `_fetchText` override

# How

Do not block the fetch request when running on lan or tunnel (no
`localhost`).

# Test Plan

- See added tests.
- Open Chrome inspector (`j`)
- Go to sources
- Try to load the `index.bundle` or `expo/AppEntry.bundle` file in the
inspector
- Actual raw bundle file should be visible

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

show more ...


# b210db99 10-Mar-2023 Cedric van Putten <[email protected]>

feature(cli): add vscode compatibility to inspector proxy (#21560)

# Why

Builds upon #21449

This adds a handler that makes sure the `vscode-js-debug` extension can
be used with the custom ins

feature(cli): add vscode compatibility to inspector proxy (#21560)

# Why

Builds upon #21449

This adds a handler that makes sure the `vscode-js-debug` extension can
be used with the custom inspector proxy. These changes should NOT
interfere with the other debuggers.

# How

- Added vscode compatibility handler
- Add missing `description` to function nodes, as required by
vscode-js-debug
_(before https://github.com/microsoft/vscode-js-debug/issues/1583)_
- Respond to `Debugger.getPossibleBreakpoints`, Hermes doesn't respond
to this message
- ~~Filter out "useless" `callFrames` when debugging~~
**Moved back to PR, we need to limit filtering**
→ https://github.com/expo/expo/pull/21663
- Avoid Hermes binding breakpoints to wrong locations, before sourcemap
is loaded
→ https://github.com/expo/expo/pull/21631
- Avoid Hermes crashing by disabling `Runtime.getProperties` on `symbol`
types
→ https://github.com/expo/expo/pull/21639

# Test Plan

- See tests
- ~~Test project with vscode, see [this
repository](https://github.com/byCedric/vscode-js-debug-issue-1583) for
a test project.~~
- See https://github.com/expo/expo/pull/21641 to test `apps/bare-expo`

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 5234fe38 08-Mar-2023 Cedric van Putten <[email protected]>

feature(cli): add custom inspector proxy based on `metro-inspector-proxy` (#21449)

# Why

Fixes ENG-7467

Related #21265

This is an initial draft to extend the CDP functionality of
`metro-in

feature(cli): add custom inspector proxy based on `metro-inspector-proxy` (#21449)

# Why

Fixes ENG-7467

Related #21265

This is an initial draft to extend the CDP functionality of
`metro-inspector-proxy`.

# How

The implementation is slightly wonky around the `ExpoInspectorDevice`.
We want to reuse as much as possible from `metro-inspector-proxy`, but
we need to add stateful data per device.

In order to achieve that, we generate a new class type, based on the
user's installed `metro-inspector-proxy`. This makes everything less
readable but should include future updates in these classes.

As for the `ExpoInspectorProxy`, to avoid having to do the same thing,
we just wrap the whole inspector class and reuse what we can. The device
map is "linked" within the original inspector proxy instance, making the
data available to all methods that need it.

# Test Plan

Enable this feature with `EXPO_USE_CUSTOM_INSPECTOR_PROXY=1`

- [x] See tests for the actual CDP events we handle.
- [ ] See tests on the "bootstrapping code" to create the inspector and
devices.

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

---------

Co-authored-by: Evan Bacon <[email protected]>

show more ...