Skip to content

Releases: protocolbuffers/protobuf

Protocol Buffers v3.4.1

15 Sep 22:32
Compare
Choose a tag to compare

This is mostly a bug fix release on runtime packages. It is safe to use 3.4.0 protoc packages for this release.

  • Fixed the missing files in 3.4.0 tarballs, affecting windows and cmake users.
  • C#: Fixed dotnet target platform to be net45 again.
  • Ruby: Fixed a segmentation error when using maps in multi-threaded cases.
  • PHP: php_generic_service file level option tag number (in descriptor.proto) has been reassigned to avoid conflicts.

Protocol Buffers v3.4.0

15 Aug 23:57
Compare
Choose a tag to compare

Planned Future Changes

  • Preserve unknown fields in proto3: We are going to bring unknown fields back into proto3. In this release, some languages start to support preserving unknown fields in proto3, controlled by flags/options. Some languages also introduce explicit APIs to drop unknown fields for migration. Please read the change log sections by languages for details. See general timeline and plan and issues and discussions

  • Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields semantic changes are finished. Please join this github issue to provide your feedback.

General

  • Extension ranges now accept options and are customizable.
  • reserve keyword now supports max in field number ranges, e.g. reserve 1000 to max;

C++

  • Proto3 messages are now able to preserve unknown fields. The default behavior is still to drop unknowns, which will be flipped in a future release. If you rely on unknowns fields being dropped. Please use Message::DiscardUnknownFields() explicitly.

  • Packable proto3 fields are now packed by default in serialization.

  • Following C++11 features are introduced when C++11 is available:

    • move-constructor and move-assignment are introduced to messages
    • Repeated fields constructor now takes std::initializer_list
    • rvalue setters are introduced for string fields
  • Experimental Table-Driven parsing and serialization available to test. To enable it, pass in table_driven_parsing table_driven_serialization protoc generator flags for C++

    $ protoc --cpp_out=table_driven_parsing,table_driven_serialization:./ test.proto

  • lite generator parameter supported by the generator. Once set, all generated files, use lite runtime regardless of the optimizer_for setting in the .proto file.

  • Various optimizations to make C++ code more performant on PowerPC platform

  • Fixed maps data corruption when the maps are modified by both reflection API and generated API.

  • Deterministic serialization on maps reflection now uses stable sort.

  • file() accessors are introduced to various *Descriptor classes to make writing template function easier.

  • ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and SpaceUsedLong() instead

  • Consistent hash function is used for maps in DEBUG and NDEBUG build.

  • "using namespace std" is removed from stubs/common.h

  • Various performance optimizations and bug fixes

Java

  • Introduced new parser API DiscardUnknownFieldsParser in preparation of proto3 unknown fields preservation change. Users who want to drop unknown fields should migrate to use this new parser API.
    For example:

    Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
    Foo foo = parser.parseFrom(input);
  • Introduced new TextFormat API printUnicodeFieldValue() that prints field value without escaping unicode characters.

  • Added Durations.compare(Duration, Duration) and Timestamps.compare(Timestamp, Timestamp).

  • JsonFormat now accepts base64url encoded bytes fields.

  • Optimized CodedInputStream to do less copies when parsing large bytes fields.

  • Optimized TextFormat to allocate less memory when printing.

Python

  • SerializeToString API is changed to SerializeToString(self, **kwargs), deterministic parameter is accepted for deterministic serialization.
  • Added sort_keys parameter in json format to make the output deterministic.
  • Added indent parameter in json format.
  • Added extension support in json format.
  • Added __repr__ support for repeated field in cpp implementation.
  • Added file in FieldDescriptor.
  • Added pretty-print filter to text format.
  • Services and method descriptors are always printed even if generic_service option is turned off.
  • Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will never update protobuf runtime. Users who depend on AppEngine 2.5 should use old protoc.

PHP

  • Support PHP generic services. Specify file option php_generic_service=true to enable generating service interface.
  • Message, repeated and map fields setters take value instead of reference.
  • Added map iterator in c extension.
  • Support json  encode/decode.
  • Added more type info in getter/setter phpdoc
  • Fixed the problem that c extension and php implementation cannot be used together.
  • Added file option php_namespace to use custom php namespace instead of package.
  • Added fluent setter.
  • Added descriptor API in runtime for custom encode/decode.
  • Various bug fixes.

Objective-C

  • Fix for GPBExtensionRegistry copying and add tests.
  • Optimize GPBDictionary.m codegen to reduce size of overall library by 46K per architecture.
  • Fix some cases of reading of 64bit map values.
  • Properly error on a tag with field number zero.
  • Preserve unknown fields in proto3 syntax files.
  • Document the exceptions on some of the writing apis.

C#

  • Implemented IReadOnlyDictionary<K,V> in MapField<K,V>
  • Added TryUnpack method for Any message in addition to Unpack.
  • Converted C# projects to MSBuild (csproj) format.

Ruby

  • Several bug fixes.

Javascript

  • Added support of field option js_type. Now one can specify the JS type of a 64-bit integer field to be string in the generated code by adding option [jstype = JS_STRING] on the field.

Protocol Buffers v3.3.0

04 May 22:49
Compare
Choose a tag to compare

Planned Future Changes

  • There are some changes that are not included in this release but are planned for the near future:
    • Preserve unknown fields in proto3: please read this doc for the timeline and follow up this github issue for discussion.
    • Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.4.0 or 3.5.0 release. Please join this github issue to provide your feedback.

C++

  • Fixed map fields serialization of DynamicMessage to correctly serialize both key and value regardless of their presence.
  • Parser now rejects field number 0 correctly.
  • New API Message::SpaceUsedLong() that’s equivalent to Message::SpaceUsed() but returns the value in size_t.
  • JSON support
    • New flag always_print_enums_as_ints in JsonPrintOptions.
    • New flag preserve_proto_field_names in JsonPrintOptions. It will instruct the JSON printer to use the original field name declared in the .proto file instead of converting them to lowerCamelCase when printing JSON.
    • JsonPrintOptions.always_print_primtive_fields now works for oneof message fields.
    • Fixed a bug that doesn’t allow different fields to set the same json_name value.
    • Fixed a performance bug that causes excessive memory copy when printing large messages.
  • Various performance optimizations.

Java

  • Map field setters eagerly validate inputs and throw NullPointerExceptions as appropriate.
  • Added ByteBuffer overloads to the generated parsing methods and the Parser interface.
  • proto3 enum's getNumber() method now throws on UNRECOGNIZED values.
  • Output of JsonFormat is now locale independent.

Python

  • Added FindServiceByName() in the pure-Python DescriptorPool. This works only for descriptors added with DescriptorPool.Add(). Generated descriptor_pool does not support this yet.
  • Added a descriptor_pool parameter for parsing Any in text_format.Parse().
  • descriptor_pool.FindFileContainingSymbol() now is able to find nested extensions.
  • Extending empty [] to repeated field now sets parent message presence.

PHP

  • Added file option php_class_prefix. The prefix will be prepended to all generated classes defined in the file.
  • When encoding, negative int32 values are sign-extended to int64.
  • Repeated/Map field setter accepts a regular PHP array. Type checking is done on the array elements.
  • encode/decode are renamed to serializeToString/mergeFromString.
  • Added mergeFrom, clear method on Message.
  • Fixed a bug that oneof accessor didn’t return the field name that is actually set.
  • C extension now works with php7.
  • This is the first GA release of PHP. We guarantee that old generated code can always work with new runtime and new generated code.

Objective-C

  • Fixed help for GPBTimestamp for dates before the epoch that contain fractional seconds.
  • Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a message and any sub messages.
  • Addressed a threading race in extension registration/lookup.
  • Increased the max message parsing depth to 100 to match the other languages.
  • Removed some use of dispatch_once in favor of atomic compare/set since it needs to be heap based.
  • Fixes for new Xcode 8.3 warnings.

