marblejs / marble

Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
https://marblejs.com
MIT License
2.15k stars 71 forks source link

Type-safe for client side who use our API. #409

Open QimatLuo opened 6 months ago

QimatLuo commented 6 months ago

Is your feature request related to a problem? Please describe. I love RxJS too, and absolutely agree the concept of your design, everything is stream, no matter it's HTTP or WebSocket, we can use the same way to solve it, no need to implement 2 different ways to solve them.

But currently it's not friendly while developing between the server and the client developers. If we compare to tRPC it's super convenient, the server side only need to export routers and the client side import the router then the client side automatically get the API code gen and type-safe.

Describe the solution you'd like It will be good if you can refer their design and implement in marble.js.

Describe alternatives you've considered The other way I know is in your to-do list - @marblejs/swagger. We can generate swagger and use OpenAPI code gen for the client side.

Additional context But due to @marblejs/swagger is not ready yet, we only can manually setup for client usage.