Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

Description

In #21492, we added a service extension to toggle profiling of widget build times. This was never wired up through the tool, so it was essentially dead code.

Related Issues

Replace this paragraph with a list of issues related to this PR from our issue database. Indicate, which of these issues are resolved or fixed by this PR.

Tests

I added the following tests:

Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See Test Coverage.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • 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 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

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@jonahwilliams
Copy link
Contributor Author

cc @fkorotkov we're getting some odd git errors in the cirrus jobs for this PR

@goderbauer goderbauer added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 10, 2019
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM.

Do the IDEs need to know about this, or are they already wired in for it?

@jonahwilliams
Copy link
Contributor Author

cc @devoncarew

printStatus('To toggle the widget inspector (WidgetsApp.showWidgetInspectorOverride), press "i".');
printStatus('To toggle the display of construction lines (debugPaintSizeEnabled), press "p".');
printStatus('To simulate different operating systems, (defaultTargetPlatform), press "o".');
printStatus('To enable profiling of widget build times, (debugProfileWidgetBuilds), press "a".');
Copy link
Contributor

@devoncarew devoncarew Apr 11, 2019

Choose a reason for hiding this comment

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

The dartdoc for debugProfileWidgetBuilds is 'Adds [Timeline] events for every Widget built'.

Perhaps, in order to keep this description terse, we say: 'Add timeline events for every widget build method'? Or, 'To enable timeline events for all widget build methods, (debugProfileWidgetBuilds), press "a"'?

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense to expose now that we have the timeline page in devtools to display the data right next to the button to toggle it on and off.

Copy link
Contributor 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
Contributor

devoncarew commented Apr 11, 2019

We did not expose this through IDEs, but it would be good to do, in order to see how useful it is.

cc @DanTup for VS Code; I'll open an issue for DevTools

@DanTup
Copy link
Contributor

DanTup commented Apr 11, 2019

@devoncarew @dnfield I've wired it up, but I don't know what it's supposed to do so I'm not sure how to verify it's working. I don't see any difference in the DevTools timeline view, nor the Logging view (though I can see it being toggled on/off). Where does it show up?

@jonahwilliams jonahwilliams merged commit cadde24 into flutter:master Apr 11, 2019
@Hixie
Copy link
Contributor

Hixie commented Apr 11, 2019

This change is fine, but FWIW, we should be wary of adding things like this just for completeness. We don't necessarily want every last feature exposed in the UI. It will make it unusable.

@jonahwilliams
Copy link
Contributor Author

We ended up using this to debug an internal issue, so its usefulness justified the cost IMO.

jiisd added a commit to jiisd/flutter that referenced this pull request Apr 12, 2019
* master: (209 commits)
  Allow mouse hover to only respond to some mouse events but not all. (flutter#30886)
  Fix issue 23527: Exception: RenderViewport exceeded its maximum number of layout cycles (flutter#30809)
  Keep hover annotation layers in sync with the mouse detector. (flutter#30829)
  Use identical instead of '==' in a constant expression. (flutter#30921)
  Add toggle for debugProfileWidgetBuilds (flutter#30867)
  Revert "Manual engine roll with disabled service authentication codes (flutter#30919)" (flutter#30930)
  Manual engine roll with disabled service authentication codes (flutter#30919)
  Baseline Aligned Row (flutter#30746)
  [Material] Fix showDialog crasher caused by old contexts (flutter#30754)
  Let `sliver.dart` `_createErrorWidget` work with other Widgets (flutter#30880)
  Add more dialog doc cross-reference (flutter#30887)
  Allow downloading of desktop embedding artifacts (flutter#30648)
  CupertinoDatePicker initialDateTime accounts for minuteInterval  (flutter#30862)
  add golden tests for CupertinoDatePicker (flutter#30828)
  Simplify toImage future handling (flutter#30876)
  Fixed Table flex column layout error flutter#30437 (flutter#30470)
  Fix iTunes Transporter quirk (flutter#30883)
  Bump Android build tools to 28.0.3 in Dockerfile (flutter#30832)
  Update the upload key which seems to have trouble for some reason (flutter#30871)
  Check for invalid elevations (flutter#30215)
  ...
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants