CHANGES.txt 39 KB

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