You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/changelog/workers/2025-03-13-wrangler-v4.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ date: 2025-02-28T22:30:00Z
8
8
9
9
import { PackageManagers } from"~/components";
10
10
11
-
We've released the next major version of [Wrangler](/workers/wrangler/), the CLI for Cloudflare Workers — `[email protected]`.
11
+
We've released the next major version of [Wrangler](/workers/wrangler/), the CLI for Cloudflare Workers — `[email protected]`. Wrangler v4 is a major release focused on updates to underlying systems and dependencies, along with improvements to keep Wrangler commands consistent and clear.
12
12
13
13
You can run the following command to install it in your projects:
Copy file name to clipboardExpand all lines: src/content/docs/pages/functions/typescript.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ If you already have a `tsconfig.json` at the root of your project, you may wish
42
42
}
43
43
```
44
44
45
-
Pages Functions can be typed using the `PagesFunction` type. This type accepts an `Env` parameter. The `Env` type should also have been generated by `wrangler types` and can be found at the top of `types.d.ts`.
45
+
Pages Functions can be typed using the `PagesFunction` type. This type accepts an `Env` parameter. The `Env` type should have been generated by `wrangler types` and can be found at the top of `types.d.ts`.
46
46
47
47
Alternatively, you can define the `Env` type manually. For example:
Copy file name to clipboardExpand all lines: src/content/docs/workers/languages/typescript/index.mdx
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ This means the correct types for your Worker depend on:
28
28
3. Your Worker's bindings, which are accessed on the `env` object.
29
29
4. Any [module rules](/workers/wrangler/configuration/#inheritable-keys) you have specified in your Wrangler configuration file under `rules`.
30
30
31
-
For example, the runtime will onlly allow you to use the [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage) class if you have `compatibility_flags = ["nodejs_als"]` in your [Wrangler configuration file](/workers/wrangler/configuration/). This should be reflected in the type definitions.
31
+
For example, the runtime will only allow you to use the [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage) class if you have `compatibility_flags = ["nodejs_als"]` in your [Wrangler configuration file](/workers/wrangler/configuration/). This should be reflected in the type definitions.
32
32
33
33
To ensure that your type definitions always match your Worker's configuration, you can dynamically generate types by running:
34
34
@@ -58,7 +58,13 @@ To ensure that your types are always up-to-date, make sure to run `wrangler type
58
58
Migrating from `@cloudflare/workers-types` to `wrangler types`
59
59
</h3>
60
60
61
-
We recommend you use `wrangler types` to generate runtime types, rather than using the `@cloudflare/workers-types` package, as it generates types based on your Worker's [compatibility date](https://github.com/cloudflare/workerd/tree/main/npm/workers-types#compatibility-dates) and `compatibility flags`, ensuring that types match the exact runtime APIs made available to your Worker. Note that there are no plans to stop publishing the `@cloudflare/workers-types` package.
61
+
We recommend you use `wrangler types` to generate runtime types, rather than using the `@cloudflare/workers-types` package, as it generates types based on your Worker's [compatibility date](https://github.com/cloudflare/workerd/tree/main/npm/workers-types#compatibility-dates) and `compatibility flags`, ensuring that types match the exact runtime APIs made available to your Worker.
62
+
63
+
:::note
64
+
65
+
There are no plans to stop publishing the `@cloudflare/workers-types` package, which will still be the recommended way to type libraries and shared packages in the workers environment.
66
+
67
+
:::
62
68
63
69
#### 1. Uninstall `@cloudflare/workers-types`
64
70
@@ -157,4 +163,3 @@ We recommend you commit your generated types file for use in CI. Alternatively,
Copy file name to clipboardExpand all lines: src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ sidebar:
7
7
8
8
Wrangler v4 is a major release focused on updates to underlying systems and dependencies, along with improvements to keep Wrangler commands consistent and clear. Unlike previous major versions of Wrangler, which were [foundational rewrites](https://blog.cloudflare.com/wrangler-v2-beta/) and [rearchitectures](https://blog.cloudflare.com/wrangler3/) — Version 4 of Wrangler includes a much smaller set of changes. If you use Wrangler today, your workflow is very unlikely to change.
9
9
10
-
While many users should expect a no-op upgrade, the following sections outline significant changes and steps for migrating where necessary.
10
+
While many users should expect a no-op upgrade, the following sections outline the more significant changes and steps for migrating where necessary.
11
11
12
12
### Summary of changes
13
13
@@ -16,7 +16,7 @@ While many users should expect a no-op upgrade, the following sections outline s
16
16
17
17
-**esbuild Version Upgrade**: Wrangler v4 uses [esbuild](https://esbuild.github.io/) to bundle Worker code before deploying it, and was previously pinned to esbuild v0.17.19. Wrangler v4 uses esbuild v0.24, which could impact dynamic wildcard imports.
18
18
19
-
-**Commands default to local mode**: All commands now run in local mode by default, requiring a `--remote` flag for API queries,
19
+
-**Commands default to local mode**: All commands that can run in either local or remote mode now default to local, requiring a `--remote` flag for API queries.
20
20
21
21
-**Deprecated commands and configurations removed:** Legacy commands, flags, and configurations have been removed.
22
22
@@ -45,10 +45,10 @@ All commands now run in **local mode by default.** Wrangler has many commands fo
45
45
46
46
For example:
47
47
48
-
-**Previous Behavior (Wrangler v3):**`wrangler kv list` queried remotely by default.
Those using `wrangler kv` and/or `wrangler r2` commands to query or write to their data store will need to add the `--remote` flag in order to replicate previous behavior.
51
+
Those using `wrangler kv key` and/or `wrangler r2 object` commands to query or write to their data store will need to add the `--remote` flag in order to replicate previous behavior.
52
52
53
53
### Deprecated Commands and Configurations Removed
0 commit comments