Skip to content

Commit d6cf904

Browse files
committed
Manually matching latest state of docs with this PR
1 parent f2b809e commit d6cf904

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: Build a WebSocket server using WebSocket Hibernation on Durable
1212
Objects and Workers.
1313
---
1414

15-
import { TypeScriptExample } from "~/components";
15+
import { TypeScriptExample, WranglerConfig } from "~/components";
1616

1717
This example is similar to the [Build a WebSocket server](/durable-objects/examples/websocket-server/) example, but uses the WebSocket Hibernation API. The WebSocket Hibernation API should be preferred for WebSocket server applications built on Durable Objects, since it significantly decreases duration charge, and provides additional features that pair well with WebSocket applications. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/best-practices/websockets/).
1818

@@ -158,22 +158,21 @@ export class WebSocketHibernationServer extends DurableObject {
158158
```
159159
</TypeScriptExample>
160160

161-
Finally, configure your `wrangler.toml` file to include a Durable Object [binding](/durable-objects/get-started/#5-configure-durable-object-bindings) and [migration](/durable-objects/reference/durable-objects-migrations/) based on the namespace and class name chosen previously.
162-
163-
import { WranglerConfig } from "~/components";
161+
Finally, configure your `wrangler.toml` file to include a Durable Object [binding](/durable-objects/get-started/#5-configure-durable-object-class-with-sqlite-storage-backend) and [migration](/durable-objects/reference/durable-objects-migrations/) based on the namespace and class name chosen previously.
164162

165163
<WranglerConfig>
166164

167165
```toml title="wrangler.toml"
168166
name = "websocket-hibernation-server"
167+
main = "src/index.ts"
169168

170169
[[durable_objects.bindings]]
171170
name = "WEBSOCKET_HIBERNATION_SERVER"
172171
class_name = "WebSocketHibernationServer"
173172

174173
[[migrations]]
175174
tag = "v1"
176-
new_classes = ["WebSocketHibernationServer"]
175+
new_sqlite_classes = ["WebSocketHibernationServer"]
177176
```
178177

179178
</WranglerConfig>

src/content/docs/durable-objects/examples/websocket-server.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar:
1010
description: Build a WebSocket server using Durable Objects and Workers.
1111
---
1212

13-
import { GlossaryTooltip, TypeScriptExample } from "~/components";
13+
import { GlossaryTooltip, TypeScriptExample, WranglerConfig } from "~/components";
1414

1515
This example shows how to build a WebSocket server using <GlossaryTooltip term="Durable Object">Durable Objects</GlossaryTooltip> and Workers. The example exposes an endpoint to create a new WebSocket connection. This WebSocket connection echos any message while including the total number of WebSocket connections currently established. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/best-practices/websockets/).
1616

@@ -133,26 +133,25 @@ sessions: Map<WebSocket, { [key: string]: string }>;
133133

134134
}
135135

136-
````
136+
```
137137
</TypeScriptExample>
138138

139-
Finally, configure your `wrangler.toml` file to include a Durable Object [binding](/durable-objects/get-started/#5-configure-durable-object-bindings) and [migration](/durable-objects/reference/durable-objects-migrations/) based on the <GlossaryTooltip term="namespace">namespace</GlossaryTooltip> and class name chosen previously.
140-
141-
import { WranglerConfig } from "~/components";
139+
Finally, configure your `wrangler.toml` file to include a Durable Object [binding](/durable-objects/get-started/#4-configure-durable-object-bindings) and [migration](/durable-objects/reference/durable-objects-migrations/) based on the <GlossaryTooltip term="namespace">namespace</GlossaryTooltip> and class name chosen previously.
142140

143141
<WranglerConfig>
144142

145143
```toml title="wrangler.toml"
146144
name = "websocket-server"
145+
main = "src/index.ts"
147146

148147
[[durable_objects.bindings]]
149148
name = "WEBSOCKET_SERVER"
150149
class_name = "WebSocketServer"
151150

152151
[[migrations]]
153152
tag = "v1"
154-
new_classes = ["WebSocketServer"]
155-
````
153+
new_sqlite_classes = ["WebSocketServer"]
154+
```
156155

157156
</WranglerConfig>
158157

0 commit comments

Comments
 (0)