Skip to content

Conversation

LiviaMedeiros
Copy link
Member

Doc-only version of #58850 (runtime deprecation).

The DEP0137 is going to be End-of-Life in the next major release.

I think we should align closing fs.Dir on GC and deprecate it as well. Now that explicit resource management is available, closing dirs properly should become easier for userland.

Note that every time a Dir is closed on GC, it already emits a warning. Alternatively we can make this deprecation runtime right away, I don't have strong opinion on this.

@nodejs-github-bot nodejs-github-bot added deprecations Issues and PRs related to deprecations. doc Issues and PRs related to the documentations. labels Sep 10, 2025
@LiviaMedeiros LiviaMedeiros added the fs Issues and PRs related to the fs subsystem / file system. label Sep 10, 2025
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

The subsystem should be doc:, not fs:

@aduh95 aduh95 added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Sep 10, 2025
@LiviaMedeiros LiviaMedeiros force-pushed the fs-deprecate-dir-close-gc-doconly branch from 4e56891 to 5a293b6 Compare September 10, 2025 11:45
@LiviaMedeiros LiviaMedeiros changed the title fs: deprecate closing fs.Dir on garbage collection doc: deprecate closing fs.Dir on garbage collection Sep 10, 2025
@LiviaMedeiros LiviaMedeiros force-pushed the fs-deprecate-dir-close-gc-doconly branch from 5a293b6 to 96104ef Compare September 10, 2025 11:46
Comment on lines +4128 to +4134
{
await using dir = await opendir('/async/disposable/directory');
} // Closed by dir[Symbol.asyncDispose]()

{
using dir = await opendir('/sync/disposable/directory');
} // Closed by dir[Symbol.dispose]()
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. since this syntax is not supported there

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue Add this label to land a pull request using GitHub Actions. deprecations Issues and PRs related to deprecations. doc Issues and PRs related to the documentations. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants