-
Notifications
You must be signed in to change notification settings - Fork 80
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
Refactor: Update the parameters for DWDS.start
#2231
Conversation
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.
Thanks Elliott, really appreciate cleaning dwds.start up! I think we have and issue for this work somewhere, will try to find it an update. Left a few comments.
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.
Thanks, left some more comments
dwds/lib/src/utilities/globals.dart
Outdated
set globalLoadStrategy(LoadStrategy strategy) => _globalLoadStrategy = strategy; | ||
LoadStrategy get globalLoadStrategy => _globalLoadStrategy; | ||
class ToolConfiguration { | ||
LoadStrategy loadStrategy; |
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 all those fields be final, or late final if needed? I don't think we want to allow changing them during the run of dwds?
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 but would lie a follow up PR where we have pre-defined test configurations and/or helpers to create them. Consider passing tool configuration to contest constructor as well.
This PR:
Dwds.start
so that all of the miscellaneous strings / boolean parameters are collected into eitherDebugSettings
orAppMetadata
. This is to make it easier to add optional parameters to theDwds.start
method, since we won't need to update theflutter_tools
DwdsLauncher
each time: https://github.com/flutter/flutter/blob/367203b3011fc1752cfa1f51adf9751d090c94e6/packages/flutter_tools/lib/src/isolated/devfs_web.dart#L46DebugSettings
andAppMetadata
as globals so that they can be accessed from anywhere (instead of having to pipe some of their fields down to theInjector
as we were previously doing)devTools/DevTools
instead ofdevtools/Devtools
enableDebugging
is no longer required but optional. If not set, it defaults totrue
This is preparatory work for #2198, because we will be adding a new parameter to
Dwds.start
(the workspace name)