Skip to content

FED-4894 Support analyzer >=10 <15 - #1012

Merged
btr-rmconsole-4[bot] merged 18 commits into
masterfrom
allow-latest-analyzer
Sep 22, 2026
Merged

btr-rmconsole-4[bot] merged 18 commits into
masterfrom
allow-latest-analyzer

Conversation

@greglittlefield-wf

@greglittlefield-wf greglittlefield-wf commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The latest analyzer package version is 14.x, but the latest over_react supports is 10.x.

We want to support the latest, to unblock upgrading of other packages, and to allow consumers to use newer language features without risk of parsing errors.

Solution

  • Bump analyzer dependency from >=5.13.0 <11.0.0 to >=10.0.0 <15.0.0
    • Supporting a wide range is difficult due to cascading API removals, so the lower bound was raised to 10
  • Update analyzer-consuming code in builder to work with breakages throughout this new range
    • NamedCompilationUnitMember removals - changed to CompilationUnitMember, added ClassishDeclaration.name to help with this and used it since we already had an instance of it in most places
    • Add BlockClassBody casts when needed
    • Add namedArgumentParts to deal with ArgumentList element type changes
  • Update tool/set_analyzer_constraint.dart to delete dependencies that unnecessarily constrain analyzer
    • This was an issue when other packages not being up to date were blocking over_react from resolving without overrides, and probably isn't necessary today, but I'm gonna leave it in since it'll likely be useful in the next analyzer upgrade

QA Instrucions

  • CI passes
  • Verify that each supported analyzer major has a corresponding validate_analyzer CI run
  • (optional) Pull into a big app and verify it builds with the latest analyzer

@greglittlefield-wf
greglittlefield-wf changed the base branch from master to drop-dart-2-support August 6, 2026 23:37
greglittlefield-wf and others added 7 commits August 6, 2026 17:03
…r analyzer 11-14

Analyzer 11-14 removed several AST APIs the builder relied on. This
migrates off them so the builder works across analyzer 10 through 14:
- NamedCompilationUnitMember → CompilationUnitMember (removed in 11)
- ClassDeclaration.{members,typeParameters,leftBracket,rightBracket} →
  via .body.members/.namePart.typeParameters/etc. (removed in 11)
- ClassBody.members shim for analyzer 10/11 (moved to ClassBody in 12)
- NamedExpression → NamedArgument via dynamic dispatch (renamed in 13)

Also removes the build_runner <2.14.0 workaround cap (fixed in 2.15.1),
updates the validate_analyzer CI matrix to test ^10 through ^14, and
extends set_analyzer_constraint.dart to strip dev deps that cap the
analyzer so high-version rows can resolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Base automatically changed from drop-dart-2-support to master September 21, 2026 22:05
/// Extension built on [NameHelper] to allow for easy access to the `name`
/// field of [Identifier]s.
extension TypeNameHelper on NamedType {
// Backwards compatibility for various analyzer versions that remove name/name2.

@greglittlefield-wf greglittlefield-wf Sep 21, 2026 •

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.

Removed these since they were only needed for older analyzer versions

dynamic getJsChildren(instance) => getProperty(instance.props as Object, 'children');

dynamic getRawDartChildren(var renderedInstance) {
dynamic getRawDartChildren(dynamic renderedInstance) {

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.

This was a random compiler warning I fixed while I was debugging build_runner/test issues

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yep, this is now an error to use var as a type in a declaration

@greglittlefield-wf greglittlefield-wf changed the title Support analyzer >=10 <15 FED-4894 Support analyzer >=10 <15 Sep 21, 2026
@greglittlefield-wf
greglittlefield-wf marked this pull request as ready for review September 21, 2026 23:50
Comment thread .github/workflows/ci.yml
- id: link
name: Override over_react dependency with local path
run: cd ../.. && dart pub get && dart tool/travis_link_plugin_deps.dart
# TODO reinstate this once we update analyzer_plugin's analyzer range to overlap with what over_react supports

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.

Note that analyzer_plugin isn't up to date on analyzer yet; that'll be a separate PR

Comment thread pubspec.yaml
@@ -1,18 +1,18 @@
name: over_react
version: 5.7.0
version: 5.8.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should this be bumped now or as part of the release?

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.

Oh good catch; usually it gets bumped in the release, but I don't think having it in this PR will cause any issues. If it does, I'll fix it up in the release PR

@robbecker-wf

Copy link
Copy Markdown
Member

QA +1 CI passes, builds and serves on analyzer 14 in internal projects

@greglittlefield-wf

Copy link
Copy Markdown
Contributor Author

@Workiva/release-management-p

@rmconsole-wf rmconsole-wf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 from RM

@btr-rmconsole-4
btr-rmconsole-4 Bot merged commit b7fc518 into master Sep 22, 2026
20 checks passed
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