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
SemanticsFlag
/SemanticsAction
cleanup (part 1)
#40571
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
SemanticsFlag
/SemanticsAction
migration part 1SemanticsFlag
/SemanticsAction
enum migration (part 1)
part 5: [engine] remove |
Yes. lol. I just edited the discord message adding the part 5. And added 6, deprecate describeEnum. Thanks! Also added a brief description on breakiness (was in part 3, before I knew I would need to break into so many parts). |
lib/ui/semantics.dart
Outdated
/// Temporary API until [values] return a list. | ||
List<SemanticsAction> get valuesAsList => values.values.toList(growable: false); |
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.
Doesn't this have to be a static
?
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.
Probably, lol. Doing now.
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.
To make sure this is actually the right change, can you implement part 2 already locally and run this change against it to make sure it works? See https://github.com/flutter/flutter/wiki/Debugging-the-engine#running-a-flutter-app-with-a-local-engine
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.
Yes. We want static. Debugging the engine is sooooo hard and obscure. I figured out just calling the class in the same package would also work.
lib/ui/semantics.dart
Outdated
/// Temporary API until [values] return a list. | ||
List<SemanticsAction> get valuesAsList => values.values.toList(growable: false); |
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.
Mark this API as deprecated so no-one starts accidentally using it during the migration outside of the use case we have for it?
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.
Done, thanks.
Do you have part 4 and 3 up somewhere as a draft already? Just curious to see what the "final" result of this would look like. |
This is the final result in the engine (before I knew the migration was needed). 200 LOC removed. This is the final result in Flutter. Almost no change, but cleaner, because |
I marked as deprecated and made them static. |
7661adc
to
e7f28f7
Compare
This should be ready to go (if approved). |
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.
LGTM
test-exempt: temporary code you might want to consider naming these properties something horrible like DO_NOT_USE_WILL_BE_DELETED_WITHOUT_WARNING_values or whatever |
hahaha I love that idea!! |
bbf0220
to
8cef14a
Compare
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.
LGTM
SemanticsFlag
/SemanticsAction
enum migration (part 1)SemanticsFlag
/SemanticsAction
cleanup (part 1)
Add temporary API.
cc @chunhtai
part of flutter/flutter#123346
Steps:
part 1: [engine] add
valuesAsList
<-- we are herepart 2: [flutter] use
valuesAsList
part 3: [engine] convert to enum
part 4: [flutter] use
values
again.part 5: [engine] remove valuesAsList.
part 6: [flutter] deprecate describeEnum.