Skip to content

Conversation

josh-audio
Copy link
Contributor

@josh-audio josh-audio commented Sep 16, 2025

This PR updates mobx_codegen to use analyzer: '>=7.4.0 < 9.0.0', and also upgrades some related packages. analyzer >= 8.0.0 removes the old Element v1 API, and deprecates the v2 names (e.g. ClassElement2).

This PR also resolves associated deprecations, and removes all deprecation ignore comments except for one, which is unrelated to this change as far as I can tell.

Deprecation changes have been reverted, see discussion below.


Pull Request Checklist

  • If the changes are being made to code, ensure the version in pubspec.yaml is updated.
  • Increment the major/minor/patch/patch-count, depending on the complexity of change
  • Add the necessary unit tests to ensure the coverage does not drop
  • Update the Changelog to include all changes made in this PR, organized by version
  • Run the melos run set_version command from the root directory
  • Include the necessary reviewers for the PR
  • Update the docs if there are any API changes or additions to functionality

@josh-audio
Copy link
Contributor Author

As requested in the PR template, pinging some folks for review:

Thank you!

@amondnet amondnet requested a review from Copilot September 16, 2025 22:52
Copy link

@Copilot Copilot AI left a 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 PR updates the mobx_codegen package to use analyzer version 8.1.1 and resolves all associated deprecations by migrating from the deprecated Element v2 API to the current Element API.

  • Upgraded analyzer to ^8.1.1 along with related packages (build, source_gen, build_runner, build_resolvers)
  • Replaced all deprecated Element2 API usage with the current Element API throughout the codebase
  • Updated type checker instantiation from runtime-based to package-scoped references

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
mobx_examples/lib/clock/clock.dart Changed parameter type from implicit to explicit dynamic
mobx_codegen/pubspec.yaml Updated package versions and incremented version to 2.7.3
mobx_codegen/lib/version.dart Updated version constant to match pubspec
mobx_codegen/CHANGELOG.md Added changelog entry for version 2.7.3
mobx_codegen/test/util_test.dart Updated import and removed deprecated API usage in test mocks
mobx_codegen/test/store_class_visitor_test.dart Updated test mocks to use current Element API
mobx_codegen/lib/src/type_names.dart Migrated from Element2 to Element API throughout type name resolution
mobx_codegen/lib/src/template/*.dart Updated template classes to use current Element API
mobx_codegen/lib/src/store_class_visitor.dart Comprehensive migration from Element2 API and updated TypeChecker usage
mobx_codegen/lib/src/mobx_codegen_base.dart Updated core generator logic to use current Element API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@josh-audio
Copy link
Contributor Author

josh-audio commented Sep 17, 2025

I've updated this PR to widen the supported analyzer range, and I've confirmed this support by setting a few overrides including analyzer: 7.4.0 in pubspec_overrides.yaml and running dart test.

@josh-audio josh-audio changed the title Update analyzer to 8.1.1 along with related packages, and resolve deprecations Update analyzer to >=7.4.0 <9.0.0, bump related packages, and resolve deprecations Sep 17, 2025
@josh-audio josh-audio changed the title Update analyzer to >=7.4.0 <9.0.0, bump related packages, and resolve deprecations Update analyzer to >=7.4.0 <9.0.0 and bump related packages Sep 17, 2025
@amondnet amondnet requested a review from Copilot September 18, 2025 03:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@amondnet amondnet merged commit 797103a into mobxjs:main Sep 18, 2025
7 checks passed
@amondnet
Copy link
Collaborator

@all-contributors
please add @josh-audio for code
please add @amondnet for review, maintenance

Copy link
Contributor

@amondnet

I've put up a pull request to add @josh-audio! 🎉

@josh-audio josh-audio deleted the analyzer-8.1.1 branch September 18, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants