Skip to content

Commit ebcac53

Browse files
glbrnttgjcairo
andauthored
Update tutorials for beta 3 (#2165)
Motivation: We're going to tag beta 3 soon, so ensure the tutorials are up to date. Modifications: - Update tutorials Result: More up-to-date docs --------- Co-authored-by: Gus Cairo <[email protected]>
1 parent 3e75bbb commit ebcac53

15 files changed

+59
-87
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ let package = Package(
3232
name: "foo-package",
3333
platforms: [.macOS("15.0")],
3434
dependencies: [
35-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
36-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.2"),
37-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
35+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
36+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.3"),
37+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
3838
],
3939
targets: [
4040
.executableTarget(

Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@Tutorial(time: 10) {
22
@XcodeRequirement(
3-
title: "Xcode 16 Beta 5+",
3+
title: "Xcode 16",
44
destination: "https://developer.apple.com/download/"
55
)
66

@@ -18,7 +18,7 @@
1818
repository by running the following command in a terminal:
1919

2020
```console
21-
git clone --branch 2.0.0-beta.2 https://github.com/grpc/grpc-swift
21+
git clone --branch 2.0.0-beta.3 https://github.com/grpc/grpc-swift
2222
```
2323

2424
You then need to change directory to the `Examples/hello-world` directory of the cloned

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step07-description.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ let package = Package(
55
name: "RouteGuide",
66
platforms: [.macOS(.v15)],
77
dependencies: [
8-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
9-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
10-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.2"),
8+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
9+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
10+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.3"),
1111
],
1212
targets: []
1313
)

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step08-description.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ let package = Package(
55
name: "RouteGuide",
66
platforms: [.macOS(.v15)],
77
dependencies: [
8-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
9-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
10-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.2"),
8+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
9+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
10+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.3"),
1111
],
1212
targets: [
1313
.executableTarget(

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step00-package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let package = Package(
55
name: "RouteGuide",
66
platforms: [.macOS(.v15)],
77
dependencies: [
8-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
9-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
8+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
9+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
1010
],
1111
targets: [
1212
.executableTarget(

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step01-package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ let package = Package(
55
name: "RouteGuide",
66
platforms: [.macOS(.v15)],
77
dependencies: [
8-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
9-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
10-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.2"),
8+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
9+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
10+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.3"),
1111
],
1212
targets: [
1313
.executableTarget(

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step02-package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ let package = Package(
55
name: "RouteGuide",
66
platforms: [.macOS(.v15)],
77
dependencies: [
8-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.2"),
9-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.2"),
10-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.2"),
8+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0-beta.3"),
9+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0-beta.3"),
10+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0-beta.3"),
1111
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
1212
],
1313
targets: [

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec06-step03-create-client.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import GRPCNIOTransportHTTP2
33

44
extension RouteGuide {
55
func runClient() async throws {
6-
let client = try GRPCClient(
6+
try await withGRPCClient(
77
transport: .http2NIOPosix(
88
target: .ipv4(host: "127.0.0.1", port: 31415),
99
transportSecurity: .plaintext
1010
)
11-
)
11+
) { client in
12+
// ...
13+
}
1214
}
1315
}

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec06-step04-run-client.swift

Lines changed: 0 additions & 15 deletions
This file was deleted.

Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec06-step05-stub.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ import GRPCNIOTransportHTTP2
33

44
extension RouteGuide {
55
func runClient() async throws {
6-
let client = try GRPCClient(
6+
try await withGRPCClient(
77
transport: .http2NIOPosix(
88
target: .ipv4(host: "127.0.0.1", port: 31415),
99
transportSecurity: .plaintext
1010
)
11-
)
12-
13-
async let _ = client.run()
14-
15-
let routeGuide = Routeguide_RouteGuide.Client(wrapping: client)
11+
) { client in
12+
let routeGuide = Routeguide_RouteGuide.Client(wrapping: client)
13+
}
1614
}
1715
}

0 commit comments

Comments
 (0)