Draft
Conversation
Collaborator
|
@dmdashenkov, have a look at https://pub.dev/packages/freezed. Their approach does not require calling a method. They construct things already immutable. |
Contributor
Author
|
Suspended for now. Please do not delete the branch. |
Collaborator
|
@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. |
Collaborator
|
@dmdashenkov, please also describe this PR so that people can quickly grasp what it's all about. |
Collaborator
|
@dmdashenkov, what you've had in meeting minutes with @armiol should go into this PR. |
Contributor
Author
|
While developing this feature, we've faced a couple of problems.
|
Contributor
Author
|
Right now, we're trying to find out if the Dart team could help us with this problem. Please see the issue. |
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.
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,nullchecks, etc.