FED-4894 Support analyzer >=10 <15 - #1012
Conversation
1d7b385 to
344dd4c
Compare
…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>
1bd7fab to
ef5b671
Compare
| /// 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. |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
This was a random compiler warning I fixed while I was debugging build_runner/test issues
There was a problem hiding this comment.
yep, this is now an error to use var as a type in a declaration
| - 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 |
There was a problem hiding this comment.
Note that analyzer_plugin isn't up to date on analyzer yet; that'll be a separate PR
| @@ -1,18 +1,18 @@ | |||
| name: over_react | |||
| version: 5.7.0 | |||
| version: 5.8.0 | |||
There was a problem hiding this comment.
should this be bumped now or as part of the release?
There was a problem hiding this comment.
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
|
QA +1 CI passes, builds and serves on analyzer 14 in internal projects |
|
@Workiva/release-management-p |
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
>=5.13.0 <11.0.0to>=10.0.0 <15.0.0NamedCompilationUnitMemberremovals - changed toCompilationUnitMember, addedClassishDeclaration.nameto help with this and used it since we already had an instance of it in most placesBlockClassBodycasts when needednamedArgumentPartsto deal withArgumentListelement type changesanalyzerQA Instrucions
validate_analyzerCI run