-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support unwrapped value type rpc method arguments #979
base: main
Are you sure you want to change the base?
feat: support unwrapped value type rpc method arguments #979
Conversation
Here's the link for prelude conversation #978 |
Seems like there's an interface trouble though somehow the code is being compiled and working in my project. export interface Clock {
Now(request: Empty): Promise<Timestamp>;
- NowString(request: StringValue): Promise<StringValue>;
- NowStringStream(request: Observable<StringValue>): Observable<StringValue>;
+ NowString(request: string | undefined): Promise<StringValue>;
+ NowStringStream(request: string | undefined): Observable<StringValue>;
NowBool(request: Empty): Promise<BoolValue>;
} It seems like the stream case is not covered correctly and I'm not sure whether it could be fixed at grpc-web level. Maybe types.ts changes are needed to implement rpc-level support for wrappers instead. |
Now I've moved the value type related branching lower into types.ts. |
The only problem still persists: incompatibility of |
Trying to implement smth like:
instead of just
inside of From this point I'm actually not sure how it's meant to be. From one side I've broken everything, from the other side why do we put that |
This part only adds support of unwrapped arguments, not return values.
Currently I do not have any value-type return types in my projects so I don't have an ability to check whether generated code does work if it contains such return values.
So this specific PR contains only stable code which I was able to check in a real project.
Either I'll create another PR when unwrapping of value-type return values is supported or just add commits to this one later.