Skip to content
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

Autogen RPC typescript type definitions from the backend #63

Open
druskus20 opened this issue Dec 26, 2022 · 2 comments
Open

Autogen RPC typescript type definitions from the backend #63

druskus20 opened this issue Dec 26, 2022 · 2 comments
Assignees
Labels
topic-frontend Things that relate to the frontend in general topic-rpc Things related to our RPC layer

Comments

@druskus20
Copy link
Member

We should generate type definitions for the RPC messages between the frontend and backend so that they remain consistent with each other.

@druskus20 druskus20 added topic-rpc Things related to our RPC layer topic-frontend Things that relate to the frontend in general labels Dec 26, 2022
@elkowar elkowar moved this to Todo in Bazed itor Dec 27, 2022
@gwimm
Copy link
Contributor

gwimm commented Dec 27, 2022

I like this idea, should we separate schema from rpc? i.e. the rpc is defined with some other language than rust or ts? and then auto-generate both?

@elkowar
Copy link
Contributor

elkowar commented Dec 27, 2022

I don't see much value in that, although it'll probably come down to choice of tool. (a schema -> rust converter will generate less comfy rust types probably and be lacking the relevant derives, whereas just generating from rust avoids that issue)

I've already done some preliminary research and found a few options for rust -> ts types. There's a good few options out there because of the several wasm usecases

Specifically, there is ts-rs which also just looks at serde annotations to specify how the type should get translated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-frontend Things that relate to the frontend in general topic-rpc Things related to our RPC layer
Projects
Status: Todo
Development

No branches or pull requests

3 participants