New
v2.0.0
2.0.0
Added
schema/0to access the underlying definition of a message.
Changed
- Minimal supported Elixir version is now 1.15.
- BREAKING CHANGE: encoding functions now return the size alongside iodata.
Previously, one had to use
:binary.list_to_bin/1to flatten the iodata and then usebyte_size, defeating the purpose of having an iodata. Furthermore, it provides a significant performance boost. - BREAKING CHANGE:
Protox.decode!andProtox.decodeno longer raise or return an error if a message don't have all required fields set. We should let the user decide whether it's a problem. - BREAKING CHANGE: Rename
InvalidFieldAttributetoInvalidFieldAttributeErrorfor consistency.
Removed
- BREAKING CHANGE: Drop support of JSON encoding and decoding. The implementation was half-baked, it's preferable to have the library focused. Even Google doesn't recommend using JSON: "In short, there are many good reasons why Google prefers to use the standard wire format for virtually everything rather than ProtoJSON format".
- BREAKING CHANGE: Remove
:pathoption in favor of the already existing:pathsoption, which covers the same functionality. - BREAKING CHANGE: Remove
:keep_unknown_fieldsoption (the corresponding--keep-unknown-fieldsoption for the mix taskprotox.generateis also removed). They are now always kept. It added complexity to the generation logic while not providing any value as one can simply ignore those fields and as it's mandatory to parse them correctly. - BREAKING CHANGE: Remove generated
defs/0(functionality remains available throughschema/0). - BREAKING CHANGE: Remove generated
field_def/1(functionality remains available throughschema/0). - BREAKING CHANGE: Remove generated
file_options/0(functionality remains available throughschema/0). - BREAKING CHANGE: Remove generated
required_fields/0(functionality remains available throughschema/0). - BREAKING CHANGE: Remove generated
syntax/0(functionality remains available throughschema/0). - BREAKING CHANGE: Remove generated
encode/1from strings for enums. - BREAKING CHANGE: Remove
Protox.Encode.encode/1andProtox.Encode.encode!/1(functionality remains available in generated modules and inProtox).