Closed natenichols closed 3 years ago
That would be correct. It will not work in Browsers w/o support for BigInt. How important is it that old browsers support ripple-lib
?
Since new browsers support it, I don't see a problem using BigInt. If we wanna make sure it is compatible with old Browsers we can use a library to replace BigInt.
LGTM. I wonder if we should add a note in the README about browser compatibility? Since we use BigInt now, will it work in browsers that don't support BigInt?
All new browsers support it, but old ones do not, like Internet Explorer and Safari versions prior to Safari 14.
I added a short note about browser compatibility. I'm also debating whether to continue to update v2.6
in order to support older browsers. All we would need to do to keep older versions up to date with the protocol is to update to the most recent definitions.json
. Thoughts?
I'm happy either way. I think the important thing is that we call out what the expected compatibility is, so that users are aware of which browsers are expected to work. If you'd like to update the 0.2.x branch, I think that is reasonable, too (especially since it's not much work). On the other hand, it's also ok to wait until someone complains :) Maybe no one will complain.
I'm happy either way. I think the important thing is that we call out what the expected compatibility is, so that users are aware of which browsers are expected to work. If you'd like to update the 0.2.x branch, I think that is reasonable, too (especially since it's not much work). On the other hand, it's also ok to wait until someone complains :) Maybe no one will complain.
Sounds good to me. I'll merge and roll this into a beta release
@natenichols
BigInt only has 80% support atm I would recommend using https://www.npmjs.com/package/big-integer which acts as a polyfill for the 20% of users who don't have BigInt support.
High Level Overview of Change
This change makes it possible to run this in the browser
Context of Change
With the packages we were using, nodeJS buffers would be compiled down to browser compatible buffers. These browser compatible buffers do not have the API for
readBigUInt64BE
andwriteBigUInt64BE
. This rewrite makes the binary-codec compatible with these tools.Type of Change
Test Plan
No functionality was changed, all tests still pass.