Skip to content

Commit f929620

Browse files
committed
Jun/PCX edits part 1
1 parent b92f7c8 commit f929620

File tree

8 files changed

+20
-24
lines changed

8 files changed

+20
-24
lines changed

src/content/docs/durable-objects/api/alarms.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Alarms
33
pcx_content_type: concept
44
sidebar:
5-
order: 4
5+
order: 6
66
---
77

88
import { Type } from "~/components";
@@ -37,16 +37,13 @@ Alarms can be used to build distributed primitives, like queues or batching of w
3737

3838
### getAlarm
3939

40-
- `getAlarm()`: <Type text ='number | null' />
40+
- <code>getAlarm()</code>: <Type text ='number | null' />
4141

4242
- If there is an alarm set, then return the currently set alarm time in number of milliseconds elapsed since the UNIX epoch. Otherwise, return `null`.
4343

4444
### setAlarm
4545

46-
- <code>
47-
setAlarm(scheduledTimeMs <Type text="number" />)
48-
</code>
49-
: <Type text="void" />
46+
- <code> setAlarm(scheduledTimeMs <Type text="number" />)</code>: <Type text="void" />
5047

5148
- Set the time for the alarm to run at in number of milliseconds elapsed since the UNIX epoch.
5249

src/content/docs/durable-objects/api/id.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { Tabs, TabItem } from "~/components";
99

1010
## Description
1111

12-
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used to by [`DurableObjectNamespace::get`](./namespace.mdx) to obtain a stub for submitting requests to the Durable Object class.
12+
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used by [`DurableObjectNamespace::get`](./namespace.mdx) to obtain a stub for submitting requests to the Durable Object class.
1313

1414
Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
1515

1616
:::note[`DurableObjectId`]
1717

18-
If you are experiencing an issue with a particular Durable Object instance the `DurableObjectId` corresponding to this particular instance is very helpful for obtaining a resolution through Cloudflare support. It is advisable to log a `DurableObjectId` from a Worker and include it in support requests where applicable.
18+
If you are experiencing an issue with a particular Durable Object instance, you may wish to log the `DurableObjectId` from your Worker and include it in your Cloudflare support request.
1919

2020
:::
2121

src/content/docs/durable-objects/api/namespace.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { Tabs, TabItem } from "~/components";
99

1010
## Description
1111

12-
The `DurableObjectNamespace` interface is used to obtain a reference to a new or existing Durable Object instance. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface for reference bindings declared in `wrangler.toml`.
12+
The `DurableObjectNamespace` interface is used to obtain a reference to a new or existing Durable Object instance. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface when referencing bindings declared in `wrangler.toml`.
1313