C#

  • Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily if provided exactly the right size of array to copy to.
  • Fixed enum JSON formatting when multiple names mapped to the same numeric value.
  • Added JSON formatting option to format enums as integers.
  • Modified RepeatedField to implement IReadOnlyList.
  • Introduced the start of custom option handling; it's not as pleasant as it might be, but the information is at least present. We expect to extend code generation to improve this in the future.
  • Introduced ByteString.FromStream and ByteString.FromStreamAsync to efficiently create a ByteString from a stream.
  • Added whole-message deprecation, which decorates the class with [Obsolete].

Ruby

  • Fixed Message#to_h for messages with map fields.
  • Fixed memcpy() in binary gems to work for old glibc, without breaking the build for non-glibc libc’s like musl.

Javascript

  • Added compatibility tests for version 3.0.0.
  • Added conformance tests.
  • Fixed serialization of extensions: we need to emit a value even if it is falsy (like the number 0).
  • Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript.

Protocol Buffers v3.2.0

17 Feb 19:53
Compare
Choose a tag to compare

General

  • Added protoc version number to protoc plugin protocol. It can be used by
    protoc plugin to detect which version of protoc is used with the plugin and
    mitigate known problems in certain version of protoc.

C++

  • The default parsing byte size limit has been raised from 64MB to 2GB.
  • Added rvalue setters for non-arena string fields.
  • Enabled debug logging for Android.
  • Fixed a double-free problem when using Reflection::SetAllocatedMessage()
    with extension fields.
  • Fixed several deterministic serialization bugs:
  • MessageLite::SerializeAsString() now respects the global deterministic
    serialization flag.
  • Extension fields are serialized deterministically as well. Fixed protocol
    compiler to correctly report importing-self as an error.
  • Fixed FileDescriptor::DebugString() to print custom options correctly.
  • Various performance/codesize optimizations and cleanups.

Java

  • The default parsing byte size limit has been raised from 64MB to 2GB.
  • Added recursion limit when parsing JSON.
  • Fixed a bug that enumType.getDescriptor().getOptions() doesn't have custom
    options.
  • Fixed generated code to support field numbers up to 2^29-1.

Python

  • You can now assign NumPy scalars/arrays (np.int32, np.int64) to protobuf
    fields, and assigning other numeric types has been optimized for
    performance.
  • Pure-Python: message types are now garbage-collectable.
  • Python/C++: a lot of internal cleanup/refactoring.

PHP (Alpha)

  • For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP
    integer on 64-bit environment and PHP string on 32-bit environment.
  • PHP generated code also conforms to PSR-4 now.
  • Fixed ZTS build for c extension.
  • Fixed c extension build on Mac.
  • Fixed c extension build on 32-bit linux.
  • Fixed the bug that message without namespace is not found in the descriptor
    pool. (#2240)
  • Fixed the bug that repeated field is not iterable in c extension.
  • Message names Empty will be converted to GPBEmpty in generated code.
  • Added phpdoc in generated files.
  • The released API is almost stable. Unless there is large problem, we won't
    change it. See
    https://developers.google.com/protocol-buffers/docs/reference/php-generated
    for more details.

Objective-C

  • Added support for push/pop of the stream limit on CodedInputStream for
    anyone doing manual parsing.

C#

  • No changes.

Ruby

  • Message objects now support #respond_to? for field getters/setters.
  • You can now compare “message == non_message_object” and it will return false
    instead of throwing an exception.
  • JRuby: fixed #hashCode to properly reflect the values in the message.

Javascript

  • Deserialization of repeated fields no longer has quadratic performance
    behavior.
  • UTF-8 encoding/decoding now properly supports high codepoints.
  • Added convenience methods for some well-known types: Any, Struct, and
    Timestamp. These make it easier to convert data between native JavaScript
    types and the well-known protobuf types.

Protocol Buffers v3.2.0rc2

19 Jan 01:25
Compare
Choose a tag to compare
Pre-release

Release candidate for v3.2.0.

Protocol Buffers v3.1.0

24 Sep 02:39
Compare
Choose a tag to compare

General

  • Proto3 support in PHP (alpha).
  • Various bug fixes.

C++

  • Added MessageLite::ByteSizeLong() that’s equivalent to
    MessageLite::ByteSize() but returns the value in size_t. Useful to check
    whether a message is over the 2G size limit that protobuf can support.
  • Moved default_instances to global variables. This allows default_instance
    addresses to be known at compile time.
  • Adding missing generic gcc 64-bit atomicops.
  • Restore New*Callback into google::protobuf namespace since these are used
    by the service stubs code
  • JSON support.
    • Fixed some conformance issues.
  • Fixed a JSON serialization bug for bytes fields.

Java

  • Fixed a bug in TextFormat that doesn’t accept empty repeated fields (i.e.,
    “field: [ ]”).
  • JSON support
    • Fixed JsonFormat to do correct snake_case-to-camelCase conversion for
      non-style-conforming field names.
    • Fixed JsonFormat to parse empty Any message correctly.
    • Added an option to JsonFormat.Parser to ignore unknown fields.
  • Experimental API
    • Added UnsafeByteOperations.unsafeWrap(byte[]) to wrap a byte array into
      ByteString without copy.

Python

  • JSON support
    • Fixed some conformance issues.

PHP (Alpha)

  • We have added the proto3 support for PHP via both a pure PHP package and a
    native c extension. The pure PHP package is intended to provide usability
    to wider range of PHP platforms, while the c extension is intended to
    provide higher performance. Both implementations provide the same runtime
    APIs and share the same generated code. Users don’t need to re-generate
    code for the same proto definition when they want to switch the
    implementation later. The pure PHP package is included in the php/src
    directory, and the c extension is included in the php/ext directory.

    Both implementations provide idiomatic PHP APIs:

    • All messages and enums are defined as PHP classes.
    • All message fields can only be accessed via getter/setter.
    • Both repeated field elements and map elements are stored in containers
      that act like a normal PHP array.

    Unlike several existing third-party PHP implementations for protobuf, our
    implementations are built on a "strongly-typed" philosophy: message fields
    and array/map containers will throw exceptions eagerly when values of the
    incorrect type (not including those that can be type converted, e.g.,
    double <-> integer <-> numeric string) are inserted.

    Currently, pure PHP runtime supports php5.5, 5.6 and 7 on linux. C
    extension runtime supports php5.5 and 5.6 on linux.

    See php/README.md for more details about installment. See
    https://developers.google.com/protocol-buffers/docs/phptutorial for more
    details about APIs.

Objective-C

  • Helpers are now provided for working the the Any well known type (see
    GPBWellKnownTypes.h for the api additions).
  • Some improvements in startup code (especially when extensions aren’t used).

Javascript

  • Fixed missing import of jspb.Map
  • Fixed valueWriterFn variable name

Ruby

  • Fixed hash computation for JRuby's RubyMessage
  • Make sure map parsing frames are GC-rooted.
  • Added API support for well-known types.

C#

  • Removed check on dependency in the C# reflection API.

Protocol Buffers v3.0.2

06 Sep 22:54
Compare
Choose a tag to compare

General

  • Various bug fixes.

Objective C

  • Fix for oneofs in proto3 syntax files where fields were set to the zero
    value.
  • Fix for embedded null character in strings.
  • CocoaDocs support

Ruby

  • Fixed memory corruption bug in parsing that could occur under GC pressure.

Javascript

  • jspb.Map is now properly exported to CommonJS modules.

C#

  • Removed legacy_enum_values flag.

Protocol Buffers v3.0.0

28 Jul 05:03
Compare
Choose a tag to compare

Version 3.0.0

This change log summarizes all the changes since the last stable release
(v2.6.1). See the last section about changes since v3.0.0-beta-4.

Proto3

  • Introduced Protocol Buffers language version 3 (aka proto3).

    When protocol buffers was initially open sourced it implemented Protocol
    Buffers language version 2 (aka proto2), which is why the version number
    started from v2.0.0. From v3.0.0, a new language version (proto3) is
    introduced while the old version (proto2) will continue to be supported.

    The main intent of introducing proto3 is to clean up protobuf before pushing
    the language as the foundation of Google's new API platform. In proto3, the
    language is simplified, both for ease of use and to make it available in a
    wider range of programming languages. At the same time a few features are
    added to better support common idioms found in APIs.

    The following are the main new features in language version 3:

    1. Removal of field presence logic for primitive value fields, removal of
      required fields, and removal of default values. This makes proto3
      significantly easier to implement with open struct representations, as
      in languages like Android Java, Objective C, or Go.
    2. Removal of unknown fields.
    3. Removal of extensions, which are instead replaced by a new standard
      type called Any.
    4. Fix semantics for unknown enum values.
    5. Addition of maps (back-ported to proto2)
    6. Addition of a small set of standard types for representation of time,
      dynamic data, etc (back-ported to proto2)
    7. A well-defined encoding in JSON as an alternative to binary proto
      encoding.

    A new notion "syntax" is introduced to specify whether a .proto file
    uses proto2 or proto3:

    // foo.proto
    syntax = "proto3";
    message Bar {...}
    

    If omitted, the protocol buffer compiler generates a warning and "proto2" is
    used as the default. This warning will be turned into an error in a future
    release.

    We recommend that new Protocol Buffers users use proto3. However, we do not
    generally recommend that existing users migrate from proto2 from proto3 due
    to API incompatibility, and we will continue to support proto2 for a long
    time.

    Other significant changes in proto3.

  • Explicit "optional" keyword are disallowed in proto3 syntax, as fields are
    optional by default; required fields are no longer supported.

  • Removed non-zero default values and field presence logic for non-message
    fields. e.g. has_xxx() methods are removed; primitive fields set to default
    values (0 for numeric fields, empty for string/bytes fields) will be skipped
    during serialization.

  • Group fields are no longer supported in proto3 syntax.

  • Changed repeated primitive fields to use packed serialization by default in
    proto3 (implemented for C++, Java, Python in this release). The user can
    still disable packed serialization by setting packed to false for now.

  • Added well-known type protos (any.proto, empty.proto, timestamp.proto,
    duration.proto, etc.). Users can import and use these protos just like
    regular proto files. Additional runtime support are available for each
    language.

  • Proto3 JSON is supported in several languages (fully supported in C++, Java,
    Python and C# partially supported in Ruby). The JSON spec is defined in the
    proto3 language guide:

    https://developers.google.com/protocol-buffers/docs/proto3#json

    We will publish a more detailed spec to define the exact behavior of
    proto3-conformant JSON serializers and parsers. Until then, do not rely
    on specific behaviors of the implementation if it’s not documented in
    the above spec.

  • Proto3 enforces strict UTF-8 checking. Parsing will fail if a string
    field contains non UTF-8 data.

General

  • Introduced new language implementations (C#, JavaScript, Ruby, Objective-C)
    to proto3.

  • Added support for map fields (implemented in both proto2 and proto3).
    Map fields can be declared using the following syntax:

    message Foo {
      map<string, string> values = 1;
    }
    

    The data of a map field is stored in memory as an unordered map and
    can be accessed through generated accessors.

  • Added a "reserved" keyword in both proto2 and proto3 syntax. Users can use
    this keyword to declare reserved field numbers and names to prevent them
    from being reused by other fields in the same message.

    To reserve field numbers, add a reserved declaration in your message:

    message TestMessage {
      reserved 2, 15, 9 to 11, 3;
    }
    

    This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of
    these as field numbers, the protocol buffer compiler will report an error.

    Field names can also be reserved:

    message TestMessage {
      reserved "foo", "bar";
    }
    
  • Added a deterministic serialization API (currently available in 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 a new field option "json_name". By default proto field names are
    converted to "lowerCamelCase" in proto3 JSON format. This option can be
    used to override this behavior and specify a different JSON name for the
    field.

  • Added conformance tests to ensure implementations are following proto3 JSON
    specification.

C++

  • Added arena allocation support (for both proto2 and proto3).

    Profiling shows memory allocation and deallocation constitutes a significant
    fraction of CPU-time spent in protobuf code and arena allocation is a
    technique introduced to reduce this cost. With arena allocation, new
    objects are allocated from a large piece of preallocated memory and
    deallocation of these objects is almost free. Early adoption shows 20% to
    50% improvement in some Google binaries.

    To enable arena support, add the following option to your .proto file:

    option cc_enable_arenas = true;
    

    The protocol buffer compiler will generate additional code to make the generated
    message classes work with arenas. This does not change the existing API
    of protobuf messages and does not affect wire format. Your existing code
    should continue to work after adding this option. In the future we will
    make this option enabled by default.

    To actually take advantage of arena allocation, you need to use the arena
    APIs when creating messages. A quick example of using the arena API:

    {
      google::protobuf::Arena arena;
      // Allocate a protobuf message in the arena.
      MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
      // All submessages will be allocated in the same arena.
      if (!message->ParseFromString(data)) {
        // Deal with malformed input data.
      }
      // Must not delete the message here. It will be deleted automatically
      // when the arena is destroyed.
    }
    

    Currently arena allocation does not work with map fields. Enabling arenas in a .proto
    file containing map fields will result in compile errors in the generated
    code. This will be addressed in a future release.

  • Added runtime support for the Any type. To use Any in your proto file, first
    import the definition of Any:

    // foo.proto
    import "google/protobuf/any.proto";
    message Foo {
      google.protobuf.Any any_field = 1;
    }
    message Bar {
      int32 value = 1;
    }
    

    Then in C++ you can access the Any field using PackFrom()/UnpackTo()
    methods:

    Foo foo;
    Bar bar = ...;
    foo.mutable_any_field()->PackFrom(bar);
    ...
    if (foo.any_field().IsType<Bar>()) {
      foo.any_field().UnpackTo(&bar);
      ...
    }
    
  • In text format, the entries of a map field will be sorted by key.

  • Introduced new utility functions/classes in the google/protobuf/util
    directory:

    • MessageDifferencer: compare two proto messages and report their
      differences.
    • JsonUtil: support converting protobuf binary format to/from JSON.
    • TimeUtil: utility functions to work with well-known types Timestamp
      and Duration.
    • FieldMaskUtil: utility functions to work with FieldMask.
  • Introduced a deterministic serialization API in
    CodedOutputStream::SetSerializationDeterministic(bool). See the notes about
    deterministic serialization in the General section.

Java

  • Introduced a new util package that will be distributed as a separate
    artifact in maven. It contains:
    • JsonFormat: convert proto messages to/from JSON.
    • Timestamps/Durations: utility functions to work with Timestamp and Duration.
    • FieldMaskUtil: utility functions to work with FieldMask.
  • Introduced an ExperimentalApi annotation. Annotated APIs are experimental
    and are subject to change in a backward incompatible way in future releases.
  • Introduced zero-copy serialization as an ExperimentalApi
    • Introduction of the ByteOutput interface. This is similar to
      OutputStream but provides semantics for lazy writing (i.e. no
      immediate copy required) of fields that are considered to be immutable.
    • ByteString now supports writing to a ByteOutput, which will directly
      expose the internals of the ByteString (i.e. byte[] or ByteBuffer)
      to the ByteOutput without copying.
    • CodedOutputStream now supports writing to a ByteOutput. ByteString
      instances that are too large to fit in the internal buffer will be
      (lazily) written to the ByteOutput directly.
      ...
Read more

Protocol Buffers v3.0.0-beta-4

20 Jul 00:40
Compare
Choose a tag to compare
Pre-release

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.

Protocol Buffers v3.0.0-beta-3.1

14 Jun 18:42
Compare
Choose a tag to compare
Pre-release

Fix iOS framework.