-
Notifications
You must be signed in to change notification settings - Fork 638
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
Allow client-side device identifiers in inspector proxy #991
Closed
byCedric
wants to merge
6
commits into
facebook:main
from
byCedric:@bycedric/inspector-proxy/allow-device-identifiers
Closed
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c52f355
Allow string device ids in inspector proxy
byCedric f2ca178
Allow device identifiers when registering inspectable device
byCedric 8c4a827
Fix some linting issue
byCedric 9bbf992
Move debugger socket reuse logic to device
byCedric e4885b1
Update new device connection debug log
byCedric 1d516da
Use docblock instead of line comments
byCedric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the
new Device
created below somehow inherit_debuggerConnection
fromoldDevice
?Also,
_debuggerConnection
is a private variable (by naming convention) and ideally shouldn't be accessed outside of theDevice
classThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, but we might need to add some logic when swapping out the
Device
instances. Basically, in my tests I found that the open debugger automatically triggered theDevice.handleDebuggerConnection
method (background reconnection). This sets the debugger connection to the newDevice
instance.I think an ideal scenario is to just invoke that method directly during the initialization.
Originally, I had to unset the debugger connection in order to avoid the device's socket close event handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we can do is move the shutdown logic into a handler on the device class. With that, we don't need to access
_debuggerConnection
,_name
, and_app
outside the class. Does that make sense to you? @voideanvalueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup makes sense. I think feel free to modify the
Device
class (as it's private within this package) to accomplish the new logic needed in a well-named method(s).