Skip to content
Merged
44 changes: 30 additions & 14 deletions src/content/docs/workers/development-testing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ To verify that the certificate exchange and validation process work as expected.
"binding": "MY_CLIENT_CERT_FETCHER",
"certificate_id": "<YOUR_UPLOADED_CERT_ID>",
"experimental_remote": true

}
]

}
]
}

```
Expand All @@ -256,10 +254,10 @@ To connect to a high-fidelity version of the Images API, and verify that all tra
<WranglerConfig>
```jsonc title="wrangler.jsonc"
{
"images": {
"binding": "IMAGES" ,
"images": {
"binding": "IMAGES" ,
"experimental_remote": true
}
}
}
```

Expand All @@ -278,13 +276,13 @@ Workers for Platforms users can configure `experimental_remote: true` in dispatc
<WranglerConfig>
```jsonc title="wrangler.jsonc"
{
"dispatch_namespaces": [
{
"binding": "DISPATCH_NAMESPACE",
"namespace": "testing",
"experimental_remote":true
"dispatch_namespaces": [
{
"binding": "DISPATCH_NAMESPACE",
"namespace": "testing",
"experimental_remote":true
}
]
]
}
```
</WranglerConfig>
Expand All @@ -297,7 +295,7 @@ Certain bindings are not supported for remote connections during local developme

If `experimental_remote: true` is specified in Wrangler configuration for any of the following unsupported binding types, Cloudflare **will issue an error**. See [all supported and unsupported bindings for remote bindings](/workers/development-testing/bindings-per-env/).

- [**Durable Objects**](/workers/wrangler/configuration/#durable-objects): Enabling remote connections for Durable Objects may be supported in the future, but currently will always run locally.
- [**Durable Objects**](/workers/wrangler/configuration/#durable-objects): Enabling remote connections for Durable Objects may be supported in the future, but currently will always run locally. However, using Durable Objects in combination with remote bindings is possible as illustrated in the [Durable Objects usage section](#durable-objects-usage-with-remote-resources) below.

- [**RPC on service bindings**](/workers/runtime-apis/bindings/service-bindings/rpc/): While you can make `fetch()` calls on remote service bindings, you cannot currently call RPC methods on remote service bindings.

Expand All @@ -314,12 +312,30 @@ If `experimental_remote: true` is specified in Wrangler configuration for any of
- [**Analytics Engine**](/analytics/analytics-engine/): Local development sessions typically don't contribute data directly to production Analytics Engine.

- [**Hyperdrive**](/workers/wrangler/configuration/#hyperdrive): This is being actively worked on, but is currently unsupported.

- [**Rate Limiting**](/workers/runtime-apis/bindings/rate-limit/#configuration): Local development sessions typically should not share or affect rate limits of your deployed Workers. Rate limiting logic should be tested against local simulations.

:::note
If you have use-cases for connecting to any of the remote resources above, please [open a feature request](https://github.com/cloudflare/workers-sdk/issues) in our [`workers-sdk` repository](https://github.com/cloudflare/workers-sdk).
:::

#### Using remote resources with Durable Objects and Workflows

While Durable Object and Workflow bindings cannot currently be remote, you can still use them during local development and have them interact with remote resources.

There are two recommended patterns for this:

- **Local Durable Objects/Workflows with remote bindings:**

When you enable remote bindings in your [Wrangler configuration](/workers/wrangler/configuration), your locally running Durable Objects and Workflows can access those remote resources.
This allows such bindings, although run locally to interact with remote resources during local development.

- **Accessing remote Durable Objects/Workflows via service bindings:**

To interact with remote Durable Object or Workflow instances, deploy a Worker that defines those. Then, in your local Worker, configure a remote [service binding](/workers/runtime-apis/bindings/service-bindings/) pointing to the deployed Worker.
Your local Worker will be then able to interact with the remote deployed Worker which in turn can communicate with the remote Durable Objects/Workflows. In such a manner you can create a communication channel via the remote service binding, effectively using the deployed Worker as a proxy interface to the remote bindings during local development.


### Important Considerations

- **Data modification**: Operations (writes, deletes, updates) on bindings connected remotely will affect your actual data in the targeted Cloudflare resource (be it preview or production).
Expand Down
Loading