-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
TextSelectionHandleControls deprecation deletion timeframe #124262
TextSelectionHandleControls deprecation deletion timeframe #124262
Conversation
…ionControls.buildToolbar, to avoid a sudden breaking change when both are removed
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. |
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 this SGTM. If we need to extend the other deprecations further, we can always do that too. Later even if we decide it is needed.
Are there any dart fixes for these? I don't think dart fix can help with replacing mixins, but there could be some assistance from dart fix for the other related APIs that are deprecated for this.
We learned when the typography changes from 2014 (A
) were replaced by the 2018 (B
) and then the current (C
), dart fix will actually migrate A
directly to C
, skipping B
. :)
This sounds great. I wonder if it'd be helpful to go a step farther and delete the There could still be text in the class's doc explaining that the plan is this will be removed in the future after |
Good point! I agree, I'll remove the deprecation altogether and replace it with a TODO for myself to deprecate it later. |
@Piinks There are no dart fixes. The simplest thing would be helping to migrate from TextSelectionControls.buildToolbar to TextField.contextMenuBuilder (or CupertinoTextField or TextFormField). But this deprecation has already been released on stable, so I'm guessing most users have already migrated (A to B). |
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: annotation change ...but I have to say, this doesn't seem like the most fun for developers. I don't really understand the situation in detail but it seems like we should find some way to automigrate people to the final API in one go, and not have them worry about any of this at all. |
I agree, this one is my bad. I should have just deprecated all of TextSelectionControls and permanently moved everyone to TextSelectionHandleControls in one step. I thought I could be clever with this 2 step approach since it only should affect a small number of users, but it's too complicated. Anyway, this PR will make it a little better by at least having two clear, separate migration steps. |
…24262) Make sure the removal of deprecated APIs TextSelectionControls.buildToolbar and TextSelectionHandleControls happen in two separate steps. Will make a tricky migration situation a little easier for affected users.
This came out of this discussion on another PR. This PR executes "Option 2" in my list of options.
Currently, TextSelectionControls.buildToolbar and TextSelectionHandleControls have the same deprecation version, which implies that they will both be deleted at the same time. This creates a problematic migration for users:
TextSelectionControls.buildToolbar to
EditableText.buildContextMenuand from
TextSelectionControls.buildHandleto
TextSelectionHandleControls.buildHandle`.TextSelectionHandleControls
is deleted, and have to migrate immediately back toTextSelectionControls.buildHandle
.Instead, I've bumped the deprecation version so that the deletion happens in two stages. This results in a two-stage migration process and avoids the sudden breaking change:
TextSelectionControls.buildToolbar
toEditableText.buildContextMenu
and fromTextSelectionControls.buildHandle
toTextSelectionHandleControls.buildHandle
.TextSelectionControls.buildToolbar
is removed. Migrate fromTextSelectionHandleControls.buildToolbar
back toTextSelectionControls.buildToolbar
.TextSelectionHandleControls
is removed safely.