Visitar URL original
Explicit resource management · Issue #366 · web-platform-dx/developer-signals · GitHub
Skip to content

Explicit resource management #366

Open

Description

@github-actions

This GitHub issue is for collecting web developer signals for Explicit resource management.

The using and await using declarations and the dispose and asyncDispose symbols manage the lifecycle of resources such as file handles and streams. The DisposableStack and AsyncDisposableStack objects can group, dispose, and coordinate dependencies between multiple disposable resources.

Browser support

chromeavailable edgeavailable firefoxavailable safariunavailable
  • Chrome 134 (Mar 4, 2025)
  • Chrome Android 134 (Mar 4, 2025)
  • Edge 134 (Mar 6, 2025)
  • Firefox 141 (Jul 22, 2025)
  • Firefox for Android 141 (Jul 22, 2025)
  • Safari: not supported
  • Safari on iOS: not supported

Give us feedback

If you're pressed for time, but you want this feature to be available in all browsers, please give this issue a thumbs up 👍 reaction.

However, a much better guide for us is to know how you'd use this feature, and what you're having to do in the meantime. This helps us judge the priority versus other features.

Copy the template below in a comment, and add the details that matter to you.

## What I want to do with this feature

<!-- Add your specific use-cases, even if they seem obvious to you. -->

## What I'm having to do in the meantime

<!--
Are you having to use another feature instead, a polyfill, or is it blocking you completely?
Why are the alternatives worse than using this feature?
-->

All comments are expected to adhere to the Code of Conduct.

Learn more

You can learn more about this feature here:

Activity

  1. akaltar commented on Dec 13, 2025

    @akaltar

    What I want to do with this feature

    Lots of resources on the web end up being stateful, from the DOM itself, to WebAudio components and WebGL components. It'd make managing them much more developer-friendly

    What I'm having to do in the meantime

    I'm manually managing this in different ways depending on the context, but it's more error-prone, and more diverse across different frameworks and systems. It's hard to always make sure to clean things up, it's very difficult to know what even is stateful. I think this proposal could pave the way to a much more robust web

  2. 1valdis commented on Jan 20, 2026

    @1valdis

    What I want to do with this feature

    As part of development for the Satellite.js library, I'm creating a WebAssembly option to propagate orbits of satellites, instead of just pure JS one. For this I make use of unmanaged memory in C++. I expose the results of propagation as views into WASM memory. To use orbit propagation in WASM, user needs to instantiate a class; in its constructor the class allocates unmanaged memory to work with it on hot path later. This memory needs to be freed when the user is done. In the future major version of the library, as part of the WASM API, the objects that work with unmanaged memory will use Explicit Resource Management to clean up the unmanaged memory after themselves when they leave the scope, and users will be encouraged to declare such objects with using.

    What I'm having to do in the meantime

    As an alternative, I expose the explicit .dispose() method that the users will have to call in try...finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions