tRPC: Building type-safe APIs with TypeScript

tRPC: Building Type-Safe APIs with TypeScript

Jake Everhart API Development, Articles, Development Technologies & Tools, GraphQL, JavaScript, TypeScript Leave a Comment

Over the years, we’ve seen many approaches to HTTP API design. While REST APIs are still very popular throughout the industry, they offer no inherent guarantees that the client’s assumptions about the response structures will be valid.

GraphQL fills this gap to an extent by allowing client-side code greater control over the resulting structures but at the cost of added complexity. RPC (remote procedure call) frameworks attempt a different solution by sharing generated type definitions between the client and server implementations. What if there was a way to achieve the type safety of RPC by simply inferring the type definitions from the server’s code?

Enter tRPC. Since JavaScript (and specifically TypeScript) can already span across client and server implementations, tRPC allows a client to directly consume structures defined by the server’s exposed procedures. Essentially, you import your dependencies from the server to access these procedures, their return types are inferred and checked at build time, and your client code can confidently consume the returned data.

In this post, we’ll look at how it achieves these goals and what limitations it places on your project stack.

Intro to Vite

An Introduction To Vite

Josh Green Articles, JavaScript, Tutorial Leave a Comment

In this blog, I’ll be introducing Vite, a JavaScript build tool that strives to be a faster and leaner development experience for modern web projects.

I found Vite while browsing a Reddit thread and saw several users that were very happy with the technology, so I decided to give it a try myself. I’ve found Vite to be extremely fast, which lends well to making little tweaks and adjustments to the code (even in large applications) and seeing those changes very quickly. But be forewarned, Vite is relatively new and can be temperamental.

React’s Unique Looping Tool For Beginners

John Dehan Articles, Development Technologies & Tools, JavaScript, React Leave a Comment

In the post, I’ll be talking more about the map() function – how it differs from other common loops, exploring its optional second parameter, using mapping in the return statement, and tracking with keys. By the end, I hope you’ll have a clearer understanding of how the map() function can be useful in your React projects.

Please note, this post is geared toward React beginners and new coders. Veteran users may not glean as much from the content.

Top React Frameworks for Enterprise App Dev

Top React Frameworks for Enterprise App Dev

Zach Gardner Articles, Consulting, Development Technologies & Tools, Opinion, React Leave a Comment

There is such a rich, user-driven ecosystem around React that it can be difficult to discern which frameworks, if any, should be used to develop enterprise-grade applications. This blog post dives into the most popular ones and analyzes which are most suitable for that specific use case.

Before diving in, please remember: the decision of which one is the right one for a given organization or application is very context-specific, so diligent consideration is required to ensure an optimal outcome.

Apollo Client and GraphQL

Apollo Client: State Management for GraphQL Made Easy

Braden Niswonger API Development, Articles, Development Technologies & Tools, GraphQL, JavaScript, Programming, React Leave a Comment

In this post, we will explore Apollo Client integrated with a React application and how it provides an abstraction layer between a JavaScript application and a GraphQL server. The features Apollo Client offers make it a prime choice for devs also using GraphQL.

We’ll begin by discussing what Apollo Client is and how it can be advantageous over other state management libraries. And finally, we will look at some example React queries for retrieving and mutating data.

Let’s get started.