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

ref: Add special case for extracting name of rewritten async function in Dart lang #1246

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

kamilogorek
Copy link
Contributor

Unfortunately dart_web is setting the platform to javascript for this variant of the SDK, so we cannot use it to make any distinction between the incoming events.

It appears that there is no way to make a distinction between regular JS code and the scenario we're solving here :(
The only way that I found is indeed actually using scope.startsWith('$async$') - https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/src/js_backend/namer.dart#L1845-L1866

@marandaneto could you please provide us with the most barebone repo case for this? Basically, a single async function that throws?
I don't want to commit 62k lines of fixtures for such a simple test case.

Fixes getsentry/symbolic#791

@marandaneto
Copy link

@kamilogorek thank you.
Will do it on Monday unless @blaugold beats me :D

@marandaneto
Copy link

marandaneto commented Jul 9, 2023

@kamilogorek thank you. Will do it on Monday unless @blaugold beats me :D

https://manoeltest.sentry.io/issues/4303672281/?project=4505499492941824&query=is%3Aunresolved&statsPeriod=24h&stream_index=0
Download source maps: https://manoeltest.sentry.io/settings/projects/flutter/source-maps/artifact-bundles/751f0a63-3c32-5bbc-b78b-51b6208a6b23/
The file is still massive, but I'm afraid I can't generate any shorter unless you clean it up for all nonrelated properties of the file.
Repo https://github.com/marandaneto/fluttersampleweb/tree/main

Screenshot 2023-07-09 at 15 02 21

This is a bare-bones flutter web app, I tried a simpler dart web app, but release builds don't generate source maps, or they are deleted automatically afterward.

@blaugold
Copy link

blaugold commented Jul 9, 2023

I've compiled the program below with dart compile js bin/main.dart -O4:

void main() async {
  await Future(() {});
  throw StateError('');
}

This yields out.js and out.map.js.

Hope that helps. :) It should be a lot smaller than event the most basic Flutter app.

@marandaneto
Copy link

Oh yeah, good call, I was using webdev build, totally forgot about calling dart compile by hand, thanks @blaugold

@kamilogorek
Copy link
Contributor Author

Lovely, thanks! Verified it works with the new fixtures.

@kamilogorek kamilogorek requested a review from a team July 10, 2023 11:03
Copy link
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for doing this.

@kamilogorek kamilogorek merged commit da9d745 into master Jul 10, 2023
@kamilogorek kamilogorek deleted the flutter-processing branch July 10, 2023 11:46
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.

Flutter web symbolication uses scope instead of name but the name in some cases if not all is better
4 participants