CHANGES.txt 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  1. 2017-12-20 version 3.5.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
  2. Planned Future Changes
  3. * Make C++ implementation C++11 only: we plan to require C++11 to build
  4. protobuf code starting from 3.6.0 release. Please join this github issue:
  5. https://github.com/google/protobuf/issues/2780 to provide your feedback.
  6. protoc
  7. * Fixed a bug introduced in 3.5.0 and protoc in Windows now accepts non-ascii
  8. characters in paths again.
  9. C++
  10. * Removed several usages of C++11 features in the code base.
  11. * Fixed some compiler warnings.
  12. PHP
  13. * Fixed memory leak in C-extension implementation.
  14. * Added discardUnknokwnFields API.
  15. * Removed duplicatd typedef in C-extension headers.
  16. * Avoided calling private php methods (timelib_update_ts).
  17. * Fixed Any.php to use fully-qualified name for DescriptorPool.
  18. Ruby
  19. * Added Google_Protobuf_discard_unknown for discarding unknown fields in
  20. messages.
  21. C#
  22. * Unknown fields are now preserved by default.
  23. * Floating point values are now bitwise compared, affecting message equality
  24. check and Contains() API in map and repeated fields.
  25. 2017-11-13 version 3.5.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
  26. Planned Future Changes
  27. * Make C++ implementation C++11 only: we plan to require C++11 to build
  28. protobuf code starting from 3.6.0 release. Please join this github issue:
  29. https://github.com/google/protobuf/issues/2780 to provide your feedback.
  30. General
  31. * Unknown fields are now preserved in proto3 for most of the language
  32. implementations for proto3 by default. See the per-language section for
  33. details.
  34. * reserve keyword are now supported in enums
  35. C++
  36. * Proto3 messages are now preserving unknown fields by default. If you rely on
  37. unknowns fields being dropped. Please use DiscardUnknownFields() explicitly.
  38. * Deprecated the unsafe_arena_release_* and unsafe_arena_add_allocated_*
  39. methods for string fields.
  40. * Added move constructor and move assignment to RepeatedField,
  41. RepeatedPtrField and google::protobuf::Any.
  42. * Added perfect forwarding in Arena::CreateMessage
  43. * In-progress experimental support for implicit weak fields with lite protos.
  44. This feature allows the linker to strip out more unused messages and reduce
  45. binary size.
  46. * Various performance optimizations.
  47. Java
  48. * Proto3 messages are now preserving unknown fields by default. If you’d like
  49. to drop unknown fields, please use the DiscardUnknownFieldsParser API. For
  50. example:
  51. Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
  52. Foo foo = parser.parseFrom(input);
  53. * Added a new CodedInputStream decoder for Iterable<ByteBuffer> with direct
  54. ByteBuffers.
  55. * TextFormat now prints unknown length-delimited fields as messages if
  56. possible.
  57. * FieldMaskUtil.merge() no longer creates unnecessary empty messages when a
  58. message field is unset in both source message and destination message.
  59. * Various performance optimizations.
  60. Python
  61. * Proto3 messages are now preserving unknown fields by default. Use
  62. message.DiscardUnknownFields() to drop unknown fields.
  63. * Add FieldDescriptor.file in generated code.
  64. * Add descriptor pool FindOneofByName in pure python.
  65. * Change unknown enum values into unknown field set .
  66. * Add more Python dict/list compatibility for Struct/ListValue.
  67. * Add utf-8 support for text_format.Merge()/Parse().
  68. * Support numeric unknown enum values for proto3 JSON format.
  69. * Add warning for Unexpected end-group tag in cpp extension.
  70. PHP
  71. * Proto3 messages are now preserving unknown fields.
  72. * Provide well known type messages in runtime.
  73. * Add prefix ‘PB’ to generated class of reserved names.
  74. * Fixed all conformance tests for encode/decode json in php runtime. C
  75. extension needs more work.
  76. Objective-C
  77. * Fixed some issues around copying of messages with unknown fields and then
  78. mutating the unknown fields in the copy.
  79. C#
  80. * Added unknown field support in JsonParser.
  81. * Fixed oneof message field merge.
  82. * Simplify parsing messages from array slices.
  83. Ruby
  84. * Unknown fields are now preserved by default.
  85. * Fixed several bugs for segment fault.
  86. Javascript
  87. * Decoder can handle both paced and unpacked data no matter how the proto is
  88. defined.
  89. * Decoder now accept long varint for 32 bit integers.
  90. 2017-08-14 version 3.4.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
  91. Planned Future Changes
  92. * There are some changes that are not included in this release but are planned
  93. for the near future
  94. - Preserve unknown fields in proto3: We are going to bring unknown fields
  95. back into proto3. In this release, some languages start to support
  96. preserving unknown fields in proto3, controlled by flags/options. Some
  97. languages also introduce explicit APIs to drop unknown fields for
  98. migration. Please read the change log sections by languages for details.
  99. For general timeline and plan:
  100. https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view
  101. For issues and discussions:
  102. https://github.com/google/protobuf/issues/272
  103. - Make C++ implementation C++11 only: we plan to require C++11 to build
  104. protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields
  105. semantic changes are finished. Please join this
  106. github issue:
  107. https://github.com/google/protobuf/issues/2780
  108. to provide your feedback.
  109. General
  110. * Extension ranges now accept options and are customizable.
  111. * "reserve" keyword now supports “max” in field number ranges,
  112. e.g. reserve 1000 to max;
  113. C++
  114. * Proto3 messages are now able to preserve unknown fields. The default
  115. behavior is still to drop unknowns, which will be flipped in a future
  116. release. If you rely on unknowns fields being dropped. Please use
  117. Message::DiscardUnknownFields() explicitly.
  118. * Packable proto3 fields are now packed by default in serialization.
  119. * Following C++11 features are introduced when C++11 is available:
  120. - move-constructor and move-assignment are introduced to messages
  121. - Repeated fields constructor now takes std::initializer_list
  122. - rvalue setters are introduced for string fields
  123. * Experimental Table-Driven parsing and serialization available to test. To
  124. enable it, pass in table_driven_parsing table_driven_serialization protoc
  125. generator flags for C++
  126. $ protoc --cpp_out=table_driven_parsing,table_driven_serialization:./ \
  127. test.proto
  128. * lite generator parameter supported by the generator. Once set, all generated
  129. files, use lite runtime regardless of the optimizer_for setting in the
  130. .proto file.
  131. * Various optimizations to make C++ code more performant on PowerPC platform
  132. * Fixed maps data corruption when the maps are modified by both reflection API
  133. and generated API.
  134. * Deterministic serialization on maps reflection now uses stable sort.
  135. * file() accessors are introduced to various *Descriptor classes to make
  136. writing template function easier.
  137. * ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and
  138. SpaceUsedLong() instead
  139. * Consistent hash function is used for maps in DEBUG and NDEBUG build.
  140. * "using namespace std" is removed from stubs/common.h
  141. * Various performance optimizations and bug fixes
  142. Java
  143. * Introduced new parser API DiscardUnknownFieldsParser in preparation of
  144. proto3 unknown fields preservation change. Users who want to drop unknown
  145. fields should migrate to use this new parser API. For example:
  146. Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
  147. Foo foo = parser.parseFrom(input);
  148. * Introduced new TextFormat API printUnicodeFieldValue() that prints field
  149. value without escaping unicode characters.
  150. * Added Durations.compare(Duration, Duration) and
  151. Timestamps.compare(Timestamp, Timestamp).
  152. * JsonFormat now accepts base64url encoded bytes fields.
  153. * Optimized CodedInputStream to do less copies when parsing large bytes
  154. fields.
  155. * Optimized TextFormat to allocate less memory when printing.
  156. Python
  157. * SerializeToString API is changed to SerializeToString(self, **kwargs),
  158. deterministic parameter is accepted for deterministic serialization.
  159. * Added sort_keys parameter in json format to make the output deterministic.
  160. * Added indent parameter in json format.
  161. * Added extension support in json format.
  162. * Added __repr__ support for repeated field in cpp implementation.
  163. * Added file in FieldDescriptor.
  164. * Added pretty-print filter to text format.
  165. * Services and method descriptors are always printed even if generic_service
  166. option is turned off.
  167. * Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will
  168. never update protobuf runtime. Users who depend on AppEngine 2.5 should use
  169. old protoc.
  170. PHP
  171. * Support PHP generic services. Specify file option php_generic_service=true
  172. to enable generating service interface.
  173. * Message, repeated and map fields setters take value instead of reference.
  174. * Added map iterator in c extension.
  175. * Support json  encode/decode.
  176. * Added more type info in getter/setter phpdoc
  177. * Fixed the problem that c extension and php implementation cannot be used
  178. together.
  179. * Added file option php_namespace to use custom php namespace instead of
  180. package.
  181. * Added fluent setter.
  182. * Added descriptor API in runtime for custom encode/decode.
  183. * Various bug fixes.
  184. Objective-C
  185. * Fix for GPBExtensionRegistry copying and add tests.
  186. * Optimize GPBDictionary.m codegen to reduce size of overall library by 46K
  187. per architecture.
  188. * Fix some cases of reading of 64bit map values.
  189. * Properly error on a tag with field number zero.
  190. * Preserve unknown fields in proto3 syntax files.
  191. * Document the exceptions on some of the writing apis.
  192. C#
  193. * Implemented IReadOnlyDictionary<K,V> in MapField<K,V>
  194. * Added TryUnpack method for Any message in addition to Unpack.
  195. * Converted C# projects to MSBuild (csproj) format.
  196. Ruby
  197. * Several bug fixes.
  198. Javascript
  199. * Added support of field option js_type. Now one can specify the JS type of a
  200. 64-bit integer field to be string in the generated code by adding option
  201. [jstype = JS_STRING] on the field.
  202. 2017-04-05 version 3.3.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
  203. Planned Future Changes
  204. * There are some changes that are not included in this release but are
  205. planned for the near future:
  206. - Preserve unknown fields in proto3: please read this doc:
  207. https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view
  208. for the timeline and follow up this github issue:
  209. https://github.com/google/protobuf/issues/272
  210. for discussion.
  211. - Make C++ implementation C++11 only: we plan to require C++11 to build
  212. protobuf code starting from 3.4.0 or 3.5.0 release. Please join this
  213. github issue:
  214. https://github.com/google/protobuf/issues/2780
  215. to provide your feedback.
  216. C++
  217. * Fixed map fields serialization of DynamicMessage to correctly serialize
  218. both key and value regardless of their presence.
  219. * Parser now rejects field number 0 correctly.
  220. * New API Message::SpaceUsedLong() that’s equivalent to
  221. Message::SpaceUsed() but returns the value in size_t.
  222. * JSON support
  223. - New flag always_print_enums_as_ints in JsonPrintOptions.
  224. - New flag preserve_proto_field_names in JsonPrintOptions. It will instruct
  225. the JSON printer to use the original field name declared in the .proto
  226. file instead of converting them to lowerCamelCase when printing JSON.
  227. - JsonPrintOptions.always_print_primtive_fields now works for oneof message
  228. fields.
  229. - Fixed a bug that doesn’t allow different fields to set the same json_name
  230. value.
  231. - Fixed a performance bug that causes excessive memory copy when printing
  232. large messages.
  233. * Various performance optimizations.
  234. Java
  235. * Map field setters eagerly validate inputs and throw NullPointerExceptions
  236. as appropriate.
  237. * Added ByteBuffer overloads to the generated parsing methods and the Parser
  238. interface.
  239. * proto3 enum's getNumber() method now throws on UNRECOGNIZED values.
  240. * Output of JsonFormat is now locale independent.
  241. Python
  242. * Added FindServiceByName() in the pure-Python DescriptorPool. This works only
  243. for descriptors added with DescriptorPool.Add(). Generated descriptor_pool
  244. does not support this yet.
  245. * Added a descriptor_pool parameter for parsing Any in text_format.Parse().
  246. * descriptor_pool.FindFileContainingSymbol() now is able to find nested
  247. extensions.
  248. * Extending empty [] to repeated field now sets parent message presence.
  249. PHP
  250. * Added file option php_class_prefix. The prefix will be prepended to all
  251. generated classes defined in the file.
  252. * When encoding, negative int32 values are sign-extended to int64.
  253. * Repeated/Map field setter accepts a regular PHP array. Type checking is
  254. done on the array elements.
  255. * encode/decode are renamed to serializeToString/mergeFromString.
  256. * Added mergeFrom, clear method on Message.
  257. * Fixed a bug that oneof accessor didn’t return the field name that is
  258. actually set.
  259. * C extension now works with php7.
  260. * This is the first GA release of PHP. We guarantee that old generated code
  261. can always work with new runtime and new generated code.
  262. Objective-C
  263. * Fixed help for GPBTimestamp for dates before the epoch that contain
  264. fractional seconds.
  265. * Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a
  266. message and any sub messages.
  267. * Addressed a threading race in extension registration/lookup.
  268. * Increased the max message parsing depth to 100 to match the other languages.
  269. * Removed some use of dispatch_once in favor of atomic compare/set since it
  270. needs to be heap based.
  271. * Fixes for new Xcode 8.3 warnings.
  272. C#
  273. * Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily
  274. if provided exactly the right size of array to copy to.
  275. * Fixed enum JSON formatting when multiple names mapped to the same numeric
  276. value.
  277. * Added JSON formatting option to format enums as integers.
  278. * Modified RepeatedField<T> to implement IReadOnlyList<T>.
  279. * Introduced the start of custom option handling; it's not as pleasant as it
  280. might be, but the information is at least present. We expect to extend code
  281. generation to improve this in the future.
  282. * Introduced ByteString.FromStream and ByteString.FromStreamAsync to
  283. efficiently create a ByteString from a stream.
  284. * Added whole-message deprecation, which decorates the class with [Obsolete].
  285. Ruby
  286. * Fixed Message#to_h for messages with map fields.
  287. * Fixed memcpy() in binary gems to work for old glibc, without breaking the
  288. build for non-glibc libc’s like musl.
  289. Javascript
  290. * Added compatibility tests for version 3.0.0.
  291. * Added conformance tests.
  292. * Fixed serialization of extensions: we need to emit a value even if it is
  293. falsy (like the number 0).
  294. * Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript.
  295. 2017-01-23 version 3.2.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite)
  296. General
  297. * Added protoc version number to protoc plugin protocol. It can be used by
  298. protoc plugin to detect which version of protoc is used with the plugin and
  299. mitigate known problems in certain version of protoc.
  300. C++
  301. * The default parsing byte size limit has been raised from 64MB to 2GB.
  302. * Added rvalue setters for non-arena string fields.
  303. * Enabled debug logging for Android.
  304. * Fixed a double-free problem when using Reflection::SetAllocatedMessage()
  305. with extension fields.
  306. * Fixed several deterministic serialization bugs:
  307. * MessageLite::SerializeAsString() now respects the global deterministic
  308. serialization flag.
  309. * Extension fields are serialized deterministically as well. Fixed protocol
  310. compiler to correctly report importing-self as an error.
  311. * Fixed FileDescriptor::DebugString() to print custom options correctly.
  312. * Various performance/codesize optimizations and cleanups.
  313. Java
  314. * The default parsing byte size limit has been raised from 64MB to 2GB.
  315. * Added recursion limit when parsing JSON.
  316. * Fixed a bug that enumType.getDescriptor().getOptions() doesn't have custom
  317. options.
  318. * Fixed generated code to support field numbers up to 2^29-1.
  319. Python
  320. * You can now assign NumPy scalars/arrays (np.int32, np.int64) to protobuf
  321. fields, and assigning other numeric types has been optimized for
  322. performance.
  323. * Pure-Python: message types are now garbage-collectable.
  324. * Python/C++: a lot of internal cleanup/refactoring.
  325. PHP (Alpha)
  326. * For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP
  327. integer on 64-bit environment and PHP string on 32-bit environment.
  328. * PHP generated code also conforms to PSR-4 now.
  329. * Fixed ZTS build for c extension.
  330. * Fixed c extension build on Mac.
  331. * Fixed c extension build on 32-bit linux.
  332. * Fixed the bug that message without namespace is not found in the descriptor
  333. pool. (#2240)
  334. * Fixed the bug that repeated field is not iterable in c extension.
  335. * Message names Empty will be converted to GPBEmpty in generated code.
  336. * Added phpdoc in generated files.
  337. * The released API is almost stable. Unless there is large problem, we won't
  338. change it. See
  339. https://developers.google.com/protocol-buffers/docs/reference/php-generated
  340. for more details.
  341. Objective-C
  342. * Added support for push/pop of the stream limit on CodedInputStream for
  343. anyone doing manual parsing.
  344. C#
  345. * No changes.
  346. Ruby
  347. * Message objects now support #respond_to? for field getters/setters.
  348. * You can now compare “message == non_message_object” and it will return false
  349. instead of throwing an exception.
  350. * JRuby: fixed #hashCode to properly reflect the values in the message.
  351. Javascript
  352. * Deserialization of repeated fields no longer has quadratic performance
  353. behavior.
  354. * UTF-8 encoding/decoding now properly supports high codepoints.
  355. * Added convenience methods for some well-known types: Any, Struct, and
  356. Timestamp. These make it easier to convert data between native JavaScript
  357. types and the well-known protobuf types.
  358. 2016-09-23 version 3.1.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite)
  359. General
  360. * Proto3 support in PHP (alpha).
  361. * Various bug fixes.
  362. C++
  363. * Added MessageLite::ByteSizeLong() that’s equivalent to
  364. MessageLite::ByteSize() but returns the value in size_t. Useful to check
  365. whether a message is over the 2G size limit that protobuf can support.
  366. * Moved default_instances to global variables. This allows default_instance
  367. addresses to be known at compile time.
  368. * Adding missing generic gcc 64-bit atomicops.
  369. * Restore New*Callback into google::protobuf namespace since these are used
  370. by the service stubs code
  371. * JSON support.
  372. * Fixed some conformance issues.
  373. * Fixed a JSON serialization bug for bytes fields.
  374. Java
  375. * Fixed a bug in TextFormat that doesn’t accept empty repeated fields (i.e.,
  376. “field: [ ]”).
  377. * JSON support
  378. * Fixed JsonFormat to do correct snake_case-to-camelCase conversion for
  379. non-style-conforming field names.
  380. * Fixed JsonFormat to parse empty Any message correctly.
  381. * Added an option to JsonFormat.Parser to ignore unknown fields.
  382. * Experimental API
  383. * Added UnsafeByteOperations.unsafeWrap(byte[]) to wrap a byte array into
  384. ByteString without copy.
  385. Python
  386. * JSON support
  387. * Fixed some conformance issues.
  388. PHP (Alpha)
  389. * We have added the proto3 support for PHP via both a pure PHP package and a
  390. native c extension. The pure PHP package is intended to provide usability
  391. to wider range of PHP platforms, while the c extension is intended to
  392. provide higher performance. Both implementations provide the same runtime
  393. APIs and share the same generated code. Users don’t need to re-generate
  394. code for the same proto definition when they want to switch the
  395. implementation later. The pure PHP package is included in the php/src
  396. directory, and the c extension is included in the php/ext directory.
  397. Both implementations provide idiomatic PHP APIs:
  398. * All messages and enums are defined as PHP classes.
  399. * All message fields can only be accessed via getter/setter.
  400. * Both repeated field elements and map elements are stored in containers
  401. that act like a normal PHP array.
  402. Unlike several existing third-party PHP implementations for protobuf, our
  403. implementations are built on a "strongly-typed" philosophy: message fields
  404. and array/map containers will throw exceptions eagerly when values of the
  405. incorrect type (not including those that can be type converted, e.g.,
  406. double <-> integer <-> numeric string) are inserted.
  407. Currently, pure PHP runtime supports php5.5, 5.6 and 7 on linux. C
  408. extension runtime supports php5.5 and 5.6 on linux.
  409. See php/README.md for more details about installment. See
  410. https://developers.google.com/protocol-buffers/docs/phptutorial for more
  411. details about APIs.
  412. Objective-C
  413. * Helpers are now provided for working the the Any well known type (see
  414. GPBWellKnownTypes.h for the api additions).
  415. * Some improvements in startup code (especially when extensions aren’t used).
  416. Javascript
  417. * Fixed missing import of jspb.Map
  418. * Fixed valueWriterFn variable name
  419. Ruby
  420. * Fixed hash computation for JRuby's RubyMessage
  421. * Make sure map parsing frames are GC-rooted.
  422. * Added API support for well-known types.
  423. C#
  424. * Removed check on dependency in the C# reflection API.
  425. 2016-09-06 version 3.0.2 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite)
  426. General
  427. * Various bug fixes.
  428. Objective C
  429. * Fix for oneofs in proto3 syntax files where fields were set to the zero
  430. value.
  431. * Fix for embedded null character in strings.
  432. * CocoaDocs support
  433. Ruby
  434. * Fixed memory corruption bug in parsing that could occur under GC pressure.
  435. Javascript
  436. * jspb.Map is now properly exported to CommonJS modules.
  437. C#
  438. * Removed legacy_enum_values flag.
  439. 2016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite)
  440. General
  441. * This log only contains changes since the beta-4 release. Summarized change
  442. log since the last stable release (v2.6.1) can be found in the github
  443. release page.
  444. Compatibility Notice
  445. * v3.0.0 is the first API stable release of the v3.x series. We do not expect
  446. any future API breaking changes.
  447. * For C++, Java Lite and Objective-C, source level compatibility is
  448. guaranteed. Upgrading from v3.0.0 to newer minor version releases will be
  449. source compatible. For example, if your code compiles against protobuf
  450. v3.0.0, it will continue to compile after you upgrade protobuf library to
  451. v3.1.0.
  452. * For other languages, both source level compatibility and binary level
  453. compatibility are guaranteed. For example, if you have a Java binary built
  454. against protobuf v3.0.0. After switching the protobuf runtime binary to
  455. v3.1.0, your built binary should continue to work.
  456. * Compatibility is only guaranteed for documented API and documented
  457. behaviors. If you are using undocumented API (e.g., use anything in the C++
  458. internal namespace), it can be broken by minor version releases in an
  459. undetermined manner.
  460. Ruby
  461. * When you assign a string field `a.string_field = "X"`, we now call
  462. #encode(UTF-8) on the string and freeze the copy. This saves you from
  463. needing to ensure the string is already encoded as UTF-8. It also prevents
  464. you from mutating the string after it has been assigned (this is how we
  465. ensure it stays valid UTF-8).
  466. * The generated file for `foo.proto` is now `foo_pb.rb` instead of just
  467. `foo.rb`. This makes it easier to see which imports/requires are from
  468. protobuf generated code, and also prevents conflicts with any `foo.rb` file
  469. you might have written directly in Ruby. It is a backward-incompatible
  470. change: you will need to update all of your `require` statements.
  471. * For package names like `foo_bar`, we now translate this to the Ruby module
  472. `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`).
  473. JavaScript
  474. * Scalar fields like numbers and boolean now return defaults instead of
  475. `undefined` or `null` when they are unset. You can test for presence
  476. explicitly by calling `hasFoo()`, which we now generate for scalar fields.
  477. Java Lite
  478. * Java Lite is now implemented as a separate plugin, maintained in the
  479. `javalite` branch. Both lite runtime and protoc artifacts will be available
  480. in Maven.
  481. C#
  482. * Target platforms now .NET 4.5, selected portable subsets and .NET Core.
  483. * legacy_enum_values option is no longer supported.
  484. 2016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript)
  485. General
  486. * Added a deterministic serialization API for C++. The deterministic
  487. serialization guarantees that given a binary, equal messages will be
  488. serialized to the same bytes. This allows applications like MapReduce to
  489. group equal messages based on the serialized bytes. The deterministic
  490. serialization is, however, NOT canonical across languages; it is also
  491. unstable across different builds with schema changes due to unknown fields.
  492. Users who need canonical serialization, e.g. persistent storage in a
  493. canonical form, fingerprinting, etc, should define their own
  494. canonicalization specification and implement the serializer using reflection
  495. APIs rather than relying on this API.
  496. * Added OneofOptions. You can now define custom options for oneof groups.
  497. import "google/protobuf/descriptor.proto";
  498. extend google.protobuf.OneofOptions {
  499. optional int32 my_oneof_extension = 12345;
  500. }
  501. message Foo {
  502. oneof oneof_group {
  503. (my_oneof_extension) = 54321;
  504. ...
  505. }
  506. }
  507. C++ (beta)
  508. * Introduced a deterministic serialization API in
  509. CodedOutputStream::SetSerializationDeterministic(bool). See the notes about
  510. deterministic serialization in the General section.
  511. * Added google::protobuf::Map::swap() to swap two map fields.
  512. * Fixed a memory leak when calling Reflection::ReleaseMessage() on a message
  513. allocated on arena.
  514. * Improved error reporting when parsing text format protos.
  515. * JSON
  516. - Added a new parser option to ignore unknown fields when parsing JSON.
  517. - Added convenient methods for message to/from JSON conversion.
  518. * Various performance optimizations.
  519. Java (beta)
  520. * File option "java_generate_equals_and_hash" is now deprecated. equals() and
  521. hashCode() methods are generated by default.
  522. * Added a new JSON printer option "omittingInsignificantWhitespace" to produce
  523. a more compact JSON output. The printer will pretty-print by default.
  524. * Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos.
  525. Python (beta)
  526. * Added support to pretty print Any messages in text format.
  527. * Added a flag to ignore unknown fields when parsing JSON.
  528. * Bugfix: "@type" field of a JSON Any message is now correctly put before
  529. other fields.
  530. Objective-C (beta)
  531. * Updated the code to support compiling with more compiler warnings
  532. enabled. (Issue 1616)
  533. * Exposing more detailed errors for parsing failures. (PR 1623)
  534. * Small (breaking) change to the naming of some methods on the support classes
  535. for map<>. There were collisions with the system provided KVO support, so
  536. the names were changed to avoid those issues. (PR 1699)
  537. * Fixed for proper Swift bridging of error handling during parsing. (PR 1712)
  538. * Complete support for generating sources that will go into a Framework and
  539. depend on generated sources from other Frameworks. (Issue 1457)
  540. C# (beta)
  541. * RepeatedField optimizations.
  542. * Support for .NET Core.
  543. * Minor bug fixes.
  544. * Ability to format a single value in JsonFormatter (advanced usage only).
  545. * Modifications to attributes applied to generated code.
  546. Javascript (alpha)
  547. * Maps now have a real map API instead of being treated as repeated fields.
  548. * Well-known types are now provided in the google-protobuf package, and the
  549. code generator knows to require() them from that package.
  550. * Bugfix: non-canonical varints are correctly decoded.
  551. Ruby (alpha)
  552. * Accessors for oneof fields now return default values instead of nil.
  553. Java Lite
  554. * Java lite support is removed from protocol compiler. It will be supported
  555. as a protocol compiler plugin in a separate code branch.
  556. 2016-05-16 version 3.0.0-beta-3 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
  557. General
  558. * Supported Proto3 lite-runtime in C++/Java for mobile platforms.
  559. * Any type now supports APIs to specify prefixes other than
  560. type.googleapis.com
  561. * Removed javanano_use_deprecated_package option; Nano will always has its own
  562. ".nano" package.
  563. C++ (Beta)
  564. * Improved hash maps.
  565. - Improved hash maps comments. In particular, please note that equal hash
  566. maps will not necessarily have the same iteration order and
  567. serialization.
  568. - Added a new hash maps implementation that will become the default in a
  569. later release.
  570. * Arenas
  571. - Several inlined methods in Arena were moved to out-of-line to improve
  572. build performance and code size.
  573. - Added SpaceAllocatedAndUsed() to report both space used and allocated
  574. - Added convenient class UnsafeArenaAllocatedRepeatedPtrFieldBackInserter
  575. * Any
  576. - Allow custom type URL prefixes in Any packing.
  577. - TextFormat now expand the Any type rather than printing bytes.
  578. * Performance optimizations and various bug fixes.
  579. Java (Beta)
  580. * Introduced an ExperimentalApi annotation. Annotated APIs are experimental
  581. and are subject to change in a backward incompatible way in future releases.
  582. * Introduced zero-copy serialization as an ExperimentalApi
  583. - Introduction of the `ByteOutput` interface. This is similar to
  584. `OutputStream` but provides semantics for lazy writing (i.e. no
  585. immediate copy required) of fields that are considered to be immutable.
  586. - `ByteString` now supports writing to a `ByteOutput`, which will directly
  587. expose the internals of the `ByteString` (i.e. `byte[]` or `ByteBuffer`)
  588. to the `ByteOutput` without copying.
  589. - `CodedOutputStream` now supports writing to a `ByteOutput`. `ByteString`
  590. instances that are too large to fit in the internal buffer will be
  591. (lazily) written to the `ByteOutput` directly.
  592. - This allows applications using large `ByteString` fields to avoid
  593. duplication of these fields entirely. Such an application can supply a
  594. `ByteOutput` that chains together the chunks received from
  595. `CodedOutputStream` before forwarding them onto the IO system.
  596. * Other related changes to `CodedOutputStream`
  597. - Additional use of `sun.misc.Unsafe` where possible to perform fast
  598. access to `byte[]` and `ByteBuffer` values and avoiding unnecessary
  599. range checking.
  600. - `ByteBuffer`-backed `CodedOutputStream` now writes directly to the
  601. `ByteBuffer` rather than to an intermediate array.
  602. * Improved lite-runtime.
  603. - Lite protos now implement deep equals/hashCode/toString
  604. - Significantly improved the performance of Builder#mergeFrom() and
  605. Builder#mergeDelimitedFrom()
  606. * Various bug fixes and small feature enhancement.
  607. - Fixed stack overflow when in hashCode() for infinite recursive oneofs.
  608. - Fixed the lazy field parsing in lite to merge rather than overwrite.
  609. - TextFormat now supports reporting line/column numbers on errors.
  610. - Updated to add appropriate @Override for better compiler errors.
  611. Python (Beta)
  612. * Added JSON format for Any, Struct, Value and ListValue
  613. * [ ] is now accepted for both repeated scalar fields and repeated message
  614. fields in text format parser.
  615. * Numerical field name is now supported in text format.
  616. * Added DiscardUnknownFields API for python protobuf message.
  617. Objective-C (Beta)
  618. * Proto comments now come over as HeaderDoc comments in the generated sources
  619. so Xcode can pick them up and display them.
  620. * The library headers have been updated to use HeaderDoc comments so Xcode can
  621. pick them up and display them.
  622. * The per message and per field overhead in both generated code and runtime
  623. object sizes was reduced.
  624. * Generated code now include deprecated annotations when the proto file
  625. included them.
  626. C# (Beta)
  627. In general: some changes are breaking, which require regenerating messages.
  628. Most user-written code will not be impacted *except* for the renaming of enum
  629. values.
  630. * Allow custom type URL prefixes in `Any` packing, and ignore them when
  631. unpacking
  632. * `protoc` is now in a separate NuGet package (Google.Protobuf.Tools)
  633. * New option: `internal_access` to generate internal classes
  634. * Enum values are now PascalCased, and if there's a prefix which matches the
  635. name of the enum, that is removed (so an enum `COLOR` with a value
  636. `COLOR_BLUE` would generate a value of just `Blue`). An option
  637. (`legacy_enum_values`) is temporarily available to disable this, but the
  638. option will be removed for GA.
  639. * `json_name` option is now honored
  640. * If group tags are encountered when parsing, they are validated more
  641. thoroughly (although we don't support actual groups)
  642. * NuGet dependencies are better specified
  643. * Breaking: `Preconditions` is renamed to `ProtoPreconditions`
  644. * Breaking: `GeneratedCodeInfo` is renamed to `GeneratedClrTypeInfo`
  645. * `JsonFormatter` now allows writing to a `TextWriter`
  646. * New interface, `ICustomDiagnosticMessage` to allow more compact
  647. representations from `ToString`
  648. * `CodedInputStream` and `CodedOutputStream` now implement `IDisposable`,
  649. which simply disposes of the streams they were constructed with
  650. * Map fields no longer support null values (in line with other languages)
  651. * Improvements in JSON formatting and parsing
  652. Javascript (Alpha)
  653. * Better support for "bytes" fields: bytes fields can be read as either a
  654. base64 string or UInt8Array (in environments where TypedArray is supported).
  655. * New support for CommonJS imports. This should make it easier to use the
  656. JavaScript support in Node.js and tools like WebPack. See js/README.md for
  657. more information.
  658. * Some significant internal refactoring to simplify and modularize the code.
  659. Ruby (Alpha)
  660. * JSON serialization now properly uses camelCased names, with a runtime option
  661. that will preserve original names from .proto files instead.
  662. * Well-known types are now included in the distribution.
  663. * Release now includes binary gems for Windows, Mac, and Linux instead of just
  664. source gems.
  665. * Bugfix for serializing oneofs.
  666. C++/Java Lite (Alpha)
  667. A new "lite" generator parameter was introduced in the protoc for C++ and
  668. Java for Proto3 syntax messages. Example usage:
  669. ./protoc --cpp_out=lite:$OUTPUT_PATH foo.proto
  670. The protoc will treat the current input and all the transitive dependencies
  671. as LITE. The same generator parameter must be used to generate the
  672. dependencies.
  673. In Proto3 syntax files, "optimized_for=LITE_RUNTIME" is no longer supported.
  674. 2015-12-30 version 3.0.0-beta-2 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
  675. General
  676. * Introduced a new language implementation: JavaScript.
  677. * Added a new field option "json_name". By default proto field names are
  678. converted to "lowerCamelCase" in proto3 JSON format. This option can be
  679. used to override this behavior and specify a different JSON name for the
  680. field.
  681. * Added conformance tests to ensure implementations are following proto3 JSON
  682. specification.
  683. C++ (Beta)
  684. * Various bug fixes and improvements to the JSON support utility:
  685. - Duplicate map keys in JSON are now rejected (i.e., translation will
  686. fail).
  687. - Fixed wire-format for google.protobuf.Value/ListValue.
  688. - Fixed precision loss when converting google.protobuf.Timestamp.
  689. - Fixed a bug when parsing invalid UTF-8 code points.
  690. - Fixed a memory leak.
  691. - Reduced call stack usage.
  692. Java (Beta)
  693. * Cleaned up some unused methods on CodedOutputStream.
  694. * Presized lists for packed fields during parsing in the lite runtime to
  695. reduce allocations and improve performance.
  696. * Improved the performance of unknown fields in the lite runtime.
  697. * Introduced UnsafeByteStrings to support zero-copy ByteString creation.
  698. * Various bug fixes and improvements to the JSON support utility:
  699. - Fixed a thread-safety bug.
  700. - Added a new option “preservingProtoFieldNames” to JsonFormat.
  701. - Added a new option “includingDefaultValueFields” to JsonFormat.
  702. - Updated the JSON utility to comply with proto3 JSON specification.
  703. Python (Beta)
  704. * Added proto3 JSON format utility. It includes support for all field types
  705. and a few well-known types except for Any and Struct.
  706. * Added runtime support for Any, Timestamp, Duration and FieldMask.
  707. * [ ] is now accepted for repeated scalar fields in text format parser.
  708. * Map fields now have proper O(1) performance for lookup/insert/delete
  709. when using the Python/C++ implementation. They were previously using O(n)
  710. search-based algorithms because the C++ reflection interface didn't
  711. support true map operations.
  712. Objective-C (Beta)
  713. * Various bug-fixes and code tweaks to pass more strict compiler warnings.
  714. * Now has conformance test coverage and is passing all tests.
  715. C# (Beta)
  716. * Various bug-fixes.
  717. * Code generation: Files generated in directories based on namespace.
  718. * Code generation: Include comments from .proto files in XML doc
  719. comments (naively)
  720. * Code generation: Change organization/naming of "reflection class" (access
  721. to file descriptor)
  722. * Code generation and library: Add Parser property to MessageDescriptor,
  723. and introduce a non-generic parser type.
  724. * Library: Added TypeRegistry to support JSON parsing/formatting of Any.
  725. * Library: Added Any.Pack/Unpack support.
  726. * Library: Implemented JSON parsing.
  727. Javascript (Alpha)
  728. * Added proto3 support for JavaScript. The runtime is written in pure
  729. JavaScript and works in browsers and in Node.js. To generate JavaScript
  730. code for your proto, invoke protoc with "--js_out". See js/README.md
  731. for more build instructions.
  732. 2015-08-26 version 3.0.0-beta-1 (C++/Java/Python/Ruby/Nano/Objective-C/C#)
  733. About Beta
  734. * This is the first beta release of protobuf v3.0.0. Not all languages
  735. have reached beta stage. Languages not marked as beta are still in
  736. alpha (i.e., be prepared for API breaking changes).
  737. General
  738. * Proto3 JSON is supported in several languages (fully supported in C++
  739. and Java, partially supported in Ruby/C#). The JSON spec is defined in
  740. the proto3 language guide:
  741. https://developers.google.com/protocol-buffers/docs/proto3#json
  742. We will publish a more detailed spec to define the exact behavior of
  743. proto3-conformant JSON serializers and parsers. Until then, do not rely
  744. on specific behaviors of the implementation if it’s not documented in
  745. the above spec. More specifically, the behavior is not yet finalized for
  746. the following:
  747. - Parsing invalid JSON input (e.g., input with trailing commas).
  748. - Non-camelCase names in JSON input.
  749. - The same field appears multiple times in JSON input.
  750. - JSON arrays contain “null” values.
  751. - The message has unknown fields.
  752. * Proto3 now enforces strict UTF-8 checking. Parsing will fail if a string
  753. field contains non UTF-8 data.
  754. C++ (Beta)
  755. * Introduced new utility functions/classes in the google/protobuf/util
  756. directory:
  757. - MessageDifferencer: compare two proto messages and report their
  758. differences.
  759. - JsonUtil: support converting protobuf binary format to/from JSON.
  760. - TimeUtil: utility functions to work with well-known types Timestamp
  761. and Duration.
  762. - FieldMaskUtil: utility functions to work with FieldMask.
  763. * Performance optimization of arena construction and destruction.
  764. * Bug fixes for arena and maps support.
  765. * Changed to use cmake for Windows Visual Studio builds.
  766. * Added Bazel support.
  767. Java (Beta)
  768. * Introduced a new util package that will be distributed as a separate
  769. artifact in maven. It contains:
  770. - JsonFormat: convert proto messages to/from JSON.
  771. - TimeUtil: utility functions to work with Timestamp and Duration.
  772. - FieldMaskUtil: utility functions to work with FieldMask.
  773. * The static PARSER in each generated message is deprecated, and it will
  774. be removed in a future release. A static parser() getter is generated
  775. for each message type instead.
  776. * Performance optimizations for String fields serialization.
  777. * Performance optimizations for Lite runtime on Android:
  778. - Reduced allocations
  779. - Reduced method overhead after ProGuarding
  780. - Reduced code size after ProGuarding
  781. Python (Alpha)
  782. * Removed legacy Python 2.5 support.
  783. * Moved to a single Python 2.x/3.x-compatible codebase, instead of using 2to3.
  784. * Fixed build/tests on Python 2.6, 2.7, 3.3, and 3.4.
  785. - Pure-Python works on all four.
  786. - Python/C++ implementation works on all but 3.4, due to changes in the
  787. Python/C++ API in 3.4.
  788. * Some preliminary work has been done to allow for multiple DescriptorPools
  789. with Python/C++.
  790. Ruby (Alpha)
  791. * Many bugfixes:
  792. - fixed parsing/serialization of bytes, sint, sfixed types
  793. - other parser bugfixes
  794. - fixed memory leak affecting Ruby 2.2
  795. JavaNano (Alpha)
  796. * JavaNano generated code now will be put in a nano package by default to
  797. avoid conflicts with Java generated code.
  798. Objective-C (Alpha)
  799. * Added non-null markup to ObjC library. Requires SDK 8.4+ to build.
  800. * Many bugfixes:
  801. - Removed the class/enum filter.
  802. - Renamed some internal types to avoid conflicts with the well-known types
  803. protos.
  804. - Added missing support for parsing repeated primitive fields in packed or
  805. unpacked forms.
  806. - Added *Count for repeated and map<> fields to avoid auto-create when
  807. checking for them being set.
  808. C# (Alpha)
  809. * Namespace changed to Google.Protobuf (and NuGet package will be named
  810. correspondingly).
  811. * Target platforms now .NET 4.5 and selected portable subsets only.
  812. * Removed lite runtime.
  813. * Reimplementation to use mutable message types.
  814. * Null references used to represent "no value" for message type fields.
  815. * Proto3 semantics supported; proto2 files are prohibited for C# codegen.
  816. Most proto3 features supported:
  817. - JSON formatting (a.k.a. serialization to JSON), including well-known
  818. types (except for Any).
  819. - Wrapper types mapped to nullable value types (or string/ByteString
  820. allowing nullability). JSON parsing is not supported yet.
  821. - maps
  822. - oneof
  823. - enum unknown value preservation
  824. 2015-05-25 version 3.0.0-alpha-3 (Objective-C/C#):
  825. General
  826. * Introduced two new language implementations (Objective-C, C#) to proto3.
  827. * Explicit "optional" keyword are disallowed in proto3 syntax, as fields are
  828. optional by default.
  829. * Group fields are no longer supported in proto3 syntax.
  830. * Changed repeated primitive fields to use packed serialization by default in
  831. proto3 (implemented for C++, Java, Python in this release). The user can
  832. still disable packed serialization by setting packed to false for now.
  833. * Added well-known type protos (any.proto, empty.proto, timestamp.proto,
  834. duration.proto, etc.). Users can import and use these protos just like
  835. regular proto files. Additional runtime support will be added for them in
  836. future releases (in the form of utility helper functions, or having them
  837. replaced by language specific types in generated code).
  838. * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use
  839. this keyword to declare reserved field numbers and names to prevent them
  840. from being reused by other fields in the same message.
  841. To reserve field numbers, add a reserved declaration in your message:
  842. message TestMessage {
  843. reserved 2, 15, 9 to 11, 3;
  844. }
  845. This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of
  846. these as field numbers, the protocol buffer compiler will report an error.
  847. Field names can also be reserved:
  848. message TestMessage {
  849. reserved "foo", "bar";
  850. }
  851. * Various bug fixes since 3.0.0-alpha-2
  852. Objective-C
  853. Objective-C includes a code generator and a native objective-c runtime
  854. library. By adding “--objc_out” to protoc, the code generator will generate
  855. a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto
  856. file.
  857. In this first release, the generated interface provides: enums, messages,
  858. field support(single, repeated, map, oneof), proto2 and proto3 syntax
  859. support, parsing and serialization. It’s compatible with ARC and non-ARC
  860. usage. Besides, user can also access it via the swift bridging header.
  861. See objectivec/README.md for details.
  862. C#
  863. * C# protobufs are based on project
  864. https://github.com/jskeet/protobuf-csharp-port. The original project was
  865. frozen and all the new development will happen here.
  866. * Codegen plugin for C# was completely rewritten to C++ and is now an
  867. integral part of protoc.
  868. * Some refactorings and cleanup has been applied to the C# runtime library.
  869. * Only proto2 is supported in C# at the moment, proto3 support is in
  870. progress and will likely bring significant breaking changes to the API.
  871. See csharp/README.md for details.
  872. C++
  873. * Added runtime support for Any type. To use Any in your proto file, first
  874. import the definition of Any:
  875. // foo.proto
  876. import "google/protobuf/any.proto";
  877. message Foo {
  878. google.protobuf.Any any_field = 1;
  879. }
  880. message Bar {
  881. int32 value = 1;
  882. }
  883. Then in C++ you can access the Any field using PackFrom()/UnpackTo()
  884. methods:
  885. Foo foo;
  886. Bar bar = ...;
  887. foo.mutable_any_field()->PackFrom(bar);
  888. ...
  889. if (foo.any_field().IsType<Bar>()) {
  890. foo.any_field().UnpackTo(&bar);
  891. ...
  892. }
  893. * In text format, entries of a map field will be sorted by key.
  894. Java
  895. * Continued optimizations on the lite runtime to improve performance for
  896. Android.
  897. Python
  898. * Added map support.
  899. - maps now have a dict-like interface (msg.map_field[key] = value)
  900. - existing code that modifies maps via the repeated field interface
  901. will need to be updated.
  902. Ruby
  903. * Improvements to RepeatedField's emulation of the Ruby Array API.
  904. * Various speedups and internal cleanups.
  905. 2015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano):
  906. General
  907. * Introduced three new language implementations (Ruby, JavaNano, and
  908. Python) to proto3.
  909. * Various bug fixes since 3.0.0-alpha-1
  910. Python:
  911. Python has received several updates, most notably support for proto3
  912. semantics in any .proto file that declares syntax="proto3".
  913. Messages declared in proto3 files no longer represent field presence
  914. for scalar fields (number, enums, booleans, or strings). You can
  915. no longer call HasField() for such fields, and they are serialized
  916. based on whether they have a non-zero/empty/false value.
  917. One other notable change is in the C++-accelerated implementation.
  918. Descriptor objects (which describe the protobuf schema and allow
  919. reflection over it) are no longer duplicated between the Python
  920. and C++ layers. The Python descriptors are now simple wrappers
  921. around the C++ descriptors. This change should significantly
  922. reduce the memory usage of programs that use a lot of message
  923. types.
  924. Ruby:
  925. We have added proto3 support for Ruby via a native C extension.
  926. The Ruby extension itself is included in the ruby/ directory, and details on
  927. building and installing the extension are in ruby/README.md. The extension
  928. will also be published as a Ruby gem. Code generator support is included as
  929. part of `protoc` with the `--ruby_out` flag.
  930. The Ruby extension implements a user-friendly DSL to define message types
  931. (also generated by the code generator from `.proto` files). Once a message
  932. type is defined, the user may create instances of the message that behave in
  933. ways idiomatic to Ruby. For example:
  934. - Message fields are present as ordinary Ruby properties (getter method
  935. `foo` and setter method `foo=`).
  936. - Repeated field elements are stored in a container that acts like a native
  937. Ruby array, and map elements are stored in a container that acts like a
  938. native Ruby hashmap.
  939. - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are
  940. present.
  941. Unlike several existing third-party Ruby extensions for protobuf, this
  942. extension is built on a "strongly-typed" philosophy: message fields and
  943. array/map containers will throw exceptions eagerly when values of the
  944. incorrect type are inserted.
  945. See ruby/README.md for details.
  946. JavaNano:
  947. JavaNano is a special code generator and runtime library designed especially
  948. for resource-restricted systems, like Android. It is very resource-friendly
  949. in both the amount of code and the runtime overhead. Here is an an overview
  950. of JavaNano features compared with the official Java protobuf:
  951. - No descriptors or message builders.
  952. - All messages are mutable; fields are public Java fields.
  953. - For optional fields only, encapsulation behind setter/getter/hazzer/
  954. clearer functions is opt-in, which provide proper 'has' state support.
  955. - For proto2, if not opted in, has state (field presence) is not available.
  956. Serialization outputs all fields not equal to their defaults.
  957. The behavior is consistent with proto3 semantics.
  958. - Required fields (proto2 only) are always serialized.
  959. - Enum constants are integers; protection against invalid values only
  960. when parsing from the wire.
  961. - Enum constants can be generated into container interfaces bearing
  962. the enum's name (so the referencing code is in Java style).
  963. - CodedInputByteBufferNano can only take byte[] (not InputStream).
  964. - Similarly CodedOutputByteBufferNano can only write to byte[].
  965. - Repeated fields are in arrays, not ArrayList or Vector. Null array
  966. elements are allowed and silently ignored.
  967. - Full support for serializing/deserializing repeated packed fields.
  968. - Support extensions (in proto2).
  969. - Unset messages/groups are null, not an immutable empty default
  970. instance.
  971. - toByteArray(...) and mergeFrom(...) are now static functions of
  972. MessageNano.
  973. - The 'bytes' type translates to the Java type byte[].
  974. See javanano/README.txt for details.
  975. 2014-12-01 version 3.0.0-alpha-1 (C++/Java):
  976. General
  977. * Introduced Protocol Buffers language version 3 (aka proto3).
  978. When protobuf was initially opensourced it implemented Protocol Buffers
  979. language version 2 (aka proto2), which is why the version number
  980. started from v2.0.0. From v3.0.0, a new language version (proto3) is
  981. introduced while the old version (proto2) will continue to be supported.
  982. The main intent of introducing proto3 is to clean up protobuf before
  983. pushing the language as the foundation of Google's new API platform.
  984. In proto3, the language is simplified, both for ease of use and to
  985. make it available in a wider range of programming languages. At the
  986. same time a few features are added to better support common idioms
  987. found in APIs.
  988. The following are the main new features in language version 3:
  989. 1. Removal of field presence logic for primitive value fields, removal
  990. of required fields, and removal of default values. This makes proto3
  991. significantly easier to implement with open struct representations,
  992. as in languages like Android Java, Objective C, or Go.
  993. 2. Removal of unknown fields.
  994. 3. Removal of extensions, which are instead replaced by a new standard
  995. type called Any.
  996. 4. Fix semantics for unknown enum values.
  997. 5. Addition of maps.
  998. 6. Addition of a small set of standard types for representation of time,
  999. dynamic data, etc.
  1000. 7. A well-defined encoding in JSON as an alternative to binary proto
  1001. encoding.
  1002. This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and
  1003. Java. Items 6 (well-known types) and 7 (JSON format) in the above feature
  1004. list are not implemented.
  1005. A new notion "syntax" is introduced to specify whether a .proto file
  1006. uses proto2 or proto3:
  1007. // foo.proto
  1008. syntax = "proto3";
  1009. message Bar {...}
  1010. If omitted, the protocol compiler will generate a warning and "proto2" will
  1011. be used as the default. This warning will be turned into an error in a
  1012. future release.
  1013. We recommend that new Protocol Buffers users use proto3. However, we do not
  1014. generally recommend that existing users migrate from proto2 from proto3 due
  1015. to API incompatibility, and we will continue to support proto2 for a long
  1016. time.
  1017. * Added support for map fields (implemented in C++/Java for both proto2 and
  1018. proto3).
  1019. Map fields can be declared using the following syntax:
  1020. message Foo {
  1021. map<string, string> values = 1;
  1022. }
  1023. Data of a map field will be stored in memory as an unordered map and it
  1024. can be accessed through generated accessors.
  1025. C++
  1026. * Added arena allocation support (for both proto2 and proto3).
  1027. Profiling shows memory allocation and deallocation constitutes a significant
  1028. fraction of CPU-time spent in protobuf code and arena allocation is a
  1029. technique introduced to reduce this cost. With arena allocation, new
  1030. objects will be allocated from a large piece of preallocated memory and
  1031. deallocation of these objects is almost free. Early adoption shows 20% to
  1032. 50% improvement in some Google binaries.
  1033. To enable arena support, add the following option to your .proto file:
  1034. option cc_enable_arenas = true;
  1035. Protocol compiler will generate additional code to make the generated
  1036. message classes work with arenas. This does not change the existing API
  1037. of protobuf messages and does not affect wire format. Your existing code
  1038. should continue to work after adding this option. In the future we will
  1039. make this option enabled by default.
  1040. To actually take advantage of arena allocation, you need to use the arena
  1041. APIs when creating messages. A quick example of using the arena API:
  1042. {
  1043. google::protobuf::Arena arena;
  1044. // Allocate a protobuf message in the arena.
  1045. MyMessage* message = Arena::CreateMessage<MyMessage>(&arena);
  1046. // All submessages will be allocated in the same arena.
  1047. if (!message->ParseFromString(data)) {
  1048. // Deal with malformed input data.
  1049. }
  1050. // Must not delete the message here. It will be deleted automatically
  1051. // when the arena is destroyed.
  1052. }
  1053. Currently arena does not work with map fields. Enabling arena in a .proto
  1054. file containing map fields will result in compile errors in the generated
  1055. code. This will be addressed in a future release.
  1056. 2014-10-20 version 2.6.1:
  1057. C++
  1058. * Added atomicops support for Solaris.
  1059. * Released memory allocated by InitializeDefaultRepeatedFields() and
  1060. GetEmptyString(). Some memory sanitizers reported them as memory leaks.
  1061. Java
  1062. * Updated DynamicMessage.setField() to handle repeated enum values
  1063. correctly.
  1064. * Fixed a bug that caused NullPointerException to be thrown when
  1065. converting manually constructed FileDescriptorProto to
  1066. FileDescriptor.
  1067. Python
  1068. * Fixed WhichOneof() to work with de-serialized protobuf messages.
  1069. * Fixed a missing file problem of Python C++ implementation.
  1070. 2014-08-15 version 2.6.0:
  1071. General
  1072. * Added oneofs(unions) feature. Fields in the same oneof will share
  1073. memory and at most one field can be set at the same time. Use the
  1074. oneof keyword to define a oneof like:
  1075. message SampleMessage {
  1076. oneof test_oneof {
  1077. string name = 4;
  1078. YourMessage sub_message = 9;
  1079. }
  1080. }
  1081. * Files, services, enums, messages, methods and enum values can be marked
  1082. as deprecated now.
  1083. * Added Support for list values, including lists of messages, when
  1084. parsing text-formatted protos in C++ and Java.
  1085. For example: foo: [1, 2, 3]
  1086. C++
  1087. * Enhanced customization on TestFormat printing.
  1088. * Added SwapFields() in reflection API to swap a subset of fields.
  1089. Added SetAllocatedMessage() in reflection API.
  1090. * Repeated primitive extensions are now packable. The
  1091. [packed=true] option only affects serializers. Therefore, it is
  1092. possible to switch a repeated extension field to packed format
  1093. without breaking backwards-compatibility.
  1094. * Various speed optimizations.
  1095. Java
  1096. * writeTo() method in ByteString can now write a substring to an
  1097. output stream. Added endWith() method for ByteString.
  1098. * ByteString and ByteBuffer are now supported in CodedInputStream
  1099. and CodedOutputStream.
  1100. * java_generate_equals_and_hash can now be used with the LITE_RUNTIME.
  1101. Python
  1102. * A new C++-backed extension module (aka "cpp api v2") that replaces the
  1103. old ("cpp api v1") one. Much faster than the pure Python code. This one
  1104. resolves many bugs and is recommended for general use over the
  1105. pure Python when possible.
  1106. * Descriptors now have enum_types_by_name and extension_types_by_name dict
  1107. attributes.
  1108. * Support for Python 3.
  1109. 2013-02-27 version 2.5.0:
  1110. General
  1111. * New notion "import public" that allows a proto file to forward the content
  1112. it imports to its importers. For example,
  1113. // foo.proto
  1114. import public "bar.proto";
  1115. import "baz.proto";
  1116. // qux.proto
  1117. import "foo.proto";
  1118. // Stuff defined in bar.proto may be used in this file, but stuff from
  1119. // baz.proto may NOT be used without importing it explicitly.
  1120. This is useful for moving proto files. To move a proto file, just leave
  1121. a single "import public" in the old proto file.
  1122. * New enum option "allow_alias" that specifies whether different symbols can
  1123. be assigned the same numeric value. Default value is "true". Setting it to
  1124. false causes the compiler to reject enum definitions where multiple symbols
  1125. have the same numeric value.
  1126. Note: We plan to flip the default value to "false" in a future release.
  1127. Projects using enum aliases should set the option to "true" in their .proto
  1128. files.
  1129. C++
  1130. * New generated method set_allocated_foo(Type* foo) for message and string
  1131. fields. This method allows you to set the field to a pre-allocated object
  1132. and the containing message takes the ownership of that object.
  1133. * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
  1134. * Custom options are now formatted correctly when descriptors are printed in
  1135. text format.
  1136. * Various speed optimizations.
  1137. Java
  1138. * Comments in proto files are now collected and put into generated code as
  1139. comments for corresponding classes and data members.
  1140. * Added Parser to parse directly into messages without a Builder. For
  1141. example,
  1142. Foo foo = Foo.PARSER.ParseFrom(input);
  1143. Using Parser is ~25% faster than using Builder to parse messages.
  1144. * Added getters/setters to access the underlying ByteString of a string field
  1145. directly.
  1146. * ByteString now supports more operations: substring(), prepend(), and
  1147. append(). The implementation of ByteString uses a binary tree structure
  1148. to support these operations efficiently.
  1149. * New method findInitializationErrors() that lists all missing required
  1150. fields.
  1151. * Various code size and speed optimizations.
  1152. Python
  1153. * Added support for dynamic message creation. DescriptorDatabase,
  1154. DescriptorPool, and MessageFactory work like their C++ counterparts to
  1155. simplify Descriptor construction from *DescriptorProtos, and MessageFactory
  1156. provides a message instance from a Descriptor.
  1157. * Added pickle support for protobuf messages.
  1158. * Unknown fields are now preserved after parsing.
  1159. * Fixed bug where custom options were not correctly populated. Custom
  1160. options can be accessed now.
  1161. * Added EnumTypeWrapper that provides better accessibility to enum types.
  1162. * Added ParseMessage(descriptor, bytes) to generate a new Message instance
  1163. from a descriptor and a byte string.
  1164. 2011-05-01 version 2.4.1:
  1165. C++
  1166. * Fixed the friendship problem for old compilers to make the library now gcc 3
  1167. compatible again.
  1168. * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
  1169. Java
  1170. * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
  1171. compatible again.
  1172. * Fixed a bug about negative enum values.
  1173. * serialVersionUID is now defined in generated messages for java serializing.
  1174. * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
  1175. message name again.
  1176. Python
  1177. * Experimental C++ implementation now requires C++ protobuf library installed.
  1178. See the README.txt in the python directory for details.
  1179. 2011-02-02 version 2.4.0:
  1180. General
  1181. * The RPC (cc|java|py)_generic_services default value is now false instead of
  1182. true.
  1183. * Custom options can have aggregate types. For example,
  1184. message MyOption {
  1185. optional string comment = 1;
  1186. optional string author = 2;
  1187. }
  1188. extend google.protobuf.FieldOptions {
  1189. optional MyOption myoption = 12345;
  1190. }
  1191. This option can now be set as follows:
  1192. message SomeType {
  1193. optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
  1194. }
  1195. C++
  1196. * Various speed and code size optimizations.
  1197. * Added a release_foo() method on string and message fields.
  1198. * Fixed gzip_output_stream sub-stream handling.
  1199. Java
  1200. * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
  1201. get the builder for the sub-message "foo". This allows you to repeatedly
  1202. modify deeply-nested sub-messages without rebuilding them.
  1203. * Builder.build() no longer invalidates the Builder for generated messages
  1204. (You may continue to modify it and then build another message).
  1205. * Code generator will generate efficient equals() and hashCode()
  1206. implementations if new option java_generate_equals_and_hash is enabled.
  1207. (Otherwise, reflection-based implementations are used.)
  1208. * Generated messages now implement Serializable.
  1209. * Fields with [deprecated=true] will be marked with @Deprecated in Java.
  1210. * Added lazy conversion of UTF-8 encoded strings to String objects to improve
  1211. performance.
  1212. * Various optimizations.
  1213. * Enum value can be accessed directly, instead of calling getNumber() on the
  1214. enum member.
  1215. * For each enum value, an integer constant is also generated with the suffix
  1216. _VALUE.
  1217. Python
  1218. * Added an experimental C++ implementation for Python messages via a Python
  1219. extension. Implementation type is controlled by an environment variable
  1220. PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
  1221. The default value is currently "python" but will be changed to "cpp" in
  1222. future release.
  1223. * Improved performance on message instantiation significantly.
  1224. Most of the work on message instantiation is done just once per message
  1225. class, instead of once per message instance.
  1226. * Improved performance on text message parsing.
  1227. * Allow add() to forward keyword arguments to the concrete class.
  1228. E.g. instead of
  1229. item = repeated_field.add()
  1230. item.foo = bar
  1231. item.baz = quux
  1232. You can do:
  1233. repeated_field.add(foo=bar, baz=quux)
  1234. * Added a sort() interface to the BaseContainer.
  1235. * Added an extend() method to repeated composite fields.
  1236. * Added UTF8 debug string support.
  1237. 2010-01-08 version 2.3.0:
  1238. General
  1239. * Parsers for repeated numeric fields now always accept both packed and
  1240. unpacked input. The [packed=true] option only affects serializers.
  1241. Therefore, it is possible to switch a field to packed format without
  1242. breaking backwards-compatibility -- as long as all parties are using
  1243. protobuf 2.3.0 or above, at least.
  1244. * The generic RPC service code generated by the C++, Java, and Python
  1245. generators can be disabled via file options:
  1246. option cc_generic_services = false;
  1247. option java_generic_services = false;
  1248. option py_generic_services = false;
  1249. This allows plugins to generate alternative code, possibly specific to some
  1250. particular RPC implementation.
  1251. protoc
  1252. * Now supports a plugin system for code generators. Plugins can generate
  1253. code for new languages or inject additional code into the output of other
  1254. code generators. Plugins are just binaries which accept a protocol buffer
  1255. on stdin and write a protocol buffer to stdout, so they may be written in
  1256. any language. See src/google/protobuf/compiler/plugin.proto.
  1257. **WARNING**: Plugins are experimental. The interface may change in a
  1258. future version.
  1259. * If the output location ends in .zip or .jar, protoc will write its output
  1260. to a zip/jar archive instead of a directory. For example:
  1261. protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
  1262. Currently the archive contents are not compressed, though this could change
  1263. in the future.
  1264. * inf, -inf, and nan can now be used as default values for float and double
  1265. fields.
  1266. C++
  1267. * Various speed and code size optimizations.
  1268. * DynamicMessageFactory is now fully thread-safe.
  1269. * Message::Utf8DebugString() method is like DebugString() but avoids escaping
  1270. UTF-8 bytes.
  1271. * Compiled-in message types can now contain dynamic extensions, through use
  1272. of CodedInputStream::SetExtensionRegistry().
  1273. * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
  1274. match other platforms. Use --disable-shared to avoid this.
  1275. Java
  1276. * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
  1277. false/null instead of throwing an exception.
  1278. * Fixed some initialization ordering bugs.
  1279. * Fixes for OpenJDK 7.
  1280. Python
  1281. * 10-25 times faster than 2.2.0, still pure-Python.
  1282. * Calling a mutating method on a sub-message always instantiates the message
  1283. in its parent even if the mutating method doesn't actually mutate anything
  1284. (e.g. parsing from an empty string).
  1285. * Expanded descriptors a bit.
  1286. 2009-08-11 version 2.2.0:
  1287. C++
  1288. * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
  1289. to generate code which only depends libprotobuf-lite, which is much smaller
  1290. than libprotobuf but lacks descriptors, reflection, and some other features.
  1291. * Fixed bug where Message.Swap(Message) was only implemented for
  1292. optimize_for_speed. Swap now properly implemented in both modes
  1293. (Issue 91).
  1294. * Added RemoveLast and SwapElements(index1, index2) to Reflection
  1295. interface for repeated elements.
  1296. * Added Swap(Message) to Reflection interface.
  1297. * Floating-point literals in generated code that are intended to be
  1298. single-precision now explicitly have 'f' suffix to avoid pedantic warnings
  1299. produced by some compilers.
  1300. * The [deprecated=true] option now causes the C++ code generator to generate
  1301. a GCC-style deprecation annotation (no-op on other compilers).
  1302. * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
  1303. EnumDescriptor for that type -- useful for templates which cannot call
  1304. SomeGeneratedEnumType_descriptor().
  1305. * Various optimizations and obscure bug fixes.
  1306. Java
  1307. * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
  1308. to generate code which only depends libprotobuf-lite, which is much smaller
  1309. than libprotobuf but lacks descriptors, reflection, and some other features.
  1310. * Lots of style cleanups.
  1311. Python
  1312. * Fixed endianness bug with floats and doubles.
  1313. * Text format parsing support.
  1314. * Fix bug with parsing packed repeated fields in embedded messages.
  1315. * Ability to initialize fields by passing keyword args to constructor.
  1316. * Support iterators in extend and __setslice__ for containers.
  1317. 2009-05-13 version 2.1.0:
  1318. General
  1319. * Repeated fields of primitive types (types other that string, group, and
  1320. nested messages) may now use the option [packed = true] to get a more
  1321. efficient encoding. In the new encoding, the entire list is written
  1322. as a single byte blob using the "length-delimited" wire type. Within
  1323. this blob, the individual values are encoded the same way they would
  1324. be normally except without a tag before each value (thus, they are
  1325. tightly "packed").
  1326. * For each field, the generated code contains an integer constant assigned
  1327. to the field number. For example, the .proto file:
  1328. message Foo { optional int bar_baz = 123; }
  1329. would generate the following constants, all with the integer value 123:
  1330. C++: Foo::kBarBazFieldNumber
  1331. Java: Foo.BAR_BAZ_FIELD_NUMBER
  1332. Python: Foo.BAR_BAZ_FIELD_NUMBER
  1333. Constants are also generated for extensions, with the same naming scheme.
  1334. These constants may be used as switch cases.
  1335. * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
  1336. in its verbatim form as a nested autoconf package, so you can drop in any
  1337. other version of Google Test if needed.
  1338. * optimize_for = SPEED is now the default, by popular demand. Use
  1339. optimize_for = CODE_SIZE if code size is more important in your app.
  1340. * It is now an error to define a default value for a repeated field.
  1341. Previously, this was silently ignored (it had no effect on the generated
  1342. code).
  1343. * Fields can now be marked deprecated like:
  1344. optional int32 foo = 1 [deprecated = true];
  1345. Currently this does not have any actual effect, but in the future the code
  1346. generators may generate deprecation annotations in each language.
  1347. * Cross-compiling should now be possible using the --with-protoc option to
  1348. configure. See README.txt for more info.
  1349. protoc
  1350. * --error_format=msvs option causes errors to be printed in Visual Studio
  1351. format, which should allow them to be clicked on in the build log to go
  1352. directly to the error location.
  1353. * The type name resolver will no longer resolve type names to fields. For
  1354. example, this now works:
  1355. message Foo {}
  1356. message Bar {
  1357. optional int32 Foo = 1;
  1358. optional Foo baz = 2;
  1359. }
  1360. Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
  1361. an error because Bar.Foo is a field, not a type. Now the type of "baz"
  1362. resolves to the message type Foo. This change is unlikely to make a
  1363. difference to anyone who follows the Protocol Buffers style guide.
  1364. C++
  1365. * Several optimizations, including but not limited to:
  1366. - Serialization, especially to flat arrays, is 10%-50% faster, possibly
  1367. more for small objects.
  1368. - Several descriptor operations which previously required locking no longer
  1369. do.
  1370. - Descriptors are now constructed lazily on first use, rather than at
  1371. process startup time. This should save memory in programs which do not
  1372. use descriptors or reflection.
  1373. - UnknownFieldSet completely redesigned to be more efficient (especially in
  1374. terms of memory usage).
  1375. - Various optimizations to reduce code size (though the serialization speed
  1376. optimizations increased code size).
  1377. * Message interface has method ParseFromBoundedZeroCopyStream() which parses
  1378. a limited number of bytes from an input stream rather than parsing until
  1379. EOF.
  1380. * GzipInputStream and GzipOutputStream support reading/writing gzip- or
  1381. zlib-compressed streams if zlib is available.
  1382. (google/protobuf/io/gzip_stream.h)
  1383. * DescriptorPool::FindAllExtensions() and corresponding
  1384. DescriptorDatabase::FindAllExtensions() can be used to enumerate all
  1385. extensions of a given type.
  1386. * For each enum type Foo, protoc will generate functions:
  1387. const string& Foo_Name(Foo value);
  1388. bool Foo_Parse(const string& name, Foo* result);
  1389. The former returns the name of the enum constant corresponding to the given
  1390. value while the latter finds the value corresponding to a name.
  1391. * RepeatedField and RepeatedPtrField now have back-insertion iterators.
  1392. * String fields now have setters that take a char* and a size, in addition
  1393. to the existing ones that took char* or const string&.
  1394. * DescriptorPool::AllowUnknownDependencies() may be used to tell
  1395. DescriptorPool to create placeholder descriptors for unknown entities
  1396. referenced in a FileDescriptorProto. This can allow you to parse a .proto
  1397. file without having access to other .proto files that it imports, for
  1398. example.
  1399. * Updated gtest to latest version. The gtest package is now included as a
  1400. nested autoconf package, so it should be able to drop new versions into the
  1401. "gtest" subdirectory without modification.
  1402. Java
  1403. * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
  1404. * Message interface has new method toBuilder() which is equivalent to
  1405. newBuilderForType().mergeFrom(this).
  1406. * All enums now implement the ProtocolMessageEnum interface.
  1407. * Setting a field to null now throws NullPointerException.
  1408. * Fixed tendency for TextFormat's parsing to overflow the stack when
  1409. parsing large string values. The underlying problem is with Java's
  1410. regex implementation (which unfortunately uses recursive backtracking
  1411. rather than building an NFA). Worked around by making use of possessive
  1412. quantifiers.
  1413. * Generated service classes now also generate pure interfaces. For a service
  1414. Foo, Foo.Interface is a pure interface containing all of the service's
  1415. defined methods. Foo.newReflectiveService() can be called to wrap an
  1416. instance of this interface in a class that implements the generic
  1417. RpcService interface, which provides reflection support that is usually
  1418. needed by RPC server implementations.
  1419. * RPC interfaces now support blocking operation in addition to non-blocking.
  1420. The protocol compiler generates separate blocking and non-blocking stubs
  1421. which operate against separate blocking and non-blocking RPC interfaces.
  1422. RPC implementations will have to implement the new interfaces in order to
  1423. support blocking mode.
  1424. * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
  1425. writeDelimitedTo() read and write "delimited" messages from/to a stream,
  1426. meaning that the message size precedes the data. This way, you can write
  1427. multiple messages to a stream without having to worry about delimiting
  1428. them yourself.
  1429. * Throw a more descriptive exception when build() is double-called.
  1430. * Add a method to query whether CodedInputStream is at the end of the input
  1431. stream.
  1432. * Add a method to reset a CodedInputStream's size counter; useful when
  1433. reading many messages with the same stream.
  1434. * equals() and hashCode() now account for unknown fields.
  1435. Python
  1436. * Added slicing support for repeated scalar fields. Added slice retrieval and
  1437. removal of repeated composite fields.
  1438. * Updated RPC interfaces to allow for blocking operation. A client may
  1439. now pass None for a callback when making an RPC, in which case the
  1440. call will block until the response is received, and the response
  1441. object will be returned directly to the caller. This interface change
  1442. cannot be used in practice until RPC implementations are updated to
  1443. implement it.
  1444. * Changes to input_stream.py should make protobuf compatible with appengine.
  1445. 2008-11-25 version 2.0.3:
  1446. protoc
  1447. * Enum values may now have custom options, using syntax similar to field
  1448. options.
  1449. * Fixed bug where .proto files which use custom options but don't actually
  1450. define them (i.e. they import another .proto file defining the options)
  1451. had to explicitly import descriptor.proto.
  1452. * Adjacent string literals in .proto files will now be concatenated, like in
  1453. C.
  1454. * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
  1455. the import path only contains "." (or contains "." but does not contain
  1456. the file), protoc incorrectly thought that the file was under ".", because
  1457. it thought that the path was relative (since it didn't start with a slash).
  1458. This has been fixed.
  1459. C++
  1460. * Generated message classes now have a Swap() method which efficiently swaps
  1461. the contents of two objects.
  1462. * All message classes now have a SpaceUsed() method which returns an estimate
  1463. of the number of bytes of allocated memory currently owned by the object.
  1464. This is particularly useful when you are reusing a single message object
  1465. to improve performance but want to make sure it doesn't bloat up too large.
  1466. * New method Message::SerializeAsString() returns a string containing the
  1467. serialized data. May be more convenient than calling
  1468. SerializeToString(string*).
  1469. * In debug mode, log error messages when string-type fields are found to
  1470. contain bytes that are not valid UTF-8.
  1471. * Fixed bug where a message with multiple extension ranges couldn't parse
  1472. extensions.
  1473. * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
  1474. a message that contained no fields (but possibly contained extensions).
  1475. * Fixed ShortDebugString() to not be O(n^2). Durr.
  1476. * Fixed crash in TextFormat parsing if the first token in the input caused a
  1477. tokenization error.
  1478. * Fixed obscure bugs in zero_copy_stream_impl.cc.
  1479. * Added support for HP C++ on Tru64.
  1480. * Only build tests on "make check", not "make".
  1481. * Fixed alignment issue that caused crashes when using DynamicMessage on
  1482. 64-bit Sparc machines.
  1483. * Simplify template usage to work with MSVC 2003.
  1484. * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
  1485. (This affected Fedora 9 in particular.)
  1486. * Now works on "Solaris 10 using recent Sun Studio".
  1487. Java
  1488. * New overload of mergeFrom() which parses a slice of a byte array instead
  1489. of the whole thing.
  1490. * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
  1491. * Improved performance of isInitialized() when optimizing for code size.
  1492. Python
  1493. * Corrected ListFields() signature in Message base class to match what
  1494. subclasses actually implement.
  1495. * Some minor refactoring.
  1496. * Don't pass self as first argument to superclass constructor (no longer
  1497. allowed in Python 2.6).
  1498. 2008-09-29 version 2.0.2:
  1499. General
  1500. * License changed from Apache 2.0 to 3-Clause BSD.
  1501. * It is now possible to define custom "options", which are basically
  1502. annotations which may be placed on definitions in a .proto file.
  1503. For example, you might define a field option called "foo" like so:
  1504. import "google/protobuf/descriptor.proto"
  1505. extend google.protobuf.FieldOptions {
  1506. optional string foo = 12345;
  1507. }
  1508. Then you annotate a field using the "foo" option:
  1509. message MyMessage {
  1510. optional int32 some_field = 1 [(foo) = "bar"]
  1511. }
  1512. The value of this option is then visible via the message's
  1513. Descriptor:
  1514. const FieldDescriptor* field =
  1515. MyMessage::descriptor()->FindFieldByName("some_field");
  1516. assert(field->options().GetExtension(foo) == "bar");
  1517. This feature has been implemented and tested in C++ and Java.
  1518. Other languages may or may not need to do extra work to support
  1519. custom options, depending on how they construct descriptors.
  1520. C++
  1521. * Fixed some GCC warnings that only occur when using -pedantic.
  1522. * Improved static initialization code, making ordering more
  1523. predictable among other things.
  1524. * TextFormat will no longer accept messages which contain multiple
  1525. instances of a singular field. Previously, the latter instance
  1526. would overwrite the former.
  1527. * Now works on systems that don't have hash_map.
  1528. Java
  1529. * Print @Override annotation in generated code where appropriate.
  1530. Python
  1531. * Strings now use the "unicode" type rather than the "str" type.
  1532. String fields may still be assigned ASCII "str" values; they will
  1533. automatically be converted.
  1534. * Adding a property to an object representing a repeated field now
  1535. raises an exception. For example:
  1536. # No longer works (and never should have).
  1537. message.some_repeated_field.foo = 1
  1538. Windows
  1539. * We now build static libraries rather than DLLs by default on MSVC.
  1540. See vsprojects/readme.txt for more information.
  1541. 2008-08-15 version 2.0.1:
  1542. protoc
  1543. * New flags --encode and --decode can be used to convert between protobuf text
  1544. format and binary format from the command-line.
  1545. * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
  1546. all parsed files directly into a single output file. This is particularly
  1547. useful if you wish to parse .proto files from programs written in languages
  1548. other than C++: just run protoc as a background process and have it output
  1549. a FileDescriptorList, then parse that natively.
  1550. * Improved error message when an enum value's name conflicts with another
  1551. symbol defined in the enum type's scope, e.g. if two enum types declared
  1552. in the same scope have values with the same name. This is disallowed for
  1553. compatibility with C++, but this wasn't clear from the error.
  1554. * Fixed absolute output paths on Windows.
  1555. * Allow trailing slashes in --proto_path mappings.
  1556. C++
  1557. * Reflection objects are now per-class rather than per-instance. To make this
  1558. possible, the Reflection interface had to be changed such that all methods
  1559. take the Message instance as a parameter. This change improves performance
  1560. significantly in memory-bandwidth-limited use cases, since it makes the
  1561. message objects smaller. Note that source-incompatible interface changes
  1562. like this will not be made again after the library leaves beta.
  1563. * Heuristically detect sub-messages when printing unknown fields.
  1564. * Fix static initialization ordering bug that caused crashes at startup when
  1565. compiling on Mac with static linking.
  1566. * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
  1567. * Fixed incorrect definition of kint32min.
  1568. * Fix bytes type setter to work with byte sequences with embedded NULLs.
  1569. * Other irrelevant tweaks.
  1570. Java
  1571. * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
  1572. * Fixed TextFormat's parsing of "inf" and "nan".
  1573. * Fixed TextFormat's parsing of comments.
  1574. * Added info to Java POM that will be required when we upload the
  1575. package to a Maven repo.
  1576. Python
  1577. * MergeFrom(message) and CopyFrom(message) are now implemented.
  1578. * SerializeToString() raises an exception if the message is missing required
  1579. fields.
  1580. * Code organization improvements.
  1581. * Fixed doc comments for RpcController and RpcChannel, which had somehow been
  1582. swapped.
  1583. * Fixed text_format_test on Windows where floating-point exponents sometimes
  1584. contain extra zeros.
  1585. * Fix Python service CallMethod() implementation.
  1586. Other
  1587. * Improved readmes.
  1588. * VIM syntax highlighting improvements.
  1589. 2008-07-07 version 2.0.0:
  1590. * First public release.