Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd9932d

Browse files
korinnepetebacondarwindario-piotrowicz
authored
Adds draft docs for connecting to remote resources during local dev (hybrid dev) (#22940)
* adds draft docs for connecting to remote resources during local dev (hybrid dev) * Update src/content/docs/workers/local-development/index.mdx Co-authored-by: Pete Bacon Darwin <[email protected]> * Update src/content/docs/workers/local-development/index.mdx Co-authored-by: Pete Bacon Darwin <[email protected]> * updates overview pages, bindings-per-env for new hybrid dev * updates naming to remote bindings, adds API section * updates workers for platforms with remote bindings information * updates example config * Update src/content/docs/cloudflare-for-platforms/workers-for-platforms/get-started/developing-with-wrangler.mdx Co-authored-by: Dario Piotrowicz <[email protected]> * Update src/content/docs/cloudflare-for-platforms/workers-for-platforms/get-started/developing-with-wrangler.mdx Co-authored-by: Dario Piotrowicz <[email protected]> * updates bindings comparison, small changes to wording * updates redirects --------- Co-authored-by: Pete Bacon Darwin <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]>
1 parent 4f78941 commit bd9932d

File tree

27 files changed

+598
-135
lines changed

27 files changed

+598
-135
lines changed

public/__redirects

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,11 @@
15331533
/workers/about/tips/debugging/ /workers/observability/ 301
15341534
/workers/testing/debugging-tools/ /workers/observability/dev-tools/ 301
15351535
/workers/testing/local-development/ /workers/local-development/ 301
1536+
/workers/local-development/ /workers/development-testing/#local-development 301
1537+
/workers/local-development/bindings-per-env/ /workers/development-testing/bindings-per-env/ 301
1538+
/workers/local-development/environment-variables/ /workers/development-testing/environment-variables/ 301
1539+
/workers/local-development/local-data/ /workers/development-testing/local-data/ 301
1540+
/workers/local-development/remote-data/ /workers/development-testing/#remote-bindings 301
15361541
/workers/about/using-cache/ /workers/reference/how-the-cache-works/ 301
15371542
/workers/learning/how-the-cache-works/ /workers/reference/how-the-cache-works/ 301
15381543
/workers/api/ /api/resources/workers/subresources/scripts/methods/list/ 301

src/content/docs/cloudflare-for-platforms/workers-for-platforms/get-started/developing-with-wrangler.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,25 @@ curl http://localhost:8600
199199
```sh output
200200
# -> user worker got "intercepted a request for customer-1 by the outbound" from fetch
201201
```
202+
203+
## Remote dispatch namespaces
204+
205+
You can configure dispatch namespace bindings to connect to remote dispatch namespaces during local development by setting [`experimental_remote = true`](/workers/development-testing/#remote-bindings):
206+
207+
<WranglerConfig>
208+
```jsonc title="wrangler.jsonc"
209+
{
210+
"dispatch_namespaces": [
211+
{
212+
"binding": "DISPATCH_NAMESPACE",
213+
"namespace": "testing",
214+
"experimental_remote": true
215+
}
216+
]
217+
}
218+
```
219+
</WranglerConfig>
220+
221+
This allows you to run your [dynamic dispatch Worker](/cloudflare-for-platforms/workers-for-platforms/reference/how-workers-for-platforms-works/#dynamic-dispatch-worker) locally, while connecting it to your remote dispatch namespace binding. You can then test changes to your core dispatching logic against real, deployed [user Workers](/cloudflare-for-platforms/workers-for-platforms/reference/how-workers-for-platforms-works/#user-workers).
222+
223+
For more information about remote bindings during local development, refer to [remote bindings documentation](/workers/development-testing/#remote-bindings).

src/content/docs/d1/observability/debug-d1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ You should include as much of the following in any bug report:
9494

9595
* Learn [how to debug Workers](/workers/observability/).
9696
* Understand how to [access logs](/workers/observability/logs/) generated from your Worker and D1.
97-
* Use [`wrangler dev`](/workers/wrangler/commands/#dev) to run your Worker and D1 locally and [debug issues before deploying](/workers/local-development/).
97+
* Use [`wrangler dev`](/workers/wrangler/commands/#dev) to run your Worker and D1 locally and [debug issues before deploying](/workers/development-testing/).

src/content/docs/durable-objects/reference/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Local development sessions create a standalone, local-only environment that mirr
7373

7474
An existing Durable Object binding of `DB` would be available to your Worker when running locally.
7575

76-
Refer to Workers [Local development](/workers/local-development/#supported-resource-bindings-in-different-environments).
76+
Refer to Workers [Local development](/workers/development-testing/bindings-per-env/).
7777

7878
## Remote development
7979

src/content/docs/pages/functions/bindings.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ You can interact with your R2 bucket bindings locally in one of two ways:
201201

202202
:::note
203203

204-
By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/local-development/).
204+
By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/development-testing/).
205205

206206
:::
207207

@@ -282,7 +282,7 @@ Interact with this binding by using `context.env` (for example, `context.env.NOR
282282

283283
:::note
284284

285-
By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/local-development/).
285+
By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/development-testing/).
286286

287287
:::
288288

src/content/docs/pages/functions/wrangler-configuration.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ A [binding](/pages/functions/bindings/) enables your Pages Functions to interact
433433

434434
:::note
435435

436-
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production database. Refer to [Local development](/workers/local-development/) for more details.
436+
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production database. Refer to [Local development](/workers/development-testing/) for more details.
437437

438438
:::
439439

@@ -475,7 +475,7 @@ Workers, the `script_name` key is optional.
475475

476476
:::note
477477

478-
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production namespace. Refer to [Local development](/workers/local-development/) for more details.
478+
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production namespace. Refer to [Local development](/workers/development-testing/) for more details.
479479

480480
:::
481481

@@ -501,7 +501,7 @@ You cannot currently configure a [queues consumer](/queues/reference/how-queues-
501501

502502
:::note
503503

504-
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production bucket. Refer to [Local development](/workers/local-development/) for more details.
504+
When using Wrangler in the default local development mode, files will be written to local storage instead of the preview or production bucket. Refer to [Local development](/workers/development-testing/) for more details.
505505

506506
:::
507507

src/content/docs/workers/local-development/bindings-per-env.mdx renamed to src/content/docs/workers/development-testing/bindings-per-env.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
pcx_content_type: navigation
3-
title: Supported bindings in local and remote dev
3+
title: Supported bindings per development mode
44
sidebar:
55
order: 4
66
head: []
7-
description: Supported bindings in local and remote development
7+
description: Supported bindings per development mode
88
---
99

1010
import { Render } from "~/components";
File renamed without changes.

0 commit comments

Comments
 (0)