logoalt Hacker News

supermdguylast Tuesday at 8:53 PM5 repliesview on HN

How do you guys share types between your frontend and backend? I've looked into tRPC, but don't like having to use their RPC system.


Replies

david422last Tuesday at 9:08 PM

I do it naively. Maintain the backend and frontend separately. Roll out each change in a backwards compatible manner.

show 2 replies
esafaklast Tuesday at 10:09 PM

I have a library translate the backend types into Typescript. What language do you use on the back?

show 1 reply
shepherdjerredlast Tuesday at 10:14 PM

Typespec is up and coming. Otherwise there are plenty of options like OpenAPI

programmarchylast Tuesday at 10:50 PM

FastAPI -> OpenAPI -> openapi-typescript

denysvitalilast Tuesday at 9:46 PM

protobuf?

show 1 reply