-
Notifications
You must be signed in to change notification settings - Fork 330
Removal of the FlutterModuleType, issue #748. #1213
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
Conversation
Flutter modules are no longer defined as modules with the FlutterModuleType, instead they are defined as modules with the Dart SDK enabled on the module, where the SDK path is defined inside of a Flutter SDK. See FlutterModuleUtils.isFlutterModule(). Flutter Bazel projects are defined by FlutterModuleUtils.getFlutterBazelWorkspace(), as a project that has a Dart SDK enabled on some module and the module has flutter or module in the directory path. The requirement to have the Dart SDK is a stronger requirement, but is already required for analysis from the Dart Analysis Server, so this will not be a problem. Small IDEs support (aka WebStorm) for project creation and support has not changed. This PR has updated and refactored FlutterModuleUtils to be more of a common interface and definition for determining the Flutterness of some Module or Project. The FlutterInitializer detects the now deprecated module type , "FLUTTER_MODULE_TYPE", and converts these modules into the type of "WEB_MODULE". On the first load of an existing project, users will see a notification from the framework "Unknown Module Type".
Thanks! Will look at this today. |
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.
Fantastic! There were a lot of corner cases to take care of here.
The code lgtm. I'm going to patch this in and play with it and runtime - will report back with any findings.
@@ -211,8 +217,17 @@ public String getParentGroup() { | |||
} | |||
|
|||
@Override | |||
@NotNull | |||
public String getBuilderId() { | |||
// The builder id is used to distingish between different builders with the same module type, see |
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.
sp: distinguish
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.
Done
public static void convertFromDeprecatedModuleType(@NotNull Project project) { | ||
for (Module module : getModules(project)) { | ||
if (isDeprecatedFlutterModuleType(module)) { | ||
setFlutterModuleType(module); |
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.
When we do this, we should show a toast (FlutterMessages.showInfo
) letting the user know - it'll help take the edge off the unknown module type toast that will also likely appear.
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.
Done
Patching in locally and tested against:
lgtm! The only feedback I have is that we should experiment with a toast - using the flutter icon and some very brief verbiage - to let the user know that their project metadata has been updated, and that the other (error) toast they're seeing from intellij is related and can be safely ignored. |
Comments addressed: PTAL at the changes. |
Flutter modules are no longer defined as modules with the FlutterModuleType, instead they are defined as modules with the Dart SDK enabled on the module, where the SDK path is defined inside of a Flutter SDK. See FlutterModuleUtils.isFlutterModule().
Flutter Bazel projects are defined by FlutterModuleUtils.getFlutterBazelWorkspace(), as a project that has a Dart SDK enabled on some module and the module has flutter or module in the directory path. The requirement to have the Dart SDK is a stronger requirement, but is already required for analysis from the Dart Analysis Server, so this will not be a problem.
Small IDEs support (aka WebStorm) for project creation and support has not changed.
This PR has updated and refactored FlutterModuleUtils to be more of a common interface and definition for determining the Flutterness of some Module or Project.
The FlutterInitializer detects the now deprecated module type , "FLUTTER_MODULE_TYPE", and converts these modules into the type of "WEB_MODULE". On the first load of an existing project, users will see a notification from the framework "Unknown Module Type".