Skip to content
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

add async-explicit-resource-management docs #2760

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/plugin-syntax-explicit-resource-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ sidebar_label: syntax-explicit-resource-management
>
> This plugin only enables Babel to parse this syntax. Babel does not support transforming this syntax

<details>
<summary>History</summary>

| Version | Changes |
| --- | --- |
| v7.22.0 | Supports `await using` |
</details>

This plugin enables Babel to parse using declarations:

```js title="JavaScript"
using handler = await read();
await using handler = await read();
```

## Installation
Expand Down Expand Up @@ -43,3 +52,6 @@ require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-explicit-resource-management"]
});
```

## Reference
- [Proposal: ECMAScript Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)