-
Notifications
You must be signed in to change notification settings - Fork 1
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
Immutable types #11
base: master
Are you sure you want to change the base?
Immutable types #11
Conversation
@dmdashenkov, have a look at https://pub.dev/packages/freezed. Their approach does not require calling a method. They construct things already immutable. |
Suspended for now. Please do not delete the branch. |
@dmdashenkov, I'm reopening the PR to:
Please also mention the issue you created in this PR, so that people can find it from that issue and see why our request is important. |
@dmdashenkov, please also describe this PR so that people can quickly grasp what it's all about. |
@dmdashenkov, what you've had in meeting minutes with @armiol should go into this PR. |
While developing this feature, we've faced a couple of problems.
|
Right now, we're trying to find out if the Dart team could help us with this problem. Please see the issue. |
In this PR we introduce immutable Dart types generated based on Protobuf definitions.
Standard Protobuf Dart tool generated code which is always mutable. Even though messages can be "frozen", their API always has setters. This is confusing so we want to make all Protobuf messages immutable by default.\
The current idea of going about this problem is to generate abstract classes based on Protobuf definitions and then feed those classes to
built_value
— a builder which would complete the boilerplate side of code generation, such as builders,null
checks, etc.