Hacker News new | ask | show | jobs
by semitones 1678 days ago
You could use Django just for the backend and have your frontend code be written in React+Typescript, no?
1 comments

But that means throwing out a large part of Django and writing lots of "interconnect" code. At that point I think it's better to choose a different backend, one that will generate typed Typescript client code (or use Typescript on the server and some clever metaprogramming).
You can also just generate an Open API spec and use something like openapi-generators to produce typed client code for data fetching (https://github.com/OpenAPITools/openapi-generator)
This has been such a life saver for me these past couple of months
The thing is that there's no TypeScript backend that gives you as much stuff out of the box as Django. You're either going to spend time on how to communicate between Django and TS, or spend time on how to recreate Django functionality in TS.
Doesn’t Django Rest Framework solve most of the issues you raise?