Skip to content

fs, stream: add initial Symbol.dispose and Symbol.asyncDispose support - #48518

Merged
nodejs-github-bot merged 10 commits into
nodejs:mainfrom
MoLow:symbol-dispose
Jun 25, 2023
Merged

fs, stream: add initial Symbol.dispose and Symbol.asyncDispose support#48518
nodejs-github-bot merged 10 commits into
nodejs:mainfrom
MoLow:symbol-dispose

Conversation

@MoLow

Copy link
Copy Markdown
Member

Both TypeScript and Bable already support using (explicit resource management proposal),
adding this to node will be convenient

Co-authored-by: Benjamin Gruenbaum benjamingr@gmail.com

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jun 22, 2023
Comment threaddoc/api/fs.md Outdated
Comment threaddoc/api/stream.md Outdated
Comment threaddoc/api/fs.md Outdated
Comment threadlib/internal/streams/readable.js Outdated
Comment threaddoc/api/stream.md Outdated
Comment threadlib/internal/process/pre_execution.js Outdated
Comment threadlib/internal/process/pre_execution.js Outdated
Comment threadlib/internal/process/pre_execution.js Outdated

@ronagronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added some comments.

@ronagronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Q: Does await using fallback to Symbol.dispose if the async version doesn't exist?

Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
@MoLow

Copy link
Copy Markdown
MemberAuthor

Q: Does await using fallback to Symbol.dispose if the async version doesn't exist?

according to this it does:
https://github.com/tc39/proposal-explicit-resource-management#await-using-declarations-with-explicit-local-bindings

@ronagronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Implement for stream.Writable as well?

Comment threadlib/internal/process/pre_execution.js Outdated
Comment threadlib/internal/per_context/primordials.js
Comment threadlib/internal/streams/readable.js Outdated
MoLowand others added 3 commits June 22, 2023 12:51
Co-authored-by: Robert Nagy <ronagy@icloud.com>
Co-authored-by: Robert Nagy <ronagy@icloud.com>
@benjamingr

Copy link
Copy Markdown
Member

@ronag

Implement for stream.Writable as well?

Yeah, and for a lot of other things (http.Server etc), the idea here was to add the symbols and one example so we can distribute the work like we did last year with iterator-helpers.

Comment threadlib/internal/streams/readable.js Outdated
Comment threadlib/internal/streams/readable.js Outdated
benjamingrand others added 2 commits June 22, 2023 13:37
Co-authored-by: Robert Nagy <ronagy@icloud.com>
Co-authored-by: Robert Nagy <ronagy@icloud.com>
nodejs-github-bot pushed a commit that referenced this pull request Jul 12, 2023
Followup to #48518; fixes#48699
PR-URL: #48703
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
juanarbol pushed a commit that referenced this pull request Jul 13, 2023
Followup to #48518; fixes#48699
PR-URL: #48703
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs#48518
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Notable changes:
crypto:
* update root certificates to NSS 3.90 (Node.js GitHub Bot) nodejs#48416
doc:
* add vmoroz to collaborators (Vladimir Morozov) nodejs#48527
* add kvakil to collaborators (Keyhan Vakil) nodejs#48449
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) nodejs#48518
test_runner:
* (SEMVER-MINOR) add initial draft for fakeTimers (Erick Wendel) nodejs#47775
tls:
* (SEMVER-MINOR) add ALPNCallback server option for dynamic ALPN negotiation (Tim Perry) nodejs#45190
PR-URL: nodejs#48643
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Followup to nodejs#48518; fixesnodejs#48699
PR-URL: nodejs#48703
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs#48518
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Notable changes:
crypto:
* update root certificates to NSS 3.90 (Node.js GitHub Bot) nodejs#48416
doc:
* add vmoroz to collaborators (Vladimir Morozov) nodejs#48527
* add kvakil to collaborators (Keyhan Vakil) nodejs#48449
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) nodejs#48518
test_runner:
* (SEMVER-MINOR) add initial draft for fakeTimers (Erick Wendel) nodejs#47775
tls:
* (SEMVER-MINOR) add ALPNCallback server option for dynamic ALPN negotiation (Tim Perry) nodejs#45190
PR-URL: nodejs#48643
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Followup to nodejs#48518; fixesnodejs#48699
PR-URL: nodejs#48703
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@ruyadorno

