You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
I think we should build or JS libraries (especially new ones) with Browser primitives and not Node.js ones. Hence I suggest using TypedArrays instead of Node.js Buffers.
I know that's a bigger issue and there were already lengthy discussions about it. So if this isn't the right place for the issue, feel free to open a new one/link to another one.
I just fear that if we don't start using TypedArrays rather soon, Node.js Buffers will bleed up to all the other stuff we build on top and we will never change it.
The text was updated successfully, but these errors were encountered:
I agree, which is why I wrote https://github.com/mikeal/bytesish but when I was writing the latest PR here I realized that I don’t expose the faster allocUnsafe call so I’m going to need to improve it before I can use it in my most recent PR.
But yes, I think this is where we should push in general. In fact, there’s some fundamental changes we should make to get-codec and how this library uses it in order to trim the bundle size as well.
Oh, for the record, I think that we should avoid using Buffer directly but we should still return Buffer instances in Node.js. This is easily doable with bytesish.native() but is a little different than “using typearrays instead of Node.js Buffers.”
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think we should build or JS libraries (especially new ones) with Browser primitives and not Node.js ones. Hence I suggest using TypedArrays instead of Node.js Buffers.
I know that's a bigger issue and there were already lengthy discussions about it. So if this isn't the right place for the issue, feel free to open a new one/link to another one.
I just fear that if we don't start using TypedArrays rather soon, Node.js Buffers will bleed up to all the other stuff we build on top and we will never change it.
The text was updated successfully, but these errors were encountered: