Open druskus20 opened 1 year ago
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?
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
We should generate type definitions for the RPC messages between the frontend and backend so that they remain consistent with each other.