-
Notifications
You must be signed in to change notification settings - Fork 111
update source_gen to v4 #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: community
Are you sure you want to change the base?
update source_gen to v4 #1877
Conversation
666d445 to
dc59fd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request upgrades the source_gen dependency to version 4.0.0 and updates related dependencies across the repository. This upgrade requires changes to accommodate breaking API changes in the analyzer and build_test packages, including the transition from deprecated element APIs to newer fragment-based APIs.
Key changes:
- Updated source_gen from 2.0.0 to 4.0.0 and analyzer from 7.3.0 to 8.0.0
- Migrated from deprecated element APIs (name, enclosingElement3, parameters, etc.) to newer alternatives (displayName, enclosingElement, formalParameters)
- Updated test utilities to use new build_test v3.0.0 API (result.readerWriter instead of InMemoryAssetWriter)
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/realm_generator/pubspec.yaml | Updated core dependencies including source_gen, analyzer, build, and build_test |
| packages/realm_generator/test/test_util.dart | Migrated test builder usage from InMemoryAssetWriter to result.readerWriter API |
| packages/realm_generator/test/common.dart | Changed from AnalysisError to Diagnostic for error handling |
| packages/realm_generator/lib/src/type_checkers.dart | Replaced TypeChecker.fromRuntime with TypeChecker.typeNamed |
| packages/realm_generator/lib/src/realm_field_info.dart | Updated field name access from name to displayName |
| packages/realm_generator/lib/src/field_element_ex.dart | Migrated multiple deprecated element APIs to current versions |
| packages/realm_generator/lib/src/error.dart | Changed enclosingElement3 to enclosingElement |
| packages/realm_generator/lib/src/element.dart | Updated from getElementDeclaration to getFragmentDeclaration API |
| packages/realm_generator/lib/src/dart_type_ex.dart | Replaced TypeChecker.fromRuntime with TypeChecker.typeNamed and added package specifications |
| packages/realm_generator/lib/src/class_element_ex.dart | Changed name to displayName for element access |
| packages/ejson_lint/pubspec.yaml | Updated analyzer and custom_lint_builder dependencies |
| packages/ejson_lint/lib/src/lints/*.dart | Migrated lint rules to use DiagnosticSeverity, DiagnosticReporter, and fragment-based APIs |
| packages/ejson_generator/pubspec.yaml | Updated source_gen, analyzer, build, and build_test dependencies |
| packages/ejson_generator/test/compile_test.dart | Migrated test builder usage to result.readerWriter API |
| packages/ejson_generator/lib/src/generator.dart | Changed from parameters to formalParameters and name to displayName |
| packages/ejson_analyzer/pubspec.yaml | Updated analyzer and source_gen dependencies |
| packages/ejson_analyzer/lib/src/ejson_analyzer_base.dart | Replaced TypeChecker.fromRuntime with TypeChecker.typeNamed |
| packages/*/pubspec.yaml | Updated SDK constraint to ^3.7.0 and various lints/test dependencies |
| CHANGELOG.md | Documented the dependency updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
35ca095 to
ca18d1b
Compare
|
@nirinchev |
|
@NatsuOnFire I checked your branch (with flutter 3.35.5) and when running It seems that the dependencies require a higher version of test_api than the one bundled with the current Flutter SDK. If you want to revert to an older test_api, it looks like analytics would also need to be downgraded from version 8 to 7. One solution I found is that the latest Flutter version (^3.38) satisfies the required test_api constraints, and the bootstrap process completes successfully. So it appears you may need to either downgrade some dependencies or upgrade Flutter to ^3.38.0 (I checked you branch with flutter 3.38.3 and everything seems ok) Hope this helps! |
ca18d1b to
e522bb9
Compare
|
Thanks @mszczesniak94 |
No description provided.