-
-
Notifications
You must be signed in to change notification settings - Fork 50
Replace @ljharb/through with native solution #55
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
Open
kibertoad
wants to merge
1
commit into
feross:master
Choose a base branch
from
kibertoad:chore/remove-dependency
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||
| var fs = require('fs') | ||||||
| var once = require('once') | ||||||
| var split = require('split') | ||||||
| var through = require('@ljharb/through') | ||||||
| var { Writable } = require('node:stream') | ||||||
| var net = require('net') | ||||||
|
|
||||||
| var WINDOWS = process.platform === 'win32' | ||||||
|
|
@@ -33,7 +33,12 @@ exports.getFile = function (filePath, preserveFormatting, cb) { | |||||
| cb = once(cb) | ||||||
| fs.createReadStream(filePath, { encoding: 'utf8' }) | ||||||
| .pipe(split()) | ||||||
| .pipe(through(online)) | ||||||
| .pipe(new Writable({ | ||||||
| write: (chunk, encoding, callback) => { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as would arrow functions
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above, realistically hostile already requires node 10+ due to chalk usage |
||||||
| online(chunk.toString()) | ||||||
| callback() | ||||||
| } | ||||||
| })) | ||||||
| .on('close', function () { | ||||||
| cb(null, lines) | ||||||
| }) | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
use of destructuring, or
node:, would be a breaking change (CI support has no bearing on what engines are supported; onlyengines.node, which defaults to*, does)also, Writable wasn't added until node 0.10, which technically would also be a breaking change and require an engines.node declaration to be added.
Uh oh!
There was an error while loading. Please reload this page.
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.
chalk 4 requires node 10+, so older versions aren't supported already.
and CI for hostile is only running on Node 14, so there was no indication for old version support to begin with.
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.
indeed you're right; 6d5d1c3 was a breaking change in a patch version.
Again, lack of CI coverage indicates nothing;
engines.nodecombined with "what actually worked at one point within the major" is the indicator. In other words, chalk needs to be dropped to 3 or replaced, and CI coverage should be expanded.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.
@ljharb literally nobody complained over all this time, so looks like it's not a problem for anyone among real users of the library, so why fix something that isn't broken?
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.
being semver-compliant requires adhering to principle, regardless of whether there's actual/reported breakage or not.
It's up to the maintainer, of course, whether they want to comply with semver or not - I'm just helpfully pointing out what that requires.
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.
@feross what is your stance on this? if requested, I can do the obsolete Node compatibility changes in this PR, but it seems more reasonable for me to stay on Node 10+