You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
The TypeScript runtime currently has limited support for integers larger than 2^53-1. bigint types are used when passing u64 WASM primitives, but when they’re passed as part of a MessagePack-encoded structure, they will always use number, causing precision to be lost for larger numbers.
Recently a new PR for msgpack-js made it possible to use bigint with MessagePack as well: msgpack/msgpack-javascript#211
I think it makes sense for us to implement an opt-in option with a similar effect.
Initial investigation indicates that the current way of dealing with large numbers in msgpack-javascript is by encoding them as strings, which isn't great. Let's (briefly) see if the PR mentioned by @arendjr will be merged. If not we can either choose to fork msgpack-javascript (or use the PR branch) or deal with large-numbers-as-strings on the Rust side of fp-bindgen.
Might even be worthwhile to wait a bit for this (assuming it's not too long), as proper BigInt support would likely be a breaking change on our side as well.
Activity
sagacity commentedon Jul 20, 2022
Initial investigation indicates that the current way of dealing with large numbers in
msgpack-javascriptis by encoding them as strings, which isn't great. Let's (briefly) see if the PR mentioned by @arendjr will be merged. If not we can either choose to forkmsgpack-javascript(or use the PR branch) or deal with large-numbers-as-strings on the Rust side offp-bindgen.arendjr commentedon Jan 16, 2023
With a bit of luck, we might be able to include this in our own 3.0 release as well: msgpack/msgpack-javascript#211 (comment)
Might even be worthwhile to wait a bit for this (assuming it's not too long), as proper BigInt support would likely be a breaking change on our side as well.
arendjr commentedon Feb 14, 2023
Unfortunately, their PR is still open, so we should go ahead with our 3.0 release without this.