-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Add Wrangler v4 RC changelog entry #20355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6674519
Add v4 RC changelog entry
penalosa fb2ba5e
Apply suggestions from code review
penalosa 3c5bea5
Copy and language updates
irvinebroque e6ebd21
More updates
irvinebroque dc892c4
Update 2025-02-27-wrangler-v4-rc.mdx
irvinebroque 221cdcb
Apply suggestions from code review
irvinebroque 419f9c6
Add more detail to deprecations
penalosa 33ac357
Update src/content/changelog/workers/2025-02-27-wrangler-v4-rc.mdx
penalosa 1f7e09a
Update src/content/changelog/workers/2025-02-27-wrangler-v4-rc.mdx
penalosa de7e3e8
Add current deprecations to v3 deprecations page
penalosa d231eb5
fix headers
penalosa d51acd0
undo format
penalosa 93b911e
use today date
penalosa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
src/content/changelog/workers/2025-02-27-wrangler-v4-rc.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| title: Use the latest JavaScript features with Wrangler CLI v4.0.0-rc.0 | ||
| description: You can now try out the v4 RC for Wrangler by installing `[email protected]` | ||
| products: | ||
| - workers | ||
| date: 2025-02-27T11:00:00Z | ||
| --- | ||
|
|
||
| import { PackageManagers } from "~/components"; | ||
|
|
||
| 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: | ||
|
|
||
| <PackageManagers pkg="wrangler@v4-rc" /> | ||
|
|
||
| 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. | ||
|
|
||
| #### New JavaScript language features that you can now use with Wrangler v4 | ||
|
|
||
| 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: | ||
|
|
||
| ##### The `using` keyword from Explicit Resource Management | ||
|
|
||
| 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: | ||
|
|
||
| ```js | ||
| function sendEmail(id, message) { | ||
| using user = await env.USER_SERVICE.findUser(id); | ||
| await user.sendEmail(message); | ||
|
|
||
| // user[Symbol.dispose]() is implicitly called at the end of the scope. | ||
| } | ||
| ``` | ||
|
|
||
| ##### Import attributes | ||
|
|
||
| [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: | ||
|
|
||
| ```js | ||
| import data from "./data.json" with { type: "json" }; | ||
| ``` | ||
|
|
||
| #### Other changes | ||
|
|
||
| ##### `--local` is now the default for all CLI commands | ||
|
|
||
| All commands that access resources (for example, `wrangler kv`, `wrangler r2`, `wrangler d1`) now access local datastores by default, ensuring consistent behavior. | ||
|
|
||
| ##### Clearer policy for the minimum required version of Node.js required to run Wrangler | ||
|
|
||
| Moving forward, the [active, maintenance, and current versions of Node.js](https://nodejs.org/en/about/previous-releases) will be officially supported by Wrangler. This means the minimum officially supported version of Node.js you must have installed for Wrangler v4 will be 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. | ||
|
|
||
| ##### Features previously deprecated in Wrangler v3 are now removed in Wrangler v4 | ||
|
|
||
| All previously deprecated features in [Wrangler v2](https://developers.cloudflare.com/workers/wrangler/deprecations/#wrangler-v2) and in [Wrangler v3](https://developers.cloudflare.com/workers/wrangler/deprecations/#wrangler-v3) have now been removed. Additionally, the following features that were deprecated during the Wrangler v3 release lifecycle have been removed: | ||
penalosa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - Legacy Assets (using `wrangler dev/deploy --legacy-assets` or the `legacy_assets` config file property). Instead, we recommend you [migrate to Workers assets](https://developers.cloudflare.com/workers/static-assets/). | ||
| - Legacy Node.js compatibility (using `wrangler dev/deploy --node-compat` or the `node_compat` config file property). Instead, use the [`nodejs_compat` compatibility flag](https://developers.cloudflare.com/workers/runtime-apis/nodejs). This includes the functionality from legacy `node_compat` polyfills and natively implemented Node.js APIs. | ||
| - `wrangler version`. Instead, use `wrangler --version` to check the current version of Wrangler. | ||
| - `getBindingsProxy()` (via `import { getBindingsProxy } from "wrangler"`). Instead, use the [`getPlatformProxy()` API](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy), which takes exactly the same arguments. | ||
| - `usage_model`. This no longer has any effect, after the [rollout of Workers Standard Pricing](https://blog.cloudflare.com/workers-pricing-scale-to-zero/). | ||
|
|
||
| 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). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.