Skip to content

Conversation

@hildjj
Copy link
Owner

@hildjj hildjj commented Feb 9, 2021

This is going to need more work before it's ready

hildjj and others added 8 commits February 1, 2021 12:35
Webpack 5 removed automatic support for node polyfills so you now can't
access the node `Buffer` global in the browser any more - you have to
`require` it first.

I've added Feross' [Buffer polyfill](https://www.npmjs.com/package/buffer)
as a dependency and `require`d it in the non-cli/test files that use
Buffer directly.

If running on node you'll get node's Buffer, if it's the browser you
get the polyfill.

It's not worth replacing `Buffer` with `Uint8Array`s entirely because there's
no equivalent API to [Buffer.allocUnsafe](https://nodejs.org/api/buffer.html#buffer_static_method_buffer_allocunsafe_size)
so it'd be a big performance hit.
@coveralls
Copy link

coveralls commented Feb 9, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 51f66dd on require-buffer into dc25e8a on master.

@hildjj
Copy link
Owner Author

hildjj commented Feb 9, 2021

Fixes #131. Fixes #132. Fixes #60.

See #130 for discussion.

@hildjj hildjj added the major-version This change will require a major version number bump, usually due to backward-incompatibility label Feb 9, 2021
@hildjj
Copy link
Owner Author

hildjj commented Feb 10, 2021

I am likely to merge this today, but doing a release will take some work, since I want to try and automate that process. But I need this on master to ensure that all of the links work.

@hildjj hildjj merged commit 6227f2b into master Feb 10, 2021
@hildjj hildjj deleted the require-buffer branch February 10, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major-version This change will require a major version number bump, usually due to backward-incompatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants