Getting builders onto 3.0.0 --> analyzer element2 model #4070
davidmorgan
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please note I'll be away/unavailable 28th June - 6th July, happy to help when I'm back on the 7th! -- Morgan
The analyzer's new element2 APIs are a prerequisite for adding augmentations to the language, which is a feature I'm sure we're all looking forward to :)
Unfortunately for builder maintainers it does mean a breaking change, if you use resolvers/analysis.
Here's the migration guide.
Some example migrations:
google/built_value.dart#1369
google/json_serializable.dart#1504
dart-lang/mockito#817
I've released the
build
element2 version as a prerelease 3.0.0-dev.For those using
source_gen
, the element2 version is merged and pending release, so for now you'll need agit
dependency to use it.Of course we'll be taking any feedback and tweaking/fixing as needed for the full release.
FAQ
What min Dart/Flutter version does my package work with if I switch to 3.0.0 / element2?
Dart >= 3.7, which means Flutter stable releases 3.29 (Feb 12th 2025) and 3.32 (May 20th 2025). This is with analyzer 7.4.0.
Will APIs break again with analyzer 8.0.0?
The current element2 APIs will continue to work until 9.0.0.
Analyzer 8.0.0 will remove the element1 names, such as
LibraryElement
, but will not remove element2 names, such asLibraryElement2
. Then during version 8, they will be renamed in a non-breaking way by adding aliases, e.g.LibraryElement
now as an alias ofLibraryElement2
, and deprecatingLibraryElement2
. ThenLibraryElement2
will be removed only in9.0.0
.Beta Was this translation helpful? Give feedback.
All reactions