Comments (6)
@ws-gregm huh, we did just ship #1027 cc @dasco144 , but I don't think importing Rpc
from ts-proto
was really working on purpose, previously.
I.e. the ts-proto
package is meant to be "the code generator you run at build-time" and not really the "the runtime code / dependency your app uses to encode/decode data".
I.e. we should be generating a interface Rpc
into the output of ts-proto
, so that when you package up the AuthorMessage
/ BookMessage
/ etc messages, the interface Rpc
type should be included in that.
So, dunno, I'm curious to learn if/how this was actually working before, but I think it's intended that you import Rpc
from the ts-proto-generated code and not the ts-proto
dependency itself.
from ts-proto.
Hey @stephenh thanks so much for getting back so quickly. Do you have an example of what this would look like or how I would use this?
so that when you package up the AuthorMessage / BookMessage / etc messages, the interface Rpc type should be included in that
from ts-proto.
Hi @ws-gregm , sorry, an example of what? For better or worse, going through ts-proto's integration/
directory and looking for usages that are most similar to what you're trying to do is the best bet.
from ts-proto.
@stephenh Digging through there - it's not clear to me how to
- instantiate a grpc client
- Specify ip and port to grpc server
from ts-proto.
@ws-gregm if you're using grpc-js, this example is probably a good one to copy/paste from:
https://github.com/stephenh/ts-proto/blob/main/integration/grpc-js/grpc-js-test.ts#L152
I'm going to close this issue out b/c I don't think it's related to a breaking change in the exports. If you'd like to submit any PRs to improve the docs for ^, that'd be great, thanks!
from ts-proto.
Hey @stephenh, maybe it's best if I open a discussion but responding here for context. I experimented with TestClient. It appears that TestClient doesn't include methods that return promises. Meanwhile, the benefit of the generated *ClientImpl classes is that they return promises.. To use the *ClientImpl, I would need to craft this mystical rpc object. There doesn't appear to be any obvious guidance on this matter in the tests. From my POV, the general aim is to drive generated client methods that return promises. What's the typical way to do this? Also, I eventually need to expose methods that return a stream. I tried combing through existing projects that use ts-proto and I'm not find clear guidance there either.
from ts-proto.
Related Issues (20)
- fromJSON should accept both snake_case and camelCase keys HOT 1
- Provide Options type for execution in TS HOT 1
- Add common types to their own file/export w/outputIndex option HOT 2
- Questions about defaults, optionals, arrays, null/undefined HOT 2
- Support `google.api` attributes/conventions HOT 1
- NestJS without Observables HOT 1
- meta generated for messages with oneOf properties is incorret for other properties HOT 1
- Add types for toJSON/fromJSON methods HOT 1
- TypeError on Runtime ChannelCredentials object HOT 1
- Using 'useDate=string' parameter; the response is still anticipating an object for Timestamp Wrapper
- Encode crashes on `null` object values HOT 2
- Rpc doesn't account for metadata HOT 2
- Generated affixes HOT 1
- Conflicting protobuf definitions when using ts-proto plugin with Buf HOT 2
- Support for proto-loader "virtual" oneof field
- Release updated ts-proto-descriptors? HOT 4
- Proto import statements not being recognized HOT 1
- Support for messages with the same name as an rpc method HOT 2
- unexpected changes in `camelToSnake()` at v1.176.1 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-proto.