Skip to content

2.0.0-beta.1

Latest
Compare
Choose a tag to compare
@glbrntt glbrntt released this 05 Dec 14:34
· 2 commits to main since this release
e390c85

What's Changed

2.0.0-beta.1 includes a number of API breaking changes from 2.0.0-alpha.1, including changes to the generated code.

⚙️ Code generation

The generated code has had a number of changes:

  • Nested protocols and types. The various protocols generated for each service are now nested within the namespace of each service. This is a breaking change. If your generated service was previously called FooService_ServiceProtocol then it will now be nested within the FooService enum and will be FooService.ServiceProtocol. This also applies to the client protocol, client struct, and streaming service protocol.
  • Simple service protocol. Another simpler protocol is now generated (SimpleServiceProtocol) making it easier to implement services. This is the recommended protocol to implement if you don't need access to metadata.
  • Documentation. Generated code now includes documentation on how to use it and includes any documentation from the source IDL.

These changes were done in #2114, #2115, #2116, #2117, #2122, #2125, #2126, #2128, #2129, #2131, #2132, #2133, #2134, #2137, #2138, #2139, and #2141.

🔄 Interceptors

Interceptors can now be registered per-service and per-method in addition to being applied to all methods. This work was done in #2096 and #2113.

✨ Other notable changes

  • RPC cancellation handler. Service implementers can use withRPCCancellationHandler(operation:onCancelRPC:) to register a callback which is invoked when the RPC is cancelled. (#2090)
  • Remote peer information. The server context now contains information about the identity of the remote peer. (#2136)
  • "with-" methods for client and server allow you to more easily run a client and server. (#2121)
  • MethodDescriptor now uses ServiceDescriptor to represent the fully qualified service name. (#2127)
  • Allow metadata to be mutated on server responses. Metadata can now be mutated in place on server responses. (#2120)
  • GRPCCore is no longer @_exported, this is a breaking change and requires you to add an explicit dependency on GRPCCore and import it where appropriate. (#2109)
  • Flatten RPCError cause to avoid deeply nested errors of the same type. (#2083)

🐛 Bug fixes

  • Fix decoding of durations in MethodConfig (#2093)
  • Fix route guide tutorial (#2094)

🔧 Other Changes

Full Changelog: 2.0.0-alpha.1...2.0.0-beta.1