ÆFLASH

React Tips and Best Practices

I've spent a good deal of the past year working with React. I've written, refactored, and re-written many components in that time, and I've seen some best practices and anti-patterns emerge.

Read more…
code javascript react components elements

Avoid forEach

Iterate over a collection. For side effects

Read more…
code javascript functional programming collections reduce transducers refactoring

Make and Browserify

I've written a lot about front-end build tools over the past year, and I have one more build-related topic to write about before I go back to talking about functional programming and javascript: Make.

Read more…
code javascript make makefiles commonjs browserify grunt Gruntfile livereload

Watchify and Grunt

One of the things that inevitably happens as your Browserify project gets large is that your build starts becoming slow. What starts out as a one-second build starts taking four to five to ten to fifteen seconds to build as you add more libraries and modules. This really can slow down your development process, as the edit → save → rebuild → livereload → debug → edit cycle starts taking longer and longer.

Read more…
code javascript modules commonjs browserify grunt Gruntfile livereload

Grunt-Browserify 2.x and Browserify-Shim

Much has changed with Grunt and Browserify over the past several months. Unfortuantely, at the time of my last Grunt/Browserify guide, the versions of the plugins I was using were already out of date. Since then, Browserify, grunt-browserify, and browserify-shim have all gone through major version updates, and as the semantic version implies, there are many backwards-incompatible changes. This guide will go over the changes needed to get something like what is described in the previous guide working. It is targeting browserify@3.44.2, grunt-browserify@2.0.3 and browserify-shim@3.4.1, although newer versions will likely work.

Read more…
code javascript modules commonjs browserify grunt Gruntfile livereload

A Year with Browserify

NOTE: this guide is out of date. It is only vaild for grunt-browserify@~1.3.0 and its included versions of browserify and browserify-shim. An updated guide is here.

Read more…
code javascript modules commonjs browserify grunt Gruntfile livereload

Monads

After my last article, I've done some more research on what monads are. They seem to be one of the last core concepts of functional programming that is still a bit elusive to me. This is a good introductory video that finally made things start to click for me. Also, this article titled You Could Have Invented Monads made me realize that they really are not that complicated.

Read more…
code javascript functional programming monads async callbacks

Async and Functional Javascript

Following in the spirit of my previous post, I realized that Functional Programming can help solve one of the problems that often arises in javascript: Callback Hell.

Read more…
code javascript functional programming async callbacks