flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Promote the use of hot restart

Open jacob314 opened this issue 3 years ago • 3 comments

Some users are unaware of hot restart and restart the app instead. Are there cases where we could detect when app restarts could be replaced by a hot restart and notify users?

Also, users are unaware that pressing the play button again in Android Studio triggers a hot restart when an app is already running.

jacob314 avatar Feb 17 '22 22:02 jacob314

A good first step is to use analytics to identify how large a problem this may be. We can track the fraction of users that stop and restart the app and also never run hot reloads from Flutter analytics. If this is high, we should consider a message in IntelliJ suggesting using hot restart along with a tip for how to use hot restart any time this pattern of behavior is identified. We could even have this prompt ask users if they were aware of hot restart to fully understand where users are going wrong.

I believe hot restart is featured more prominently in the VSCode toolbar. Comparing the number of hot restarts from vscode could also clarify this issue.

FYI @DanTup as VSCode users might also struggle with this.

jacob314 avatar Feb 17 '22 22:02 jacob314

In VS Code, we handle the normal Restart button/menu entries as a Hot Restart, so as long as the user is clicking Restart, it'll be a Hot Restart.

It could be interesting to set a timer whenever a debug session stops and if another starts within a small period (< 30s?) increment a counter, and if it hits some threshold within a single editor session, show a prompt about hot restart (or solicit feedback on why it's not being used)?

DanTup avatar Feb 18 '22 08:02 DanTup

We can look at flutter tool analytics to see how often these <30s debug session stops and starts occur to see how large an issue this is. If it is significant enough, I think adding prompts asking for feedback could be very useful. We may only want to ever show the prompts for users who have not demonstrated that they know how to hot restart.

jacob314 avatar Feb 18 '22 18:02 jacob314