I was putting together a doc about the many places we wait for a resume event after either a hot-restart or a page-refresh when pauseIsolatesOnStart is true, and realized that I had missed waiting for the resume event for page refreshes when running an app with flutter_tools.
I then realized that the solution implemented for waiting for a resume event after a page-refresh for internal apps (https://github.com/dart-lang/webdev/pull/2398 and cl/626138927) could be modified to work for both flutter_tools and internal apps. These modifications are in this PR.
Before this change:
DWDS exposed a method shouldPauseIsolatesOnStart which could be called by a client (flutter_tools, DDR) to determine whether or not to immediately call DWDS' runMain method after an app connection event
With this change:
flutter_tools and DDR immediately call DWDS' runMain method after an app connection event
runMain waits for the _readyToRunMain Future before running the app's main() method
This _readyToRunMain Future is resolved once DWDS receives a resume event
I was putting together a doc about the many places we wait for a
resume
event after either a hot-restart or a page-refresh whenpauseIsolatesOnStart
istrue
, and realized that I had missed waiting for theresume
event for page refreshes when running an app withflutter_tools
.I then realized that the solution implemented for waiting for a
resume
event after a page-refresh for internal apps (https://github.com/dart-lang/webdev/pull/2398 and cl/626138927) could be modified to work for bothflutter_tools
and internal apps. These modifications are in this PR.Before this change:
shouldPauseIsolatesOnStart
which could be called by a client (flutter_tools, DDR) to determine whether or not to immediately call DWDS'runMain
method after an app connection eventWith this change:
runMain
method after an app connection eventrunMain
waits for the_readyToRunMain
Future before running the app'smain()
method_readyToRunMain
Future is resolved once DWDS receives aresume
eventWork towards https://github.com/flutter/devtools/issues/7231
Requires cl/632610137 to be submitted as well