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.
We should let the consumer of the package add Codable conformances if they need it. Tonic does not depend on these conformances.
The reason being that Swift doesn't allow you to override the default encode/decode behavior if defined in the package. This is inflexible for the consumer of the package.
Example of a problem that I just ran into:
I defined my own coding keys and encode/decode methods for these structs and used them in my save files. I did this because at the time of writing the code our raw values were integers and I wanted keys which would not change with future updates to the package. However, now that we added Codable to the package I am forced to use the package's raw values for coding keys and the default encode/decode. This breaks my save files in a way that would require a significant refactor to resolve.
TLDR - let the developer using the package add this in their codebase:
extension ChordType: Codable {}