-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: enable explicit resource management for JavaScript #28119
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
feat: enable explicit resource management for JavaScript #28119
Conversation
Need to land denoland/deno_ast#290 first and add a test that uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We can't land this - V8 does not call the dispose method with the correct receiver when |
Just tested this branch and found another bug where a top-level console.log("before await using");
await using _ = {
[Symbol.dispose]() {
console.log("dispose");
},
};
console.log("after await using"); |
@0f-0b Thanks, filed https://issues.chromium.org/issues/396661138. |
|
Great news, v8 official support for explicit resource management landed with chrome 134 🎉 Explicit resource management (async) Explicit resource management (sync) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs the deno_ast
upgrade
Should have renamed this one as |
This commit enabled [explicit resource management] (https://github.com/tc39/proposal-explicit-resource-management) proposal for JavaScript code. This is done by upgrading `deno_ast` to a version that no longer transpiles TS files with `using` keyword, and instead enables a V8 flag that provides native support. Closes #20821 --------- Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit enabled [explicit resource management]
(https://github.com/tc39/proposal-explicit-resource-management)
proposal for JavaScript code.
This is done by upgrading
deno_ast
to a version that no longertranspiles TS files with
using
keyword, and instead enablesa V8 flag that provides native support.
Closes #20821