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

Use Buffer.from to to remove deprecation warning #49

Merged
merged 2 commits into from
Mar 6, 2017

Conversation

dovidweisz
Copy link

Using this plugin with node7 outputs this warning to the console

DeprecationWarning: Using Buffer without new will soon stop working. Use new Buffer(), or preferably Buffer.from(), Buffer.allocUnsafe() or Buffer.alloc() instead.

@jefsnare
Copy link
Collaborator

jefsnare commented Mar 5, 2017

@dovidweisz Thanks! Is this backwards compatible with Node 6.x and 4.x?

What other changes you advice to stay on track with the new Buffer changes in Node 7?

@jefsnare jefsnare added this to the Release 2.2.0 milestone Mar 5, 2017
@dovidweisz
Copy link
Author

@jefsnare looks like Buffer.from wasn't added until v5.10.0. But I'll code around it if necessary.

@jefsnare
Copy link
Collaborator

jefsnare commented Mar 5, 2017

@dovidweisz Would be great if you want to, since we don't want to break older Node.js environments for now. Agree that from Release 3 we should mention that we support 5.10 and above?

@dovidweisz
Copy link
Author

... I am in no way an authority on Buffer (or Nodejs for that matter ). But this was the only depreciation warning that we were getting.

@jefsnare
Copy link
Collaborator

jefsnare commented Mar 5, 2017

@dovidweisz okay great. Is it possible to apply the changes before Release 2.2.0?

@dovidweisz
Copy link
Author

dovidweisz commented Mar 5, 2017

I think that on a new release you should only commit to supporting one full version back. So if the current stable version is 7.x, you should give support back to 6.x.

@jefsnare
Copy link
Collaborator

jefsnare commented Mar 5, 2017

@dovidweisz sounds good to me, @backflip what are your thoughts?

@dovidweisz
Copy link
Author

I plan on getting to it today or tomorrow.

@dovidweisz
Copy link
Author

dovidweisz commented Mar 6, 2017

I'm doing some testing now and it seems like node 4.x is fine with Buffer.from("") and I only need to fall back to Buffer("") for versions 3.x and earlier.

@dovidweisz
Copy link
Author

@jefsnare @backflip Done :)

@jefsnare jefsnare merged commit e6be55e into backflip:master Mar 6, 2017
@jefsnare
Copy link
Collaborator

jefsnare commented Mar 6, 2017

@dovidweisz thanks!

@dovidweisz
Copy link
Author

@jefsnare is there any way we can move this release?
My team keeps bothering me about the github link in our package.json

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

Successfully merging this pull request may close these issues.

None yet

2 participants