Skip to content

[go_router] Use library prefix for meta #9434

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Jun 13, 2025

We plan to export the internal attribute from package:flutter/foundation.dart.

Currently, go_router has files that import both package:meta/meta.dart and package:flutter/foundation.dart. This causes lint failures when foundation exports internal:

   info - lib/src/match.dart:12:8 - The import of 'package:meta/meta.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. Try removing the import directive. - unnecessary_import
   info - lib/src/route.dart:10:8 - The import of 'package:meta/meta.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. Try removing the import directive. - unnecessary_import

This updates go_router to use a library prefix for package:meta in affected files to make the lints happy.

This change is a refactoring and does not affect semantics and is exempt from the test, version change, and CHANGELOG policies.

Part of flutter/flutter#167668

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@loic-sharma loic-sharma requested a review from chunhtai as a code owner June 13, 2025 19:23
@flutter-dashboard
Copy link

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 you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@loic-sharma loic-sharma added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Jun 13, 2025
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM, will there be another migration to use the foundation one?

@loic-sharma
Copy link
Member Author

Yup!

@stuartmorgan-g
Copy link
Contributor

test-exempt: code refactor with no semantic change

@loic-sharma loic-sharma force-pushed the go_router_prepare_for_internal branch from f5b65f8 to 99bd076 Compare June 17, 2025 16:48
@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 17, 2025
@Piinks Piinks added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: go_router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants