Sunday, February 8, 2015

Isomorphic React + Flux using Yahoo's Fluxible, part 2

On my last post, I demonstrated how to create a simple Isomorphic Application with multiple routes using Yahoo's Fluxible library. On this post, I will expand that app so it can communicate with a backend API, in order to build a simple To-Do application.

Sunday, November 30, 2014

Isomorphic React + Flux using Yahoo's Fluxible, part 1

Earlier this year Facebook announced Flux, an "architecture for building user interfaces that eschews MVC in favor of a unidirectional data flow". The official Flux website does a pretty good job explaining the virtues and overall philosophy of Flux, but falls a bit short when demonstrating a real implementation.

That's where the Yahoo Flux examples come in. Not only do they demonstrate how to use Flux, but they do it by building an Isomorphic application.

Tuesday, August 5, 2014

Isomorphic apps with Backbone.js and React

Ever since AJAX came into the scene more than 10 years ago, developers have been looking for a way to build fast, efficient, and powerful web applications with as little maintenance nightmares as possible. Many developers now prefer to create single page applications (SPAs), delegating the entire UI rendering to the client. However, SPAs come with a set of problems:

Thursday, July 31, 2014

Dynamically loading optimized require.js files

One of the greatest benefits of using require.js is that you're able to structure your code into small, manageable modules, each living in its own file. This is great during development, but loading multiple files as separate HTTP requests is a performance-killer on production.

That is why require.js comes with r.js, an optimizer that combines and minifies related scripts together. If your app is relatively small, the easiest thing to do is to produce a single file with all your JS code combined and minified. However, as your app increases in size, it makes more sense to split your app into bundles, and only loading each bundle if/when it is required.

Thursday, January 23, 2014

Resetting your postgres database before each spec

If you run integration tests, you've probably come across this problem:
You need to find a way to clean your database before each spec runs.

There are two common approaches to solve this problem:
  1. Run every spec inside a transaction
  2. Truncate all tables before (or after) every spec

Monday, September 23, 2013

Living Documentation with Javascript

Documentation is an essential part of software development. Good documentation allows developers to collaborate and build upon each other's work, speeds up the onboarding process for new team members, and makes debugging easier.

However, many developers fail at writing documentation. Very often you'll find projects where:
  • There's no documentation, because developers never got around to it.
  • There's documentation, but it's so outdated it's practically useless.

Sunday, September 8, 2013

Managing your dotfiles with Puppet

As developers, we spend a lot of time tweaking our workstations to make sure it adjusts perfectly to our workflow. Most of our configuration is stored in dotfiles, ie, hidden files that start with a dot (.bashrc, .bash_profile, .vimrc, .gitconfig, etc). Lately, many developers have decided to store their dotfiles using version control. That way they have a safe copy in case anything might happen to their local computer, and it makes it easier to set up a new computer if they need to.

While everyone agrees this is a good idea, there's not consensus on what's the best way to do it. Github even published a website where it keeps track of different plugins to use and paths to follow. After trying a few of them, I decided Puppet was the best tool for this task.