Skip to content

Commit e6ebd21

Browse files
authored
More updates
1 parent 3c5bea5 commit e6ebd21

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

src/content/changelog/workers/2025-02-27-wrangler-v4-rc.mdx

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,55 @@ date: 2025-02-27T11:00:00Z
88

99
import { PackageManagers } from "~/components";
1010

11-
We've released a release candidate of the next major version of [Wrangler](/workers/wrangler/), the CLI for Cloudflare Workers — `[email protected]`. You can run the following command to install it and be one of the first to try it out:
11+
We've released a release candidate of the next major version of [Wrangler](/workers/wrangler/), the CLI for Cloudflare Workers — `[email protected]`.
12+
13+
You can run the following command to install it and be one of the first to try it out:
1214

1315
<PackageManagers pkg="wrangler@v4-rc" />
1416

15-
Unlike previous major versions of Wrangler, which were foundational rewrites and rearchitectures — Version 4 of Wrangler includes a much smaller set of changes. If you use Wrangler today, your workflow is very unlikely to change. Before we release Wrangler v4 and advance past the release candidate stage, we'll share a detailed migration guide in the Workers developer docs. But for the vast majority of cases, you won't need to do anything to migrate — things will just work as they do today.
17+
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. Before we release Wrangler v4 and advance past the release candidate stage, we'll share a detailed migration guide in the Workers developer docs. But for the vast majority of cases, you won't need to do anything to migrate — things will just work as they do today. We are sharing this release candidate in advance of the official release of v4, so that you can try it out early and share feedback.
18+
19+
#### New JavaScript language features that you can now use with Wrangler v4
20+
21+
Version 4 of Wrangler updates the version of [esbuild](https://esbuild.github.io/) that Wrangler uses internally, allowing you to use modern JavaScript language features, including:
22+
23+
##### The `using` keyword from Explicit Resource Management
24+
25+
The [`using` keyword from the Explicit Resource Management standard](/workers/runtime-apis/rpc/lifecycle/#explicit-resource-management), making it easier to work with the [JavaScript-native RPC system built into Workers](/workers/runtime-apis/rpc/). This means that when you obtain a stub, you can ensure that it is automatically disposed when you exit scope it was created in:
26+
27+
```js
28+
function sendEmail(id, message) {
29+
using user = await env.USER_SERVICE.findUser(id);
30+
await user.sendEmail(message);
31+
32+
// user[Symbol.dispose]() is implicitly called at the end of the scope.
33+
}
34+
```
35+
36+
##### Import attributes
37+
38+
[Import attributes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with) allow you to denote the type or other attributes of the module that your code imports. For example, you can import a JSON module, using the following syntax:
39+
40+
```js
41+
import data from "./data.json" with { type: "json" };
42+
```
43+
44+
#### Other changes
45+
46+
##### `--local` is now the default for all CLI commands
47+
48+
All commands that access resources (for example, `wrangler kv`, `wrangler r2`, `wrangler d1`) now access local datastores by default, ensuring consistent behavior, intended to reduce confusion
1649

17-
Most notably, version 4 of Wrangler updates the version of [esbuild](https://esbuild.github.io/) that Wrangler uses internally, allowing you to use modern JavaScript language features, including:
50+
##### Clearer policy for the minimum required version of Node.js required to run Wrangler
1851

19-
- the [`using` keyword from the Explicit Resourece Management standard](https://github.com/tc39/proposal-explicit-resource-management), making it easier to work with the [JavaScript-native RPC system built into Workers](/workers/runtime-apis/rpc/).
20-
- import attributes
52+
Moving forward, the [active, maintenance, and current versions of Node.js](https://nodejs.org/en/about/previous-releases) will be officially supported. This means the minimum officially supported version of Node.js for Wrangler v4 will e Node.js v18 or later. This policy mirrors how many other packages and CLIs support older versions of Node.js, and ensures that as long as you are using a version of Node.js that the Node.js project itself supports, this will be supported by Wrangler as well.
2153

22-
Version 4 also introduces the following changes:
54+
##### Features previously deprecated in Wrangler v3 are now removed in Wrangler v4
2355

24-
- **`--local` is now the default for all CLI commands**
25-
All commands that access resources (for example, `wrangler kv`, `wrangler r2`, `wrangler d1`) now access local datastores by default, ensuring consistent behavior, intended to reduce confusion
56+
The following features, previously deprecated over one year ago in Wrangler v3, now can no longer be used in Wrangler v4:
2657

27-
- **Clearer policy for the minimum required version of Node.js required to run Wrangler**
28-
Moving forward, the [active, maintenance, and current versions of Node.js](https://nodejs.org/en/about/previous-releases) will be officially supported. This means the minimum officially supported version of Node.js for Wrangler v4 will e Node.js v18 or later. This policy mirrors how many other packages and CLIs support older versions of Node.js, and ensures that as long as you are using a version of Node.js that the Node.js project itself supports, this will be supported by Wrangler as well.
58+
(think these need a — instead do x...)
2959

30-
- **Features previously deprecated in Wrangler v3 are now removed in Wrangler v4**
31-
All deprecated features will be removed from Wrangler, including
3260
- Arguments:
3361
- `wrangler dev/deploy --legacy-assets`
3462
- `wrangler dev/deploy --format`
@@ -53,4 +81,4 @@ Version 4 also introduces the following changes:
5381
- `kv-namespaces`
5482
- `legacy_assets`
5583

56-
We'd love your feedback, etc.
84+
We'd love your feedback! If you find a bug or hit a roadblock when upgrading to Wrangler v4, [open an issue on the `cloudflare/workers-sdk` repository on GitHub](https://github.com/cloudflare/workers-sdk/issues/new?template=bug-template.yaml).

0 commit comments

Comments
 (0)