Copy link
Copy Markdown
Member

This commit does not land cleanly on v18.x-staging and will need manual backport in case we want it in v18.

@atlowChemiatlowChemi mentioned this pull request Sep 11, 2023
atlowChemi pushed a commit to atlowChemi/node that referenced this pull request Sep 11, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs#48518
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
ruyadorno pushed a commit that referenced this pull request Sep 11, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #48518
Backport-PR-URL: #49598
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
ruyadorno added a commit that referenced this pull request Sep 11, 2023
Notable changes:
build:
* sync libuv header change (Jiawen Geng) #48078
crypto:
* update root certificates to NSS 3.90 (Node.js GitHub Bot) #48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) #48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) #48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) #48078
doc:
* add vmoroz to collaborators (Vladimir Morozov) #48527
* add kvakil to collaborators (Keyhan Vakil) #48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) #43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) #48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) #48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) #45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) #47885
PR-URL: #49220
ruyadorno added a commit that referenced this pull request Sep 12, 2023
Notable changes:
build:
* sync libuv header change (Jiawen Geng) #48078
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) #49341
* update root certificates to NSS 3.90 (Node.js GitHub Bot) #48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) #48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) #48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) #48078
doc:
* add atlowChemi to collaborators (atlowChemi) #48757
* add vmoroz to collaborators (Vladimir Morozov) #48527
* add kvakil to collaborators (Keyhan Vakil) #48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) #43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) #48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) #48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) #45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) #47885
PR-URL: #49220
ruyadorno pushed a commit that referenced this pull request Sep 13, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #48518
Backport-PR-URL: #49598
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
ruyadorno added a commit that referenced this pull request Sep 13, 2023
Notable changes:
build:
* sync libuv header change (Jiawen Geng) #48078
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) #49341
* update root certificates to NSS 3.90 (Node.js GitHub Bot) #48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) #48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) #48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) #48078
doc:
* add atlowChemi to collaborators (atlowChemi) #48757
* add vmoroz to collaborators (Vladimir Morozov) #48527
* add kvakil to collaborators (Keyhan Vakil) #48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) #43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) #48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) #48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) #45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) #47885
PR-URL: #49220
ruyadorno pushed a commit that referenced this pull request Sep 17, 2023
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #48518
Backport-PR-URL: #49598
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
ruyadorno added a commit that referenced this pull request Sep 17, 2023
Notable changes:
build:
* sync libuv header change (Jiawen Geng) #48078
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) #49341
* update root certificates to NSS 3.90 (Node.js GitHub Bot) #48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) #48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) #48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) #48078
doc:
* add atlowChemi to collaborators (atlowChemi) #48757
* add vmoroz to collaborators (Vladimir Morozov) #48527
* add kvakil to collaborators (Keyhan Vakil) #48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) #43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) #48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) #48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) #45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) #47885
PR-URL: #49220
ruyadorno added a commit that referenced this pull request Sep 18, 2023
Notable changes:
build:
* sync libuv header change (Jiawen Geng) #48078
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) #49341
* update root certificates to NSS 3.90 (Node.js GitHub Bot) #48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) #48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) #48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) #48078
doc:
* add atlowChemi to collaborators (atlowChemi) #48757
* add vmoroz to collaborators (Vladimir Morozov) #48527
* add kvakil to collaborators (Keyhan Vakil) #48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) #43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) #48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) #48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) #45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) #47885
PR-URL: #49220
targos pushed a commit that referenced this pull request Nov 27, 2023
Followup to #48518; fixes#48699
PR-URL: #48703
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.notable-changePRs with changes that should be highlighted in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

13 participants

@MoLow@nodejs-github-bot@benjamingr@ruyadorno@ljharb@mcollina@mscdex@anonrig@zloirock@ronag@rbuckton@ErickWendel@aduh95