Skip to content

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

Merged
merged 3 commits into from
Jul 17, 2017

Conversation

jwren
Copy link
Member

@jwren jwren commented Jul 14, 2017

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".

jwren added 2 commits July 14, 2017 12:10
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".
@devoncarew
Copy link
Member

Thanks! Will look at this today.

Copy link
Member

@devoncarew devoncarew left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp: distinguish

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@devoncarew
Copy link
Member

devoncarew commented Jul 17, 2017

Patching in locally and tested against:

  • existing projects (it works, and creates the diffs on disk that you'd expect)
  • new projects from intellij
  • new projects from the cli
  • new projects from the cli, w/ the intellij metadata deleted

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.

@jwren
Copy link
Member Author

jwren commented Jul 17, 2017

Comments addressed: FlutterMessages.showInfo and spelling error.

PTAL at the changes.

@jwren jwren merged commit da5eea7 into flutter:master Jul 17, 2017
@jwren jwren deleted the rm-module-type branch October 18, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants