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

Refactor code to use Uint8Array instead of Buffer #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pajasevi
Copy link
Contributor

@pajasevi pajasevi commented Jan 6, 2024

This PR is a refactor of the code to use Uint8Arrays instead of Buffer, which would basically make this library usable in the browser without any polyfill for Node.js internals.

I've had an issue with extending typeforce (due to no support for Uint8Array), which is IMO outdated library which doesn't have ES6 support, doesn't even translate type safety to Typescript and is very hard to extend properly. I would be in favor of getting rid of it and using custom type guards instead but didn't want to inlude such change yet in this PR.

I am aware of the fact that this change might warrant releasing a major version of the library but that is unavoidable in this case.

Let me know what you think and we can discuss

@pajasevi
Copy link
Contributor Author

pajasevi commented Jan 6, 2024

Failing coverage check is apparently caused by the file/code used for typeforce extension. Suggestions?

@junderw
Copy link
Member

junderw commented Jan 6, 2024

I've given up trying to update typeforce. Please let me know what you think about well maintained libraries we can use that are easy to audit and meet requirements. (ie. doesn't trigger unsafe-eval, doesn't cause issues with browsers etc.)

bitcoinjs/bitcoinjs-lib#2030

@pajasevi
Copy link
Contributor Author

pajasevi commented Mar 6, 2024

Hi @junderw. I don't want to sound pushy or anything because I know you are very busy and the whole bitcoinjs ecosystem is very complex. I just wanted to ask for a possible ETA of having this merged? Months maybe?

The discussion in bitcoinjs/bitcoinjs-lib#2030 did not really have any conclusion.

What can I do to help? Would it help if I implemented Typia or zod typechecks in a separate PR, for this repo?

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.

2 participants