Skip to content

Considerations on Int64 marshalling type #15

@ArcadeMode

Description

@ArcadeMode

e.g. Int64/long can be marshalled to JS as number or BigInt. Most use cases will be covered with number, which is the current marshalled type. This is a somewhat big assumption (that number covers most use cases), but configurable marshal types seem to add little value at this time.

It'd be preferable to swap the target JS type from number to BigInt for now. If the user does not need such large numbers, they can always convert their C# classes to Int32. Furthermore large long values dont actually fit in number as its 52 bits (wtf), the interop library will throw when encountering such values.

In a nutshell

TypeShim will not support configurable JSType configurations for now.

  • Swap the target JS type for long/Int64 from number to BigInt
  • Update README

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions