Skip to content

Conversation

@stereotype441
Copy link
Contributor

In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add logic to the analyzer for generating a warning if an API marked @experimental is used. This will allow experimental analyzer features to be developed without creating a risk of breaking changes downstream.

To prepare for this, release 8.2.0 of the analyzer removes several old @experimental annotations that were out of date. To avoid breaking trybots, those removals need to roll into flutter before we can land https://dart-review.googlesource.com/c/sdk/+/450970.

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. You must list at least one issue.

Pre-Review Checklist

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-assist bot 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

  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

In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add
logic to the analyzer for generating a warning if an API marked
`@experimental` is used. This will allow experimental analyzer features
to be developed without creating a risk of breaking changes downstream.

To prepare for this, release `8.2.0` of the analyzer removes several old
`@experimental` annotations that were out of date. To avoid breaking
trybots, those removals need to roll into flutter before we can land
https://dart-review.googlesource.com/c/sdk/+/450970.
@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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 analyzer dependency to version ^8.2.0. The code changes are necessary adaptations for breaking changes introduced in the new version of the analyzer package. This includes handling nullability for element names by adding null assertions (!), and updating API usage from deprecated properties like parameters to formalParameters on FunctionType, and replacing getDisplayString() with displayName where the method signature changed. The changes are correct and directly related to the dependency upgrade.

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.

The code LGTM. Can you write c change log entry and bump the version? it seems like this pr warrants a new release.

@stereotype441
Copy link
Contributor Author

@chunhtai

The code LGTM. Can you write c change log entry and bump the version? it seems like this pr warrants a new release.

Sure, I'll be happy to do that.

Any idea what to do about the check failures? It looks like there are version solving issues (see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8702737759630305985/+/u/Run_package_tests/custom_package_tests/stdout).

But when I run flutter pub get locally, it works fine. 😕

@stereotype441
Copy link
Contributor Author

stereotype441 commented Sep 25, 2025

@chunhtai

The code LGTM. Can you write c change log entry and bump the version? it seems like this pr warrants a new release.

Sure, I'll be happy to do that.

Any idea what to do about the check failures? It looks like there are version solving issues (see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8702737759630305985/+/u/Run_package_tests/custom_package_tests/stdout).

But when I run flutter pub get locally, it works fine. 😕

Hey @stuartmorgan-g, @bkonyi suggested that you might be a good person to ask about the version solving issue that's coming up in the checks (see above).

Digging a little further, the error I get from the bot says (among other things): because go_router_builder_example depends on flutter_test from sdk which depends on test_api 0.7.6, go_router_builder from path is incompatible with test >=1.16.6.

But if I look in the pubspec of my checkout of flutter, I see test_api: 0.7.7

So I presume what is happening is that this is a bot that tests the current version of packages against some older version of flutter? If that's the case, then I guess the version solving error is happening because the older version of Flutter isn't compatible with analyzer 8.2.0.

Assuming I'm right about that, then I guess bumping to analyzer 8.2.0 right now is just not an option. So I will try making an alternative PR that uses // ignore comments to suppress the problematic warnings. I'll link that CL from here once I have it ready to go. Update: here it is: #10082

stereotype441 added a commit to stereotype441/packages that referenced this pull request Sep 25, 2025
In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add
logic to the analyzer for generating a warning if an API marked
`@experimental` is used. This will allow experimental analyzer features
to be developed without creating a risk of breaking changes downstream.

Unfortunately, the `go_router_builder` package uses an old version of
the analyzer in which some parts of the API were marked as
`@experimental`, even though they were fully supported. So to avoid
breaking trybots when the new warning rolls out, I need to add `//
ignore` comments to ignore the upcoming warnings.

In a future PR, I intend to bump the `go_router_builder` package's
analyzer dependency to 8.2.0; in that analyzer version, the erroneous
`@experimental` annotations have been removed. Unfortunately, that
can't be done yet, since `go_router_builder` still needs to support
versions of flutter that pin analyzer to an earlier version. (See
flutter#10079, which attempts to bump
the analyzer dependency, but breaks trybots).
@daiki1003

This comment was marked as off-topic.

@stuartmorgan-g
Copy link
Collaborator

But if I look in the pubspec of my checkout of flutter, I see test_api: 0.7.7

What version of Flutter are you using? It sounds like probably master from within the last couple of months.

So I presume what is happening is that this is a bot that tests the current version of packages against some older version of flutter?

The bot labeled stable is testing the current stable release of Flutter (stable channel, currently 3.35). The N-1 bot is testing the previous stable (3.32), and the N-2 bot is testing the version before that (3.29).

If that's the case, then I guess the version solving error is happening because the older version of Flutter isn't compatible with analyzer 8.2.0.

That's my reading of the resolver output as well.

Assuming I'm right about that, then I guess bumping to analyzer 8.2.0 right now is just not an option.

Dropping N-1 and N-2 support is an option, but breaking compatibility with stable is not.

@stereotype441
Copy link
Contributor Author

@stuartmorgan-g

Dropping N-1 and N-2 support is an option, but breaking compatibility with stable is not.

Gotcha, thanks. I'll close this PR and go with #10082 then.

stereotype441 added a commit to stereotype441/packages that referenced this pull request Sep 26, 2025
In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add
logic to the analyzer for generating a warning if an API marked
`@experimental` is used. This will allow experimental analyzer features
to be developed without creating a risk of breaking changes downstream.

Unfortunately, the `go_router_builder` package uses an old version of
the analyzer in which some parts of the API were marked as
`@experimental`, even though they were fully supported. So to avoid
breaking trybots when the new warning rolls out, I need to add `//
ignore` comments to ignore the upcoming warnings.

In a future PR, I intend to bump the `go_router_builder` package's
analyzer dependency to 8.2.0; in that analyzer version, the erroneous
`@experimental` annotations have been removed. Unfortunately, that
can't be done yet, since `go_router_builder` still needs to support
versions of flutter that pin analyzer to an earlier version. (See
flutter#10079, which attempts to bump
the analyzer dependency, but breaks trybots).
stereotype441 added a commit that referenced this pull request Sep 26, 2025
…s. (#10082)

In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add
logic to the analyzer for generating a warning if an API marked
`@experimental` is used. This will allow experimental analyzer features
to be developed without creating a risk of breaking changes downstream.

Unfortunately, the `go_router_builder` package uses an old version of
the analyzer in which some parts of the API were marked as
`@experimental`, even though they were fully supported. So to avoid
breaking trybots when the new warning rolls out, I need to add `//
ignore` comments to ignore the upcoming warnings.

In a future PR, I intend to bump the `go_router_builder` package's
analyzer dependency to 8.2.0; in that analyzer version, the erroneous
`@experimental` annotations have been removed. Unfortunately, that can't
be done yet, since `go_router_builder` still needs to support versions
of flutter that pin analyzer to an earlier version. (See
#10079, which attempts to bump
the analyzer dependency, but breaks trybots).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants