This report documents all public methods that were removed or changed in a source/binary incompatible way between ScalaPB v0.9.8 and v0.10.11.
| Method/Change | Location | Change Type | Source Compat | Binary Compat | Deprecated Since | Can Pre-Migrate in 0.9.8? | Replacement/Migration |
|---|---|---|---|---|---|---|---|
valueDescriptor |
GeneratedEnum |
Removed | ❌ No | ❌ No | 0.5.47 | ✅ Yes | Use javaValueDescriptor |
descriptor |
GeneratedEnumCompanion |
Removed | ❌ No | ❌ No | 0.5.47 | ✅ Yes | Use javaDescriptor |
getField(JavaDescriptor) |
GeneratedMessage |
Removed | ❌ No | ❌ No | 0.6.0 | ✅ Yes | Use getField with ScalaPB descriptor |
getAllFields |
GeneratedMessage |
Removed | ❌ No | ❌ No | 0.6.0 | ✅ Yes | Use toPMessage |
fromFieldsMap |
GeneratedMessageCompanion |
Removed | ❌ No | ❌ No | 0.6.0 | ✅ Yes | Use messageReads |
descriptor |
GeneratedMessageCompanion |
Removed | ❌ No | ❌ No | 0.5.47 | ✅ Yes | Use javaDescriptor |
mergeFrom(input) |
Generated messages (instance) | Removed | ❌ No | ❌ No | N/A (not deprecated) | Use parseFrom (available); merge only in 0.10+ |
|
of(..., unknownFields) |
Generated companions | Signature changed | ❌ No | N/A | ❌ No | Remove unknownFields param; use .withUnknownFields() |
|
Message[T] trait |
Generated messages | Removed from extends | ✅ Yes | ❌ No | N/A | ✅ Yes | Use GeneratedMessage in type bounds |
| Enum base type | Generated enums | trait → class |
✅ Yes | ❌ No | N/A | ✅ N/A | Recompile; no code changes needed |
| Oneof parameter order | Generated messages | Position changed | ❌ No | ❌ No | N/A | ✅ Yes | Use named parameters (already works in 0.9.8) |
unknownFields parameter |
Generated case classes | Added to constructor | ❌ No | N/A | ❌ No | Update pattern matches; use @ pattern |
- ✅ Yes: Compatible / Can pre-migrate
- ❌ No: Incompatible / Cannot pre-migrate
⚠️ Partial: May be compatible depending on usage / Partial migration possible- N/A: Not applicable
| Category | Count | Severity |
|---|---|---|
| Removed deprecated methods | 6 | 🟡 Medium (long deprecated) |
| Removed non-deprecated methods | 1 | 🔴 High (mergeFrom) |
| Signature changes | 4 | 🔴 High (of(), Message[T], merge, enum base) |
| Structural changes | 2 | 🟠 Medium-High (oneof order, unknown fields) |
| Total breaking changes | 13 | - |
From commit f50436f4956d832f2e0f30be4376fa8628eddb22 (November 28, 2019), these deprecated methods were removed from the runtime:
def valueDescriptor: JavaDescriptors.EnumValueDescriptor- Deprecated since: ScalaPB 0.5.47
- Replacement: Use
javaValueDescriptorinstead - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
def descriptor: com.google.protobuf.Descriptors.EnumDescriptor- Deprecated since: ScalaPB 0.5.47
- Replacement: Use
javaDescriptorinstead (note: in future versions this may refer toscalaDescriptor) - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
-
def getField(field: com.google.protobuf.Descriptors.FieldDescriptor): Any- Deprecated since: 0.6.0
- Replacement: Use
getFieldthat accepts a ScalaPB descriptor and returnsPValue - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
-
def getAllFields: Map[JavaDescriptors.FieldDescriptor, Any]- Deprecated since: 0.6.0
- Replacement: Use
toPMessage - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
-
def fromFieldsMap(fields: Map[JavaDescriptors.FieldDescriptor, Any]): A- Deprecated since: 0.6.0
- Replacement: Use
messageReads - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
-
def descriptor: com.google.protobuf.Descriptors.Descriptor- Deprecated since: ScalaPB 0.5.47
- Replacement: Use
javaDescriptorinstead (note: in future versions this may refer toscalaDescriptor) - Location:
scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala
def mergeFrom(_input__: CodedInputStream): A- Removed from: Generated message classes (as instance method)
- Replaced with: Companion object method
def merge(_message__: A, _input__: CodedInputStream): A - Commit:
c5eda09b16ef954a0ec091b281b7a1947b6ee1fb(November 30, 2019) - Impact: Source and binary incompatible
- Migration: Instead of
message.mergeFrom(input), useMessageCompanion.merge(message, input)or use the generatedparseFrommethods - Location: Generated code in
compiler-plugin/src/main/scala/scalapb/compiler/ProtobufGenerator.scala
Commit: a0d25705e74774a214d129cfad248fc7d3efb2f (March 10, 2020)
Change: The unknownFields parameter was removed from the of() method in companion objects
Before (v0.9.8):
def of(
field1: T1,
field2: T2,
// ... more fields
unknownFields: _root_.scalapb.UnknownFieldSet
): MessageTypeAfter (v0.10.11):
def of(
field1: T1,
field2: T2
// ... more fields (no unknownFields parameter)
): MessageTypeImpact: Binary incompatible (method signature changed). May be source compatible in some cases if unknownFields was always passed explicitly.
Migration: Remove the unknownFields parameter from of() calls. If you need to set unknown fields, use the case class constructor directly or use .withUnknownFields() after construction.
Example:
// Before:
val msg = MyMessage.of(field1 = "value", unknownFields = UnknownFieldSet.empty)
// After:
val msg = MyMessage.of(field1 = "value")
// Or if you need unknown fields:
val msg = MyMessage.of(field1 = "value").withUnknownFields(unknownFields)Commit: c5eda09b16ef954a0ec091b281b7a1947b6ee1fb (November 30, 2019)
Change: Message[T] trait removed from generated message extends clause
Before (v0.9.8):
final case class MyMessage(...)
extends scalapb.GeneratedMessage
with scalapb.Message[MyMessage]
with scalapb.lenses.Updatable[MyMessage]After (v0.10.11):
final case class MyMessage(...)
extends scalapb.GeneratedMessage
with scalapb.lenses.Updatable[MyMessage]Note: In 0.10.x, Message[T] became a type alias to Any for source compatibility. It is fully deprecated.
Impact: Binary incompatible but source compatible for most code.
Migration: Remove explicit references to Message[T] in type bounds and extends clauses. Use GeneratedMessage instead.
Example:
// Before:
def process[T <: GeneratedMessage with Message[T]](msg: T): Unit = ???
// After:
def process[T <: GeneratedMessage](msg: T): Unit = ???Commit: c5eda09b16ef954a0ec091b281b7a1947b6ee1fb (November 30, 2019)
Change: The mergeFrom method moved from instance to companion and changed signature
Before (v0.9.8):
// Instance method
def mergeFrom(_input__: CodedInputStream): MyMessageAfter (v0.10.11):
// Companion object method
def merge(_message__: MyMessage, _input__: CodedInputStream): MyMessageImpact: Source and binary incompatible
Migration:
- If you were calling
mergeFromdirectly, switch to using the companionmergemethod - However, most users should use the
parseFrommethods instead, which remain unchanged - The
mergemethod is typically used internally by ScalaPB's parsing logic
Example:
// Before:
val updated = existingMessage.mergeFrom(codedInputStream)
// After:
val updated = MyMessage.merge(existingMessage, codedInputStream)
// Better: Use parseFrom for most cases
val message = MyMessage.parseFrom(inputStream)Commit: Part of 0.10.0 release (commit c5eda09b and related)
Change: Enum case objects changed from extending a sealed trait to extending a sealed abstract base class
Before (v0.9.8):
sealed trait MyEnum extends GeneratedEnum { ... }
case object Value1 extends MyEnum
case object Value2 extends MyEnumAfter (v0.10.11):
sealed abstract class MyEnum extends GeneratedEnum { ... }
case object Value1 extends MyEnum
case object Value2 extends MyEnumImpact: Binary incompatible but source compatible for most code. This was done for improved performance.
Migration: No source code changes needed. Recompile all code that depends on the generated enums.
BREAKING CHANGE: In earlier versions, constructor parameters for oneofs were always generated after all the regular fields. From 0.10.x, oneofs are generated in the position that matches their index in the proto file.
Impact: Source and binary incompatible if you were relying on parameter positions
Migration: Use named parameters when constructing messages with oneofs
BREAKING CHANGE: All messages now preserve unknown fields by default, which adds an additional unknownFields: UnknownFieldSet parameter to case classes.
Impact: Source incompatible if using pattern matching with specific parameter counts, binary incompatible
Migration:
- Update pattern matches to handle the additional parameter or use
@pattern - To disable this feature: set
preserve_unknown_fieldstofalseat the file or package level
Example:
// Before (v0.9.8):
case class MyMessage(field1: String, field2: Int)
// After (v0.10.11):
case class MyMessage(
field1: String,
field2: Int,
unknownFields: UnknownFieldSet = UnknownFieldSet.empty
)The most impactful breaking changes between v0.9.8 and v0.10.11 are:
- Removal of long-deprecated methods (0.5.47, 0.6.0):
fromFieldsMap,getAllFields,getField,descriptor,valueDescriptor mergeFrom→merge: Instance method removed, replaced with companion static methodof()signature change:unknownFieldsparameter removedMessage[T]removal: Generated messages no longer extendMessage[T]- Unknown fields parameter: Added to all case classes by default
- Oneof parameter order: Now matches proto file order instead of always being last
- Enum base type: Changed from sealed trait to sealed abstract class
Most users should focus on:
- Removing
unknownFieldsfromof()calls - Updating type bounds to remove
Message[T] - Handling the additional
unknownFieldsparameter in pattern matches - Using named parameters for messages with oneofs
- Commit
f50436f4956d832f2e0f30be4376fa8628eddb22: Remove deprecated methods - Commit
a0d25705e74774a214d129cfad248fc7d3efb2f: Remove unknownFields parameter from of() - Commit
c5eda09b16ef954a0ec091b281b7a1947b6ee1fb: Deprecate Message[T] and move mergeFrom - ScalaPB CHANGELOG
Claude Code prompt, executed from the root of a locally cloned ScalaPB repo: