Skip to content

chore(deps): [BREAKING] Support freezed 3#87

Open
JohannSchramm wants to merge 3 commits intotimcreatedit:mainfrom
JohannSchramm:freezed-3
Open

chore(deps): [BREAKING] Support freezed 3#87
JohannSchramm wants to merge 3 commits intotimcreatedit:mainfrom
JohannSchramm:freezed-3

Conversation

@JohannSchramm
Copy link
Collaborator

Description

This updates the version constraints of freezed and freezed_annotation to support freezed 3.x versions.

Instead of using freezed: ^3.0.0, I opted into using freezed: ">=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/.when are no longer generated, and Sketch is 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

  • My PR title is in the style of conventional commits
  • All public facing APIs are documented with dartdoc
  • I have added tests to cover my changes

@JohannSchramm JohannSchramm changed the title [BREAKING] Support freezed 3 chore(deps): [BREAKING] Support freezed 3 Feb 27, 2026
Copy link

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 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 freezed and freezed_annotation version 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 class keyword 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.

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