-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
DWDS interacts with the runtime debugging APIs available here: https://github.com/dart-lang/sdk/blob/eafb6b73f7ddab69d7832f20fc7e336d62bcca48/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/debugger.dart. While these will be re-exposed in a different manner in ddc_module_loader.js with the new module format, many of these APIs still consume and return Dart objects e.g. getObjectMetadata or getRecordFields.
Instead, we've floated around a few ideas:
- A
WeakMapof Dart objects to some ID. This ID would then be packaged with other metadata in some JSON-like format. - A direct
WeakRefof the Dart object.
1 is preferred due to the extra information provided. One complication is that DWDS type-checks the resulting object using basic JS type-checks, so we may only want to do this replacement when the value is not a JS type e.g. string, array (but the values inside should also be examined).
Possibly related issue: #40273