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 theFooService
enum
and will beFooService.ServiceProtocol
. This also applies to the client protocol, clientstruct
, 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 onGRPCCore
and import it where appropriate. (#2109)- Flatten
RPCError
cause to avoid deeply nested errors of the same type. (#2083)
🐛 Bug fixes
🔧 Other Changes
- Improvements to CI and tooling (#2105, #2091, #2106)
- Use Swift's new
Mutex
inBroadcastAsyncSequence
(#2108) - Improvements to documentation (#2100, #2112, #2123)
Full Changelog: 2.0.0-alpha.1...2.0.0-beta.1