Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jun 11, 2020

Description

Add deprecation infrastructure to flutter command. Deprecate make-host-app-editable and make a no-op.

Screen Shot 2020-06-10 at 5 33 10 PM

Related Issues

Fixes #54408
Fixes #32989

Tests

flutter_command_test

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added the a: existing-apps Integration with existing apps via the add-to-app flow label Jun 11, 2020
@jmagman jmagman self-assigned this Jun 11, 2020
@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 11, 2020

void _printDeprecationWarning() {
if (deprecated) {
globals.printStatus('$warningMark The "$name" command is deprecated and will be removed in a future version of Flutter.');
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: long line

Copy link
Member Author

Choose a reason for hiding this comment

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

This line is only 129 characters long. The consistency on line length recommendations is all over the place (you're not alone, I've seen this comment in other reviews). Is this really more readable?
Screen Shot 2020-06-11 at 9 31 20 AM

I don't get why we care about "long" lines. Your IDE wraps and scrolls and you're probably working on a ~27" display anyway (130 characters doesn't look long on a 13" laptop either).

I can't even get the Android Studio column guide feature to work, it always just shows 80 characters no matter what I put in the visual guide field. What decade is this?
Screen Shot 2020-06-11 at 9 33 10 AM

I'm all for consistency, but either we should have a linter or we shouldn't enforce it, and should just wrap where it's naturally readable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I don't really have anything to go off of here (feel free to ignore nits). I would certainly prefer if we had a standard max line length, probably longer than 80 but I'm not sure how much until we hit the terminal width limit for @zanderso

The framework "hand-formatting" standard is really making this harder than it should be. Not to mention all of our lines are longer than they need to be due to the unnecessary RHS types for locals

Copy link
Member

Choose a reason for hiding this comment

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

Here is the relevant section of the style guide: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#prefer-a-maximum-line-length-of-80-characters. In particular, 'prefer going over if breaking the line would make it less readable, or if it would make the line less consistent with other nearby lines.'

'less readable' is subjective, so at the end of the day, this really means something like, "come to a consensus with the code reviewers."

I would vastly prefer it if we could use dartfmt under packages/flutter_tools with a line limit of say, 100 or so, and just not have these conversations anymore, but I believe that ship has sailed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was pointed to this as an example of why we should use dartfmt... It's worth noting that dartfmt never breaks strings, so it would not make this better. In fact it would make this worse because it puts a random newline before the ( and then puts the rest of the line on the next line indented by four:

  void _printDeprecationWarning() {
    if (deprecated) {
      globals.printStatus(
          '$warningMark The "$name" command is deprecated and will be removed in a future version of Flutter.');

My recommendation for formatting this would be:

  void _printDeprecationWarning() {
    if (deprecated) {
      globals.printStatus(
        '$warningMark The "$name" command is deprecated '
        'and will be removed in a future version of Flutter.',
      );

(If you do that, then it happens that dartfmt will keep that output unmodified. But it won't proactively cut the string.)

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM!

The analyzer is unhappy with some extra imports though

@jmagman jmagman merged commit 222c2cb into flutter:master Jun 11, 2020
@jmagman jmagman deleted the deprecate-mhae branch June 11, 2020 18:37
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm

}
}
final String description = 'Moves host apps from generated directories to non-generated directories so that they can be edited by developers.';

Copy link
Member

Choose a reason for hiding this comment

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

Can we add a line here that says for modifications required in the host Android or iOS apps, make those modifications in your own wrapper apps that import the Flutter module?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. I'll open a new PR.

@xster
Copy link
Member

xster commented Jun 11, 2020

Thanks for the cleanup \o/

zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: existing-apps Integration with existing apps via the add-to-app flow tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate make-host-app-editable command Settle on the module project's host project pattern: in flutter tools vs ephemeral vs materialized

7 participants