-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: move SyncWriteStream to internal/fs #6749
Conversation
@@ -131,7 +131,7 @@ function createWritableStdioStream(fd) { | |||
break; | |||
|
|||
case 'FILE': | |||
var fs = require('fs'); | |||
var fs = require('internal/fs'); |
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.
const
?
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'd rather not in this PR. There are several similar updates that can be made elsewhere in this file that should be done in a separate PR
value: SyncWriteStream | ||
get: util.deprecate( | ||
() => { return _syncwritestream; }, | ||
'fs.SyncWriteStream is deprecated.'), |
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.
perhaps and will be removed soon/in Node.js v***
?
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.
Because domain
and fs.existsSync
are also deprecated 😉.
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.
Perhaps just will be removed soon
without a firm version.
@nodejs/ctc ... Tagging as ctc-agenda because it's (a) a semver-major and (b) requires a deprecation. I don't think this one is particularly controversial tho. |
+1, but only after a full deprecation cycle |
Ah, also +1 from me (with a deprecation cycle). https://gist.github.com/ChALkeR/f2cb74429769e91752d4b7f41b70dda2 — I'll copy my comment from a note above:
|
f2f6515
to
90508a0
Compare
The deprecation is in there now. Just squashed the commits down. |
CI is green. |
@jasnell that serialport failure on ppc is new... rerunning on master to double check edit: looks like there was an update to serialport that may have broken this |
hmm... I've seen that serialport failure before. I believe I was running citgm locally tho. |
|
||
// Change strings to buffers. SLOW | ||
if (typeof data === 'string') { | ||
data = Buffer.from(data, encoding); |
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.
Note to self, this doesn't need to be done. But for future optimization.
A run on master has serialport tests passing on ppc Here's another run of this pull's head just to make sure it wasn't a one off: https://ci.nodejs.org/view/Node.js-citgm/job/thealphanerd-smoker/269/ edit: was green this time... ¯_(ツ)_/¯ |
Happy to see this out of fs.js, LGTM. |
This is blocked by #6413, btw. I mean — merging this will obviously break reevaluating |
I'm curious — aside from the comment that notes that it was supposed to be private, what's the reasoning behind making this private now? It seems like it might not be worth potentially breaking things to move this into |
CTC discussion on this was to leave this open but hold off on landing until a later date after #6413 lands. |
It's a semver-patch that depends on a semver-major, right? Adding the "dont-land" labels. |
I believe so, yes, landing on v6 should be fine tho as I believe the semver-major landed there. Could be wrong. |
The |
ah yes, because of the graceful-fs warning. You're right. That's fine, it wouldn't be critical to land this in v6 at all. |
@targos ... other than the don't land labels, does this LGTY? |
@ChALkeR ... does this still LGTY? The only change is that I removed the runtime deprecation |
@jasnell, what does the «doc-only deprecation» mean here? It isn't documented =). |
It just means adding the code comment that indicates the intention to On Friday, September 2, 2016, Сковорода Никита Андреевич <
|
@jasnell What would be the difference to users between runtime deprecation in v7 and runtime deprecation in v8? Why do we prefer the latter? |
Given the issues that have been caused by other runtime deprecations, and On Friday, September 2, 2016, Сковорода Никита Андреевич <
|
@jasnell Ah, ok. LGTM. =) |
@jasnell Perhaps that could be included into the release notes, for this and other «documentation-only» deprecations of undocumented functions. |
+1 to adding it to the release notes. |
Move the implementation of SyncWriteStream to internal/fs.
818f2e4
to
7fbd77c
Compare
Some weird red in that last CI run... trying again: https://ci.nodejs.org/job/node-test-pull-request/3928/ |
@nodejs/build ... there's definitely something weird happening with arm in CI |
Failures in CI are unrelated. Landing! |
Move the implementation of SyncWriteStream to internal/fs. PR-URL: #6749 Reviewed-By: Ron Korving <ron@ronkorving.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Landed in dc72779 |
How do we install "internal/fs" ? when I run |
You don't install internal/fs, this is a bug in graceful-fs, sounds like. |
Checklist
Affected core subsystem(s)
fs
Description of change
Move the internal SyncWriteStream class to internal/fs. This pulls it off require('fs') without a deprecation. It was always intended to be private, says that it's private in the source and tells people not to use it.
Update the impl a bit while we're at it to use class instead of util.extends