-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
[flutter_tools] add needsFullRestart flag on hot runner #104562
[flutter_tools] add needsFullRestart flag on hot runner #104562
Conversation
@@ -228,6 +228,7 @@ class HotRunner extends ResidentRunner { | |||
Completer<void> appStartedCompleter, | |||
bool allowExistingDdsInstance = false, | |||
bool enableDevTools = false, | |||
bool needsFullRestart = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -1183,6 +1183,7 @@ abstract class ResidentRunner extends ResidentHandlers { | |||
Completer<void> appStartedCompleter, | |||
bool allowExistingDdsInstance = false, | |||
bool enableDevTools = false, | |||
bool needsFullRestart = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a doc comment on what needsFullRestart
is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats fine, but it needs to go on the method itself and not the parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit
@@ -1178,11 +1178,14 @@ abstract class ResidentRunner extends ResidentHandlers { | |||
String route, | |||
}); | |||
|
|||
/// The first time we do a run hot a full restart is not needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM
fixes: #92000
Pre-launch Checklist
///
).