Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIv2: track breaking changes #867

Closed
dsnet opened this issue Jun 11, 2019 · 29 comments
Closed

APIv2: track breaking changes #867

dsnet opened this issue Jun 11, 2019 · 29 comments
Labels
breaking-change requires making a breaking API change

Comments

@dsnet
Copy link
Member

dsnet commented Jun 11, 2019

This is a meta-issue for tracking any breaking changes that occur before the final v2 release. Since v2 is not yet released, we reserve the right to make breaking changes to improve the API to be as good as it can be.

The CL (changelist) that introduces a breaking change will be posted here as a comment. Subscribe to this issue to be notified of breakages. We try to batch multiple breaking changes close together in time to reduce user churn.

@robbertvanginkel

This comment has been minimized.

@dsnet

This comment has been minimized.

@dsnet
Copy link
Member Author

dsnet commented Jun 17, 2019

Breaking changes:

  • CL/182537: reflect/protoregistry: remove Files.RangeFilesByPath method
  • CL/175987: reflect/protoreflect: remove bool output for Descriptor.Parent method
  • CL/176942: reflect/protoreflect: remove FieldDescriptor.{Oneof,Extendee} methods
  • CL/174938: reflect/protoreflect: remove {Enum,Message}.Type methods
  • CL/182597: reflect/protoreflect: remove KnownFields and UnknownFields interfaces

@dsnet
Copy link
Member Author

dsnet commented Jun 19, 2019

Minor change:

  • CL/182638: reflect/protodesc: use Resolver interface

@neild
Copy link
Contributor

neild commented Jun 19, 2019

Exceedingly minor change:

  • CL/182980: encoding/proto{json,text}.MarshalOptions.Resolver must also resolve extensions

@dsnet
Copy link
Member Author

dsnet commented Jun 20, 2019

Minor change:

  • CL/183101: internal/fileinit: remove package

This only affects generated code; the fix is to regenerate the .pb.go files.

@dsnet
Copy link
Member Author

dsnet commented Jun 24, 2019

Breaking change:

  • CL/183700: reflect/protoregistry: remove Files.Find{Enum,Message,Extension,Service}ByName

@neild
Copy link
Contributor

neild commented Jun 25, 2019

Breaking change:

  • CL/183678: all: remove protoreflect.Message.Len

@dsnet
Copy link
Member Author

dsnet commented Jul 3, 2019

Behavior change:

  • CL/184837: reflect/protodesc: enforce strict validation

This CL enforces that the input file descriptors are well-formed according to the same rules as the C++ protoc implementation.

@dsnet dsnet removed the api-v2 label Jul 10, 2019
@kyessenov

This comment has been minimized.

@neild

This comment has been minimized.

@dsnet

This comment has been minimized.

@golang golang locked as off-topic and limited conversation to collaborators Aug 5, 2019
@neild
Copy link
Contributor

neild commented Aug 5, 2019

  • CL/187857: reflect/prototype: drop Extension

The rest of the prototype package will probably follow soon.

@dsnet
Copy link
Member Author

dsnet commented Aug 7, 2019

  • CL/189198: compiler/protogen, cmd/protoc-gen-go: use alternative comments API

@neild
Copy link
Contributor

neild commented Aug 8, 2019

Breaking changes:

  • CL/189199: all: refactor extensions, add proto.GetExtension etc.

This CL changes the protoreflect.{Message,Enum,Extension}Type types to no longer implement the corresponding Descriptor interface. (They still have a has-a relationship with the descriptor.)

