-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove source mapping from async methods #44374
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
Comments
@nshahan @sigmundch - do we have an owner on this? It's currently marked Jan. |
@mariamhas @grouma Can you help us gauge the priority of this issue? Should this be considered a blocker for the next release? |
I don't see this as being a blocker but it's certainly a nice to have fix. |
@nshahan I'm assigning you as the owner for now. Feel free to reassign if needed. |
After investigating I found the situation is a little different than described. Given: module.foo = function foo() { // (1)
return async.async(dart.dynamic, function* foo() { // (2)
return yield bar.bar(); // (3)
});
}; There are actually no source mapped locations for line (1) so nothing to remove there. When paused at the line (3) two stack frames appear labeled "foo". The frames correspond to the source mapped locations on lines (2) and (3). With the current implementation in webdev, I can't find a way to avoid two stack frames appearing when paused on line (3) unless I remove all source mappings from line (2). With those removed the stack traces from errors and the debugging experience in chrome devtools with source maps enabled will regress. @grouma Let's do some brainstorming to come up with a more targeted way we can detect async methods and hide the unwanted stack frame. Add a list of source maps to ignore in the metadata? Other ideas? |
When collecting async frames we do actually remove duplicate async markers. We could potentially add some similar logic in that class. What would be the signal though? Is it enough to remove back to back frames with the exact same location? |
I'm not sure, maybe we should hack on this and brainstorm.
I don't think that's the answer because the duplicated frames are not identical because they actually map to different lines. |
Any update? |
To properly resolve this issue we likely need to make use of the DDC metadata files. This issue is very similar to dart-lang/webdev#1179. We won't get to it in this quarter but we intend to have an OKR around enhanced inspection next quarter. This enhanced inspection will leverage additional metadata within the DDC metadata files instead of relying on various heuristics. |
If we remove the source map information from the outer function of the generated code below it would potentially avoid showing the redundant stack frames when debugging with Dart DevTools.
Dart:
Generated JavaScript:
We need to be careful that we don't drastically regress debugging in chrome devtools in the process.
The text was updated successfully, but these errors were encountered: