CHANGES.txt 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. 2015-12-30 version 3.0.0-beta-2 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
  2. General
  3. * Introduced a new language implementation: JavaScript.
  4. * Added a new field option "json_name". By default proto field names are
  5. converted to "lowerCamelCase" in proto3 JSON format. This option can be
  6. used to override this behavior and specify a different JSON name for the
  7. field.
  8. * Added conformance tests to ensure implementations are following proto3 JSON
  9. specification.
  10. C++ (Beta)
  11. * Various bug fixes and improvements to the JSON support utility:
  12. - Duplicate map keys in JSON are now rejected (i.e., translation will
  13. fail).
  14. - Fixed wire-format for google.protobuf.Value/ListValue.
  15. - Fixed precision loss when converting google.protobuf.Timestamp.
  16. - Fixed a bug when parsing invalid UTF-8 code points.
  17. - Fixed a memory leak.
  18. - Reduced call stack usage.
  19. Java (Beta)
  20. * Cleaned up some unused methods on CodedOutputStream.
  21. * Presized lists for packed fields during parsing in the lite runtime to
  22. reduce allocations and improve performance.
  23. * Improved the performance of unknown fields in the lite runtime.
  24. * Introduced UnsafeByteStrings to support zero-copy ByteString creation.
  25. * Various bug fixes and improvements to the JSON support utility:
  26. - Fixed a thread-safety bug.
  27. - Added a new option “preservingProtoFieldNames” to JsonFormat.
  28. - Added a new option “includingDefaultValueFields” to JsonFormat.
  29. - Updated the JSON utility to comply with proto3 JSON specification.
  30. Python (Beta)
  31. * Added proto3 JSON format utility. It includes support for all field types
  32. and a few well-known types except for Any and Struct.
  33. * Added runtime support for Any, Timestamp, Duration and FieldMask.
  34. * [ ] is now accepted for repeated scalar fields in text format parser.
  35. * Map fields now have proper O(1) performance for lookup/insert/delete
  36. when using the Python/C++ implementation. They were previously using O(n)
  37. search-based algorithms because the C++ reflection interface didn't
  38. support true map operations.
  39. Objective-C (Beta)
  40. * Various bug-fixes and code tweaks to pass more strict compiler warnings.
  41. * Now has conformance test coverage and is passing all tests.
  42. C# (Beta)
  43. * Various bug-fixes.
  44. * Code generation: Files generated in directories based on namespace.
  45. * Code generation: Include comments from .proto files in XML doc
  46. comments (naively)
  47. * Code generation: Change organization/naming of "reflection class" (access
  48. to file descriptor)
  49. * Code generation and library: Add Parser property to MessageDescriptor,
  50. and introduce a non-generic parser type.
  51. * Library: Added TypeRegistry to support JSON parsing/formatting of Any.
  52. * Library: Added Any.Pack/Unpack support.
  53. * Library: Implemented JSON parsing.
  54. Javascript (Alpha)
  55. * Added proto3 support for JavaScript. The runtime is written in pure
  56. JavaScript and works in browsers and in Node.js. To generate JavaScript
  57. code for your proto, invoke protoc with "--js_out". See js/README.md
  58. for more build instructions.
  59. 2015-08-26 version 3.0.0-beta-1 (C++/Java/Python/Ruby/Nano/Objective-C/C#)
  60. About Beta
  61. * This is the first beta release of protobuf v3.0.0. Not all languages
  62. have reached beta stage. Languages not marked as beta are still in
  63. alpha (i.e., be prepared for API breaking changes).
  64. General
  65. * Proto3 JSON is supported in several languages (fully supported in C++
  66. and Java, partially supported in Ruby/C#). The JSON spec is defined in
  67. the proto3 language guide:
  68. https://developers.google.com/protocol-buffers/docs/proto3#json
  69. We will publish a more detailed spec to define the exact behavior of
  70. proto3-conformant JSON serializers and parsers. Until then, do not rely
  71. on specific behaviors of the implementation if it’s not documented in
  72. the above spec. More specifically, the behavior is not yet finalized for
  73. the following:
  74. - Parsing invalid JSON input (e.g., input with trailing commas).
  75. - Non-camelCase names in JSON input.
  76. - The same field appears multiple times in JSON input.
  77. - JSON arrays contain “null” values.
  78. - The message has unknown fields.
  79. * Proto3 now enforces strict UTF-8 checking. Parsing will fail if a string
  80. field contains non UTF-8 data.
  81. C++ (Beta)
  82. * Introduced new utility functions/classes in the google/protobuf/util
  83. directory:
  84. - MessageDifferencer: compare two proto messages and report their
  85. differences.
  86. - JsonUtil: support converting protobuf binary format to/from JSON.
  87. - TimeUtil: utility functions to work with well-known types Timestamp
  88. and Duration.
  89. - FieldMaskUtil: utility functions to work with FieldMask.
  90. * Performance optimization of arena construction and destruction.
  91. * Bug fixes for arena and maps support.
  92. * Changed to use cmake for Windows Visual Studio builds.
  93. * Added Bazel support.
  94. Java (Beta)
  95. * Introduced a new util package that will be distributed as a separate
  96. artifact in maven. It contains:
  97. - JsonFormat: convert proto messages to/from JSON.
  98. - TimeUtil: utility functions to work with Timestamp and Duration.
  99. - FieldMaskUtil: utility functions to work with FieldMask.
  100. * The static PARSER in each generated message is deprecated, and it will
  101. be removed in a future release. A static parser() getter is generated
  102. for each message type instead.
  103. * Performance optimizations for String fields serialization.
  104. * Performance optimizations for Lite runtime on Android:
  105. - Reduced allocations
  106. - Reduced method overhead after ProGuarding
  107. - Reduced code size after ProGuarding
  108. Python (Alpha)
  109. * Removed legacy Python 2.5 support.
  110. * Moved to a single Python 2.x/3.x-compatible codebase, instead of using 2to3.
  111. * Fixed build/tests on Python 2.6, 2.7, 3.3, and 3.4.
  112. - Pure-Python works on all four.
  113. - Python/C++ implementation works on all but 3.4, due to changes in the
  114. Python/C++ API in 3.4.
  115. * Some preliminary work has been done to allow for multiple DescriptorPools
  116. with Python/C++.
  117. Ruby (Alpha)
  118. * Many bugfixes:
  119. - fixed parsing/serialization of bytes, sint, sfixed types
  120. - other parser bugfixes
  121. - fixed memory leak affecting Ruby 2.2
  122. JavaNano (Alpha)
  123. * JavaNano generated code now will be put in a nano package by default to
  124. avoid conflicts with Java generated code.
  125. Objective-C (Alpha)
  126. * Added non-null markup to ObjC library. Requires SDK 8.4+ to build.
  127. * Many bugfixes:
  128. - Removed the class/enum filter.
  129. - Renamed some internal types to avoid conflicts with the well-known types
  130. protos.
  131. - Added missing support for parsing repeated primitive fields in packed or
  132. unpacked forms.
  133. - Added *Count for repeated and map<> fields to avoid auto-create when
  134. checking for them being set.
  135. C# (Alpha)
  136. * Namespace changed to Google.Protobuf (and NuGet package will be named
  137. correspondingly).
  138. * Target platforms now .NET 4.5 and selected portable subsets only.
  139. * Removed lite runtime.
  140. * Reimplementation to use mutable message types.
  141. * Null references used to represent "no value" for message type fields.
  142. * Proto3 semantics supported; proto2 files are prohibited for C# codegen.
  143. Most proto3 features supported:
  144. - JSON formatting (a.k.a. serialization to JSON), including well-known
  145. types (except for Any).
  146. - Wrapper types mapped to nullable value types (or string/ByteString
  147. allowing nullability). JSON parsing is not supported yet.
  148. - maps
  149. - oneof
  150. - enum unknown value preservation
  151. 2015-05-25 version 3.0.0-alpha-3 (Objective-C/C#):
  152. General
  153. * Introduced two new language implementations (Objective-C, C#) to proto3.
  154. * Explicit "optional" keyword are disallowed in proto3 syntax, as fields are
  155. optional by default.
  156. * Group fields are no longer supported in proto3 syntax.
  157. * Changed repeated primitive fields to use packed serialization by default in
  158. proto3 (implemented for C++, Java, Python in this release). The user can
  159. still disable packed serialization by setting packed to false for now.
  160. * Added well-known type protos (any.proto, empty.proto, timestamp.proto,
  161. duration.proto, etc.). Users can import and use these protos just like
  162. regular proto files. Additional runtime support will be added for them in
  163. future releases (in the form of utility helper functions, or having them
  164. replaced by language specific types in generated code).
  165. * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use
  166. this keyword to declare reserved field numbers and names to prevent them
  167. from being reused by other fields in the same message.
  168. To reserve field numbers, add a reserved declaration in your message:
  169. message TestMessage {
  170. reserved 2, 15, 9 to 11, 3;
  171. }
  172. This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of
  173. these as field numbers, the protocol buffer compiler will report an error.
  174. Field names can also be reserved:
  175. message TestMessage {
  176. reserved "foo", "bar";
  177. }
  178. * Various bug fixes since 3.0.0-alpha-2
  179. Objective-C
  180. Objective-C includes a code generator and a native objective-c runtime
  181. library. By adding “--objc_out” to protoc, the code generator will generate
  182. a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto
  183. file.
  184. In this first release, the generated interface provides: enums, messages,
  185. field support(single, repeated, map, oneof), proto2 and proto3 syntax
  186. support, parsing and serialization. It’s compatible with ARC and non-ARC
  187. usage. Besides, user can also access it via the swift bridging header.
  188. See objectivec/README.md for details.
  189. C#
  190. * C# protobufs are based on project
  191. https://github.com/jskeet/protobuf-csharp-port. The original project was
  192. frozen and all the new development will happen here.
  193. * Codegen plugin for C# was completely rewritten to C++ and is now an
  194. integral part of protoc.
  195. * Some refactorings and cleanup has been applied to the C# runtime library.
  196. * Only proto2 is supported in C# at the moment, proto3 support is in
  197. progress and will likely bring significant breaking changes to the API.
  198. See csharp/README.md for details.
  199. C++
  200. * Added runtime support for Any type. To use Any in your proto file, first
  201. import the definition of Any:
  202. // foo.proto
  203. import "google/protobuf/any.proto";
  204. message Foo {
  205. google.protobuf.Any any_field = 1;
  206. }
  207. message Bar {
  208. int32 value = 1;
  209. }
  210. Then in C++ you can access the Any field using PackFrom()/UnpackTo()
  211. methods:
  212. Foo foo;
  213. Bar bar = ...;
  214. foo.mutable_any_field()->PackFrom(bar);
  215. ...
  216. if (foo.any_field().IsType<Bar>()) {
  217. foo.any_field().UnpackTo(&bar);
  218. ...
  219. }
  220. * In text format, entries of a map field will be sorted by key.
  221. Java
  222. * Continued optimizations on the lite runtime to improve performance for
  223. Android.
  224. Python
  225. * Added map support.
  226. - maps now have a dict-like interface (msg.map_field[key] = value)
  227. - existing code that modifies maps via the repeated field interface
  228. will need to be updated.
  229. Ruby
  230. * Improvements to RepeatedField's emulation of the Ruby Array API.
  231. * Various speedups and internal cleanups.
  232. 2015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano):
  233. General
  234. * Introduced three new language implementations (Ruby, JavaNano, and
  235. Python) to proto3.
  236. * Various bug fixes since 3.0.0-alpha-1
  237. Python:
  238. Python has received several updates, most notably support for proto3
  239. semantics in any .proto file that declares syntax="proto3".
  240. Messages declared in proto3 files no longer represent field presence
  241. for scalar fields (number, enums, booleans, or strings). You can
  242. no longer call HasField() for such fields, and they are serialized
  243. based on whether they have a non-zero/empty/false value.
  244. One other notable change is in the C++-accelerated implementation.
  245. Descriptor objects (which describe the protobuf schema and allow
  246. reflection over it) are no longer duplicated between the Python
  247. and C++ layers. The Python descriptors are now simple wrappers
  248. around the C++ descriptors. This change should significantly
  249. reduce the memory usage of programs that use a lot of message
  250. types.
  251. Ruby:
  252. We have added proto3 support for Ruby via a native C extension.
  253. The Ruby extension itself is included in the ruby/ directory, and details on
  254. building and installing the extension are in ruby/README.md. The extension
  255. will also be published as a Ruby gem. Code generator support is included as
  256. part of `protoc` with the `--ruby_out` flag.
  257. The Ruby extension implements a user-friendly DSL to define message types
  258. (also generated by the code generator from `.proto` files). Once a message
  259. type is defined, the user may create instances of the message that behave in
  260. ways idiomatic to Ruby. For example:
  261. - Message fields are present as ordinary Ruby properties (getter method
  262. `foo` and setter method `foo=`).
  263. - Repeated field elements are stored in a container that acts like a native
  264. Ruby array, and map elements are stored in a container that acts like a
  265. native Ruby hashmap.
  266. - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are
  267. present.
  268. Unlike several existing third-party Ruby extensions for protobuf, this
  269. extension is built on a "strongly-typed" philosophy: message fields and
  270. array/map containers will throw exceptions eagerly when values of the
  271. incorrect type are inserted.
  272. See ruby/README.md for details.
  273. JavaNano:
  274. JavaNano is a special code generator and runtime library designed especially
  275. for resource-restricted systems, like Android. It is very resource-friendly
  276. in both the amount of code and the runtime overhead. Here is an an overview
  277. of JavaNano features compared with the official Java protobuf:
  278. - No descriptors or message builders.
  279. - All messages are mutable; fields are public Java fields.
  280. - For optional fields only, encapsulation behind setter/getter/hazzer/
  281. clearer functions is opt-in, which provide proper 'has' state support.
  282. - For proto2, if not opted in, has state (field presence) is not available.
  283. Serialization outputs all fields not equal to their defaults.
  284. The behavior is consistent with proto3 semantics.
  285. - Required fields (proto2 only) are always serialized.
  286. - Enum constants are integers; protection against invalid values only
  287. when parsing from the wire.
  288. - Enum constants can be generated into container interfaces bearing
  289. the enum's name (so the referencing code is in Java style).
  290. - CodedInputByteBufferNano can only take byte[] (not InputStream).
  291. - Similarly CodedOutputByteBufferNano can only write to byte[].
  292. - Repeated fields are in arrays, not ArrayList or Vector. Null array
  293. elements are allowed and silently ignored.
  294. - Full support for serializing/deserializing repeated packed fields.
  295. - Support extensions (in proto2).
  296. - Unset messages/groups are null, not an immutable empty default
  297. instance.
  298. - toByteArray(...) and mergeFrom(...) are now static functions of
  299. MessageNano.
  300. - The 'bytes' type translates to the Java type byte[].
  301. See javanano/README.txt for details.
  302. 2014-12-01 version 3.0.0-alpha-1 (C++/Java):
  303. General
  304. * Introduced Protocol Buffers language version 3 (aka proto3).
  305. When protobuf was initially opensourced it implemented Protocol Buffers
  306. language version 2 (aka proto2), which is why the version number
  307. started from v2.0.0. From v3.0.0, a new language version (proto3) is
  308. introduced while the old version (proto2) will continue to be supported.
  309. The main intent of introducing proto3 is to clean up protobuf before
  310. pushing the language as the foundation of Google's new API platform.
  311. In proto3, the language is simplified, both for ease of use and to
  312. make it available in a wider range of programming languages. At the
  313. same time a few features are added to better support common idioms
  314. found in APIs.
  315. The following are the main new features in language version 3:
  316. 1. Removal of field presence logic for primitive value fields, removal
  317. of required fields, and removal of default values. This makes proto3
  318. significantly easier to implement with open struct representations,
  319. as in languages like Android Java, Objective C, or Go.
  320. 2. Removal of unknown fields.
  321. 3. Removal of extensions, which are instead replaced by a new standard
  322. type called Any.
  323. 4. Fix semantics for unknown enum values.
  324. 5. Addition of maps.
  325. 6. Addition of a small set of standard types for representation of time,
  326. dynamic data, etc.
  327. 7. A well-defined encoding in JSON as an alternative to binary proto
  328. encoding.
  329. This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and
  330. Java. Items 6 (well-known types) and 7 (JSON format) in the above feature
  331. list are not implemented.
  332. A new notion "syntax" is introduced to specify whether a .proto file
  333. uses proto2 or proto3:
  334. // foo.proto
  335. syntax = "proto3";
  336. message Bar {...}
  337. If omitted, the protocol compiler will generate a warning and "proto2" will
  338. be used as the default. This warning will be turned into an error in a
  339. future release.
  340. We recommend that new Protocol Buffers users use proto3. However, we do not
  341. generally recommend that existing users migrate from proto2 from proto3 due
  342. to API incompatibility, and we will continue to support proto2 for a long
  343. time.
  344. * Added support for map fields (implemented in C++/Java for both proto2 and
  345. proto3).
  346. Map fields can be declared using the following syntax:
  347. message Foo {
  348. map<string, string> values = 1;
  349. }
  350. Data of a map field will be stored in memory as an unordered map and it
  351. can be accessed through generated accessors.
  352. C++
  353. * Added arena allocation support (for both proto2 and proto3).
  354. Profiling shows memory allocation and deallocation constitutes a significant
  355. fraction of CPU-time spent in protobuf code and arena allocation is a
  356. technique introduced to reduce this cost. With arena allocation, new
  357. objects will be allocated from a large piece of preallocated memory and
  358. deallocation of these objects is almost free. Early adoption shows 20% to
  359. 50% improvement in some Google binaries.
  360. To enable arena support, add the following option to your .proto file:
  361. option cc_enable_arenas = true;
  362. Protocol compiler will generate additional code to make the generated
  363. message classes work with arenas. This does not change the existing API
  364. of protobuf messages and does not affect wire format. Your existing code
  365. should continue to work after adding this option. In the future we will
  366. make this option enabled by default.
  367. To actually take advantage of arena allocation, you need to use the arena
  368. APIs when creating messages. A quick example of using the arena API:
  369. {
  370. google::protobuf::Arena arena;
  371. // Allocate a protobuf message in the arena.
  372. MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
  373. // All submessages will be allocated in the same arena.
  374. if (!message->ParseFromString(data)) {
  375. // Deal with malformed input data.
  376. }
  377. // Must not delete the message here. It will be deleted automatically
  378. // when the arena is destroyed.
  379. }
  380. Currently arena does not work with map fields. Enabling arena in a .proto
  381. file containing map fields will result in compile errors in the generated
  382. code. This will be addressed in a future release.
  383. 2014-10-20 version 2.6.1:
  384. C++
  385. * Added atomicops support for Solaris.
  386. * Released memory allocated by InitializeDefaultRepeatedFields() and
  387. GetEmptyString(). Some memory sanitizers reported them as memory leaks.
  388. Java
  389. * Updated DynamicMessage.setField() to handle repeated enum values
  390. correctly.
  391. * Fixed a bug that caused NullPointerException to be thrown when
  392. converting manually constructed FileDescriptorProto to
  393. FileDescriptor.
  394. Python
  395. * Fixed WhichOneof() to work with de-serialized protobuf messages.
  396. * Fixed a missing file problem of Python C++ implementation.
  397. 2014-08-15 version 2.6.0:
  398. General
  399. * Added oneofs(unions) feature. Fields in the same oneof will share
  400. memory and at most one field can be set at the same time. Use the
  401. oneof keyword to define a oneof like:
  402. message SampleMessage {
  403. oneof test_oneof {
  404. string name = 4;
  405. YourMessage sub_message = 9;
  406. }
  407. }
  408. * Files, services, enums, messages, methods and enum values can be marked
  409. as deprecated now.
  410. * Added Support for list values, including lists of messages, when
  411. parsing text-formatted protos in C++ and Java.
  412. For example: foo: [1, 2, 3]
  413. C++
  414. * Enhanced customization on TestFormat printing.
  415. * Added SwapFields() in reflection API to swap a subset of fields.
  416. Added SetAllocatedMessage() in reflection API.
  417. * Repeated primitive extensions are now packable. The
  418. [packed=true] option only affects serializers. Therefore, it is
  419. possible to switch a repeated extension field to packed format
  420. without breaking backwards-compatibility.
  421. * Various speed optimizations.
  422. Java
  423. * writeTo() method in ByteString can now write a substring to an
  424. output stream. Added endWith() method for ByteString.
  425. * ByteString and ByteBuffer are now supported in CodedInputStream
  426. and CodedOutputStream.
  427. * java_generate_equals_and_hash can now be used with the LITE_RUNTIME.
  428. Python
  429. * A new C++-backed extension module (aka "cpp api v2") that replaces the
  430. old ("cpp api v1") one. Much faster than the pure Python code. This one
  431. resolves many bugs and is recommended for general use over the
  432. pure Python when possible.
  433. * Descriptors now have enum_types_by_name and extension_types_by_name dict
  434. attributes.
  435. * Support for Python 3.
  436. 2013-02-27 version 2.5.0:
  437. General
  438. * New notion "import public" that allows a proto file to forward the content
  439. it imports to its importers. For example,
  440. // foo.proto
  441. import public "bar.proto";
  442. import "baz.proto";
  443. // qux.proto
  444. import "foo.proto";
  445. // Stuff defined in bar.proto may be used in this file, but stuff from
  446. // baz.proto may NOT be used without importing it explicitly.
  447. This is useful for moving proto files. To move a proto file, just leave
  448. a single "import public" in the old proto file.
  449. * New enum option "allow_alias" that specifies whether different symbols can
  450. be assigned the same numeric value. Default value is "true". Setting it to
  451. false causes the compiler to reject enum definitions where multiple symbols
  452. have the same numeric value.
  453. Note: We plan to flip the default value to "false" in a future release.
  454. Projects using enum aliases should set the option to "true" in their .proto
  455. files.
  456. C++
  457. * New generated method set_allocated_foo(Type* foo) for message and string
  458. fields. This method allows you to set the field to a pre-allocated object
  459. and the containing message takes the ownership of that object.
  460. * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
  461. * Custom options are now formatted correctly when descriptors are printed in
  462. text format.
  463. * Various speed optimizations.
  464. Java
  465. * Comments in proto files are now collected and put into generated code as
  466. comments for corresponding classes and data members.
  467. * Added Parser to parse directly into messages without a Builder. For
  468. example,
  469. Foo foo = Foo.PARSER.ParseFrom(input);
  470. Using Parser is ~25% faster than using Builder to parse messages.
  471. * Added getters/setters to access the underlying ByteString of a string field
  472. directly.
  473. * ByteString now supports more operations: substring(), prepend(), and
  474. append(). The implementation of ByteString uses a binary tree structure
  475. to support these operations efficiently.
  476. * New method findInitializationErrors() that lists all missing required
  477. fields.
  478. * Various code size and speed optimizations.
  479. Python
  480. * Added support for dynamic message creation. DescriptorDatabase,
  481. DescriptorPool, and MessageFactory work like their C++ counterparts to
  482. simplify Descriptor construction from *DescriptorProtos, and MessageFactory
  483. provides a message instance from a Descriptor.
  484. * Added pickle support for protobuf messages.
  485. * Unknown fields are now preserved after parsing.
  486. * Fixed bug where custom options were not correctly populated. Custom
  487. options can be accessed now.
  488. * Added EnumTypeWrapper that provides better accessibility to enum types.
  489. * Added ParseMessage(descriptor, bytes) to generate a new Message instance
  490. from a descriptor and a byte string.
  491. 2011-05-01 version 2.4.1:
  492. C++
  493. * Fixed the friendship problem for old compilers to make the library now gcc 3
  494. compatible again.
  495. * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
  496. Java
  497. * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
  498. compatible again.
  499. * Fixed a bug about negative enum values.
  500. * serialVersionUID is now defined in generated messages for java serializing.
  501. * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
  502. message name again.
  503. Python
  504. * Experimental C++ implementation now requires C++ protobuf library installed.
  505. See the README.txt in the python directory for details.
  506. 2011-02-02 version 2.4.0:
  507. General
  508. * The RPC (cc|java|py)_generic_services default value is now false instead of
  509. true.
  510. * Custom options can have aggregate types. For example,
  511. message MyOption {
  512. optional string comment = 1;
  513. optional string author = 2;
  514. }
  515. extend google.protobuf.FieldOptions {
  516. optional MyOption myoption = 12345;
  517. }
  518. This option can now be set as follows:
  519. message SomeType {
  520. optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
  521. }
  522. C++
  523. * Various speed and code size optimizations.
  524. * Added a release_foo() method on string and message fields.
  525. * Fixed gzip_output_stream sub-stream handling.
  526. Java
  527. * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
  528. get the builder for the sub-message "foo". This allows you to repeatedly
  529. modify deeply-nested sub-messages without rebuilding them.
  530. * Builder.build() no longer invalidates the Builder for generated messages
  531. (You may continue to modify it and then build another message).
  532. * Code generator will generate efficient equals() and hashCode()
  533. implementations if new option java_generate_equals_and_hash is enabled.
  534. (Otherwise, reflection-based implementations are used.)
  535. * Generated messages now implement Serializable.
  536. * Fields with [deprecated=true] will be marked with @Deprecated in Java.
  537. * Added lazy conversion of UTF-8 encoded strings to String objects to improve
  538. performance.
  539. * Various optimizations.
  540. * Enum value can be accessed directly, instead of calling getNumber() on the
  541. enum member.
  542. * For each enum value, an integer constant is also generated with the suffix
  543. _VALUE.
  544. Python
  545. * Added an experimental C++ implementation for Python messages via a Python
  546. extension. Implementation type is controlled by an environment variable
  547. PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
  548. The default value is currently "python" but will be changed to "cpp" in
  549. future release.
  550. * Improved performance on message instantiation significantly.
  551. Most of the work on message instantiation is done just once per message
  552. class, instead of once per message instance.
  553. * Improved performance on text message parsing.
  554. * Allow add() to forward keyword arguments to the concrete class.
  555. E.g. instead of
  556. item = repeated_field.add()
  557. item.foo = bar
  558. item.baz = quux
  559. You can do:
  560. repeated_field.add(foo=bar, baz=quux)
  561. * Added a sort() interface to the BaseContainer.
  562. * Added an extend() method to repeated composite fields.
  563. * Added UTF8 debug string support.
  564. 2010-01-08 version 2.3.0:
  565. General
  566. * Parsers for repeated numeric fields now always accept both packed and
  567. unpacked input. The [packed=true] option only affects serializers.
  568. Therefore, it is possible to switch a field to packed format without
  569. breaking backwards-compatibility -- as long as all parties are using
  570. protobuf 2.3.0 or above, at least.
  571. * The generic RPC service code generated by the C++, Java, and Python
  572. generators can be disabled via file options:
  573. option cc_generic_services = false;
  574. option java_generic_services = false;
  575. option py_generic_services = false;
  576. This allows plugins to generate alternative code, possibly specific to some
  577. particular RPC implementation.
  578. protoc
  579. * Now supports a plugin system for code generators. Plugins can generate
  580. code for new languages or inject additional code into the output of other
  581. code generators. Plugins are just binaries which accept a protocol buffer
  582. on stdin and write a protocol buffer to stdout, so they may be written in
  583. any language. See src/google/protobuf/compiler/plugin.proto.
  584. **WARNING**: Plugins are experimental. The interface may change in a
  585. future version.
  586. * If the output location ends in .zip or .jar, protoc will write its output
  587. to a zip/jar archive instead of a directory. For example:
  588. protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
  589. Currently the archive contents are not compressed, though this could change
  590. in the future.
  591. * inf, -inf, and nan can now be used as default values for float and double
  592. fields.
  593. C++
  594. * Various speed and code size optimizations.
  595. * DynamicMessageFactory is now fully thread-safe.
  596. * Message::Utf8DebugString() method is like DebugString() but avoids escaping
  597. UTF-8 bytes.
  598. * Compiled-in message types can now contain dynamic extensions, through use
  599. of CodedInputStream::SetExtensionRegistry().
  600. * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
  601. match other platforms. Use --disable-shared to avoid this.
  602. Java
  603. * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
  604. false/null instead of throwing an exception.
  605. * Fixed some initialization ordering bugs.
  606. * Fixes for OpenJDK 7.
  607. Python
  608. * 10-25 times faster than 2.2.0, still pure-Python.
  609. * Calling a mutating method on a sub-message always instantiates the message
  610. in its parent even if the mutating method doesn't actually mutate anything
  611. (e.g. parsing from an empty string).
  612. * Expanded descriptors a bit.
  613. 2009-08-11 version 2.2.0:
  614. C++
  615. * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
  616. to generate code which only depends libprotobuf-lite, which is much smaller
  617. than libprotobuf but lacks descriptors, reflection, and some other features.
  618. * Fixed bug where Message.Swap(Message) was only implemented for
  619. optimize_for_speed. Swap now properly implemented in both modes
  620. (Issue 91).
  621. * Added RemoveLast and SwapElements(index1, index2) to Reflection
  622. interface for repeated elements.
  623. * Added Swap(Message) to Reflection interface.
  624. * Floating-point literals in generated code that are intended to be
  625. single-precision now explicitly have 'f' suffix to avoid pedantic warnings
  626. produced by some compilers.
  627. * The [deprecated=true] option now causes the C++ code generator to generate
  628. a GCC-style deprecation annotation (no-op on other compilers).
  629. * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
  630. EnumDescriptor for that type -- useful for templates which cannot call
  631. SomeGeneratedEnumType_descriptor().
  632. * Various optimizations and obscure bug fixes.
  633. Java
  634. * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
  635. to generate code which only depends libprotobuf-lite, which is much smaller
  636. than libprotobuf but lacks descriptors, reflection, and some other features.
  637. * Lots of style cleanups.
  638. Python
  639. * Fixed endianness bug with floats and doubles.
  640. * Text format parsing support.
  641. * Fix bug with parsing packed repeated fields in embedded messages.
  642. * Ability to initialize fields by passing keyword args to constructor.
  643. * Support iterators in extend and __setslice__ for containers.
  644. 2009-05-13 version 2.1.0:
  645. General
  646. * Repeated fields of primitive types (types other that string, group, and
  647. nested messages) may now use the option [packed = true] to get a more
  648. efficient encoding. In the new encoding, the entire list is written
  649. as a single byte blob using the "length-delimited" wire type. Within
  650. this blob, the individual values are encoded the same way they would
  651. be normally except without a tag before each value (thus, they are
  652. tightly "packed").
  653. * For each field, the generated code contains an integer constant assigned
  654. to the field number. For example, the .proto file:
  655. message Foo { optional int bar_baz = 123; }
  656. would generate the following constants, all with the integer value 123:
  657. C++: Foo::kBarBazFieldNumber
  658. Java: Foo.BAR_BAZ_FIELD_NUMBER
  659. Python: Foo.BAR_BAZ_FIELD_NUMBER
  660. Constants are also generated for extensions, with the same naming scheme.
  661. These constants may be used as switch cases.
  662. * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
  663. in its verbatim form as a nested autoconf package, so you can drop in any
  664. other version of Google Test if needed.
  665. * optimize_for = SPEED is now the default, by popular demand. Use
  666. optimize_for = CODE_SIZE if code size is more important in your app.
  667. * It is now an error to define a default value for a repeated field.
  668. Previously, this was silently ignored (it had no effect on the generated
  669. code).
  670. * Fields can now be marked deprecated like:
  671. optional int32 foo = 1 [deprecated = true];
  672. Currently this does not have any actual effect, but in the future the code
  673. generators may generate deprecation annotations in each language.
  674. * Cross-compiling should now be possible using the --with-protoc option to
  675. configure. See README.txt for more info.
  676. protoc
  677. * --error_format=msvs option causes errors to be printed in Visual Studio
  678. format, which should allow them to be clicked on in the build log to go
  679. directly to the error location.
  680. * The type name resolver will no longer resolve type names to fields. For
  681. example, this now works:
  682. message Foo {}
  683. message Bar {
  684. optional int32 Foo = 1;
  685. optional Foo baz = 2;
  686. }
  687. Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
  688. an error because Bar.Foo is a field, not a type. Now the type of "baz"
  689. resolves to the message type Foo. This change is unlikely to make a
  690. difference to anyone who follows the Protocol Buffers style guide.
  691. C++
  692. * Several optimizations, including but not limited to:
  693. - Serialization, especially to flat arrays, is 10%-50% faster, possibly
  694. more for small objects.
  695. - Several descriptor operations which previously required locking no longer
  696. do.
  697. - Descriptors are now constructed lazily on first use, rather than at
  698. process startup time. This should save memory in programs which do not
  699. use descriptors or reflection.
  700. - UnknownFieldSet completely redesigned to be more efficient (especially in
  701. terms of memory usage).
  702. - Various optimizations to reduce code size (though the serialization speed
  703. optimizations increased code size).
  704. * Message interface has method ParseFromBoundedZeroCopyStream() which parses
  705. a limited number of bytes from an input stream rather than parsing until
  706. EOF.
  707. * GzipInputStream and GzipOutputStream support reading/writing gzip- or
  708. zlib-compressed streams if zlib is available.
  709. (google/protobuf/io/gzip_stream.h)
  710. * DescriptorPool::FindAllExtensions() and corresponding
  711. DescriptorDatabase::FindAllExtensions() can be used to enumerate all
  712. extensions of a given type.
  713. * For each enum type Foo, protoc will generate functions:
  714. const string& Foo_Name(Foo value);
  715. bool Foo_Parse(const string& name, Foo* result);
  716. The former returns the name of the enum constant corresponding to the given
  717. value while the latter finds the value corresponding to a name.
  718. * RepeatedField and RepeatedPtrField now have back-insertion iterators.
  719. * String fields now have setters that take a char* and a size, in addition
  720. to the existing ones that took char* or const string&.
  721. * DescriptorPool::AllowUnknownDependencies() may be used to tell
  722. DescriptorPool to create placeholder descriptors for unknown entities
  723. referenced in a FileDescriptorProto. This can allow you to parse a .proto
  724. file without having access to other .proto files that it imports, for
  725. example.
  726. * Updated gtest to latest version. The gtest package is now included as a
  727. nested autoconf package, so it should be able to drop new versions into the
  728. "gtest" subdirectory without modification.
  729. Java
  730. * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
  731. * Message interface has new method toBuilder() which is equivalent to
  732. newBuilderForType().mergeFrom(this).
  733. * All enums now implement the ProtocolMessageEnum interface.
  734. * Setting a field to null now throws NullPointerException.
  735. * Fixed tendency for TextFormat's parsing to overflow the stack when
  736. parsing large string values. The underlying problem is with Java's
  737. regex implementation (which unfortunately uses recursive backtracking
  738. rather than building an NFA). Worked around by making use of possessive
  739. quantifiers.
  740. * Generated service classes now also generate pure interfaces. For a service
  741. Foo, Foo.Interface is a pure interface containing all of the service's
  742. defined methods. Foo.newReflectiveService() can be called to wrap an
  743. instance of this interface in a class that implements the generic
  744. RpcService interface, which provides reflection support that is usually
  745. needed by RPC server implementations.
  746. * RPC interfaces now support blocking operation in addition to non-blocking.
  747. The protocol compiler generates separate blocking and non-blocking stubs
  748. which operate against separate blocking and non-blocking RPC interfaces.
  749. RPC implementations will have to implement the new interfaces in order to
  750. support blocking mode.
  751. * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
  752. writeDelimitedTo() read and write "delimited" messages from/to a stream,
  753. meaning that the message size precedes the data. This way, you can write
  754. multiple messages to a stream without having to worry about delimiting
  755. them yourself.
  756. * Throw a more descriptive exception when build() is double-called.
  757. * Add a method to query whether CodedInputStream is at the end of the input
  758. stream.
  759. * Add a method to reset a CodedInputStream's size counter; useful when
  760. reading many messages with the same stream.
  761. * equals() and hashCode() now account for unknown fields.
  762. Python
  763. * Added slicing support for repeated scalar fields. Added slice retrieval and
  764. removal of repeated composite fields.
  765. * Updated RPC interfaces to allow for blocking operation. A client may
  766. now pass None for a callback when making an RPC, in which case the
  767. call will block until the response is received, and the response
  768. object will be returned directly to the caller. This interface change
  769. cannot be used in practice until RPC implementations are updated to
  770. implement it.
  771. * Changes to input_stream.py should make protobuf compatible with appengine.
  772. 2008-11-25 version 2.0.3:
  773. protoc
  774. * Enum values may now have custom options, using syntax similar to field
  775. options.
  776. * Fixed bug where .proto files which use custom options but don't actually
  777. define them (i.e. they import another .proto file defining the options)
  778. had to explicitly import descriptor.proto.
  779. * Adjacent string literals in .proto files will now be concatenated, like in
  780. C.
  781. * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
  782. the import path only contains "." (or contains "." but does not contain
  783. the file), protoc incorrectly thought that the file was under ".", because
  784. it thought that the path was relative (since it didn't start with a slash).
  785. This has been fixed.
  786. C++
  787. * Generated message classes now have a Swap() method which efficiently swaps
  788. the contents of two objects.
  789. * All message classes now have a SpaceUsed() method which returns an estimate
  790. of the number of bytes of allocated memory currently owned by the object.
  791. This is particularly useful when you are reusing a single message object
  792. to improve performance but want to make sure it doesn't bloat up too large.
  793. * New method Message::SerializeAsString() returns a string containing the
  794. serialized data. May be more convenient than calling
  795. SerializeToString(string*).
  796. * In debug mode, log error messages when string-type fields are found to
  797. contain bytes that are not valid UTF-8.
  798. * Fixed bug where a message with multiple extension ranges couldn't parse
  799. extensions.
  800. * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
  801. a message that contained no fields (but possibly contained extensions).
  802. * Fixed ShortDebugString() to not be O(n^2). Durr.
  803. * Fixed crash in TextFormat parsing if the first token in the input caused a
  804. tokenization error.
  805. * Fixed obscure bugs in zero_copy_stream_impl.cc.
  806. * Added support for HP C++ on Tru64.
  807. * Only build tests on "make check", not "make".
  808. * Fixed alignment issue that caused crashes when using DynamicMessage on
  809. 64-bit Sparc machines.
  810. * Simplify template usage to work with MSVC 2003.
  811. * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
  812. (This affected Fedora 9 in particular.)
  813. * Now works on "Solaris 10 using recent Sun Studio".
  814. Java
  815. * New overload of mergeFrom() which parses a slice of a byte array instead
  816. of the whole thing.
  817. * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
  818. * Improved performance of isInitialized() when optimizing for code size.
  819. Python
  820. * Corrected ListFields() signature in Message base class to match what
  821. subclasses actually implement.
  822. * Some minor refactoring.
  823. * Don't pass self as first argument to superclass constructor (no longer
  824. allowed in Python 2.6).
  825. 2008-09-29 version 2.0.2:
  826. General
  827. * License changed from Apache 2.0 to New BSD.
  828. * It is now possible to define custom "options", which are basically
  829. annotations which may be placed on definitions in a .proto file.
  830. For example, you might define a field option called "foo" like so:
  831. import "google/protobuf/descriptor.proto"
  832. extend google.protobuf.FieldOptions {
  833. optional string foo = 12345;
  834. }
  835. Then you annotate a field using the "foo" option:
  836. message MyMessage {
  837. optional int32 some_field = 1 [(foo) = "bar"]
  838. }
  839. The value of this option is then visible via the message's
  840. Descriptor:
  841. const FieldDescriptor* field =
  842. MyMessage::descriptor()->FindFieldByName("some_field");
  843. assert(field->options().GetExtension(foo) == "bar");
  844. This feature has been implemented and tested in C++ and Java.
  845. Other languages may or may not need to do extra work to support
  846. custom options, depending on how they construct descriptors.
  847. C++
  848. * Fixed some GCC warnings that only occur when using -pedantic.
  849. * Improved static initialization code, making ordering more
  850. predictable among other things.
  851. * TextFormat will no longer accept messages which contain multiple
  852. instances of a singular field. Previously, the latter instance
  853. would overwrite the former.
  854. * Now works on systems that don't have hash_map.
  855. Java
  856. * Print @Override annotation in generated code where appropriate.
  857. Python
  858. * Strings now use the "unicode" type rather than the "str" type.
  859. String fields may still be assigned ASCII "str" values; they will
  860. automatically be converted.
  861. * Adding a property to an object representing a repeated field now
  862. raises an exception. For example:
  863. # No longer works (and never should have).
  864. message.some_repeated_field.foo = 1
  865. Windows
  866. * We now build static libraries rather than DLLs by default on MSVC.
  867. See vsprojects/readme.txt for more information.
  868. 2008-08-15 version 2.0.1:
  869. protoc
  870. * New flags --encode and --decode can be used to convert between protobuf text
  871. format and binary format from the command-line.
  872. * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
  873. all parsed files directly into a single output file. This is particularly
  874. useful if you wish to parse .proto files from programs written in languages
  875. other than C++: just run protoc as a background process and have it output
  876. a FileDescriptorList, then parse that natively.
  877. * Improved error message when an enum value's name conflicts with another
  878. symbol defined in the enum type's scope, e.g. if two enum types declared
  879. in the same scope have values with the same name. This is disallowed for
  880. compatibility with C++, but this wasn't clear from the error.
  881. * Fixed absolute output paths on Windows.
  882. * Allow trailing slashes in --proto_path mappings.
  883. C++
  884. * Reflection objects are now per-class rather than per-instance. To make this
  885. possible, the Reflection interface had to be changed such that all methods
  886. take the Message instance as a parameter. This change improves performance
  887. significantly in memory-bandwidth-limited use cases, since it makes the
  888. message objects smaller. Note that source-incompatible interface changes
  889. like this will not be made again after the library leaves beta.
  890. * Heuristically detect sub-messages when printing unknown fields.
  891. * Fix static initialization ordering bug that caused crashes at startup when
  892. compiling on Mac with static linking.
  893. * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
  894. * Fixed incorrect definition of kint32min.
  895. * Fix bytes type setter to work with byte sequences with embedded NULLs.
  896. * Other irrelevant tweaks.
  897. Java
  898. * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
  899. * Fixed TextFormat's parsing of "inf" and "nan".
  900. * Fixed TextFormat's parsing of comments.
  901. * Added info to Java POM that will be required when we upload the
  902. package to a Maven repo.
  903. Python
  904. * MergeFrom(message) and CopyFrom(message) are now implemented.
  905. * SerializeToString() raises an exception if the message is missing required
  906. fields.
  907. * Code organization improvements.
  908. * Fixed doc comments for RpcController and RpcChannel, which had somehow been
  909. swapped.
  910. * Fixed text_format_test on Windows where floating-point exponents sometimes
  911. contain extra zeros.
  912. * Fix Python service CallMethod() implementation.
  913. Other
  914. * Improved readmes.
  915. * VIM syntax highlighting improvements.
  916. 2008-07-07 version 2.0.0:
  917. * First public release.