grpc / grpc/grpc-node

Allow configuration to choose `BigInt` over `Long.js` for `int64` types

Open
#3,047 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
716
Avg merge
2d 3h
Merged PRs (30d)
10

Description

### Is your feature request related to a problem? Please describe.
Inability to configure parsing `int64` types to `BigInt` over `Long.js` or `String` - .

### Describe the solution you'd like
At the moment the choices for when we can handle `int64`/`uint64` types are only `Long` or `String` - Now with the ES2020 inclusion of `BigInt` which is much more compatible and doesn't rely on a third party package. We're also using `ts-proto` to codegen values and they give us the option but unfortunately it's not available on this library AFAIK.

### Describe alternatives you've considered
We _can_ use strings or Long.js but for us it makes much more sense in our use case to maintain using the Number type and using the BigInt option for us as it's much more futureproof.

### Additional context
We're using `Nest.js` here with these package versions:
```
@nestjs/microservices: ^11.1.17
@grpc/grpc-js: ^1.14.3
@grpc/proto-loader: ^0.8.0
@nestjs/common: ^11.0.1
@nestjs/core: ^11.0.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.