Skip to content
Merged
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
8 changes: 1 addition & 7 deletions src/content/docs/workers/runtime-apis/rpc/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ function sendEmail(id, message) {

### How to use the `using` declaration in your Worker

Because it has not yet landed in V8, the `using` keyword is not yet available directly in the Workers runtime. To use it in your code, you must use a prerelease version of the [Wrangler CLI](/workers/wrangler/) to run and deploy your Worker:

```sh
npx wrangler@using-keyword-experimental dev
```

This version of Wrangler will transpile `using` into direct calls to `Symbol.dispose()`, before running your code or deploying it to Cloudflare.
[Wrangler](/workers/wrangler/) v4+ supports the `using` keyword natively. If you are on an earlier version of Wrangler, you can alternatively call dispose of resources manually.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Wrangler](/workers/wrangler/) v4+ supports the `using` keyword natively. If you are on an earlier version of Wrangler, you can alternatively call dispose of resources manually.
[Wrangler](/workers/wrangler/) v4+ supports the `using` keyword natively. If you are using an earlier version of Wrangler, you will need to manually dispose of resources instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GregBrimble Sorry I didn't realize you had auto-merge on. I think you have a typo here. Can you confirm my suggestion here and I'll make another PR to fix it?


The following code:

Expand Down