- Bump protobuf and protoc to 4.26.0. Currently files must specify proto2 and proto3 syntax. Editions are not supported yet.
- References to descriptors are fully qualified (#1724)
- Oneofs are now generated as sealed abstract class instead of sealed traits (#1694)
- References to descriptors are fully qualified (#1724)
- Add
using
as a reserved keyword (#1666) - Deprecate undocumented getFieldByNumber in favor of the PValue-based API (#1669)
- sealed_oneof_companion_extends is handled also for optional sealed oneofs (#1639)
- added sealed_oneof_empty_extends to add trait to the empty case object of sealed oneofs (#1640)
- When more than one enum values share the same number, the first one would generate a case object as usual, and subsequent ones will value values referencing the case object. This is consistent with the Java behavior (#1611)
Option
now rendered as_root_.scala.Option
to resolve name conflicts (#1623)- scalapb-runtime-grpc: optimize Marshaller for InProcessTransport (#1615)
- Repeated extensions can now use arbitrary iterable types or any collection type there is a CollectionAdapter for (#1509)
- Introduced new generator parameter
scala3_sources
(also available via scalapb.proto) to generate sources that are compatible with Scala 3 (#1576) aux_*_options
now accept*
in the target field to match all entities in scope.- Add
derives
andsealed_oneof_derives
to the message options that adds a derived clause to generated messages and sealed oneofs. - Bump Scala.js to 1.14.0
- Added input and output message type for method descriptor (#1503)
- Improved performance for field lookup which is used by JSON deserialization. (#1468)
- use SAM conversion (#1444)
- ScalaPB is now tested with upsteam protobuf conformance tests and multiple
conformance issues have been fixed. See
conformance/*.txt
for a list of some remaining failing tests, some due to unimplemented feature such asgroup
fields. By large, ScalaPB is highly compliant with the official protobuf implementation, however there are some minor differences that are not expected to occur in practice for users.
- Lens now extends Serializable.
- Bump up to protobuf-java 3.19.6
- Add StubFactory for grpc clients (#1351)
- Support transformation on repeated option scalar (#1355)
- Exclude preamble from service files. (#1367)
- Add support for universal traits for sealed oneofs (#1352)
- Add support for mixing additional traits into sealed oneof companion (#1370)
- Fix missing import definitions in services. (#1331)
- Add namespace for go to scalapb.proto (#1336)
- Downgrade to Scala 3.0.2 for compatibility reasons (#1326)
- Bump up protobuf-java to 3.19.2 for CVE-2021-22569.
- Fix native protoc plugin handling of custom options that extend ScalaPB.
- Update default protoc used to 3.19.1
- Bump sbt-protoc to 1.0.5, protoc-bridge to 0.9.4
- Update grpc to 1.41.0
- Add new Scala 3 reserved keywords (#1230)
- Bump Scala versions to 3.0.2 and 2.12.15
- Fix: non-total typemappers now work in
no_box
fields (#1198) - Memoize serializedSize of empty messages (previously serialized size was recomputed for empty message)
- Expose
scalaName
for enum values through Scala descriptors (#1201)
- Add options for enum annotations (#1155)
- Add "export" as reserved word (#1159)
- Remove Serializable from types inferred across companions (#1162)
- Added new options to support enum annotations
- Fix java conversion not working for sealed oneofs (#1158)
- Fix bug where generated code would not compile if a message was named Unit (#1126)
- Add option to block generation/access to field getters (#1098)
- Support Scala 3.0.0-RC2
- ScalaPB artifacts include https://www.scala-lang.org/blog/2021/02/16/preventing-version-conflicts-with-versionscheme.html
- Add ScalaJs cross build for Scala 3.0.0-RC1
- Update to Scala 3.0.0-RC1
- Update to Scala 2.13.5
- Remove Builder class (#1033)
- GeneratedMessage now extends Product for better type inference (#984)
- Update to Scala 3.0.0-M3
- Update to Scala 2.13.4
- Upgraded to Protobuf 3.13.0
- Add java_conversions as a file-level options in scalapb.proto
- google.protobuf.Timestamp and google.protobuf.Duration now come with a new constructor that takes a java.time.Instant or Duration. There are are implicit converters between the case classes and the java types that can be imported from scalapb.DurationConverters and scalapb.TimestampConverters (#939).
- Add support for renaming
oneof
fields (#946) - Allow sealed oneofs to be defined inside a parent message (#977)
- Support Scala 3.0.0-M1
- Supports protobuf 3.12.2
- Supports the new experimental optional fields introduced in proto3 at
protobuf 3.12.0 (see https://github.com/protocolbuffers/protobuf/blob/v3.12.0/docs/field_presence.md). To enable, add the following to your
build.sbt
: Compile / PB.protocOptions += "--experimental_allow_proto3_optional" - Supports Dotty (0.27.0-RC1). Generated code compiles in Dotty (with
-source 3.0-migration
) - Added auxiliary enum value options.
- Removed dependency on fastparse2 which was used for ASCII format parsing. ScalaPB now implements its own custom parser.
- Adds support for preprocessor plugins that can mutate ScalaPB options (see #1007)
- Adds new field transformation DSL that allows changing FieldOptions when user-defined rules match (see #1007).
- Add more collection-level options in scalapb.proto to support non-standard collections such as cats.data.NonEmptyList, NonEmptyMap and NonEmptySet (see scalapb/scalapb-validate#38)
- ScalaPBC backport from master to support NixOS.
- Add option for annotating the unknown field (#898)
- Add extension ranges for scalapb.proto messages so plugins can further extend ScalaPB.
- scalapb.proto is no longer shaded into compilerplugin.
- Fix a regression where calling scalapb.gen() without parameters would not generate grpc stubs. Workaround: pass grpc=true explicitly. #879
- Add asMap to UnkownFieldSet to make it possible to extract the map (#878)
- ScalaPBC now accepts --jvm-plugin flag that loads an artifact from maven that is expected to have a main class which extends ProtocCodeGenerator.
- Add support for insertion points so other plugins can inject code into ScalaPB generated code. Currently, the only insertion point available is at the companion object of messages.
- Updated protoc-bridge to 0.9.0-RC2.
- Updated protoc-bridge to 0.9.0-RC1.
- Minimum version of sbt-protoc required is 0.99.33
- ScalaPB compiler plugin is now compatible with SBT 1.4.0-M1
- Plugin runs in a sandboxed classloader.
- Updated protoc-bridge to 0.8.3
- Changed scalapb.Message to extend Any, instead of a type alias to Any (see #777)
- Added StructUtils to convert between messages to Struct, see #812 (Thanks, @ittaiz)
- BREAKING CHANGE: remove unknownFields parameter from
of
(see #778)
- Add ScalaPBC support for fetching artifacts from maven.
-
For SBT uses, sbt-protoc >= 0.99.28 is required.
-
BREAKING CHANGE: all messages are now preserving unknown fields by default. This results in an additional parameter to the case class. This may break your code if you are using pattern matching and expecting a specific number of parameters. This feature can be disabled by settings
preserve_unknown_fields
tofalse
at the file or package level.Why is this feature important? If your service receives messages that were serialized by a future version of the proto, the unknown fields your service does not know about will be deserialized into the unknown fields. Once the message is serialized again, the unknown fields will be serialized too, so this data will not be lost. When this feature is disabled, unknown fields are dropped.
-
Deprecated
Message[T]
. Up to 0.10.x, generated messages would extendGeneratedMessage with Message[T]
. The additionalwith Message[T]
added noise to the code and did not provide much value. In 0.10.x,Message[T]
is a type-alias toAny
for source compatibility. -
BREAKING CHANGE: in earlier version, constructor parameters for oneofs were always generated after all the regular fields. From this version of ScalaPB, oneofs are generated in the position that matches their index in the proto file.
-
BREAKING CHANGE: Enums case objects now extend a sealed abstract base class instead of a sealed trait for improved performance. This breaks binary compatibility for the generated code. Source should remained compatible.
-
Strings are now parsed using CodedInputStream.readStringRequireUtf8 instead of CodedInputStream.readString (following protobuf-java)
-
Update to protobuf 3.11.4
-
Drop Scala 2.11 and sbt 0.13.x support. Scala 2.11 is EOL and no longer able to compile protocol buffers generated by protoc 3.11.x in mixed Scala mode.
-
Added
aux_message_options
,aux_field_options
andaux_enum_options
file-level options to enable providing ScalaPB options to protos that can't be edited to include ScalaPB-specific settings (#737). -
Added
bytes_type
file-level options to modify the Scala type generated for protobuf'sbytes
type (#746). -
Updated to Scala.js 1.0.0
-
ScalaPB runtime now depends on scala-collection-compat and is warning-free for both 2.12 and 2.13.
-
SparkSQL-scalapb: removed support for directly reading and writing Parquet file (outside Spark). It is still possible to load and save protobuf to parquet through converting them to dataframes in Spark. Reason of removal is what I perceive as low adoption due to getting no feedback. If you were relying on the ability to directly load and save protobufs to/from parquet, please let us know by filing a ticket.
- Fix compatibility with sbt 1.4.x (#777)
- Support custom types in generated RPCs (#697)
- Support enum_strip_prefix (#730)
- Improve name conflicts collision between oneofs, fields and packages (#782)
- Fix a couple of cases of oneof naming conflicts. (#695)
- Add option for generating enum values in CamelCase (#675)
- Add option to specify names for enum values (#675)
- Rename standalone code generators from
protoc-gen-scalapb
toprotoc-gen-scala
- Native protoc-gen-scala binary for Linux is now statically linked.
- It is now possible to specify no_box at the message-level.
- We now release to github native binary version of ScalaPB codegen.
- Updated to Scala 2.12.10
- Added
NonEmpty
marker trait to non-empty cases of sealed oneofs. A new methodasNonEmpty
returns anOption[NonEmpty]
. See #633 - Added
no_default_values_in_constructor
to inhibit generation of default values in case class constructors. - Update to protobuf 3.8.0
- Experimental support for Scala 2.13.0. Notes:
- ScalaPB now generates
scala.Seq
by default for repeated fields (previously wasscala.collection.Seq
). This ensures usage of immutable Seqs on Scala 2.13 without breaking compatibility for old code. - The generated code compiles for Scala 2.13 and older version, so deprecation warnings are expected when compiling for 2.13. In a future release, we may have a generator that generates code that compiles cleanly, but only for 2.13.
- ScalaPB now generates
- ScalaPB code generator is published to maven as a plugin. This enabled Gradle and Maven protobuf plugins to download and invoke ScalaPB.
- Dropped support for Scala 2.10.
- Custom collections are now required to provide an
iterator
method that returns anIterator[A]
over their elements. - Temporarily dropped support for Scala Native (pending on fastparse2 support)
- Bumped fastparse to 2.1.0 (which is binary-incompatible with fastparse 1)
- Add support for custom map types (#410)
- Upgrade to protobuf 3.7.1
- Removed deprecated com.trueaccord symbols
- Added
scalapb.GeneratedSealedOneof
as a base trait for all sealed oneofs. - Added
sealed_oneof_extends
option to allow adding base classes for sealed oneofs. - Add support for services & methods comments (scaladoc & runtime inspection)
- Add
scalaName
to FieldDescriptor to make the name of the Scala field accessible from the descriptor. This is done by updatingscalapb.FieldOptions
in the descriptor we serialize in the proto file companion object. - Add
of
method to companion object to enable construction of case classes without having default values.
- Add
retain_source_code_info
setting for accessing source code information through thelocation
accessor on descriptors. - Add option to not generate lenses.
- Experimental support for providing package-level options through a proto file
v0.8.0 (2018-09-23)
- Build with protobuf 3.6.0
- ScalaPBC uses 3.6.0 by default
- Optimize cases where custom mappers are called twice during serialization
- Added file-level option to set the proto object name (#412)
- Implementation of sealed oneofs
- Added FieldMaskUtil (Thanks @xuwei-k)
v0.7.4 (2018-05-01)
Note:
- Maven artifacts are now published under a new group id: com.thesamet.scalapb
- Classes were renamed from com.trueaccord.scalapb.X to scalapb.X
Changes:
- Update to protobuf-java 3.5.0
- Added file-level option to preserve unknown fields in generated classes.
- ScalaPBC can run custom ProtocGenerator if they are available on the class path.
- Added type member ValueType to GeneratedOneof that makes it easy to write type classes that deal with Oneofs.
- Add support for Scala annotations on field-level, and companion object level.
- It is now possible to specify additional traits for oneofs.
- #235: toString is now not overridden by ScalaPB and does not generate the default TextFormat. To get the text format, use toProtoString. See issue #235 for how to achieve a backwards-compatible behavior.
- Added support for Scala Native.
singleLineToString
has been renamed tosingleLineToProtoString
. If you are using ScalaPBC, the new flag name issingle_line_to_proto_string
.- Unrecognized enum and one-of case classes are marked
final
. withX
methods convertnull
toNone
for options.
v0.6.7 (2017-11-23)
- GeneratedMessageCompanion: add
nestedMessagesCompanions
and Add - Added base class GeneratedFileObject that will be the base class for the singleton object generated for each proto file.
- Custom base classes for enums
- Add support for custom Scala annotations on messages.
v0.6.0 (2017-01-07)
- Support for custom names for fields: https://scalapb.github.io/customizations.html#custom-names This enables users to get around name conflicts in the generated code.
- Add messageCompanionForFieldNumber and enumCompanionForFieldNumber to retrive companion objects of message and enum fields by the field number.
- Support for Scala protocol buffers.
- Primitive wrappers are now the default.
scalapb.proto
: Add no_primitive_wrappers, deprecateprimitive_wrappers
.- Add support for custom collection types (representation of
repeated
in Scala can be almost any Scala collection. - Add support for custom types for keys and values of map<>.
- Added support for extensions (Scala.js compatible!).
BREAKING CHANGE:
- Custom options now work on both JVM and Scala.js. To migrate, remove
imports of
com.trueaccord.scalapb.Implicits
and use the newscalaDescriptor
wheneverdescriptor
orjavaDescriptor
have been used.
v0.5.47 (2017-01-07)
- GeneratedMessageCompanion.descriptor is deprecated in favor of
javaDescriptor
- Added GeneratedMessage.toByteString
v0.5.43 (2016-09-27)
-
We are switching from sbt-scalapb to sbt-protoc. Migration instructions are at http://scalapb.github.io/migrating.html
-
Breaking change: The outer class of a GRPC service used to extend
ServiceCompanion
. The traitServiceCompanion
has been changed to a type-classServiceCompanion[A]
whereA
is some service, and is now used as a companion object for the service itselfA. This allows you to implicitly obtain the companion object given a service
T`:implicity[ServiceCompanion[T]].descriptor
Fixes #154.
-
Add GeneratedEnum.fromName that gives an Option[EnumValue] given a name string (#160)
-
Required fields must be provided explicitly to constructor.
-
Grpc java updated to 1.0.0
v0.5.35 (2016-07-31)
- Update to protobuf 3.0.0
- Upgrade grpc-java to 1.0.0-pre1
- Scaladoc is automatically generated for case classes based on comments in the proto.
v0.5.34 (2016-07-15)
- Include Scala versions of well-known types, including basic support for Any.
- Bugfix: package names with reserved words (
type
,val
) no longer use backticks in the directory name. - Fix support for additional reserved keywords.
- Bufgix: support for well-known types in conjunction with flat_package.
Closed issues:
v0.5.29 (2016-06-06)
Closed issues:
- Remove usages of deprecated methods from CodedOutputStream #123
- [0.5.27 regression] serializedSize does not work with java serialization #121
Merged pull requests:
- fixes #121: java serialization breaks serializedSize #122 (eiennohito)
v0.5.28 (2016-05-31)
v0.5.27 (2016-05-30)
Closed issues:
- ScalaPB + Intellij #120
- sbt gives error: scalapb.sbt:1: error: object trueaccord is not a member of package com addSbtPlugin("com.trueaccord.scalapb" % "sbt-scalapb" % com.trueaccord.scalapb.Version.sbtPluginVersion) This happens after downloadin zipfile from github and running sbt in the e2e folder (Fedora) #117
- grpc should not depend on grpc-all #113
- protoc-jar version #111
- Make grpc service name visible in generated code #108
Merged pull requests:
- replace lazy vals in size generation with explicit lazy initialization #119 (eiennohito)
- update documentation for removing grpc-all #115 (eiennohito)
- depend not on grpc-all, but on more fine-grained dependencies #114 (eiennohito)
- grpc 0.14.0 #109 (xuwei-k)
v0.5.26 (2016-04-28)
Closed issues:
- Option for companion objects to extend specified classes/traits #105
- Won't decode not packed
repeated
if declared aspacked
in.proto
and vice-versa #102 - default value unexpected behaviour #100
- Option to change repeated fields collection type from Seq to IndexedSeq #97
Merged pull requests:
- Add companion_extends #107 (ngthanhtrung)
- fix #102 #106 (xuwei-k)
- Use fully-qualified Option class name in code generator #101 (zackangelo)
v0.5.25 (2016-04-12)
Closed issues:
- CameCase issue #94
- multi-lined toString #82
- Support for sealed traits #67
- Support for options is missing. #65
- Add support to convert messages to Json #62
v0.5.24 (2016-04-01)
Closed issues:
- scala.js link fail on sbt-scalapb
0.5.23
#98 - Incompatibility between enums and Spark SQL #87
- excludeFilter doesn't work #24
v0.5.23 (2016-03-28)
Merged pull requests:
- add scalacOptions for Scala.js source map #95 (xuwei-k)
- change method descriptor from private to public #93 (matsu-chara)
v0.5.22 (2016-03-16)
Closed issues:
- scalapbc command line tool does not generate gRPC scala code. #91
- Issue:value enablePlugins is not a member of sbt.Project possible cause #89
- Protobuf 2.x support #88
- Compilation fails due to attempt to write two files with the same name #86
- Need some details for implementing grpc #85
- Compilation not working. #84
- Getting 'protoc not found' error #83
- support grpc-java 0.13 #81
- Release 0.5.20 artifact #78
Merged pull requests:
v0.5.21 (2016-01-19)
Closed issues:
- Option PB.sourceDirectories is not available in 0.4.21 #76
Merged pull requests:
- fix #76 #79 (xuwei-k)
- Add implicit value for the companion object of enums #77 (sebastienrainville)
v0.5.20 (2016-01-11)
Closed issues:
- Unsupported major.minor version 52.0 #75
- broken sbt build due to sbt-protobuf dependency #74
- Unnecessary long filename for InternalFields_xxx files #73
v0.4.21 (2016-01-08)
Closed issues:
- gRPC: Should not call onComplete after onError #71
Merged pull requests:
- Fix double stream close, don't call onComplete after onError #72 (zackangelo)
- Add a Gitter chat badge to README.md #69 (gitter-badger)
- update protobuf-java 3.0.0-beta-2 #68 (xuwei-k)
v0.5.19 (2016-01-02)
Closed issues:
- GeneratedMessageCompanion#parseFrom always successful even for incompatible types #66
- Is there any plan to support GRPC? #44
- ScalaJs compatibility #31
Merged pull requests:
v0.5.18 (2015-12-07)
v0.5.17 (2015-12-05)
Merged pull requests:
v0.5.16 (2015-12-01)
Closed issues:
- e2e test fail #55
Merged pull requests:
- GeneratedEnum and GeneratedOneof extends Product #59 (xuwei-k)
- fix Encoding bug #57 (xuwei-k)
- optimize com.trueaccord.scalapb.Encoding #56 (xuwei-k)
v0.5.15 (2015-11-16)
Closed issues:
- Add an option to wrap primitives to Option[] #54
- Case class and object conflict #47
- Maps in proto2 files #43
- use printToUnicodeString instead of printToString in generated toString #41
- Add an option not to wrap some values in Options when generating Scala values #40
- Compile for Scala 2.12 M1 #38
Merged pull requests:
- target java7 #53 (xuwei-k)
- Target JDK 1.7 #52 (plaflamme)
- support java_multiple_files #51 (xuwei-k)
- "macro" is a reserved word since Scala 2.11 #50 (xuwei-k)
- call asSymbol in fullJavaName #49 (xuwei-k)
- remove unused local variables #48 (xuwei-k)
- fix typo #46 (xuwei-k)
- update dependencies #45 (xuwei-k)
- make generated toString use printToUnicodeString #42 (eiennohito)
v0.4.20 (2015-09-05)
v0.5.14 (2015-09-05)
Closed issues:
- Output directory conflicts with IntelliJ #37
- 0.5.9 has sbt generated classes in the packaged scalapb-runtime jar #35
- Make it possible to run ScalaPB outside SBT #17
- Support for enums with unknown values #11
v0.4.19 (2015-08-23)
v0.4.18 (2015-08-23)
v0.4.17 (2015-08-23)
v0.5.13 (2015-08-22)
v0.5.12 (2015-08-22)
v0.5.11 (2015-08-22)
Closed issues:
- Why are option fields with default value converted to Option[..] ? #36
- ScalaPB uses javax, which is not available on Android #34
- ScalaPB jar includes google proto files #33
- In proto3, add support for file name equals message name #26
v0.4.16 (2015-08-18)
v0.5.10 (2015-08-18)
Closed issues:
- import does not work correctly #32
- Protosb descriptor isn't 2.x compatible #28
- javaConversions Doesnt work #19
v0.5.9 (2015-06-18)
v0.5.8 (2015-06-07)
v0.5.7 (2015-06-07)
v0.5.6 (2015-06-06)
v0.5.5 (2015-06-04)
Closed issues:
- Support for hinted deserialization? #29
v0.4.15 (2015-05-31)
v0.5.1 (2015-05-31)
Closed issues:
v0.4.14 (2015-05-16)
v0.4.13 (2015-05-16)
Merged pull requests:
- build: upgrade scala versions #23 (ahjohannessen)
v0.5.0 (2015-05-08)
v0.4.12 (2015-05-07)
Closed issues:
- ScalaPB generates invalid class names if the original proto filename contains dot #22
v0.4.11 (2015-05-07)
Closed issues:
- doesn't respect the protoc setting of sbt-protobuf #21
v0.4.10 (2015-05-06)
Closed issues:
v0.4.9 (2015-04-05)
v0.4.8 (2015-03-28)
Closed issues:
- containingOneOfName field does not give the name #15
- Support for generation of marker types #14
- Allow oneofs with reserved named like 'type' #10
- Add support for packed enums #9
Merged pull requests:
- Fix generator to correctly provide the oneof name #16 (henrymai)
- Fix code generator for double and float fields with [default=nan] #12 (chrischamberlin)
v0.4.7 (2015-02-09)
v0.4.6 (2015-02-09)
v0.4.5 (2015-02-09)
v0.4.4 (2015-01-24)
v0.4.3 (2015-01-24)
v0.4.2 (2015-01-21)
Closed issues:
- Should use declared package name #8
- Fields cannot be named
get
ortag
#7 - protoc-gen-scala: program not found or is not executable #5
- Value classes for primitive single-element message? #4
v0.4.1 (2015-01-01)
Closed issues:
v0.4.0 (2014-11-26)
v0.3.4 (2014-11-25)
v0.3.3 (2014-11-24)
v0.3.2 (2014-11-23)
Merged pull requests:
* This Change Log was automatically generated by github_changelog_generator