chore(deps): [BREAKING] Support freezed 3#87
Open
JohannSchramm wants to merge 3 commits intotimcreatedit:mainfrom
Open
chore(deps): [BREAKING] Support freezed 3#87JohannSchramm wants to merge 3 commits intotimcreatedit:mainfrom
JohannSchramm wants to merge 3 commits intotimcreatedit:mainfrom
Conversation
87596b6 to
c562bfd
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the freezed dependencies to support version 3.x while maintaining backward compatibility with version 2.4.7+. The models have been regenerated with freezed 3, introducing breaking changes where pattern matching methods (.map/.when) are moved from mixins to extensions, and internal implementation classes are now exposed.
Changes:
- Updated
freezedandfreezed_annotationversion constraints to support both 2.4.7+ and <4.0.0 - Regenerated all freezed models with freezed 3, moving pattern matching methods to extensions
- Added
abstract classkeyword to freezed model declarations for freezed 3 compatibility
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Updated version constraints for freezed and freezed_annotation to support 2.4.7+ through 3.x |
| lib/src/view/state/scribble.state.g.dart | Regenerated JSON serialization code with simplified naming (_$DrawingImpl → Drawing) |
| lib/src/view/state/scribble.state.freezed.dart | Regenerated freezed code with pattern matching moved to extensions, exposed implementation classes |
| lib/src/domain/model/sketch_line/sketch_line.dart | Added abstract keyword to class declaration |
| lib/src/domain/model/sketch_line/sketch_line.g.dart | Regenerated JSON serialization code with simplified naming |
| lib/src/domain/model/sketch_line/sketch_line.freezed.dart | Regenerated freezed code with pattern matching in extensions |
| lib/src/domain/model/sketch/sketch.dart | Added abstract keyword to class declaration |
| lib/src/domain/model/sketch/sketch.g.dart | Regenerated JSON serialization code with simplified naming |
| lib/src/domain/model/sketch/sketch.freezed.dart | Regenerated freezed code with pattern matching in extensions |
| lib/src/domain/model/point/point.dart | Added abstract keyword to class declaration |
| lib/src/domain/model/point/point.g.dart | Regenerated JSON serialization code with simplified naming |
| lib/src/domain/model/point/point.freezed.dart | Regenerated freezed code with pattern matching in extensions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This updates the version constraints of
freezedandfreezed_annotationto support freezed 3.x versions.Instead of using
freezed: ^3.0.0, I opted into usingfreezed: ">=2.4.7 <4.0.0"to allow using both freezed 3 and freezed 2, as updating to freezed 3 can be quite substantial.Although it is compatible with freezed 2, the models were generated with freezed 3, so this is a breaking change, as
.map/.whenare no longer generated, andSketchis exposed. However updating the codebase to use pattern matching is probably less of a hassle than generally adopting freezed 3 and potentially riverpod 3.This should also close: #78
Checklist