-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Migrate bn.js
to bignumber
#1542
Comments
Based on this discussion and ethers v6 using native bigint in their maths "package" (see here), it seems like ethers got rid of big-number libraries altogether and went completely in favor of native bigint. |
Related to the It would solve the issue across the board. Although messing with the prototype is risky as it can cause collisions ... what's the chance that two libraries would be adding this same method? Also, as the comment I linked to above mentioned, MDN also recommends it, although in the image I'm serializing into hex, not a stringified number.
|
when you stringify again, it's not a BigInt anymore |
Stringifying |
I was not there when For our own purposes, I believe this has come from reported inaccuracies when using I support @nedsalk implementation of |
After taking a look at it with @danielbate, replacing The benefits, as mentioned by @danielbate above, are:
Besides that, we've already got a precedent for it with The cons at this moment are:
@FuelLabs/frontend @FuelLabs/sdk-ts It would be great to get additional input from everyone. |
As of the time of writing, there is no consensus in the team for moving forward with this issue so I'm removing my assignment from it. I won't be closing it as it's a valid issue and something that should probably be done in the future for package size benefits. |
Related to package size reduction, by doing an in-depth analysis of |
Closing this for now. Contextually tree-shaking is being discussed in #1592 so that can be resolved there. The proposal that this issue makes we have not got a consensus on so therefore doesn't seem right for us at the moment. |
Suggestions were made to replace one library with the other.
Ideally, we should have a pros and cons list before deciding.
Note
The text was updated successfully, but these errors were encountered: