diff --git a/public/_redirects b/public/_redirects index 6a998490ad72ba..13cef2b0f4925b 100644 --- a/public/_redirects +++ b/public/_redirects @@ -1354,6 +1354,7 @@ /workers/platform/routes/ /workers/configuration/routing/ 301 /workers/about/tips/debugging/ /workers/observability/ 301 /workers/testing/debugging-tools/ /workers/observability/dev-tools/ 301 +/workers/testing/local-development/ /workers/local-development/ 301 /workers/about/tips/signing-requests/ /workers/examples/signing-requests/ 301 /workers/about/using-cache/ /workers/reference/how-the-cache-works/ 301 /workers/learning/how-the-cache-works/ /workers/reference/how-the-cache-works/ 301 @@ -1544,7 +1545,7 @@ /workers/runtime-apis/mtls/ /workers/runtime-apis/bindings/mtls/ 301 /workers/runtime-apis/queues/ /workers/runtime-apis/bindings/bindings/queues/ 301 /workers/runtime-apis/service-bindings/ /workers/runtime-apis/bindings/service-bindings/ 301 -/workers/observability/local-development-and-testing/ /workers/testing/local-development/ 301 +/workers/observability/local-development-and-testing/ /workers/local-development/ 301 /workers/observability/sentry-integration/ /workers/observability/integrations/sentry 301 /workers/configuration/deployments/ /workers/configuration/versions-and-deployments/ 301 /workers/configuration/continuous-integration/ /workers/ci-cd/ 301 diff --git a/src/content/docs/d1/observability/debug-d1.mdx b/src/content/docs/d1/observability/debug-d1.mdx index 194dab50323009..afcb4b9ae3ff24 100644 --- a/src/content/docs/d1/observability/debug-d1.mdx +++ b/src/content/docs/d1/observability/debug-d1.mdx @@ -94,4 +94,4 @@ You should include as much of the following in any bug report: * Learn [how to debug Workers](/workers/observability/). * Understand how to [access logs](/workers/observability/logs/) generated from your Worker and D1. -* Use [`wrangler dev`](/workers/wrangler/commands/#dev) to run your Worker and D1 locally and [debug issues before deploying](/workers/testing/local-development/). +* Use [`wrangler dev`](/workers/wrangler/commands/#dev) to run your Worker and D1 locally and [debug issues before deploying](/workers/local-development/). diff --git a/src/content/docs/pages/functions/bindings.mdx b/src/content/docs/pages/functions/bindings.mdx index 976cc4dcc29fe5..c21c6531108393 100644 --- a/src/content/docs/pages/functions/bindings.mdx +++ b/src/content/docs/pages/functions/bindings.mdx @@ -196,7 +196,7 @@ You can interact with your R2 bucket bindings locally in one of two ways: :::note -By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/testing/local-development/). +By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/local-development/). ::: @@ -277,7 +277,7 @@ Interact with this binding by using `context.env` (for example, `context.env.NOR :::note -By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/testing/local-development/). +By default, Wrangler automatically persists data to local storage. For more information, refer to [Local development](/workers/local-development/). ::: diff --git a/src/content/docs/pages/functions/wrangler-configuration.mdx b/src/content/docs/pages/functions/wrangler-configuration.mdx index 460b0cd99dcc03..00afd598fbf744 100644 --- a/src/content/docs/pages/functions/wrangler-configuration.mdx +++ b/src/content/docs/pages/functions/wrangler-configuration.mdx @@ -431,7 +431,7 @@ A [binding](/pages/functions/bindings/) enables your Pages Functions to interact :::note -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/testing/local-development/) for more details. +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. ::: @@ -471,7 +471,7 @@ When using Wrangler in the default local development mode, files will be written :::note -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/testing/local-development/) for more details. +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. ::: @@ -497,7 +497,7 @@ You cannot currently configure a [queues consumer](/queues/reference/how-queues- :::note -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/testing/local-development/) for more details. +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. ::: diff --git a/src/content/docs/workers/ci-cd/index.mdx b/src/content/docs/workers/ci-cd/index.mdx index ae936ee0273a91..b819b3d0bc9882 100644 --- a/src/content/docs/workers/ci-cd/index.mdx +++ b/src/content/docs/workers/ci-cd/index.mdx @@ -3,7 +3,7 @@ pcx_content_type: concept title: CI/CD description: Set up continuous integration and continuous deployment for your Workers. sidebar: - order: 8 + order: 9 --- You can set up continuous integration and continuous deployment (CI/CD) for your Workers by using either the integrated build system, [Workers Builds](#workers-builds), or using [external providers](#external-cicd) to optimize your development workflow. diff --git a/src/content/docs/workers/configuration/index.mdx b/src/content/docs/workers/configuration/index.mdx index d970bb963befad..ac54c931a9bef0 100644 --- a/src/content/docs/workers/configuration/index.mdx +++ b/src/content/docs/workers/configuration/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Configuration sidebar: - order: 7 + order: 8 group: hideIndex: true --- diff --git a/src/content/docs/workers/databases/index.mdx b/src/content/docs/workers/databases/index.mdx index d3d01ad139b6f2..df58c580329c33 100644 --- a/src/content/docs/workers/databases/index.mdx +++ b/src/content/docs/workers/databases/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Databases sidebar: - order: 12 + order: 13 group: hideIndex: true --- diff --git a/src/content/docs/workers/demos.mdx b/src/content/docs/workers/demos.mdx index d6ac6d70ce4236..b2d57d598b4591 100644 --- a/src/content/docs/workers/demos.mdx +++ b/src/content/docs/workers/demos.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Demos and architectures sidebar: - order: 5 + order: 6 --- diff --git a/src/content/docs/workers/frameworks/index.mdx b/src/content/docs/workers/frameworks/index.mdx index d039d2914b6d77..9d3a79524465e1 100644 --- a/src/content/docs/workers/frameworks/index.mdx +++ b/src/content/docs/workers/frameworks/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Frameworks sidebar: - order: 11 + order: 12 group: badge: Beta head: [] diff --git a/src/content/docs/workers/glossary.mdx b/src/content/docs/workers/glossary.mdx index 9eeddd269612bc..e7b8fd54d4643a 100644 --- a/src/content/docs/workers/glossary.mdx +++ b/src/content/docs/workers/glossary.mdx @@ -2,7 +2,7 @@ title: Glossary pcx_content_type: glossary sidebar: - order: 19 + order: 20 --- import { Glossary } from "~/components"; diff --git a/src/content/docs/workers/languages/index.mdx b/src/content/docs/workers/languages/index.mdx index 22067b572d1625..45550457d559d9 100644 --- a/src/content/docs/workers/languages/index.mdx +++ b/src/content/docs/workers/languages/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Languages sidebar: - order: 16 + order: 17 head: [] description: Languages supported on Workers, a polyglot platform. --- diff --git a/src/content/docs/workers/testing/local-development.mdx b/src/content/docs/workers/local-development.mdx similarity index 94% rename from src/content/docs/workers/testing/local-development.mdx rename to src/content/docs/workers/local-development.mdx index 00e608b7c07820..026b51bcee3949 100644 --- a/src/content/docs/workers/testing/local-development.mdx +++ b/src/content/docs/workers/local-development.mdx @@ -2,12 +2,12 @@ title: Local development pcx_content_type: concept sidebar: - order: 2 + order: 5 head: [] description: Develop your Workers locally via Wrangler. --- -Cloudflare Workers and most connected resources can be fully developed and tested locally - providing confidence that the applications you build locally will work the same way in production. This allows you to be more efficient and effective by providing a faster feedback loop and removing the need to test against remote resources. Local development runs against the same production runtime used by Cloudflare Workers, [workerd](https://github.com/cloudflare/workerd). +Cloudflare Workers and most connected resources can be fully developed and tested locally - providing confidence that the applications you build locally will work the same way in production. This allows you to be more efficient and effective by providing a faster feedback loop and removing the need to [test against remote resources](#develop-using-remote-resources-and-bindings). Local development runs against the same production runtime used by Cloudflare Workers, [workerd](https://github.com/cloudflare/workerd). In addition to testing Workers locally with [`wrangler dev`](/workers/wrangler/commands/#dev), the use of Miniflare allows you to test other Developer Platform products locally, such as [R2](/r2/), [KV](/kv/), [D1](/d1/), and [Durable Objects](/durable-objects/). @@ -50,7 +50,7 @@ npx wrangler dev | Vectorize | ✅[^2] | ✅ | | Workflows | ✅ | ❌ | -With any bindings that are not supported locally, you will need to use the `--remote` command in wrangler, such as `wrangler dev --remote`. +With any bindings that are not supported locally, you will need to use the [`--remote` command](#develop-using-remote-resources-and-bindings) in wrangler, such as `wrangler dev --remote`. [^1]: Using Workers AI always accesses your Cloudflare account in order to run AI models and will incur usage charges even in local development. @@ -62,7 +62,7 @@ When running `wrangler dev`, resources such as KV, Durable Objects, D1, and R2 w ### Use bindings in Wrangler configuration files -[Wrangler](/workers/wrangler/) will automatically create local versions of bindings found in the [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/). These local resources will not have data in them initially, so you will need to add data manually via Wrangler commands and the [`--local` flag](/workers/testing/local-development/#use---local-flag). +[Wrangler](/workers/wrangler/) will automatically create local versions of bindings found in the [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/). These local resources will not have data in them initially, so you will need to add data manually via Wrangler commands and the [`--local` flag](#use---local-flag). When you run `wrangler dev` Wrangler stores local resources in a `.wrangler/state` folder, which is automatically created. diff --git a/src/content/docs/workers/observability/dev-tools/breakpoints.mdx b/src/content/docs/workers/observability/dev-tools/breakpoints.mdx index e1e6a6f7996d56..0a86c8dd4d3ea3 100644 --- a/src/content/docs/workers/observability/dev-tools/breakpoints.mdx +++ b/src/content/docs/workers/observability/dev-tools/breakpoints.mdx @@ -60,4 +60,4 @@ The `.vscode/launch.json` file only applies to a single workspace. If you prefer ## Related resources -- [Local Development](/workers/testing/local-development/) - Develop your Workers and connected resources locally via Wrangler and [`workerd`](https://github.com/cloudflare/workerd), for a fast, accurate feedback loop. +- [Local Development](/workers/local-development/) - Develop your Workers and connected resources locally via Wrangler and [`workerd`](https://github.com/cloudflare/workerd), for a fast, accurate feedback loop. diff --git a/src/content/docs/workers/observability/dev-tools/cpu-usage.mdx b/src/content/docs/workers/observability/dev-tools/cpu-usage.mdx index cd45571f0b1381..b6aa18ff83acb0 100644 --- a/src/content/docs/workers/observability/dev-tools/cpu-usage.mdx +++ b/src/content/docs/workers/observability/dev-tools/cpu-usage.mdx @@ -17,7 +17,7 @@ for security purposes. However, measuring CPU execution times is possible in loc When using DevTools to monitor CPU usage, it may be difficult to replicate specific behavior you are seeing in production. To mimic production behavior, make sure the requests you send to the local Worker are similar to requests in production. This might mean sending a large volume of requests, making requests -to specific routes, or using production-like data with the [--remote flag](/workers/testing/local-development/#develop-using-remote-resources-and-bindings). +to specific routes, or using production-like data with the [--remote flag](/workers/local-development/#develop-using-remote-resources-and-bindings). ## Taking a profile diff --git a/src/content/docs/workers/observability/dev-tools/index.mdx b/src/content/docs/workers/observability/dev-tools/index.mdx index 5db135d0af7d23..f451ad70b9492a 100644 --- a/src/content/docs/workers/observability/dev-tools/index.mdx +++ b/src/content/docs/workers/observability/dev-tools/index.mdx @@ -31,4 +31,4 @@ DevTools can be used in a variety of situations. For more information, see the d ## Related resources -- [Local development](/workers/testing/local-development/) - Develop your Workers and connected resources locally via Wrangler and workerd, for a fast, accurate feedback loop. +- [Local development](/workers/local-development/) - Develop your Workers and connected resources locally via Wrangler and workerd, for a fast, accurate feedback loop. diff --git a/src/content/docs/workers/observability/dev-tools/memory-usage.mdx b/src/content/docs/workers/observability/dev-tools/memory-usage.mdx index f7cd1dcd6731fc..8ef523e8e5b62c 100644 --- a/src/content/docs/workers/observability/dev-tools/memory-usage.mdx +++ b/src/content/docs/workers/observability/dev-tools/memory-usage.mdx @@ -16,7 +16,7 @@ objects in memory. When using DevTools to profile memory, it may be difficult to replicate specific behavior you are seeing in production. To mimic production behavior, make sure the requests you send to the local Worker are similar to requests in production. This might mean sending a large volume of requests, making requests -to specific routes, or using production-like data with the [--remote flag](/workers/testing/local-development/#develop-using-remote-resources-and-bindings). +to specific routes, or using production-like data with the [--remote flag](/workers/local-development/#develop-using-remote-resources-and-bindings). ## Taking a snapshot diff --git a/src/content/docs/workers/observability/index.mdx b/src/content/docs/workers/observability/index.mdx index 0c039e33a104cd..d68b9994d38921 100644 --- a/src/content/docs/workers/observability/index.mdx +++ b/src/content/docs/workers/observability/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Observability sidebar: - order: 14 + order: 15 group: hideIndex: true --- diff --git a/src/content/docs/workers/observability/logs/real-time-logs.mdx b/src/content/docs/workers/observability/logs/real-time-logs.mdx index 1fb1b361f92f2d..8e02d4b4829374 100644 --- a/src/content/docs/workers/observability/logs/real-time-logs.mdx +++ b/src/content/docs/workers/observability/logs/real-time-logs.mdx @@ -28,7 +28,7 @@ To view real-time logs associated with any deployed Worker using the Cloudflare 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. 2. In Account Home, go to **Workers & Pages**. 3. In **Overview**, select your **Worker**. -4. Select **Logs**. +4. Select **Logs**. 5. In the right-hand navigation bar, select **Live**. @@ -97,7 +97,7 @@ Logs can be persisted, filtered, and analyzed with [Workers Logs](/workers/obser ## Related resources - [Errors and exceptions](/workers/observability/errors/) - Review common Workers errors. -- [Local development and testing](/workers/testing/local-development/) - Develop and test you Workers locally. +- [Local development and testing](/workers/local-development/) - Develop and test you Workers locally. - [Workers Logs](/workers/observability/logs/workers-logs) - Collect, store, filter and analyze logging data emitted from Cloudflare Workers. - [Logpush](/workers/observability/logs/logpush/) - Learn how to push Workers Trace Event Logs to supported destinations. - [Tail Workers](/workers/observability/logs/tail-workers/) - Learn how to attach Tail Workers to transform your logs and send them to HTTP endpoints. diff --git a/src/content/docs/workers/observability/logs/tail-workers.mdx b/src/content/docs/workers/observability/logs/tail-workers.mdx index fceb06aad8c046..60181cfa19c392 100644 --- a/src/content/docs/workers/observability/logs/tail-workers.mdx +++ b/src/content/docs/workers/observability/logs/tail-workers.mdx @@ -105,5 +105,5 @@ The Worker that you add a `tail_consumers` binding to must have a `tail()` handl * [`tail()`](/workers/runtime-apis/handlers/tail/) Handler API docs - Learn how to set up a `tail()` handler in your Worker. - [Errors and exceptions](/workers/observability/errors/) - Review common Workers errors. -- [Local development and testing](/workers/testing/local-development/) - Develop and test you Workers locally. +- [Local development and testing](/workers/local-development/) - Develop and test you Workers locally. - [Source maps and stack traces](/workers/observability/source-maps) - Learn how to enable source maps and generate stack traces for Workers. diff --git a/src/content/docs/workers/platform/index.mdx b/src/content/docs/workers/platform/index.mdx index effff15d9332d1..50de4fc6f988f2 100644 --- a/src/content/docs/workers/platform/index.mdx +++ b/src/content/docs/workers/platform/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Platform sidebar: - order: 17 + order: 18 --- import { DirectoryListing } from "~/components"; diff --git a/src/content/docs/workers/playground.mdx b/src/content/docs/workers/playground.mdx index 89432cff235dcd..b4a4e8a2afd133 100644 --- a/src/content/docs/workers/playground.mdx +++ b/src/content/docs/workers/playground.mdx @@ -2,7 +2,7 @@ pcx_content_type: concept title: Playground sidebar: - order: 6 + order: 7 --- import { LinkButton } from "~/components"; diff --git a/src/content/docs/workers/reference/index.mdx b/src/content/docs/workers/reference/index.mdx index 8cae0bc593d94e..d33d40e1816bbe 100644 --- a/src/content/docs/workers/reference/index.mdx +++ b/src/content/docs/workers/reference/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Reference sidebar: - order: 18 + order: 19 group: hideIndex: true --- diff --git a/src/content/docs/workers/runtime-apis/index.mdx b/src/content/docs/workers/runtime-apis/index.mdx index 99c391ce54a35b..81c7e15ac4fefb 100644 --- a/src/content/docs/workers/runtime-apis/index.mdx +++ b/src/content/docs/workers/runtime-apis/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Runtime APIs sidebar: - order: 9 + order: 10 --- import { DirectoryListing } from "~/components"; diff --git a/src/content/docs/workers/static-assets/compatibility-matrix.mdx b/src/content/docs/workers/static-assets/compatibility-matrix.mdx index f2573c17762fa6..d16ad3d8d7559d 100644 --- a/src/content/docs/workers/static-assets/compatibility-matrix.mdx +++ b/src/content/docs/workers/static-assets/compatibility-matrix.mdx @@ -34,7 +34,7 @@ We plan to bridge the gaps between Workers and Pages and provide ways to migrate | [Gradual Deployments](/workers/configuration/versions-and-deployments/) | ✅ | ❌ | | [Preview URLs](/workers/configuration/previews) | ✅ | ✅ | | [Testing tools](/workers/testing) | ✅ | ✅ | -| [Local Development](/workers/testing/local-development/) | ✅ | ✅ | +| [Local Development](/workers/local-development/) | ✅ | ✅ | | [Remote Development (`--remote`)](/workers/wrangler/commands/) | ✅ | ❌ | | [Quick Editor in Dashboard](https://blog.cloudflare.com/improved-quick-edit) | ✅ | ❌ | | **Static Assets** | | | diff --git a/src/content/docs/workers/static-assets/index.mdx b/src/content/docs/workers/static-assets/index.mdx index 42fb9d2f6e519e..0bd35098d9ba55 100644 --- a/src/content/docs/workers/static-assets/index.mdx +++ b/src/content/docs/workers/static-assets/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Static Assets sidebar: - order: 10 + order: 11 group: badge: Beta head: [] diff --git a/src/content/docs/workers/testing/index.mdx b/src/content/docs/workers/testing/index.mdx index 559425debea07e..af144d0de844c5 100644 --- a/src/content/docs/workers/testing/index.mdx +++ b/src/content/docs/workers/testing/index.mdx @@ -2,7 +2,7 @@ pcx_content_type: navigation title: Testing sidebar: - order: 13 + order: 14 --- import { DirectoryListing, Render } from "~/components"; diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 4d4fe6b7462e5c..7e3b062cfda0ff 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -517,7 +517,7 @@ As of Wrangler v3.2.0, `wrangler dev` is supported by any Linux distributions pr -`wrangler dev` is a way to [locally test](/workers/testing/local-development/) your Worker while developing. With `wrangler dev` running, send HTTP requests to `localhost:8787` and your Worker should execute as expected. You will also see `console.log` messages and exceptions appearing in your terminal. +`wrangler dev` is a way to [locally test](/workers/local-development/) your Worker while developing. With `wrangler dev` running, send HTTP requests to `localhost:8787` and your Worker should execute as expected. You will also see `console.log` messages and exceptions appearing in your terminal. --- diff --git a/src/content/docs/workers/wrangler/configuration.mdx b/src/content/docs/workers/wrangler/configuration.mdx index ca16a75f7f97d6..b7e6ceb386791e 100644 --- a/src/content/docs/workers/wrangler/configuration.mdx +++ b/src/content/docs/workers/wrangler/configuration.mdx @@ -483,7 +483,7 @@ To bind D1 databases to your Worker, assign an array of the below object to the :::note -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 and testing](/workers/testing/local-development/) for more details. +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 and testing](/workers/local-development/) for more details. ::: @@ -680,7 +680,7 @@ To bind KV namespaces to your Worker, assign an array of the below object to the :::note -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 and testing](/workers/testing/local-development/) for more details. +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 and testing](/workers/local-development/) for more details. ::: @@ -805,7 +805,7 @@ To bind R2 buckets to your Worker, assign an array of the below object to the `r :::note -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 and testing](/workers/testing/local-development/) for more details. +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 and testing](/workers/local-development/) for more details. :::