dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
213 stars 71 forks source link

`globals` are not exposed in the Debugger #2442

Open elliette opened 1 month ago

elliette commented 1 month ago

global Dart variables are not currently shown in the debugger.

@nshahan did some investigation and found we will likely need to request the globals for the current library. In Chrome DevTools, they are discoverable in a closure with the library name:

Screenshot 2024-05-30 at 10 06 34 AM
nshahan commented 1 month ago

I'm anticipating there are some changes coming soon to the way DDC represents library global methods, getters, setters, and fields to support hot reload. This will likely need to be coordinated with dwds once we settle on a representation that works well. One idea is to use the same representation we use for class static methods, getters, setters, and fields so there might be an opportunity to reduce some of the logic required.