Skip to content

Commit

Permalink
Upgrade docusaurus (#214)
Browse files Browse the repository at this point in the history
This upgrades Docusaurus to v3.x for all dependencies and fixes any
issues as a result.

---------

Signed-off-by: Steve Ayers <sayers@buf.build>
  • Loading branch information
smaye81 authored Oct 1, 2024
1 parent c1a31e9 commit 22f1834
Show file tree
Hide file tree
Showing 16 changed files with 3,699 additions and 5,123 deletions.
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ will return the wire error.
Alternatively, if you wish to cancel the operation and immediately stop
the client stream, see [below](#cancel-stream) to cancel the operation.

### How do I cancel a client response stream in Connect-Go?
### How do I cancel a client response stream in Connect-Go? {#cancel-stream}

To cancel and abort a stream, call the cancel function of the underlying
context associated with the stream. This context is provided on stream
Expand Down
5 changes: 3 additions & 2 deletions docs/kotlin/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ The Protobuf dependency can be what the current project is already using. Make s
versions between the runtime and the Google Java plugin version. Here we are using the latest version.
:::
<details><summary>Having trouble with Gradle files? Here is what one might look like: </summary>
<details>
<summary>Having trouble with Gradle files? Here is what one might look like: </summary>
```groovy title="app/build.gradle"
plugins {
Expand Down Expand Up @@ -282,7 +283,7 @@ dependencies {

:::note

The default for my Android Studio isn't set up with Gradle `kts`. The examples here will is using
The default for Android Studio isn't set up with Gradle `kts`. The examples here are using
classic Gradle with Groovy. With Gradle `kts`, the changes are pretty similar for the dependency
declarations.

Expand Down
2 changes: 1 addition & 1 deletion docs/node/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ We do not recommend using [`fastify.inject()`](https://fastify.dev/docs/v1.14.x/
for testing Connect routes. `fastify.inject()` is a great tool, but using it means you have to handle details of the
protocol like `Content-Type` headers and status codes yourself. This is rather straight-forward for Connect unary,
but much less so for streaming RPCs, or the gRPC or gRPC-Web protocols.
:::note
:::

### Testing with an in-memory server

Expand Down
28 changes: 14 additions & 14 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,23 @@ general-purpose HTTP tools.
* **Unary-Call-Specification** &rarr; Method-Post Path Unary-Content-Type \[Connect-Protocol-Version\] \[Timeout\] \[Content-Encoding\] \[Accept-Encoding\]
* **Method-Post** &rarr; ":method POST"
* **Path** &rarr; ":path" "/" [Routing-Prefix "/"] Procedure-Name ; case-sensitive
* **Routing-Prefix** &rarr; {_arbitrary prefix_}
* **Procedure-Name** &rarr; {_IDL-specific service &amp; method name_} ; see [Protocol Buffers](#protobuf)
* **Message-Codec** &rarr; ("proto" / "json" / {_custom_})
* **Routing-Prefix** &rarr; \{_arbitrary prefix_\}
* **Procedure-Name** &rarr; \{_IDL-specific service &amp; method name_\} ; see [Protocol Buffers](#protobuf)
* **Message-Codec** &rarr; ("proto" / "json" / \{_custom_\})
* **Unary-Content-Type** &rarr; "content-type" "application/" Message-Codec
* **Connect-Protocol-Version** &rarr; "connect-protocol-version" "1"
* **Timeout** &rarr; "connect-timeout-ms" Timeout-Milliseconds
* **Timeout-Milliseconds** &rarr; {_positive integer as ASCII string of at most 10 digits_}
* **Timeout-Milliseconds** &rarr; \{_positive integer as ASCII string of at most 10 digits_\}
* **Content-Encoding** &rarr; "content-encoding" Content-Coding
* **Content-Coding** &rarr; "identity" / "gzip" / "br" / "zstd" / {_custom_}
* **Content-Coding** &rarr; "identity" / "gzip" / "br" / "zstd" / \{_custom_\}
* **Accept-Encoding** &rarr; "accept-encoding" Content-Coding \*("," [" "] Content-Coding) ; subset of HTTP quality value syntax
* **Leading-Metadata** &rarr; Custom-Metadata
* **Custom-Metadata** &rarr; ASCII-Metadata / Binary-Metadata
* **ASCII-Metadata** &rarr; Header-Name ASCII-Value
* **Binary-Metadata** &rarr; {Header-Name "-bin"} {base64-encoded value}
* **Binary-Metadata** &rarr; \{Header-Name "-bin"\} \{base64-encoded value\}
* **Header-Name** &rarr; 1\*( %x30-39 / %x61-7A / "\_" / "-" / ".") ; 0-9 a-z \_ - .
* **ASCII-Value** &rarr; 1\*( %x20-%x7E ) ; space &amp; printable ASCII
* **Bare-Message** &rarr; *{binary octet}
* **Bare-Message** &rarr; *\{binary octet\}

**Unary-Request-Headers** are sent as &mdash; and have the same semantics as
&mdash; HTTP headers. Servers may respond with an error if the client sends too
Expand Down Expand Up @@ -215,7 +215,7 @@ content.
* **Unary-Get-Call-Specification** &rarr; Method-Get Path "?" Query-Get \[Timeout\] \[Accept-Encoding\]
* **Method-Get** &rarr; ":method GET"
* **Query-Get** &rarr; Message-Query Encoding-Query \[Base64-Query\] \[Compression-Query\] \[Connect-Version-Query\]
* **Message-Query** &rarr; "message=" (*{percent-encoded octet})
* **Message-Query** &rarr; "message=" (*\{percent-encoded octet\})
* **Base64-Query** &rarr; "&base64=1"
* **Encoding-Query** &rarr; "&encoding=" Message-Codec
* **Compression-Query** &rarr; "&compression=" Content-Coding
Expand Down Expand Up @@ -299,10 +299,10 @@ an HTTP status code of 400.

* **Unary-Response** &rarr; Unary-Response-Headers Bare-Message
* **Unary-Response-Headers** &rarr; HTTP-Status Unary-Content-Type \[Content-Encoding\] \[Accept-Encoding\] \*Leading-Metadata \*Prefixed-Trailing-Metadata
* **HTTP-Status** &rarr; ":status" ("200" / {_error code translated to HTTP_})
* **HTTP-Status** &rarr; ":status" ("200" / \{_error code translated to HTTP_\})
* **Prefixed-Trailing-Metadata** &rarr; Prefixed-ASCII-Metadata / Prefixed-Binary-Metadata
* **Prefixed-ASCII-Metadata** &rarr; Prefixed-Header-Name ASCII-Value
* **Prefixed-Binary-Metadata** &rarr; {Prefixed-Header-Name "-bin"} {base64-encoded value}
* **Prefixed-Binary-Metadata** &rarr; \{Prefixed-Header-Name "-bin"\} \{base64-encoded value\}
* **Prefixed-Header-Name** &rarr; "trailer-" Header-Name

**Unary-Response-Headers** are sent as &mdash; and have the same semantics as
Expand Down Expand Up @@ -422,13 +422,13 @@ RPC types may be unavailable.
* **Streaming-Request** &rarr; Streaming-Request-Headers \*Enveloped-Message
* **Streaming-Request-Headers** &rarr; Streaming-Call-Specification \*Leading-Metadata
* **Streaming-Call-Specification** &rarr; Method-Post Path Streaming-Content-Type \[Connect-Protocol-Version\] \[Timeout\] \[Streaming-Content-Encoding\] \[Streaming-Accept-Encoding\]
* **Streaming-Content-Type** &rarr; "content-type" "application/connect+" ("proto" / "json" / {_custom_})
* **Streaming-Content-Type** &rarr; "content-type" "application/connect+" ("proto" / "json" / \{_custom_\})
* **Streaming-Content-Encoding** &rarr; "connect-content-encoding" Content-Coding
* **Streaming-Accept-Encoding** &rarr; "connect-accept-encoding" Content-Coding \*("," [" "] Content-Coding)
* **Enveloped-Message** &rarr; Envelope-Flags Message-Length Message
* **Envelope-Flags** &rarr; %d0-255 ; 8 bitwise flags encoded as 1 byte unsigned integer
* **Message-Length** &rarr; {_length of Message_} ; encoded as 4 byte unsigned integer, big-endian
* **Message** &rarr; *{binary octet}
* **Message-Length** &rarr; \{_length of Message_\} ; encoded as 4 byte unsigned integer, big-endian
* **Message** &rarr; *\{binary octet\}

If **Streaming-Content-Type** does not begin with "application/connect+",
servers should respond with an HTTP status of 415 Unsupported Media Type. This
Expand Down Expand Up @@ -643,7 +643,7 @@ After a successful RPC, `EndStreamResponse` can be as simple as `{}`.

When used with Protocol Buffer IDL,

* **Procedure-Name** &rarr; ?( {_proto package name_} "." ) {_service name_} "/" {_method name_}
* **Procedure-Name** &rarr; ?( \{_proto package name_\} "." ) \{_service name_\} "/" \{_method name_\}
* **Unary-Content-Type** &rarr; "content-type application/" ("proto" / "json")
* **Streaming-Content-Type** &rarr; "content-type application/connect+" ("proto" / "json")

Expand Down
19 changes: 14 additions & 5 deletions docs/swift/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Getting started
sidebar_position: 1
---

Connect-Swift is a small library (<200KB!) that provides support for using
Connect-Swift is a small library (\<200KB!) that provides support for using
generated, type-safe, and idiomatic Swift APIs to communicate with your app's
servers using [Protocol Buffers (Protobuf)][protobuf]. It works with the Connect, gRPC, and gRPC-Web protocols.

Expand Down Expand Up @@ -197,7 +197,11 @@ At this point, your app should build successfully.

To create the chat view, replace the contents of `ContentView.swift` with:

<details><summary>Click to expand <code>ContentView.swift</code></summary>
<details>

<summary>
Click to expand <code>ContentView.swift</code>
</summary>

```swift
import Combine
Expand Down Expand Up @@ -320,7 +324,10 @@ struct ContentView: View {

Lastly, replace the contents of `ElizaApp.swift` with:

<details><summary>Click to expand <code>ElizaApp.swift</code></summary>
<details>
<summary>
Click to expand <code>ElizaApp.swift</code>
</summary>

```swift
import Connect
Expand Down Expand Up @@ -397,7 +404,9 @@ If you'd like to use gRPC as the transport protocol in the above example,
simply change the following lines after ensuring you have
[included the `ConnectNIO` library dependency](#add-the-connect-swift-package):

<details><summary>Click to expand</summary>
<details>

<summary>Click to expand</summary>

```swift
//highlight-next-line
Expand Down Expand Up @@ -483,7 +492,7 @@ using the gRPC protocol for a few reasons:
as well as the ability to register custom
[compression algorithms](./using-clients.md#compression)
and [interceptors](./interceptors.md).
- **Binary size.** The Connect-Swift library is very small (<200KB)
- **Binary size.** The Connect-Swift library is very small (\<200KB)
and does not require any third party networking dependencies when using
it with the Connect and gRPC-Web protocols. When using it with gRPC,
the binary size is a bit bigger (~2.4MB) due to the SwiftNIO dependency
Expand Down
10 changes: 8 additions & 2 deletions docs/swift/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ When the production `connect-swift` plugin is invoked, it outputs
- A protocol interface ending with `*ClientInterface`
- A production implementation that conforms to the protocol and ends with `*Client`

<details><summary>Click to expand <code>eliza.connect.swift</code></summary>
<details>
<summary>
Click to expand <code>eliza.connect.swift</code>
</summary>

```swift
import Connect
Expand Down Expand Up @@ -130,7 +133,10 @@ When the mock `connect-swift-mocks` plugin is invoked, it outputs a
`.mock.swift` file which includes an implementation ending with `*ClientMock`
that conforms to the same interface as the production client:

<details><summary>Click to expand <code>eliza.mock.swift</code></summary>
<details>
<summary>
Click to expand <code>eliza.mock.swift</code>
</summary>

```swift
import Combine
Expand Down
Loading

0 comments on commit 22f1834

Please sign in to comment.