-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
fs: add fs/promises alias module #31553
Conversation
1db0897
to
aff5f29
Compare
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
The concern applies because fs had no “children” before, and things like resolve identify core modules by the full name, not just the first segment. I expect CIGTM to fail with this change. |
aff5f29
to
8890701
Compare
@ljharb it seems resolve already has an entry for it, and the The namespacing concern is from adding new things that occupy space in global registries such as npm, not about breaking modules that have a list of all the things you can successfully require in node. |
It does, due to 10.0.0, that is true, and yes, i can easily add the next version - but it will be marked as a non-core module until users update to the latest version of resolve. |
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
simple and elegant!
I'd like to see @jasnell sign-off on this as I believe he was one of the folks who identified earlier security concerns. To be clear I'm extremely happy to see this land! |
Should this be semver-minor? |
ping @jasnell |
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 but I'm inclined to run CITGM in case of unforeseen consequences?
Should there be a test that does something like this?: assert.strictEqual(require('fs/promises'), require('fs').promises) Otherwise, I don't think we're testing CommonJS |
Refs: #31553 Refs: #32953 PR-URL: #34001 Refs: #34002 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs#31553 Refs: nodejs#32953 Refs: nodejs#33950 Refs: nodejs#34001 Refs: nodejs#34002
Refs: nodejs#31553 Refs: nodejs#32953 Refs: nodejs#33950 Refs: nodejs#34001 Refs: nodejs#34002 Refs: nodejs#34055
Refs: #31553 Refs: #32953 Refs: #33950 Refs: #34001 Refs: #34002 Refs: #34055 PR-URL: #34962 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
Refs: #31553 Refs: #32953 Refs: #33950 Refs: #34001 Refs: #34002 PR-URL: #34055 Refs: #34962 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Fixes: nodejs#35740 Refs: nodejs#31553 Refs: nodejs#32953 Refs: nodejs#33991 Refs: nodejs#34001 Refs: nodejs#34055 Refs: nodejs#34962 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Rich Trott <[email protected]>
Fixes: #35740 Refs: #31553 Refs: #32953 Refs: #33991 Refs: #34001 Refs: #34055 Refs: #34962 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Rich Trott <[email protected]> PR-URL: #34002 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Pranshu Srivastava <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #35740 Refs: #31553 Refs: #32953 Refs: #33991 Refs: #34001 Refs: #34055 Refs: #34962 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Rich Trott <[email protected]> PR-URL: #34002 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Pranshu Srivastava <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Refs: #31553 Refs: #32953 Refs: #33950 Refs: #34001 Refs: #34002 Refs: #34055 PR-URL: #34962 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
Refs: #31553 Refs: #32953 Refs: #33950 Refs: #34001 Refs: #34002 PR-URL: #34055 Refs: #34962 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Fixes: #35740 Refs: #31553 Refs: #32953 Refs: #33991 Refs: #34001 Refs: #34055 Refs: #34962 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Rich Trott <[email protected]> PR-URL: #34002 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Pranshu Srivastava <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #35740 Refs: #31553 Refs: #32953 Refs: #33991 Refs: #34001 Refs: #34055 Refs: #34962 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Rich Trott <[email protected]> PR-URL: #34002 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Pranshu Srivastava <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
This restores
fs/promises
in node core. It can't be overridden by a file on disk in a version of node that has it. It will fail to load on a version of node that doesn't have it because thefs
module on npm is locked. It is not a new core module, it is a child of the fs module, so the concern about namespacing shouldn't apply.Fixes #21014
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes