Skip to content

Add migration guide to decoupling's deprecation message - #194592

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
justinmc:decoupling-deprecation-message
Oct 24, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:masterfrom
justinmc:decoupling-deprecation-message

Conversation

@justinmc

Copy link
Copy Markdown
Contributor

It was revealed by @jakemac53 that agents are struggling to find our recommendations for migrating things to material_ui and cupertino_ui, such as the compatibility bridge. This PR makes it obvious by putting the migration guide in the error message.

This changes the deprecations added in #192957.

Open question: Should we always include a link to the relevant migration guide in the corresponding deprecation message?

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Oct 16, 2026
@justinmc justinmc self-assigned this Oct 16, 2026
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

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. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages f: cupertino labels Oct 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the deprecation messages in cupertino.dart and material.dart to include a link to the migration guide. The review feedback suggests splitting the long deprecation message strings across multiple lines to comply with the 80-character line limit recommendation in the Dart style guide.

Comment thread packages/flutter/lib/cupertino.dart Resolved
Comment thread packages/flutter/lib/material.dart Resolved
justinmc and others added 2 commits October 16, 2026 14:01
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Renzo-Olivares
Renzo-Olivares self-requested a review October 20, 2026 23:35
@justinmc

Copy link
Copy Markdown
Contributor Author

Open question: Should we always include a link to the relevant migration guide in the corresponding deprecation message?

I asked this question in a meeting with framework and ecosystem engineers and the unanimous answer was yes.

@Renzo-Olivares Renzo-Olivares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Deprecated(
'Use package:cupertino_ui/cupertino_ui.dart instead. '
'See the migration guide at: '
'https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui. '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a trailing white space after the period? Same for material.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the answer is yes for all lines except the final line, for example:

@Deprecated(
'Set this flag to false to opt into the 2024 progress indicator appearance. Defaults to true. '
'In the future, this flag will default to false. Use ProgressIndicatorThemeData to customize individual properties. '
'This feature was deprecated after v3.26.0-0.1.pre.',
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 22, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 22, 2026
@auto-submit

auto-submit Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194592, because - This pull request has the missing-tests label and does not have the test-exempt label. Please add tests or obtain a test exemption from a tech lead before re-applying the autosubmit label.

@justinmc justinmc added the test-exempt Exempt from tests. Overrides `missing-tests` label label Oct 23, 2026
@justinmc

Copy link
Copy Markdown
Contributor Author

I applied test-exempt as this only changes a deprecation message. I could write a test that verifies the deprecation message, but IMO it's adding maintenance burden for no value.

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 23, 2026
Merged via the queue into flutter:master with commit f62c9d1 Oct 24, 2026
33 of 34 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 24, 2026
@justinmc
justinmc deleted the decoupling-deprecation-message branch October 26, 2026 20:11
GhagSagar23 pushed a commit to Kryonex-Labs/flutter that referenced this pull request Oct 27, 2026
This PR updates our [Tree Hygiene wiki
page](https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#deprecations)
to say that we should include a link to the migration guide inside of
deprecation messages.

This was decided in order to help agents (and regular ol' humans)
discover how to migrate deprecated code. See
flutter#194592 for more information.

FYI @jakemac53

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
It was revealed by @jakemac53 that agents are struggling to find our
recommendations for migrating things to material_ui and cupertino_ui,
such as the [compatibility
bridge](https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui#compatibility-bridge).
This PR makes it obvious by putting the migration guide in the error
message.

This changes the deprecations added in
flutter#192957.

Open question: Should we always include a link to the relevant migration
guide in the corresponding deprecation message?

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
This PR updates our [Tree Hygiene wiki
page](https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#deprecations)
to say that we should include a link to the migration guide inside of
deprecation messages.

This was decided in order to help agents (and regular ol' humans)
discover how to migrate deprecated code. See
flutter#194592 for more information.

FYI @jakemac53

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: cupertino framework flutter/packages/flutter repository. See also f: labels. missing-tests p: material_ui material_ui package in flutter/packages test-exempt Exempt from tests. Overrides `missing-tests` label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants