Running in profile mode for web seems to get stuck with this notification. Split from https://github.com/Dart-Code/Dart-Code/issues/3206
It looks like this may be because we never get an app.debugPort messages from Flutter when launching profile mode on the web.
@grouma @jacob314 should there be an available VM Service for a web app running with --profile? For non-web it seems there is, but for web there's no app.debugPort event from Flutter (flutter run -d ios --machine --profile will send one, but flutter run -d chrome --machine --profile will not).
I'm not familiar with the profile flag. Does that imply DDC? Note that package:dwds only works with DDC.
My understanding for non-web is that Profile mode is "almost a release mode" but still has some code to enable running profiling tools etc.
package:dwdsonly works with DDC.
Ah, that's probably the issue here then. https://flutter.dev/docs/testing/build-modes says that a web app in profile mode is compiled with dart2js. In that case, Dart-Code should probably be aware that it's not going to get a VM Service URI for a web app in debug mode, and behave accordingly.
Profile mode is Dart2JS. Profile mode is expected to match the characteristics of the release build app.
Yeah that sounds like the issue. Long term we want to support better debugging tools for Dart2JS but it isn't a current priority.
@grouma
but it isn't a current priority
Do you mean this issue or the debugging tools for Dart2JS in general?
Debugging tools for Dart2JS.
This seems to affect Release mode for all platforms too - because we use the VM service as a signal for the app having finished loading, anything without a VM service will leave the loading toast visible.
@grouma @jonahwilliams I've fixed this by not expecting to get a VM Service (app.debugPort from flutter run --machine) for all release mode runs, or for profile mode on the web. However it meant Dart-Code now has to know whether:
This doesn't seem ideal (although it may be slightly simpler if/when the debug adapter moves into flutter_tools), but I'm not sure there's an easy alternative. We may need to update this if either of those things change in future.
@DanTup By this fix, Do I will be able to connect profile mode to Dev tools for Flutter web?
@amr-eniou-3r not when running on web - my understanding from @grouma's comments above it that profile-mode on Web does not support the VM Service and therefore is not currently usable with DevTools. Profile mode for non-web should work though.
This fix just prevents the loading notification from hanging around after the app launches (since it was previously waiting for a debugger connection that would never happen).
@grouma @DanTup I wonder if you could give me the link for the issue of profile mode for Flutter web which I should subscribe to?
@grouma @DanTup I wonder if you could give me the link for the issue of profile mode for Flutter web which I should subscribe to?
I'm not sure if we have a canonical one. @nshahan may know?