Git Product home page Git Product logo

grpc-ts's People

Contributors

actions-user avatar askuzminov avatar kot9ta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpc-ts's Issues

Incompatible encode/decode for negative values in int32, int64 with protobufjs

In official documentation (https://developers.google.com/protocol-buffers/docs/proto#scalar) types int32 and int64 has possibility to have negative numbers.
But your encoding/decoding is not compatible with this types for protobufjs library.

You can check it in types.spec.ts:

int32: -16868,
int64: -2343919238923492000,

will produce an error:

-   "int32": -16868,
-   "int64": -2343919238923492000,
+   "int32": 18446744073709535000,
+   "int64": 16102824834786060000,

Enum reserved support?

I tried to run npx @whisklabs/grpc on a proto with an Enum with reserved fields (here's the proto spec), and I received an error:

Thrower {
  name: 'enum value',
  message: [
    [ 'Token "1" not equal "="', 1 ],
    [ 'Token ";" not equal "number"', 2 ],
    [ 'Token "reserved" not equal ";,["', 3 ],
    [ 'reserved, 1, ;, reserved, ;', 0 ]
  ],
  line: 4,
  column: 12,
  range: [
    'reserved',      '1',
    ';',             'reserved',
    '"ANIMAL_BIRD"', '...',
    'ANIMAL_DOG',    '=',
    '3',             ';',
    '}'
  ]
}

It looks like the reserved field is not supported in the enum parser? Here's a simple example illustrating it:

syntax = "proto3";

enum Animal {
  ANIMALUNSPECIFIED = 0;
  ANIMAL_CAT = 2;
  ANIMAL_DOG = 3;
  reserved 1;
  reserved "ANIMAL_BIRD";
}

And run PROTO_DIR=./ PROTO_OUT=whisk npx @whisklabs/grpc

No found message or enum for google.protobuf.Duration or google.protobuf.Timestamp

When running npx @whisklabs/grpc on my proto file I get errors for every duration and timestamp field like the error below

No found message or enum: uwGrpc_google_protobuf_Duration [in "uwGrpc_IntValueDuration" field "duration = 2"]

I compared my proto to the one in your tests which uses timestamps and couldn't find any differences in imports or the one the fields are defined.

I am using Ubuntu 21.10, I have protoc installed and can successfully generate js libaries using protoc grpc-web

Nodejs support?

Hi, I noticed grpc-ts is unable to make rpc requests on node.js. This is mostly because of the use of XMLHttpRequest.

Perhaps support could be added via axios or fetch. Fetch would be nice, as native support is being added to Node.js but It would limit deployment to places that have the most recent version of node. It's likely serverless deployment hosting will lag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.