Accessing extension fields in a protoreflect.Message now requires a protoreflect.ExtensionTypeDescriptor (which implements FieldDescriptor) instead of an ExtensionType (which doesn't any more). ExtensionType.Descriptor returns an ExtensionTypeDescriptor.

  • CL/189340: all: drop reflect/prototype package

The prototype package is removed as unnecessary.

@neild
Copy link
Contributor

neild commented Aug 20, 2019

Breaking change:

  • CL/189563: all: unify protoV1.ExtensionDesc and proto.ExtensionType
  • CL/189564: internal/impl: clean up obsolete ExtensionInfo fields/funcs

The protoiface.ExtensionDescV1 type is removed. (And lots of other internal refactoring, but I believe that's the only breaking API change.) This is unlikely to affect anyone.

@dsnet
Copy link
Member Author

dsnet commented Aug 21, 2019

Minor breaking change:

  • CL/191039: compiler/protogen: export Plugin.FilesByPath

@neild
Copy link
Contributor

neild commented Aug 28, 2019

Breaking change:

  • CL/192139: rename ExtensionType Descriptor method to TypeDescriptor

This is a fiddly change, but improves clarity a bit around the very subtle interactions between the various views of an extension.

@neild
Copy link
Contributor

neild commented Sep 5, 2019

Breaking change:

Superseded by the more general-purpose Message.NewField, List.NewElement, and Map.NewValue.

@neild
Copy link
Contributor

neild commented Oct 9, 2019

Breaking change:

  • CL/199060: remove {Enum,Message,Extension}Type.GoType methods

Removed to simplify the interface, and because there are now better ways to do just about everything they were used for.

@neild
Copy link
Contributor

neild commented Nov 5, 2019

Minor breaking change:

  • CL/204897: remove nullability from repeated extension fields

m.Has(extensionTypeDescriptor) will now return false for a zero-length repeated extension field.

@neild
Copy link
Contributor

neild commented Nov 8, 2019

Breaking change:

The (*Files).Register and (*Types).Register functions in the protoregistry package have been replaced by type-safe Register{File,Enum,Message,Extension} methods.

The protoregistry.NewFiles and protoregistry.NewTypes functions are gone. (Just call Register...)

The protoregistry.Type type is removed (nothing references it any more).

@dsnet
Copy link
Member Author

dsnet commented Nov 13, 2019

Minor breaking change:

  • CL/207077: testing/protocmp: switch Enum.Number to be a method

@neild
Copy link
Contributor

neild commented Nov 26, 2019

  • CL/209018: reflect/protoreflect: add {Message,List,Map}.IsValid
  • CL/209019: all: fix reflection behavior for empty lists and maps

Minor addition to some protoreflect types, only affecting implementations of those types.

Brought reflection behavior for empty lists and maps in line with documentation. Technically not a breaking change (just doing what the documentation said!), but it would have been easy to depend on the previous behavior by accident.

@neild
Copy link
Contributor

neild commented Jan 21, 2020

  • CL/215718: all: add ProtoMethods method to protoreflect.Message
  • CL/215719: all: abstract fast-path marshal and unmarshal inputs and outputs

Changes to the fast-path ProtoUnmarshal method: It moves into the protoreflect.Message interface, and the method signature changes a bit.

Performance improvement (avoids an interface->interface type conversion, which is expensive) and future-proofing.

@neild
Copy link
Contributor

neild commented Feb 12, 2020

  • CL/219145: proto: remove shallow merge support, and MergeOptions

Shallow merges were well-defined, but we're debating whether that definition is useful. Dropped support for shallow merges for now, since this isn't a v1 feature we need to preserve.

@neild
Copy link
Contributor

neild commented Feb 19, 2020

  • CL/220117: reflect/protoreflect: add List.AppendMutable and Map.Mutable

Convenience methods on protoreflect's List and Map types.

@neild
Copy link
Contributor

neild commented Feb 19, 2020

  • CL/219505: all: fast-path method refactoring

One last change to the fast-path method signatures, for consistency and future expansion.

@neild
Copy link
Contributor

neild commented Mar 3, 2020

APIv2 is released. No more breaking changes!

@neild neild closed this as completed Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change requires making a breaking API change
Projects
None yet
Development

No branches or pull requests

4 participants