Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These preview URLs are named after your branch and are posted as a comment to ea

Each comment includes **two preview URLs** as shown above:

* **Commit Preview URL**: Unique to the specific version/commit (e.g., `<version-prefix>-<worker-name>.<subdomain>.workers.dev`)
* **Commit Preview URL**: Unique to the specific version/commit (e.g., `<version-prefix>-<worker-name>.<subdomain>.workers.dev`)
* **Branch Preview URL**: A stable alias based on the branch name (e.g., `<branch-name>-<worker-name>.<subdomain>.workers.dev`)

## How it works
Expand All @@ -31,7 +31,7 @@ When you create a pull request:

## Custom alias name

You can also assign a custom preview alias using the [Wrangler CLI](/workers/wrangler/), by passing the `--preview-alias` flag when [uploading a version](/workers/wrangler/commands/#upload) of your Worker:
You can also assign a custom preview alias using the [Wrangler CLI](/workers/wrangler/), by passing the `--preview-alias` flag when [uploading a version](/workers/wrangler/commands/#versions-upload) of your Worker:

```bash
wrangler versions upload --preview-alias staging
Expand All @@ -41,5 +41,5 @@ wrangler versions upload --preview-alias staging

* Only available on the **workers.dev** subdomain (custom domains not yet supported)
* Requires **Wrangler v4.21.0+**
* Preview URLs are not generated for Workers that use [Durable Objects](/durable-objects/)
* Preview URLs are not generated for Workers that use [Durable Objects](/durable-objects/)
* Not yet supported for [Workers for Platforms](/cloudflare-for-platforms/workers-for-platforms/)
4 changes: 2 additions & 2 deletions src/content/docs/workers/configuration/previews.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Every time you create a new [version](/workers/configuration/versions-and-deploy
New versions of a Worker are created when you run:

- [`wrangler deploy`](/workers/wrangler/commands/#deploy)
- [`wrangler versions upload`](/workers/wrangler/commands/#upload)
- [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload)
- Or when you make edits via the Cloudflare dashboard

If Preview URLs have been enabled, they are public and available immediately after version creation.
Expand All @@ -53,7 +53,7 @@ Minimum required Wrangler version: 3.74.0. Check your version by running `wrangl

#### View versioned preview URLs using Wrangler

The [`wrangler versions upload`](/workers/wrangler/commands/#upload) command uploads a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker and returns a preview URL for each version uploaded.
The [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload) command uploads a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker and returns a preview URL for each version uploaded.

#### View versioned preview URLs on the Workers dashboard

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/workers/configuration/secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Secrets can be added through [`wrangler secret put`](/workers/wrangler/commands/
npx wrangler secret put <KEY>
```

If using [gradual deployments](/workers/configuration/versions-and-deployments/gradual-deployments/), instead use the `wrangler versions secret put` command. This will only create a new version of the Worker, that can then be deploying using [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2).
If using [gradual deployments](/workers/configuration/versions-and-deployments/gradual-deployments/), instead use the `wrangler versions secret put` command. This will only create a new version of the Worker, that can then be deploying using [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy).

:::note
Wrangler versions before 3.73.0 require you to specify a `--x-versions` flag.
Expand Down Expand Up @@ -88,7 +88,7 @@ Secrets can be deleted through [`wrangler secret delete`](/workers/wrangler/comm
npx wrangler secret delete <KEY>
```

If using [gradual deployments](/workers/configuration/versions-and-deployments/gradual-deployments/), instead use the `wrangler versions secret delete` command. This will only create a new version of the Worker, that can then be deploying using [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2).
If using [gradual deployments](/workers/configuration/versions-and-deployments/gradual-deployments/), instead use the `wrangler versions secret delete` command. This will only create a new version of the Worker, that can then be deploying using [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy).

```sh
npx wrangler versions secret delete <KEY>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Answer `yes` or `no` to using TypeScript. Answer `yes` to deploying your applica

#### 2. Create a new version of the Worker

To create a new version of the Worker, edit the Worker code by changing the `Response` content to your desired text and upload the Worker by using the [`wrangler versions upload`](/workers/wrangler/commands/#upload) command.
To create a new version of the Worker, edit the Worker code by changing the `Response` content to your desired text and upload the Worker by using the [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload) command.

```sh
npx wrangler versions upload
Expand All @@ -56,7 +56,7 @@ This will create a new version of the Worker that is not automatically deployed.

#### 3. Create a new deployment

Use the [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2) command to
Use the [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy) command to
create a new deployment that splits traffic between two versions of the Worker. Follow the interactive prompts to create a deployment with the versions uploaded in [step #1](/workers/configuration/versions-and-deployments/gradual-deployments/#1-create-and-deploy-a-new-worker) and [step #2](/workers/configuration/versions-and-deployments/gradual-deployments/#2-create-a-new-version-of-the-worker). Select your desired percentages for each version.

```sh
Expand Down Expand Up @@ -190,7 +190,7 @@ In this example, your deployment is initially configured to route all traffic to
| :----------------------------------: | :--------: |
| db7cd8d3-4425-4fe7-8c81-01bf963b6067 | 100% |

Create a new deployment using [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2) and specify 0% for the new version whilst keeping the previous version at 100%.
Create a new deployment using [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy) and specify 0% for the new version whilst keeping the previous version at 100%.

| Version ID | Percentage |
| :----------------------------------: | :--------: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Wrangler versions before 3.73.0 require you to specify a `--x-versions` flag.

:::

To create a new version of your Worker that is not deployed immediately, use the [`wrangler versions upload`](/workers/wrangler/commands/#upload) command or create a new version via the Cloudflare dashboard using the **Save** button. You can find the **Save** option under the down arrow beside the "Deploy" button.
To create a new version of your Worker that is not deployed immediately, use the [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload) command or create a new version via the Cloudflare dashboard using the **Save** button. You can find the **Save** option under the down arrow beside the "Deploy" button.

Versions created in this way can then be deployed all at once or gradually deployed using the [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2) command or via the Cloudflare dashboard under the **Deployments** tab.
Versions created in this way can then be deployed all at once or gradually deployed using the [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy) command or via the Cloudflare dashboard under the **Deployments** tab.

:::note
When using [Wrangler](/workers/wrangler/), changes made to a Worker's triggers [routes, domains](/workers/configuration/routing/) or [cron triggers](/workers/configuration/cron-triggers/) need to be applied with the command [`wrangler triggers deploy`](/workers/wrangler/commands/#triggers).
Expand Down Expand Up @@ -94,11 +94,11 @@ To view your deployments in the Cloudflare dashboard:

### First upload

You must use [C3](/workers/get-started/guide/#1-create-a-new-worker-project) or [`wrangler deploy`](/workers/wrangler/commands/#deploy) the first time you create a new Workers project. Using [`wrangler versions upload`](/workers/wrangler/commands/#upload) the first time you upload a Worker will fail.
You must use [C3](/workers/get-started/guide/#1-create-a-new-worker-project) or [`wrangler deploy`](/workers/wrangler/commands/#deploy) the first time you create a new Workers project. Using [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload) the first time you upload a Worker will fail.

### Service worker syntax

Service worker syntax is not supported for versions that are uploaded through [`wrangler versions upload`](/workers/wrangler/commands/#upload). You must use ES modules format.
Service worker syntax is not supported for versions that are uploaded through [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload). You must use ES modules format.

Refer to [Migrate from Service Workers to ES modules](/workers/reference/migrate-to-module-workers/#advantages-of-migrating) to learn how to migrate your Workers from the service worker format to the ES modules format.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/observability/source-maps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ upload_source_maps = true

</WranglerConfig>

When `upload_source_maps` is set to `true`, Wrangler will automatically generate and upload source map files when you run [`wrangler deploy`](/workers/wrangler/commands/#deploy) or [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2).
When `upload_source_maps` is set to `true`, Wrangler will automatically generate and upload source map files when you run [`wrangler deploy`](/workers/wrangler/commands/#deploy) or [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy).
​​

:::note
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1271,8 +1271,8 @@ If you are using `CLOUDFLARE_API_TOKEN` instead of OAuth, and you can logout by

<DashButton url="/?to=/:account/api-tokens" />

3. Select the three-dot menu on your Wrangler token.
4. Select **Delete**.
2. Select the three-dot menu on your Wrangler token.
3. Select **Delete**.

---

Expand Down Expand Up @@ -1387,7 +1387,7 @@ The minimum required wrangler version to use these commands is 3.40.0. For versi

### `deploy`

Apply changes to triggers ([Routes or domains](/workers/configuration/routing/) and [Cron Triggers](/workers/configuration/cron-triggers/)) when using [`wrangler versions upload`](/workers/wrangler/commands/#upload).
Apply changes to triggers ([Routes or domains](/workers/configuration/routing/) and [Cron Triggers](/workers/configuration/cron-triggers/)) when using [`wrangler versions upload`](/workers/wrangler/commands/#versions-upload).

```txt
wrangler triggers deploy [OPTIONS]
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/wrangler/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ In many cases, this allows you to work provide just enough of an API to make a d
[Source maps](/workers/observability/source-maps/) translate compiled and minified code back to the original code that you wrote. Source maps are combined with the stack trace returned by the JavaScript runtime to present you with a stack trace.

- `upload_source_maps` <Type text="boolean" />
- When `upload_source_maps` is set to `true`, Wrangler will automatically generate and upload source map files when you run [`wrangler deploy`](/workers/wrangler/commands/#deploy) or [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2).
- When `upload_source_maps` is set to `true`, Wrangler will automatically generate and upload source map files when you run [`wrangler deploy`](/workers/wrangler/commands/#deploy) or [`wrangler versions deploy`](/workers/wrangler/commands/#versions-deploy).

Example:

Expand Down
Loading