Skip to content

Commit 3bfc55e

Browse files
authored
Add deprecation warnings (#50)
Motivation: gRPC Swift v2 has moved to a new repo, grpc-swift-2 and as a result this package has a new major version. That's not all that discoverable. Modifications: Deprecate commonly used high-level types with a link to a forums post explaining the move. Result: Users are notified about the move
1 parent 41ba003 commit 3bfc55e

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed

Sources/GRPCHealthService/HealthService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public import GRPCCore
4242
/// }
4343
/// ```
4444
@available(gRPCSwiftExtras 1.0, *)
45+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
4546
public struct HealthService: Sendable, RegistrableRPCService {
4647
/// An implementation of the `grpc.health.v1.Health` service.
4748
private let service: Service

Sources/GRPCInteropTests/InteroperabilityTestCase.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
public import GRPCCore
1717

1818
@available(gRPCSwiftExtras 1.0, *)
19+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
1920
public protocol InteroperabilityTest {
2021
/// Run a test case using the given connection.
2122
///

Sources/GRPCInteropTests/TestService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private import struct Foundation.Data
2424
#endif
2525

2626
@available(gRPCSwiftExtras 1.0, *)
27+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
2728
public struct TestService: Grpc_Testing_TestService.ServiceProtocol {
2829
public init() {}
2930

Sources/GRPCOTelTracingInterceptors/Tracing/ClientOTelTracingInterceptor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ package import Tracing
3030
/// - https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans
3131
/// - https://opentelemetry.io/docs/specs/semconv/rpc/grpc/
3232
@available(gRPCSwiftExtras 1.0, *)
33+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
3334
public struct ClientOTelTracingInterceptor: ClientInterceptor {
3435
private let injector: ClientRequestInjector
3536
private var serverHostname: String

Sources/GRPCOTelTracingInterceptors/Tracing/ServerOTelTracingInterceptor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ package import Tracing
2929
/// - https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans
3030
/// - https://opentelemetry.io/docs/specs/semconv/rpc/grpc/
3131
@available(gRPCSwiftExtras 1.0, *)
32+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
3233
public struct ServerOTelTracingInterceptor: ServerInterceptor {
3334
private let extractor: ServerRequestExtractor
3435
private var serverHostname: String

Sources/GRPCReflectionService/Service/ReflectionService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public import struct Foundation.Data
3434
/// The service will offer information to clients about any registered services. You can register
3535
/// a service by providing its descriptor set to the service.
3636
@available(gRPCSwiftExtras 1.0, *)
37+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
3738
public struct ReflectionService: Sendable {
3839
private let service: ReflectionService.V1
3940

Sources/GRPCServiceLifecycle/GRPCClient+Service.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public import ServiceLifecycle
2020
// A `@retroactive` conformance here is okay because this project is also owned by the owners of
2121
// `GRPCCore`, and thus, the owners of `GRPCClient`. A conflicting conformance won't be added.
2222
@available(gRPCSwiftExtras 1.0, *)
23+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
2324
extension GRPCClient: @retroactive Service {
2425
public func run() async throws {
2526
try await withGracefulShutdownHandler {

Sources/GRPCServiceLifecycle/GRPCServer+Service.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public import ServiceLifecycle
2020
// A `@retroactive` conformance here is okay because this project is also owned by the owners of
2121
// `GRPCCore`, and thus, the owners of `GRPCServer`. A conflicting conformance won't be added.
2222
@available(gRPCSwiftExtras 1.0, *)
23+
@available(*, deprecated, message: "See https://forums.swift.org/t/80177")
2324
extension GRPCServer: @retroactive Service {
2425
public func run() async throws {
2526
try await withGracefulShutdownHandler {

0 commit comments

Comments
 (0)