14-
There are several functions of this interface that can be used to create an ID for a Durable Object instance. Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
14+
This interface defines several [methods](../namespace/#methods) that can be used to create an ID for a Durable Object instance. Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
1515

1616
<Tabs> <TabItem label="JavaScript" icon="seti:javascript">
1717

@@ -84,14 +84,13 @@ The string to be used to generate a [`DurableObjectId`](../id) corresponding to
8484

8585
#### Return value
8686

87-
A [`DurableObjectId`](../id) refering to an instance of a Durable Object class.
87+
A [`DurableObjectId`](../id) referring to an instance of a Durable Object class.
8888

8989
### `newUniqueId`
9090

9191
#### Description
9292

93-
creates a `DurableObjectId` which refers to an individual instance of the
94-
Durable Object class.
93+
`newUniqueId` creates a `DurableObjectId` which refers to an individual instance of the Durable Object class.
9594

9695
```js
9796
const id = env.MY_DURABLE_OBJECT.newUniqueId();
@@ -110,7 +109,7 @@ An optional object with the key `jurisdiction` and value of a [jurisdiction](../
110109

111110
#### Return value
112111

113-
A [`DurableObjectId`](../id) refering to an instance of the Durable Object class.
112+
A [`DurableObjectId`](../id) referring to an instance of the Durable Object class.
114113

115114
### `idFromString`
116115

@@ -133,7 +132,7 @@ The string corresponding to a [`DurableObjectId`](../id) previously generated ei
133132

134133
#### Return value
135134

136-
A [`DurableObjectId`](../id) refering to an instance of a Durable Object class.
135+
A [`DurableObjectId`](../id) referring to an instance of a Durable Object class.
137136

138137
### `get`
139138

@@ -152,7 +151,7 @@ A required [`DurableObjectId`](../id) and an optional object with the key `locat
152151

153152
#### Return value
154153

155-
A [`DurableObjectStub`](../stub) refering to an instance of a Durable Object class.
154+
A [`DurableObjectStub`](../stub) referring to an instance of a Durable Object class.
156155

157156
### `jurisdiction`
158157

src/content/docs/durable-objects/api/storage-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Storage API
33
pcx_content_type: concept
44
sidebar:
5-
order: 2
5+
order: 4
66

77
---
88

@@ -100,7 +100,7 @@ Each method is implicitly wrapped inside a transaction, such that its results ar
100100

101101
* <code>deleteAll(options <Type text='Object' /> <MetaInfo text='optional' />)</code>: <Type text='Promise' />
102102

103-
* Deletes all stored data, effectively deallocating all storage used by the Durable Object. For Durable Objects with a key-value storage backend, `deleteAll()` removes all keys and associated values for an individual Durable Object. For Durable Objects with a [SQLite storage backend](/durable-objects/best-practices/access-durable-objects-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database.
103+
* Deletes all stored data, effectively deallocating all storage used by the Durable Object. For Durable Objects with a key-value storage backend, `deleteAll()` removes all keys and associated values for an individual Durable Object. For Durable Objects with a [SQLite storage backend](/durable-objects/best-practices/access-durable-objects-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database.
104104
* For Durable Objects with a key-value storage backend, an in-progress `deleteAll()` operation can fail, which may leave a subset of data undeleted. Durable Objects with a SQLite storage backend do not have a partial `deleteAll()` issue because `deleteAll()` operations are atomic (all or nothing).
105105
* `deleteAll()` does not proactively delete [Alarms](/durable-objects/api/alarms/). Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) to delete an alarm.
106106

src/content/docs/durable-objects/api/webgpu.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pcx_content_type: configuration
33
title: WebGPU
44
sidebar:
5-
order: 4
5+
order: 7
66
---
77

88
:::caution

src/content/docs/durable-objects/api/websockets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: WebSockets
33
pcx_content_type: concept
44
sidebar:
5-
order: 3
5+
order: 5
66

77
---
88

src/content/docs/durable-objects/api/workers-rs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ pcx_content_type: navigation
33
title: Rust API
44
external_link: https://github.com/cloudflare/workers-rs?tab=readme-ov-file#durable-objects
55
sidebar:
6-
order: 5
6+
order: 10
77

88
---

src/content/docs/durable-objects/reference/data-location.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Jurisdictions are used to create Durable Object instances that only run and stor
1111

1212
Workers may still access Durable Objects constrained to a jurisdiction from anywhere in the world. The jurisdiction constraint only controls where the Durable Object itself runs and persists data. Consider using [Regional Services](/data-localization/regional-services/) to control the regions from which Cloudflare responds to requests.
1313

14-
:::note[logging]
14+
:::note[Logging]
1515

1616
A [`DurableObjectId`](../../api/id) will be logged outside of the specified jurisdiction for billing and debugging purposes.
1717

1818
:::
1919

20-
Durable Object instances can be restricted to a specific jurisdiction either by creating a [`DurableObjectNamespace`](../../api/namespace/) restricted to a jurisdiction or by creating an individual [`DurableObjectId`](../../api/id) restricted to a jurisdiction:
20+
Durable Object instances can be restricted to a specific jurisdiction either by creating a [`DurableObjectNamespace`](../../api/namespace/) restricted to a jurisdiction, or by creating an individual [`DurableObjectId`](../../api/id) restricted to a jurisdiction:
2121

2222
```js
2323
const euSubnamespace = env.MY_DURABLE_OBJECT.jurisdiction("eu");
@@ -34,7 +34,7 @@ const euId2 = env.MY_DURABLE_OBJECT.jurisdiction("eu").idFromName("my-name");
3434
console.assert(!euId1.equal(euId2), "This should always be true");
3535
```
3636

37-
While methods on a [`DurableObjectNamespace`](../../api/namespace/) that take a [`DurableObjectId`](../../api/id) as a parameter will throw an exception if the parameter is associated with a different jurisdiction, these methods will not throw an exception if the [`DurableObjectNamespace`](../../api/namespace/) is not associated with a jurisdiction. The common case is that any valid [`DurableObjectId`](../../api/id) can be used in the top-level namespace's methods.
37+
Methods on a [`DurableObjectNamespace`](../../api/namespace/) that take a [`DurableObjectId`](../../api/id) as a parameter will throw an exception if the parameter is associated with a different jurisdiction. However, these methods will not throw an exception if the [`DurableObjectNamespace`](../../api/namespace/) is not associated with a jurisdiction. The common case is that any valid [`DurableObjectId`](../../api/id) can be used in the top-level namespace's methods.
3838

3939
```js
4040
const euSubnamespace = env.MY_DURABLE_OBJECT.jurisdiction("eu");

0 commit comments

Comments
 (0)