-
Notifications
You must be signed in to change notification settings - Fork 30k
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
[x] fs: refactor to fully use Stream api #29048
Conversation
8ea1c0e
to
4a10df8
Compare
5a163e6
to
8135078
Compare
7394b4c
to
0487efa
Compare
@Trott: I think this needs a blocked label. |
Since #29058 is tagged semver-major and is needed for this shouldn't this also be semver-major? That issue aside this will break anything which extends |
a44f414
to
fa10d0d
Compare
@coreyfarrell: Fixed in way that should maintain compat. |
Another problem though (not directly related to this PR) is that |
6632caf
to
0a9a759
Compare
lib/internal/fs/streams.js
Outdated
this.on('open', () => { | ||
// Do this in listener to maintain compat with e.g. | ||
// graceful-fs. | ||
this[kPending] = false; |
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[kPending] = false
is not needed before errorOrDestroy()
?
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.
no, I don't think so
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.
it exist to check whether 'open' has been emitted or not
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.
Sorry, I was wrong. It's needed before. I'm not quite sure what's the best way here...
0a9a759
to
0a97fca
Compare
This will break |
If this PR will be a semver-major then I'm not sure it needs to be resolved, assuming #29083 or similar is merged so |
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.
I'm ok with the changes to fs. However I'm not ok with the changes to the stream destroy methods here. Are those already part of #29058?
This is semver-major. |
Fair enough. They were required to make this correct. Yes, those changes are already part of #29058. This could land before, but is probably better if it lands after. |
d1376d9
to
e35a498
Compare
@Trott no longer blocked |
e35a498
to
e1ba8c6
Compare
closing for now |
This refactors the
fs
streams to fully/properly use the existing stream API's and helpers.No test modified. All fs tests pass.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes