Blog

I have recently started writing for Logrocket. My personal blog is here.

Cypress.io: the Selenium killer

One of the main differences between cypress.io and selenium is that selenium executes in a process outside of the browser or device we are testing. Cypress executes in the browser and in the same run loop as the device under test.

Read More

const assertions are the killer new TypeScript feature

For my money, const assertions are the killer new feature of TypeScript 3.4 and as I will explain later, I can omit a lot of tedious type declarations using this new feature.

Read More

Code splitting with typescript, webpack and React lazy

I am writing this because everytime I have to set up code splitting with typescript, webpack and React, I forget how I did it last time and…

Read More

typescript - excess property checks and return type widening

The title of this post would not have meant anything to me 24 hours ago until I came across a scenario that I am surprised I have not come…

Read More

React hooks and closures, there may be dragons

The title of this post would not have meant anything to me 24 hours ago until I came across a scenario that I am surprised I have not come…

Read More

Down the rabbit hole with typescript's mapped and lookup types

Two of the more abstract concepts in typescript are mapped types and lookup types.

Read More

SVG transformations with affine matrices

I recently had a requirement to add zooming and panning to an svg image. Panning and zooming are popular interaction techniques which let…

Read More

Narrowing a union type in typescript and a gotcha with callbacks

Narrowing a union type In typescript, a union type describes a value that can be one of several types separated by the vertical bar, for…

Read More

Creating an Accessible React Website

I've recently been working on an online application form in the form of a multistep wizard that had strict accessibility requirements. I've never worked on a project with such strict requirements before. I've also heard rumblings that it was not possible to make a SPA accessible. It turns out that there is not that much work involved in making your site accessible and I am going to ensure that any work I do from now on has an accessible first approach. I'm now going to outline in no particular order what I have learned over the past few months.

Read More

Animating a Sine Wave With d3.js and MathJax

I have spent the last year learning some of the maths I should have learned about 27 years ago. One of the things that I have found interesting while learning maths is the relationship between the unit circle and a sine wave graph of y = sin(x).

Read More