Skip to content

Embed Dart DevTools in Chrome DevTools #1502

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 11 commits into from
Feb 16, 2022
Merged

Conversation

elliette
Copy link
Contributor

@elliette elliette requested a review from grouma February 14, 2022 20:10
Copy link
Member

@grouma grouma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in the following scenarios:

  1. You have chrome devtools opened and connected but you try to click the extension again?
  2. You click Start Debugging before a Dart app is detected?

@@ -6,6 +6,7 @@
pub run build_runner build web -o build -r
```

TODO(elliette): Building with DDC no longer works, figure out why.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you loading the extension correctly from the built directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, there are two directories:

  1. /dwds/debug_extension/web
  2. /dwds/debug_extension/build/web
    Which one is the correct one to load from? Is it (1) for dart2js and (2) for DDC?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, unless something has changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I've opened #1506 to investigate (this occurs on master branch as well)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the TODO with the issue number please.

} else {
alert('''
Could not find a Dart app to start debugging.
Has the Dart Debug Extension icon turned blue yet?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase this to: The Dart Debug Extension will turn blue when a Dart application is detected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's better, changed to that

],
"run_at": "document_end"
}]
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it autoformats on save for me 🤷‍♀️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to update your IDE settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it working, added old formatting back. Thanks!

<p>Before debugging, please <strong>disable</strong> focus on the Sources panel for breakpoints:</p>
<code>Settings > Preferences > Sources > uncheck "Focus Sources panel when triggering a breakpoint"</code>
<img src="devtools_settings.png" alt="Picture of the setting in Chrome DevTools to disable.">
<p>And make sure the Dart Debug Extension is <strong>pinned</strong> to your Chrome profile:</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why must they pin it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point, they don't have to for this. Removed that part of the instructions.

@elliette
Copy link
Contributor Author

What happens in the following scenarios:

  1. You have chrome devtools opened and connected but you try to click the extension again?
  2. You click Start Debugging before a Dart app is detected?
  1. If you click the Dart Debug Extension while the embed Dart DevTools is debugging the app, you will see an alert: "DevTools is already opened on a different window." We could change that alert to make it more generic since it's not technically a different window.
  2. If you click the button before a Dart app is detected, nothing will happen. Again, we could add an alert or error message so that the user knows they should wait.

Wdyt? These could be in this PR or follow up polish items.

@grouma
Copy link
Member

grouma commented Feb 16, 2022

What happens in the following scenarios:

  1. You have chrome devtools opened and connected but you try to click the extension again?
  2. You click Start Debugging before a Dart app is detected?
  1. If you click the Dart Debug Extension while the embed Dart DevTools is debugging the app, you will see an alert: "DevTools is already opened on a different window." We could change that alert to make it more generic since it's not technically a different window.

Updating so the message is more generic makes sense to me.

  1. If you click the button before a Dart app is detected, nothing will happen. Again, we could add an alert or error message so that the user knows they should wait.

Can we not make the button conditionally enabled?

Wdyt? These could be in this PR or follow up polish items.

It's fine to be left for a follow up PR.

@@ -6,6 +6,7 @@
pub run build_runner build web -o build -r
```

TODO(elliette): Building with DDC no longer works, figure out why.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the TODO with the issue number please.

@elliette elliette merged commit 3fbe522 into dart-lang:master Feb 16, 2022
@elliette elliette deleted the b218721601 branch May 4, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants