Skip to content

Protocol Buffers v3.0.0-beta-4

Pre-release
Pre-release
Compare
Choose a tag to compare
@xfxyjwf xfxyjwf released this 20 Jul 00:40

Version 3.0.0-beta-4

General

  • Added a deterministic serialization API for C++. The deterministic
    serialization guarantees that given a binary, equal messages will be
    serialized to the same bytes. This allows applications like MapReduce to
    group equal messages based on the serialized bytes. The deterministic
    serialization is, however, NOT canonical across languages; it is also
    unstable across different builds with schema changes due to unknown fields.
    Users who need canonical serialization, e.g. persistent storage in a
    canonical form, fingerprinting, etc, should define their own
    canonicalization specification and implement the serializer using reflection
    APIs rather than relying on this API.

  • Added OneofOptions. You can now define custom options for oneof groups.

    import "google/protobuf/descriptor.proto";
    extend google.protobuf.OneofOptions {
      optional int32 my_oneof_extension = 12345;
    }
    message Foo {
      oneof oneof_group {
        (my_oneof_extension) = 54321;
        ...
      }
    }
    

C++ (beta)

  • Introduced a deterministic serialization API in
    CodedOutputStream::SetSerializationDeterministic(bool). See the notes about
    deterministic serialization in the General section.
  • Added google::protobuf::Map::swap() to swap two map fields.
  • Fixed a memory leak when calling Reflection::ReleaseMessage() on a message
    allocated on arena.
  • Improved error reporting when parsing text format protos.
  • JSON
    • Added a new parser option to ignore unknown fields when parsing JSON.
    • Added convenient methods for message to/from JSON conversion.
  • Various performance optimizations.

Java (beta)

  • File option "java_generate_equals_and_hash" is now deprecated. equals() and
    hashCode() methods are generated by default.
  • Added a new JSON printer option "omittingInsignificantWhitespace" to produce
    a more compact JSON output. The printer will pretty-print by default.
  • Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos.

Python (beta)

  • Added support to pretty print Any messages in text format.
  • Added a flag to ignore unknown fields when parsing JSON.
  • Bugfix: "@type" field of a JSON Any message is now correctly put before
    other fields.

Objective-C (beta)

  • Updated the code to support compiling with more compiler warnings
    enabled. (Issue 1616)
  • Exposing more detailed errors for parsing failures. (PR 1623)
  • Small (breaking) change to the naming of some methods on the support classes
    for map<>. There were collisions with the system provided KVO support, so
    the names were changed to avoid those issues. (PR 1699)
  • Fixed for proper Swift bridging of error handling during parsing. (PR 1712)
  • Complete support for generating sources that will go into a Framework and
    depend on generated sources from other Frameworks. (Issue 1457)

C# (beta)

  • RepeatedField optimizations.
  • Support for .NET Core.
  • Minor bug fixes.
  • Ability to format a single value in JsonFormatter (advanced usage only).
  • Modifications to attributes applied to generated code.

Javascript (alpha)

  • Maps now have a real map API instead of being treated as repeated fields.
  • Well-known types are now provided in the google-protobuf package, and the
    code generator knows to require() them from that package.
  • Bugfix: non-canonical varints are correctly decoded.

Ruby (alpha)

  • Accessors for oneof fields now return default values instead of nil.

Java Lite

  • Java lite support is removed from protocol compiler. It will be supported
    as a protocol compiler plugin in a separate code branch.