4 ms·
I've started to use TypeScript and React on the front end, with a JSON RPC middleware on an express server with helpers that automatically implement service int
by jeremija 7y ago
I've started to use TypeScript and React on the front end, with a JSON RPC middleware on an express server with helpers that automatically implement service interfaces for API calls, action creators and reducer handlers. And all of them are type-safe.
I've spent a lot of time building CRUD APIs and GraphQL interfaces, and this is the simplest solution that has saved me so much development time. JSON RPC gets so much hate, but it's made my life so much simpler.
- NohatCoder 7y agoSounds neat, what project are you working on?
- jeremija 7y agoI'm currently working on various projects at work that I cannot discuss here, but in parallel I've been working on an express / TypeORM / React (SPA & SSR) framework that I hope to release one day as an open source project. The main focus is to: - easily share React components that use Redux state and actions between projects - rapidly develop new server-side services and immediately use them in React components (by removing code duplication when it comes to creating action creators and action types) - have type safety - provide basic server-side and client-side components for basic user actions such as login, user profile, etc - make it easy to write tests And at some point in the future, I hope to make it generic enough so the libraries mentioned above can be swapped for other libraries, but that might be too much work :)
- NohatCoder 7y agoSounds like a lot of work, how do you know that it is a net time saver?
- jeremija 7y agoHaha, I guess it is not at the moment, but it keeps me amused. In the first post I was just referring to using JSONRPC over standard REST endpoints as the time saver.