whisklabs / grpc-ts Goto Github PK
View Code? Open in Web Editor NEWWhisk GRPC web library
License: MIT License
Whisk GRPC web library
License: MIT License
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,
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
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
Hi!
Does grpc-ts support server side streaming? I see it does parse services with streaming enabled, any examples how to use them?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.