Skip to content
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

DWDS should include static members in class information #1430

Closed
elliette opened this issue Oct 20, 2021 · 3 comments
Closed

DWDS should include static members in class information #1430

elliette opened this issue Oct 20, 2021 · 3 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on package:dwds triaged

Comments

@elliette
Copy link
Contributor

In the Dart DevTools debugger, we don’t show static fields in the expression evaluation autocomplete when connected to a web app. This is because DWDS only populates the class information with instance fields, not static fields: dwds/lib/src/debugging/classes.dart.

The sdkUtils that DWDS uses to fetch the instance fields is an alias DDC’s own internal runtime library. There are also methods for getting various static members ( ddc_runtime/classes.dart ), but their implementation was removed because they weren’t being used within DDC.

@nshahan is working on adding the DDC implementations back, but only including the static members’ names so as not to add too much internal bloat. Once DDC returns the names, DWDS can begin calling the sdkUtils methods for getting static members.

Related bugs:

FYI @annagrin as well.

@elliette elliette self-assigned this Oct 20, 2021
@nshahan
Copy link
Contributor

nshahan commented Oct 20, 2021

I found adding only the names increased the size of the compiled javascript by ~1% when testing in a large google3 application. This is down from ~7% when we add names and types. I have a CL in progress now https://dart-review.googlesource.com/c/sdk/+/217501.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 25, 2021
Temporarily add names of static members so they can be accessed by the
debugger. Eventually, these will be accessible through the symbol data
and should be removed from the compiled Javascript.

This increases the size of the compiled output by ~1% in a large
google3 application.

Names and types of static members were originally removed from the
compiled output in https://dart-review.googlesource.com/c/sdk/+/48455
because they are not needed for runtime correctness.


Change-Id: Idfd827ececec80d903586917676ec027e2a5a9e8
Issue: #40273
Issue: dart-lang/webdev#1430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217501
Reviewed-by: Anna Gringauze <[email protected]>
Commit-Queue: Nicholas Shahan <[email protected]>
@bkonyi
Copy link
Collaborator

bkonyi commented Jan 8, 2025

@nshahan would you happen to know if this is still relevant?

@bkonyi bkonyi added P2 A bug or feature request we're likely to work on triaged labels Jan 8, 2025
@nshahan
Copy link
Contributor

nshahan commented Jan 8, 2025

I did land the change that encodes the names of the class static members so they can be retrieved at runtime and it looks like Elliott did land a change in DWDS to consume those names. Without any more info I think that means we can close this and open new issues if we discover problems with class static members.

@nshahan nshahan closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on package:dwds triaged
Projects
None yet
Development

No branches or pull requests

3 participants