-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[go_router_builder] expand supported versions of analyzer, build and source_gen #10078
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
Conversation
|
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. |
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.
Code Review
This pull request updates the dependency constraints for analyzer, build, and source_gen to support newer versions. The code has been updated to be compatible with the new APIs from these dependencies, primarily by replacing deprecated analyzer and source_gen APIs like element.name with element.displayName and TypeChecker.fromRuntime with TypeChecker.typeNamed. The changes look good, but I found one minor issue where a TypeChecker.typeNamed call is missing the inSdk: true parameter for a Dart SDK type.
f22b81a to
71bb240
Compare
| analyzer: ">=7.4.0 <9.0.0" | ||
| async: ^2.8.0 | ||
| build: ^3.0.0 | ||
| build: ">=3.0.0 <5.0.0" |
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.
we should use ^ syntax to avoid breaking change. same for source gen
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.
when i use
analyzer: ^8.0.0
build: ^4.0.0
source_gen: ^4.0.0
the build broken due the package: test that in flutter stable is pinned to 1.26.2 (currently not supports analyzer: ^8.0.0)
Note: matcher is pinned to version 0.12.17 by flutter_test from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.Note: test_api is pinned to version 0.7.6 by flutter_test from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.Because test >=1.25.9 <1.26.3 depends on analyzer >=6.0.0 <8.0.0 and test >=1.21.6 <1.24.4 depends on analyzer >=2.0.0 <6.0.0, test >=1.21.6 <1.24.4-∞ or >=1.25.9 <1.26.3-∞ requires analyzer >=2.0.0 <6.0.0 or >=6.0.0 <8.0.0. And because test >=1.21.0 <1.21.6 depends on analyzer >=2.0.0 <5.0.0, test >=1.21.0 <1.24.4-∞ or >=1.25.9 <1.26.3-∞ requires analyzer >=2.0.0 <6.0.0 or >=6.0.0 <8.0.0.(1) So, because test >=1.24.3 <1.25.13 depends on matcher >=0.12.16 <0.12.17 and test >=1.26.3 depends on test_api 0.7.7, test
>=1.21.0 requires analyzer >=2.0.0 <6.0.0 or >=6.0.0 <8.0.0 or matcher >=0.12.16 <0.12.17 or test_api 0.7.7.Because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.6 <1.20.0 requires analyzer >=1.0.0 <3.0.0. And because test >=1.20.0 <1.21.2 depends on test_api 0.4.9, test >=1.16.6 <1.21.2 requires analyzer >=1.0.0 <3.0.0 or test_api 0.4.9. And because test >=1.21.0 requires analyzer >=2.0.0 <6.0.0 or >=6.0.0 <8.0.0 or matcher >=0.12.16 <0.12.17 or test_api 0.7.7 (1), test >=1.16.6 requires analyzer >=1.0.0 <6.0.0 or >=6.0.0 <8.0.0 or matcher >=0.12.16 <0.12.17 or test_api 0.4.9 or 0.7.7.(2) So, because every version of flutter_test from sdk depends on both matcher 0.12.17 and test_api 0.7.6, if flutter_test from sdk
and test >=1.16.6 then analyzer >=1.0.0 <6.0.0 or >=6.0.0 <8.0.0.Because no versions of source_gen match >4.0.0 <4.0.1 and source_gen >=4.0.1 depends on analyzer ^8.1.1, source_gen >4.0.0 requires analyzer ^8.1.1. And because source_gen 4.0.0 depends on build ^3.0.0 and every version of go_router_builder from path depends on build ^4.0.0, if source_gen >=4.0.0 and go_router_builder from path then analyzer ^8.1.1. And because if flutter_test from sdk and test >=1.16.6 then analyzer >=1.0.0 <6.0.0 or >=6.0.0 <8.0.0 (2), one of flutter_test from sdk or test >=1.16.6 or source_gen >=4.0.0 or go_router_builder from path must be false. And because every version of go_router_builder from path depends on source_gen ^4.0.0 and go_router_builder_example depends on flutter_test from sdk, test >=1.16.6 is incompatible with go_router_builder from path. So, because go_router_builder_example depends on both go_router_builder from path and test ^1.17.0, version solving failed.
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.
so as a workaround to be able to use the new version of analyzer I ended using version range
Curiously, doing this allows the installation of analyzer ^8
Additionally I think this would an intermediate version in order to be not wait until next flutter version (beta branch contains meta: 1.26.3)
additionally i wish in a near future (next flutter release) migrate away Elements2 like mentioned here PR#9649
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.
As a note the currents checks do a test with both ranges (see Linux analyze stable)
analyzer: ^8.0.0
build: ^4.0.0
source_gen: ^4.0.0
and for downgrade (see Linux analyze_downgraded stable)
analyzer: ^7.0.0
build: ^3.0.0
source_gen: ^3.0.0
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.
can you add a todo to use pinned version once the new stable rolled in?
For downgrade, check we can opt out for this package when we ready to pin the version
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 can follow up on this so we can get this in.
71bb240 to
408180e
Compare
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
408180e to
3d2b252
Compare
This comment was marked as spam.
This comment was marked as spam.
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.
sorry this fell off my radar, please use re-request review if you want me to take another look.
This change lgtm, just need a todo.
| analyzer: ">=7.4.0 <9.0.0" | ||
| async: ^2.8.0 | ||
| build: ^3.0.0 | ||
| build: ">=3.0.0 <5.0.0" |
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.
can you add a todo to use pinned version once the new stable rolled in?
For downgrade, check we can opt out for this package when we ready to pin the version
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
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
…build and source_gen (flutter/packages#10078)
…build and source_gen (flutter/packages#10078)
…build and source_gen (flutter/packages#10078)
…build and source_gen (flutter/packages#10078)
flutter/packages@d113bbc...9ec29b6 2025-10-22 [email protected] [go_router] Support for top level `onEnter` callback. (flutter/packages#8339) 2025-10-22 [email protected] [go_router_builder] Ignore experimental features (flutter/packages#10275) 2025-10-22 [email protected] Roll Flutter from 2d34167 to 75004a6 (39 revisions) (flutter/packages#10279) 2025-10-22 [email protected] [ci]Adds mechanism for packages to opt in to batched release (flutter/packages#10237) 2025-10-22 [email protected] [tool] Change gradle-check logic to enforce alignment of java versions and a minimum (17) (flutter/packages#10206) 2025-10-22 [email protected] [various] Migrate example Radio groups to new RadioGroup API (flutter/packages#10155) 2025-10-22 [email protected] [mustache_template] Emoji support (flutter/packages#10110) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for android (flutter/packages#10188) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for platform interface (flutter/packages#10211) 2025-10-21 [email protected] [camera_avfoundation] Wrappers swift migration - part 1 (flutter/packages#10119) 2025-10-21 [email protected] [go_router_builder] expand supported versions of analyzer, build and source_gen (flutter/packages#10078) 2025-10-20 [email protected] Roll Flutter from 891d7d5 to 2d34167 (18 revisions) (flutter/packages#10268) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@d113bbc...9ec29b6 2025-10-22 [email protected] [go_router] Support for top level `onEnter` callback. (flutter/packages#8339) 2025-10-22 [email protected] [go_router_builder] Ignore experimental features (flutter/packages#10275) 2025-10-22 [email protected] Roll Flutter from 2d34167 to 75004a6 (39 revisions) (flutter/packages#10279) 2025-10-22 [email protected] [ci]Adds mechanism for packages to opt in to batched release (flutter/packages#10237) 2025-10-22 [email protected] [tool] Change gradle-check logic to enforce alignment of java versions and a minimum (17) (flutter/packages#10206) 2025-10-22 [email protected] [various] Migrate example Radio groups to new RadioGroup API (flutter/packages#10155) 2025-10-22 [email protected] [mustache_template] Emoji support (flutter/packages#10110) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for android (flutter/packages#10188) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for platform interface (flutter/packages#10211) 2025-10-21 [email protected] [camera_avfoundation] Wrappers swift migration - part 1 (flutter/packages#10119) 2025-10-21 [email protected] [go_router_builder] expand supported versions of analyzer, build and source_gen (flutter/packages#10078) 2025-10-20 [email protected] Roll Flutter from 891d7d5 to 2d34167 (18 revisions) (flutter/packages#10268) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
close flutter/flutter#175071
Expand support build and source_gen versions to support build v4 and source_gen v4
Expand support analyzer version to allow to v8.
List which issues are fixed by this PR. You must list at least one issue.
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
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