Skip to content

Upgrade freezed_annotation to the latest version (^3.0.0) #815

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

Closed
riojosdev opened this issue Apr 16, 2025 · 4 comments
Closed

Upgrade freezed_annotation to the latest version (^3.0.0) #815

riojosdev opened this issue Apr 16, 2025 · 4 comments

Comments

@riojosdev
Copy link
Contributor

Describe the bug/problem

Please describe the bug/problem here
Including the latest openapi_spec package (v0.9.0) in the apidash_core dependencies causes a dependencies version conflict (for freezed_annotation package), the following error message was received during this import

Resolving dependencies... (1.7s)
Because every version of apidash_core from path depends on freezed_annotation
  ^2.4.1 and every version of openapi_spec from path depends on
  freezed_annotation ^3.0.0, apidash_core from path is incompatible with
  openapi_spec from path.
So, because apidash depends on apidash_core from path which depends on
  openapi_spec from path, version solving failed.
Failed to update packages.

Steps to Reproduce the bug/problem

Please provide the steps to reproduce the behavior. Screenshot(s)/image(s) are preferred to help explain it better

  • cd into packages\apidash_core
  • git clone https://github.com/tazatechnology/openapi_spec.git
  • Include the new package openapi_spec by adding the following in the dependencies section of packages\apidash_core\pubspec.yaml and packages\apidash_core\pubspec_overrides.yaml
openapi_spec:
    path: ../openapi_spec
  • Run flutter pub get while in the apidash root directory

Expected behavior

Description of what you expected to happen
Newly added package getting resolved and downloaded into the project

Device Info (The device where you encountered this issue)

  • OS: [e.g. Windows, MacOS] Windows
  • Version: [e.g. Catalina 10.15.7, Monterey 12.3.1, Windows 11 22H2] Windows 11 22H2
@riojosdev
Copy link
Contributor Author

riojosdev commented Apr 16, 2025

related to issue #121
(edit) and the draft PR #816

@riojosdev
Copy link
Contributor Author

During the upgrade of freezed_annotation to v3.0.0 and freezed to v3.0.6 package, for supporting openapi_spec v0.9.0, version solving conflict happened between apidash's dependecy melos and with openapi_spec, mentioning pub_updater (0.4.0 and 0.5.0 respectively).

Solving this issue resulted in #820

@animator
Copy link
Member

Switch to a lower compatible version.

@riojosdev
Copy link
Contributor Author

@animator I agree, we do not need to upgrade right now. A lot more packages APIDash depends on are using a lower version of freezed and freezed_annotation. Currently I found the packages apidash_core, insomnia_collection, postman, seed, ollama_dart, mime_dart using a lower version.

For the migration each freezed classes needs to have a modifier either abstract or sealed. And I haven't yet fully come up how to migrate the pattern matching implementation. See freezed 2 -> 3 migration guide. It would help if we can identify what all classes and the pattern matching implementations needed to be changed for a seamless migration, later when this issue is reopened

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

No branches or pull requests

2 participants