GraphQL + Apollo – Part 1: An Introduction

This past September, I attended the Strange Loop conference in St. Louis. Among the plethora of great talks that I attended was one about GraphQL, given by Lee Byron. This talk, supplemented by a great deal of research, convinced me that I should use GraphQL in the project that I started a couple of months ago.
Read more on GraphQL + Apollo – Part 1: An Introduction…

Timing Your Queries in Knex.js for Node.js

While developing web applications, I keep a close eye on performance issues, particularly in database queries. In my latest project, I’ve been using Knex.js, a SQL query builder for Node.js.

I developed a method of logging the queries executed by Knex.js as well as the execution times for each query. This method can be applied to nearly any application that uses Knex.js, and it uses a few features of Knex.js that I didn’t notice immediately, so I thought I’d share this small but useful bit of code.
Read more on Timing Your Queries in Knex.js for Node.js…

Higher-Order Components in React

React emphasizes composition over inheritance, making it simple to compose larger components by reusing smaller ones. This approach is at odds with the way many programmers are accustomed to reusing code: inheritance Object-Oriented Programming (OOP).

React uses higher-order components (HoCs) as an alternative to inheritance. Similar to higher-order functions, which take or return other functions, HoCs are functions that take a component as an argument and return another component. Read more on Higher-Order Components in React…

Lazy Sequences with ECMAScript 6 Generators

Generators are an ES6 feature that started receiving a lot of attention a few years ago because of their potential to ease some of the pain associated with writing asynchronous code. However, with the emergent async/await proposal (mere syntax sugar around generators and promises), some of the shine has worn off, and generators aren’t getting the same amount of attention they used to.

This is a shame, because even if you disregard their uses in asynchronous code, generators are still pretty cool in their own right. I’m going to explore some of the ways you can use them to implement lazy sequences.
Read more on Lazy Sequences with ECMAScript 6 Generators…

More Robust Browser-Side Networking

What happens to your web application when used over a flaky network connection? Does it swallow errors and stop responding? Does it bounce users immediately to the browser’s built-in “no connection” page? Does it give you a way to continue using the application when network connectivity is restored?

It used to be acceptable to simply say that a web application could only be used when there was a consistent, reliable network connection. They are web applications, after all. But it’s time to stop using that excuse. Read more on More Robust Browser-Side Networking…

Elm and Express: A Simple Client-Server Implementation

When I do a side project, I usually want to spin up something quickly, and most of my projects have some sort of client talking to a server. Recently, I’ve been exploring Elm, so I decided to find a quick way to put together a simple client and server using Elm and Express. Here’s what I’ve come up with.
Read more on Elm and Express: A Simple Client-Server Implementation…