Move Widget Inspector service extensions from DevTools to Flutter#113861
Merged
auto-submit[bot] merged 13 commits intoflutter:masterfrom Oct 28, 2022
Merged
Move Widget Inspector service extensions from DevTools to Flutter#113861auto-submit[bot] merged 13 commits intoflutter:masterfrom
auto-submit[bot] merged 13 commits intoflutter:masterfrom
Conversation
kenzieschmoll
commented
Oct 25, 2022
| return null; | ||
| }, | ||
| ); | ||
| registerServiceExtension( |
Member
Author
There was a problem hiding this comment.
The service extensions added in this file are copied / moved from https://github.com/flutter/devtools/blob/master/packages/devtools_app/assets/scripts/inspector_polyfill_script.dart with minimal changes for adhering to the flutter/flutter style guide and lints.
kenzieschmoll
commented
Oct 25, 2022
| expect(childJson['chidlren'], isNull); | ||
| }, skip: !WidgetInspectorService.instance.isWidgetCreationTracked()); // [intended] Test requires --track-widget-creation flag. | ||
|
|
||
| testWidgets('ext.flutter.inspector.getRootWidgetSummaryTreeWithPreviews', (WidgetTester tester) async { |
Member
Author
There was a problem hiding this comment.
The tests added to this file are all new, as we did not have tests for these service extensions in DevTools.
CoderDake
reviewed
Oct 25, 2022
goderbauer
reviewed
Oct 25, 2022
CoderDake
approved these changes
Oct 27, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Oct 28, 2022
This was referenced Oct 29, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Oct 29, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Oct 29, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Oct 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These service extensions have been dynamically registered from DevTools for years now (see inspector_polyfill_script.dart). Originally, when DevTools had to be backwards compatible with older versions of Flutter, this was a way to guarantee these service extensions would be available for any version of Flutter. Since this time, we have changed the DevTools distribution strategy to ship DevTools with the Dart SDK, so we no longer have to be concerned with backwards compatibility issues.
Moving these service extension registrations to the widget_inspector.dart file in Flutter is a tech debt clean up, and also a performance improvement for DevTools IPL. This change will eliminate the need for the DevTools inspector to perform an expensive 'eval' at the initial load of the inspector to register the service extensions (@annagrin). The initial expression compilation that draws the Flutter layout explorer takes ~3sec when connected to a flutter web app built with DDC, which, before this change, delayed the time until the flutter inspector was ready for user action. This change prevents the 3 seconds delay from happening before the inspector loads. However, the delay will still exist for the first load of the layout explorer (the cost is loading the widget_inspector.dart file for evaluation). This is a separate problem that will be tackled in a separate effort.
All the new service extensions added in this PR are copied from https://github.com/flutter/devtools/blob/master/packages/devtools_app/assets/scripts/inspector_polyfill_script.dart with minimal changes for adhering to the flutter/flutter style guide and lints.
This is the required flutter changes for flutter/devtools#4634. DevTools changes are in flutter/devtools#4633.