patterns

Tools for Building Rich Web Apps

3 minute read Updated

After recently planning to do a survey of tools for building rich web apps I stumbled across  github.com/codylindley/frontend-tools, which claims to be an opinionated list of tools for building front-end applications. For those new to building modern web applications, it’s certainly easier to take in than larger lists like github.com/joyent/node/wiki/modules. But lists aren’t necessarily the best place to start for putting an application together. At least not where the rubber hits the road.

Update 2017-04-09: This post is out of date. Lately it seems Marko JS may become the new hotness following React and, for Web dev in general, look into JAMstack.

The Holy Grail of Rich Internet Applications

2 minute read Updated

Learning about Isomorphic Web Applications from Airbnb.

One of the largest perceived drawbacks to creating a SPA or other Rich Internet Application is that they’re not SEO friendly or very accessible. With the advent of technologies such as ARIA, HTML5 and Node.js, things are changing. Web apps are becoming more usable and accessible, though also making them crawlable and highly performant is a formidable challenge.

Using ES7 Decorators with Babel 6

1 minute read Published

How to use decorators in JavaScript using Babel.

I wrote this late last year and it gets, well, a lot of traffic. Why? Because it hit home with a common concern in the JS community–a path forward for decorators. It just may change the way you build React apps for the better.

Tame Async JavaScript with ES6

2 minute read Published

Tame async JavaScript with ES6 using Generators and Promises

One of the trickier parts of writing JS for the web is taming async code. Control flow abstractions for handling async JS exist but are commonly overlooked in engineering organizations, which can lead JS projects unknowingly into a labyrinth of IIFEs, through the pyramid of doom ( issue) and directly to callback hell — making code brittle and prone to breakage.

Analyzing User Agent Strings

3 minute read Published

The user agent string, a piece of data transmitted in the HTTP header during a web request, contains information valuable in determining browser type and often basic system information.

Example user agent string sent from a web browser during an HTTP request:

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5

The above example, for instance, provides information such as browser and browser version, user locale (language), OS, system architecture and the layout engine used. When authoring documents for the Web, information from the user agent string can be valuable in determining how best to mark-up documents.

Getting the information is easy.

Building a Better Lightbox

3 minute read Published

Though modal dialogs are not a new concept in UI design, the number of homegrown  Lightbox clones ( source) appearing on the Web since major JavaScript libraries like Prototype and jQuery hit the scene has been staggering. Unfortunately, many of the clones developed leave some key usability considerations unaddressed, and struggle with common problems in accessibility.

Some key usability features that should be considered during creation of a Web-based modal dialog include (1) manage focus and allow tab navigation (2) disable elements outside the modal dialog (3) give users an out and (4) provide graceful error recovery.