Skip to content
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

fix: Removes usage of deprecated Buffer constructor. (#5477) #5731

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 25, 2018

Summary

Fixes #5477 and #5704.

Remove usager of deprecated Bufferconstructor to avoid ugly warnings on Node 10.

Test plan

Existing test should pass.

@fungilation
Copy link

Please merge. Node 10 is released and I keep seeing warning like:

(node:35805) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

Thanks a ton for doing this!

@@ -767,8 +767,8 @@ export function normalizeOS(body: string): string {
return body.replace(/\r\n/g, '\n');
}

const cr = new Buffer('\r', 'utf8')[0];
Copy link
Member

Choose a reason for hiding this comment

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

lol

@BYK BYK merged commit 5231984 into yarnpkg:master Apr 26, 2018
@aduh95 aduh95 deleted the remove-buffer-constructor-usage branch April 26, 2018 11:22
@felixrabe
Copy link

Thanks!

As a workaround before the next release of Yarn, I've created a ~/bin/node script that comes before (Homebrew-installed) /usr/local/bin/node in my $PATH:

#!/bin/bash

/usr/local/bin/node --no-deprecation "$@"

@tusharmath
Copy link

tusharmath commented May 6, 2018

Has this been release? If not then when is the next planned release?

@gausam
Copy link

gausam commented May 20, 2018

Great work on having this out of the way. Any news on a release with the fix? Hit pretty hard, and as more people update their npm the cats will rain harder.

@BYK
Copy link
Member

BYK commented May 20, 2018

@tusharmath @samtheson you can follow #5769 for the final Node 10 fix. We'll release a new version as soon as we merge that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants