Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Support BigInt in TypeScript runtime #113

Open

Description

@arendjr

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.

Activity

  1. added
    enhancement
    on May 6, 2022
  2. sagacity commented on Jul 20, 2022

    @sagacity
    Contributor

    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.

  3. arendjr commented on Jan 16, 2023

    @arendjr
    ContributorAuthor

    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.

  4. arendjr commented on Feb 14, 2023

    @arendjr
    ContributorAuthor

    Unfortunately, their PR is still open, so we should go ahead with our 3.0 release without this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions