-
Notifications
You must be signed in to change notification settings - Fork 911
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
web3.js: Remove use of Buffer #1100
Comments
100%. This is another change that we should negotiate with near/borsh-js to eliminate this dependency from the web bundle entirely, everywhere. cc/ @ailisp. |
Your treeshaking proposal is impressive! We also have plan to drop Buffer-usage in borsh. Uint8Array is available for all, <10-year browsers. The only challenge part is to borsh serialize a string, it uses |
Yeah Uint8Array has good polyfills so I think it's fine-- virtually all frontend packaging tools have some form of browserslist/polyfilling in their build configs. 10kb gzipped if you guys accomplish this. And no more browserify! 🙂 |
Glad to hear this! node buffer shim took me almost 3 hours to make it to work for both dev and prod via |
Is this already work in progress? I might want to have a look at this. Does anyone know how big/complex this migration gonna be? |
My focus is on replacing web3.js altogether. Follow along in #1111 and in all of the new packages in the Deprecating |
Sorry for being that guy but any update on this? This prevents me to use vite before. |
Unfortunately we can't save the legacy library from |
|
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up. |
Problem
Buffer isn't built for the web. Uint8Array is and saves 10kb gzipped.
Proposed Solution
Begin migrating code to use Uint8Array instead. Code that doesn't use Borsh should get optimized automatically.
The text was updated successfully, but these errors were encountered: