-
Notifications
You must be signed in to change notification settings - Fork 341
Pass 'valueId' (Diagnosticable) instead of 'objectId' (DiagnosticsNode) to inspector API. #5918
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
This reverts commit 0c7f14b.
@@ -603,16 +603,6 @@ class InspectorController extends DisposableController | |||
_refreshRateLimiter.scheduleRequest(); | |||
} | |||
|
|||
bool identicalDiagnosticsNodes( |
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.
Fyi @incendial, why wasn't this method detected as dead code?
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.
Good question, will check.
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.
I think I was running the command without the --monorepo
option. And since inspector_controller
is in the package exports, any unused code is skipped.
With the option it shows a bunch of things:
lib/src/screens/inspector/inspector_controller.dart:
⚠ unused field highlightNodesShownInBothTrees
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:237:3
⚠ unused method getTreeType
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:254:3
⚠ unused method highlightShowFromNodeInstanceRef
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:285:3
⚠ unused method getSubtreeRootValue
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:493:3
⚠ unused method getTreeNode
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:574:3
⚠ unused method maybeUpdateValueUI
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:578:3
⚠ unused method identicalDiagnosticsNodes
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:602:3
⚠ unused method treeTypeDisplayName
at /Users/dimannich/Desktop/code/devtools/packages/devtools_app/lib/src/screens/inspector/inspector_controller.dart:922:3
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.
And in other files as well.
Can create a PR if the team is ready for another unused code removal round 🙂.
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.
It would be amazing. Thank you!!!
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.
Actually, I was running the command on a stale fork, so some of these reports have already been removed 😅
@@ -122,7 +122,7 @@ abstract class LayoutExplorerWidgetState<W extends LayoutExplorerWidget, | |||
|
|||
void updateHighlighted(L? newProperties); | |||
|
|||
String? id(RemoteDiagnosticsNode? node) => node?.dartDiagnosticRef.id; |
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.
Make sure to verify that the layout explorer still works after this change. For example, try changing flex values for widgets in a row.
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.
Screen.Recording.2023-06-16.at.1.47.59.PM.mov
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.
…sticsNode) to inspector API. (flutter#5918)" This reverts commit 3ce878c.
Prerequisite PRs that update APIs to take Diagnosticable:
flutter/flutter#128833
getChildrenSummaryTree
flutter/flutter#128897
getProperties
flutter/flutter#128962
getSelectedSummaryWidget
getSelectedWidget
getChildrenSummaryTree
getChildrenDetailsSubtree
getDetailsSubtree
getLayoutExplorerNode
Tests should start passing after switching to this version of Flutter: