Skip to main content

74 posts tagged with "TypeScript"

The TypeScript programming language.

View All Tags

TypeScript vs JSDoc JavaScript

· 6 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

There's a debate to be had about whether using JavaScript or TypeScript leads to better outcomes when building a project. The introduction of using JSDoc annotations to type a JavaScript codebase introduces a new dynamic to this discussion. This post will investigate what that looks like, and come to an (opinionated) conclusion.

title image reading "JSDoc JavaScript vs TypeScript" with a JavaScript logo and TypeScript logo

If you'd like to learn more about setting up a codebase to be type checked with JSDoc and TypeScript, then read this guide.

Google APIs: authentication with TypeScript

· 9 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

Google has a wealth of APIs which we can interact with. At the time of writing, there's more than two hundred available; including YouTube, Google Calendar and GMail (alongside many others). To integrate with these APIs, it's necessary to authenticate and then use that credential with the API. This post will take you through how to do just that using TypeScript. It will also demonstrate how to use one of those APIs: the Google Calendar API.

The Service Now API and TypeScript Conditional Types

· 8 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

The Service Now REST API is an API which allows you to interact with Service Now. It produces different shaped results based upon the sysparm_display_value query parameter. This post looks at how we can model these API results with TypeScripts conditional types. The aim being to minimise repetition whilst remaining strongly typed. This post is specifically about the Service Now API, but the principles around conditional type usage are generally applicable.

Service Now and TypeScript

ts-loader goes webpack 5

· 7 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

ts-loader has just released v9.0.0. This post goes through what this release is all about, and what it took to ship this version. For intrigue, it includes a brief scamper into my mental health along the way. Some upgrades go smoothly - this one had some hiccups. But we'll get into that.

hello world bicep

Bulletproof uniq with TypeScript generics (yay code reviews!)

· 4 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

Never neglect the possibilities of a code review. There are times when you raise a PR and all you want is for everyone to hit approve so you can merge, merge and ship, ship! This can be a missed opportunity. For as much as I'd like to imagine my code is perfect, it's patently not. There's always scope for improvement.

Web Workers, comlink, TypeScript and React

· 10 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

JavaScript is famously single threaded. However, if you're developing for the web, you may well know that this is not quite accurate. There are Web Workers:

A worker is an object created using a constructor (e.g. Worker()) that runs a named JavaScript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window.

If you're using Vite to build your React app, you may prefer to read this post.

Definitely Typed: The Movie

· 49 min read
John Reilly
OSS Engineer - TypeScript, Azure, React, Node.js, .NET

This post is a a little different from most that sit on my site. It's the story of the Definitely Typed project, of which I was an early member. It had a seismic impact on the development of TypeScript. When exchanging messages with Andrew Branch (member of the TypeScipt team), I realised it was an untold story, and perhaps I should tell it, before I forget! So I did, and this is it.

I named it "Definitely Typed: The Movie" as the name entertained me. Little did I know, that a few years later, a documentary would be made about TypeScript, and I'd be in it; in part thanks to writing this history. You can see more about that here.

For now, back to Definitely Typed...

A title image that reads "Definitely Typed: The Movie"