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 issue is to track considerations for overridable marshalling type as part of the TypeShim annotations e.g. [OverrideMarshallingType<JSType.XXX>]

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 may be considered 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. But if the user creates a BigInt in JS, then converting to long on the dotnet side seems defensive, at which point the user can always proceed however they see fit.

In a nutshell

TypeShim will not support configurable JSType configurations for now.

  • Decide wether to swap the target JS type from number to BigInt
  • Document this behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions