All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
schema/0
to access the underlying definition of a message.
- 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/1
to 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.decode
no 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
InvalidFieldAttribute
toInvalidFieldAttributeError
for consistency.
- 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
:path
option in favor of the already existing:paths
option, which covers the same functionality. - BREAKING CHANGE: Remove
:keep_unknown_fields
option (the corresponding--keep-unknown-fields
option for the mix taskprotox.generate
is 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/1
from strings for enums. - BREAKING CHANGE: Remove
Protox.Encode.encode/1
andProtox.Encode.encode!/1
(functionality remains available in generated modules and inProtox
).
- Fix warnings of unknown JSON modules when a JSON library is not installed
- Fix launch by removing :propcheck from extra applications
- Fix typespecs for JSON decoding (thanks to https://github.com/squirmy)
- Use origin repository for propchek rather than a fork
- Fix handling of enum in snake case
- Raise DecodingError and EncodingError for invalid strings (thanks to https://github.com/g-andrade)
- Fix typespec of enum encode function (thanks to https://github.com/wingyplus)
- Fix decoding and encoding of proto3 optional fields
- Support FileOptions (which can be access with
Msg.file_options/0
)
- Format of generated files
- Fix deprecation warnings in Elixir >= 1.14 about Bitwise (thanks to https://github.com/moogle19)
- Raise clearer error message if protoc is missing (thanks to https://github.com/josevalim)
- New release to publish docs using the improved ex_doc 0.27
- Fix JSON conformance tests related to fractional part in Timestamp
- Option to not generate deprecated functions
defs/0
anddefs_by_name/0
- Elixir 1.9 is now the minimal supported version
- Relax constraint on Decimal version (thanks to https://github.com/ananthakumaran)
- Renamed module Protox.Message into Protox.MergeMessage to reflect its real role
- Fix inconsistent behavior when encoding to JSON an enum with an unknown atom field (WARNING: Requires to regenerate code from .proto definitions)
- Fix typespec of message's json_decode! function
- Fix possible double compilation of Empty well-known type
- Fix dependency on protoc for generated code
- Fix compilation when protoc does not include well-known types
- Add support of JSON protobuf encoding and decoding (https://developers.google.com/protocol-buffers/docs/proto3##json), with support of well-known types (except for Any)
- More accurate error reporting
- Internal refactoring to hopefully make things more explicit (based on a work initiated by https://github.com/sneako)
- Fix decoding of fixed32 and fixed64 values (detected using JSON conformance tests)
Protox.Encode.encode/1
andProtox.Encode.encode!/1
; useProtox.encode/1
andProtox.encode!/1
instead- Generated functions
defs/0
anddefs_by_name/0
Fix handling of multiple import paths (thanks to https://github.com/zolakeith)
- Allow multiple import paths (thanks to https://github.com/cheng81)
- Add support of proto3 optional fields (thanks to https://github.com/sneako)
- Bump version to build doc using ex_doc 0.24
- Fix table of types mapping in documentation
- Allow namespaces through protox.generate (thanks to https://github.com/sdrew)
- Expand output path when generating files
- More thorough testing of code generation
- Format generated code
- Fix warning when compiling generated code (thanks to https://github.com/xinz)
- Fix warning about unused variable in generated code when encoding an empty protobuf message
- Update documentation to better explain the package directive usage
- Enable listing of task protox.generate via mix help.
--keep-unknown-fields
option to configure support of unknown fields when generating files
- Add
:keep_unknown_fields
option to configure support of unknown fields
- Fix documentation links
- It's now possible to generate one file per protobuf message to speed up compilation (thanks to https://github.com/qgau)
- Use Protox exceptions as errors codes
- Add mix task to generate files
- Bump to Elixir 1.7 as minimal supported version
- Usage of
@external_resource
is no longer necessary
- Fix parse of
[packed=false]
option (the serialization was correct, but not in compliance with Protobuf conformance checker recommandations)
- BREAKING CHANGE:
encode/1
returns a tuple, useencode!/1
to get the old behavior ofencode/1
- +40% speedup & -30% memory consumption when decoding thanks to macros
- Raise RequiredFieldsError when encoding or decoding a Protobuf 2 message with unset required fields (that is, that have the value
nil
) - Raise IllegalTagError when decoding a message with a tag set to
0
- Fix missing encoding of unknown fields when a message hadn't any field
- Constant time encoding of oneof fields
- Move back to ahamez/protox
- Bump to Elixir 1.6 as minimal supported version
- Add benchmarks
- Add conformance tests to CI
- Add dialyzer to CI
- Pass all tests of protobuf 3.12 conformance suite tests
- Always serialize required fields (proto2)
defs_by_name/0
in generated modules for messagessyntax/0
in generated modules for messagesProtox.MergeMessage.merge/2
to merge two messages of the same type
- BREAKING CHANGE: (proto2) use nil for unset fields
- BREAKING CHANGE: rename generated
get_required_fields/0
intorequired_fields/0
- BREAKING CHANGE: rename generated
get_unknown_fields/0
intounknown_fields/0
- BREAKING CHANGE: rename generated
get_unknown_fields_name/0
intounknown_fields_name/0
- Fix warning about duplicate keys (thanks to https://github.com/ananthakumaran)
- CamelCase for all generated modules (fixes #3)
- Allow ability to construct file names at compile time (thanks to https://github.com/ananthakumaran)
:path
option to specify import path (thanks to https://github.com/mathsaey)
- Fix generation of typespecs for when there are more than one required field
- Change base name for unknown fields from
__unknown_fields__
to__uf__
- Fix handling of +/-infinity and NaN when encoding/decoding floats
- Move
RandomInit
to tests
- Fix typespecs for enum constants accessors
- Fix typespecs for unknown and required fields accessors
- Use
0.0
as default value for floats and doubles
- Development now takes place at https://github.com/EasyMile/protox
- Move conformance test escript to https://github.com/EasyMile/protox-conformance
- Benchmarks escripts
- Typespecs for generated encoder
- Bring
varint
library intoprotox
- Fix decoding of booleans encoded with a varint which is not
0
or1
- Fix handling of unset members in map entries
- ~2x speed improvement when encoding
- It's now possible to clear unknown fields
- Encode unknown fields
- Update deps (dialyxir, excoveralls, hackney)
- Keep unknown fields when decoding
- Raise an error when decoding and when required fields are missing
- Fix encoding of varint to match C++ version
- Fix encoding of enums to match C++ version
- Read definitions from files or binaries
- Parse definitions with protoc
- Generate Elixir structs from parsed definition
- Can prepend namespaces
- Encode/decode protobuf messages