[flutter_tools] add needsFullRestart flag on hot runner#104562
[flutter_tools] add needsFullRestart flag on hot runner#104562fluttergithubbot merged 9 commits intoflutter:masterfrom
Conversation
| Completer<void> appStartedCompleter, | ||
| bool allowExistingDdsInstance = false, | ||
| bool enableDevTools = false, | ||
| bool needsFullRestart = true, |
There was a problem hiding this comment.
Instead of adding it here, I would add it to the ResidentRunner base class and document it. While its technically allowed to add new named parameters to overriden methods on subclasses, I think you should generally avoid that practice. It occasionally leads to surprises when a developer can't autocomplete a parameter due to the static type of a variable.
| Completer<void> appStartedCompleter, | ||
| bool allowExistingDdsInstance = false, | ||
| bool enableDevTools = false, | ||
| bool needsFullRestart = true, |
There was a problem hiding this comment.
Can you add a doc comment on what needsFullRestart is for?
There was a problem hiding this comment.
Doc comments should go on the method itself. Look at the flutter framework for examples of how parameters are documented. Usually something like:
/// One sentence summary about what foo does
///
/// [bar] is blah blah.
void foo(String bar);
```
There was a problem hiding this comment.
I was following this particular example which apparently to have more than one line is acceptable. About going in the method agree I should move this up. https://dart.dev/guides/language/effective-dart/documentation#avoid-redundancy-with-the-surrounding-context
There was a problem hiding this comment.
Thats fine, but it needs to go on the method itself and not the parameter
| String route, | ||
| }); | ||
|
|
||
| /// The first time we do a run hot a full restart is not needed |
There was a problem hiding this comment.
How about something like:
/// Connect to a flutter application.
///
/// [needsFullRestart] defaults to `true`, and controls if the frontend server should
/// compile a full dill. This should be set to `false` if this is called in [ResidentRunner.run], since that method already perfoms an initial compilation.
fixes: #92000
Pre-launch Checklist
///).