Type-Safe Object Merging (TypeScript 2.8 Edition)

There are times when you want to merge two generic types in TypeScript, and type inference just isn’t doing it for you. Object.assign’s typing isn’t as precise as it could be, and spreading generics still doesn’t work. I’ve found a way to implement typing when merging objects using some of the new features in TypeScript 2.8.

Read more on Type-Safe Object Merging (TypeScript 2.8 Edition)…

Excel Snapshot Testing with Node

A couple of weeks after I worked on PDF snapshot testing with Node and GraphicsMagick, I was tasked with writing some code to generate downloadable Microsoft Excel Workbook files. I thought I would use snapshot comparisons again, much as I did with PDF files to automatically detect regressions in the implementation. Read more on Excel Snapshot Testing with Node…

PDF Snapshot Testing with Node and GraphicsMagick

The task I am working on this week involves generating downloadable PDF files for customer and supplier orders. We’d like to drive the implementation using tests and be able to find any regressions in the code automatically.

After looking at different alternatives for accomplishing this, we decided to try a visual snapshot approach similar to the way Jest does snapshot testing.
Read more on PDF Snapshot Testing with Node and GraphicsMagick…

Building Your Own VS Code Extension for a Mac Touch Bar

Visual Studio Code is an excellent editor, with a ton of room for customization. As a recent convert from Emacs, I appreciate the ability to customize my editor through the form of extensions. Creating an extension is quite simple, if none that fit your needs are available in the marketplace. Read more on Building Your Own VS Code Extension for a Mac Touch Bar…

Type Check Your Polyglot Dictionary with TypeScript

I recently started using Airbnb’s Polyglot package to provide some basic I18n for my project. I only needed it to manage translations and do string interpolation for pluralization. I soon found (after a few misspelled translation keys), that I needed to type check my translations for it. Read more on Type Check Your Polyglot Dictionary with TypeScript…

React and TypeScript – The Basics

React is great, and with TypeScript, it can be even better.

If you haven’t used TypeScript with React, you might be wondering how much work is required to get started, and how React development with TypeScript is different than JavaScript. I’m going to address these questions, covering everything I would have liked to find in one place when I was getting started with TypeScript—specifically, what is required to set up a React/TypeScript project, and how some of the basic React/Redux type definitions work. Read more on React and TypeScript – The Basics…