eng(build): upgrade analyzer, build and source_gen dependencies#650
eng(build): upgrade analyzer, build and source_gen dependencies#650tshedor merged 23 commits intoGetDutchie:mainfrom JaseElder:main
Conversation
|
great! |
| required SupabaseProvider provider, | ||
| OfflineFirstWithSupabaseRepository? repository, | ||
| }) async { | ||
| return Customer(); |
There was a problem hiding this comment.
data should still populate the Customer instance fields
| required SqliteProvider provider, | ||
| OfflineFirstWithSupabaseRepository? repository, | ||
| }) async { | ||
| return Customer()..primaryKey = data['_brick_id'] as int; |
| required SupabaseProvider provider, | ||
| OfflineFirstWithSupabaseRepository? repository, | ||
| }) async { | ||
| return Pizza(); |
There was a problem hiding this comment.
@tshedor I didn't knowingly regenerate them. I tried to stay away from the example folders. They may have been generated during rework - I'll try to explicitly gen.
| required SqliteProvider provider, | ||
| OfflineFirstWithSupabaseRepository? repository, | ||
| }) async { | ||
| return Pizza()..primaryKey = data['_brick_id'] as int; |
| if (!checkerA.isExactly(b.enclosingElement)) { | ||
| // in this case, you want to prioritize the enclosingElement that is more "super". | ||
| if (checkerA.isAssignableFrom(b.enclosingElement3)) { | ||
| if (checkerA.isAssignableFrom(b.enclosingElement)) { |
There was a problem hiding this comment.
Non-actionable feedback here. The analyzer team is so inconsistent. When I first wrote this code there were no numbers. Now they're going back to numbers. But it's all the same property and same value. I wish they would stop publishing these breaking changes. Thank you again for taking the effort to update these.
There was a problem hiding this comment.
Also it's really hard to find documentation on migration and deprecation for analyzer. And quite a few of the methods/properties were deprecated in intermediate analyzer versions, and then completely removed in the latest, so working out what the replacement path is was frustrating.
packages/brick_build/pubspec.yaml
Outdated
|
|
||
| dependencies: | ||
| analyzer: ">=6.11.0 <8.0.0" | ||
| analyzer: ">=6.11.0 <9.0.0" |
There was a problem hiding this comment.
Is this minimum version still valid?
| analyzer: ">=6.11.0 <9.0.0" | |
| analyzer: ">=8.0.0 <9.0.0" |
packages/brick_build/pubspec.yaml
Outdated
| analyzer: ">=6.11.0 <9.0.0" | ||
| brick_core: ">=2.0.0 <3.0.0" | ||
| build: ">=2.4.2 <2.5.0" | ||
| build: ">=2.4.2 <5.0.0" |
There was a problem hiding this comment.
Similarly. It's OK to keep this restricted
| build: ">=2.4.2 <5.0.0" | |
| build: ">=4.0.0 <5.0.0" |
| repository: https://github.com/GetDutchie/brick | ||
|
|
||
| version: 3.0.0 | ||
| version: 3.0.1 |
There was a problem hiding this comment.
| version: 3.0.1 | |
| version: 3.1.0 |
|
|
||
| dependencies: | ||
| analyzer: ">=6.11.0 <8.0.0" | ||
| analyzer: ">=6.11.0 <9.0.0" |
There was a problem hiding this comment.
I won't go through every pubspec, but they can all be updated to one major version less than the highest band
There was a problem hiding this comment.
Upgraded minimums
| } | ||
|
|
||
| /// Extract filename from library identifier path | ||
| static String _extractFilename(String libraryPath) { |
There was a problem hiding this comment.
This feels...off. But I also know that source gen doesn't really want you to know the path of the file you're generating. This is the best solution given the new properties available?
There was a problem hiding this comment.
Yeah this was messy - I've made it more aligned with the new properties now, I think.
… dependencies - reverted generated file changes in example_supabase - simplified allMigrationsByFilePath() file path fetching
# Conflicts: # packages/brick_json_generators/pubspec.yaml # packages/brick_offline_first_build/pubspec.yaml # packages/brick_offline_first_with_supabase_build/pubspec.yaml # packages/brick_rest_generators/pubspec.yaml # packages/brick_sqlite_generators/pubspec.yaml # packages/brick_supabase_generators/pubspec.yaml
… dependencies - reverted generated file changes in example_supabase - simplified allMigrationsByFilePath() file path fetching
|
Those are the tests I was talking about above. In this case, nullableConstructor is the culprit. If you could point me in the direction of where to look to modify the generator to make the test past, I could amend the code. Otherwise, it might be faster for you to have a look. |
| final defaultConstructor = _firstWhereOrNull<ConstructorElement>( | ||
| element.constructors, | ||
| (e) => !e.isFactory && e.name.isEmpty, | ||
| (e) => !e.isFactory && ((e.name?.isEmpty ?? true) || e.name == 'new'), |
There was a problem hiding this comment.
@JaseElder this was the missing logic that was breaking tests. The default (unnamed) constructor is no longer unnamed in the analyzer, it's now 'new'
There was a problem hiding this comment.
@tshedor Nice one!
Thanks for the help and the repo update
Hi,
This PR should address the issues with out of date dependencies for analyzer, source_gen and build.
There were a few breaking changes since the last compatible analyzer version, so there were quite a few API deprecations and deletions.
Almost all tests are passing, but for the tests that deal with nullability type mismatches in Constructors, e.g.
in
packages/brick_offline_first_build/test/offline_first_generator_test.dartthe testCustomOfflineFirstSerdesThese are failing - I couldn't track down where the type needed to be modified.
But that affects ~3 tests, and I'd imagine you'll be able to track it down instantly.