-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[flutter_tools] add needsFullRestart flag on hot runner #104562
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
Changes from 8 commits
e706d54
0b7ac80
91878c9
0bfe680
60c74c9
54c1080
cc74d47
5369fe6
602751d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
}) async { | ||
_didAttach = true; | ||
try { | ||
|
@@ -276,7 +277,7 @@ class HotRunner extends ResidentRunner { | |
} | ||
|
||
final Stopwatch initialUpdateDevFSsTimer = Stopwatch()..start(); | ||
final UpdateFSReport devfsResult = await _updateDevFS(fullRestart: true); | ||
final UpdateFSReport devfsResult = await _updateDevFS(fullRestart: needsFullRestart); | ||
_addBenchmarkData( | ||
'hotReloadInitialDevFSSyncMilliseconds', | ||
initialUpdateDevFSsTimer.elapsed.inMilliseconds, | ||
|
@@ -436,6 +437,7 @@ class HotRunner extends ResidentRunner { | |
connectionInfoCompleter: connectionInfoCompleter, | ||
appStartedCompleter: appStartedCompleter, | ||
enableDevTools: enableDevTools, | ||
needsFullRestart: false, | ||
); | ||
} | ||
|
||
|
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:
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