-
Notifications
You must be signed in to change notification settings - Fork 341
chore: remove more unused code #5949
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
chore: remove more unused code #5949
Conversation
Hm, I didn't notice that |
Looks good. Some questions:
|
@elliette @kenzieschmoll @CoderDake Can you also review? |
You mean you want to run |
Here is the video of working app: Screen.Recording.2023-07-23.at.21.49.17.movLooks like everything works except for one overflow error (but I'm not sure whether it existed before): Screen.Recording.2023-07-23.at.21.50.13.mov |
LGTM assuming others LGTM their parts |
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 have some concerns about devtools_shared and some other small comments
@@ -69,7 +52,6 @@ class SourcePosition { | |||
); | |||
} | |||
|
|||
final String? file; |
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 might be better to add this to toString
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.
Sure, do you have any preference regarding the format (ex. '$file:$line:$column' or '$file\n$line:$column')?
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.
'$file:$line:$column' SGTM
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.
What bothers me is that file is not passed anywhere and is not used in bool operator ==(other) {
and int get hashCode =>
. On top of that any toString
call will start with null:
.
Are you sure this field should be restored?
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.
@elliette does this seem like a bug that we are not using the file
parameter anywhere? I suspect this would cause weird equality issues where two SourcePosition
objects appear identical because they have the same line
& column
& tokenPos
but they are actually from two different files.
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 don't think this is a bug. It looks like file
parameter was added in PR #3448 to combine two definitions of SourcePosition
in two different files (debugger_model
and diagnostics_node
), the second of which had file
as a parameter but never used it.
SourcePosition
is usually used in conjunction with some other class that contains file information (for example ScriptRef
in StackFrameAndSourcePosition
).
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.
Okay thanks for the input - @incendial why don't we just remove this parameter completely then as you originally did.
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 didn't revert this change, so it's removed
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.
please remove all changes to packages/devtools_shared
. The devtools_shared
package is published and is used by the devtools server, which is part of the Dart SDK.
packages/devtools_app/lib/src/screens/memory/shared/primitives/instance_context_menu.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/screens/memory/shared/primitives/memory_timeline.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/shared/diagnostics/diagnostics_node.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart
Outdated
Show resolved
Hide resolved
@incendial Thanks for your contribution! Is this still on your radar? |
@Hixie hi, thanks for the reminder, I hope to get back to this PR soon. Btw, any chance we can discuss whether the Flutter team could benefit from using Dart Code Metrics? |
@incendial There's been some discussion of that, I forget the conclusion. I recommend bringing it up on the #hackers-framework channel of our Discord. |
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.
please add a changelog entry for package:devtools_app_shared, which is also published on pub. This package is still under early development so these breaking changes are okay. Please put the changes under a new entry for version 0.0.6 and bump the package version in the pubspec.yaml to 0.0.6
@Hixie thank you, will do!
Oh, I missed that, thanks! Will do once all other changes are approved to be merged (otherwise there might be a 0.0.6 from somebody else before that 😁). |
@kenzieschmoll I've updated the package version to 0.0.7 and updated the changelog. Can you please take a look? And as for failing pipelines, looks like they are failing not because of the changes introduced here. The commit before I upstreamed the main branch got all checks passed. |
If you merge master, these issues should be resolved. |
@kenzieschmoll I think all threads are now address + the pipelines are green. Can you please take a final look? Hope we can merge this today 😁 |
After the mention here I ran the unused check again with a different flag and got a bunch of new highlights. Some of them look illegal 😅.
Note: not all of the removed code might be unused intentionally, but I have no context of that. Also, there are might be not obvious to me false-positives.
RELEASE_NOTE_EXCEPTION=[Internal refactoring]
Pre-launch Checklist
///
).