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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer@4 #1476

Merged
merged 1 commit into from
Jan 9, 2016
Merged

buffer@4 #1476

merged 1 commit into from
Jan 9, 2016

Conversation

feross
Copy link
Member

@feross feross commented Jan 9, 2016

Node.js removed the buffer.toArrayBuffer() API sometime during node 0.11. Users who rely on it will have code that doesn't work in node.js, which is unfortunate.

feross/buffer v4.0.0 removed buffer.toArrayBuffer() to have parity with node.js.

Going forward, users can just use buffer.buffer to get an ArrayBuffer since Buffer is just a subclass of Uint8Array in both node.js and the browser.

This is a breaking change, since we're removing a method from the buffer.

I'm only sending this PR now, since buffer v4.1.0 has a 30% performance increase for lots of the buffer methods and I want users to have that 馃憤

@feross
Copy link
Member Author

feross commented Jan 9, 2016

I would like to release this as browserify v13, if there are no objections.

@ghost
Copy link

ghost commented Jan 9, 2016

Looks good to me!

feross added a commit that referenced this pull request Jan 9, 2016
@feross feross merged commit bc32336 into master Jan 9, 2016
@feross feross deleted the bufferv4 branch January 9, 2016 18:18
@feross
Copy link
Member Author

feross commented Jan 9, 2016

Here's what's going into the changelog:

This release bumps the buffer dependency to v4, which has one possible breaking change:

  • The buffer.toArrayBuffer() method on Buffer instances has been removed.

(This is probably not a problem for 99.9% of users.)

This API was added in node v0.11.8 and
removed before v0.12 was released.
It was added to browserify's buffer implementation but was never removed when v0.12
was released. buffer v4 removes it so we have full parity with node.js.

Going forward, to get an ArrayBuffer from a node.js-style Buffer, users should
just use buffer.buffer. This works because Buffer is a subclass of Uint8Array
in both the browser and node.js (since v3).

On the plus side, this release also includes:

  • Performance improvements to buffer that
    increase the speed of some buffer
    methods by as much as 30%!

@feross
Copy link
Member Author

feross commented Jan 9, 2016

v13.0.0 is released.

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

Successfully merging this pull request may close these issues.

None yet

1 participant