Monday, February 24, 2014

Development Grunt Tasks in a Heroku Production Environment

We ran into a bit of a conflict between Gruntfile.js and package.json. The package.json file defines the npm packages that are used by the application and by Grunt. However, some of the grunt tasks only make sense to run in a development or test environment, but not in a production environment. Our package.json file was able to make this distinction but our Gruntfile.js wasn't.

Thursday, February 20, 2014

Angular JS localization with Require JS i18n module

When we started working with AngularJS, one of the first non-trivial challenges we were faced with was to find a way to localize the text in our app.

We had a few basic requirements for the localization solution:

  1. Will not require any changes to my existing controllers.
  2. Will not polute the current $scope.
  3. Be able to define the desired string directly on the markup with a simple syntax.
  4. Be defined as a module that can be minified and compiled with RequireJS.

Friday, February 7, 2014

Complete Grunt deployment workflow for a client side app with RequireJS, Jasmine, LESS, and Amazon S3

This blog post will cover a complete Grunt workflow for a client side app with RequireJS. There are no server side components, and the data is retrieved through a web service API. The goal for this post is to cover all the different steps for a full Grunt build script with the goal of a complete release package that can be deployed to any environment - in this case, we are deploying to an Amazon S3 bucket.

For this post, we assume some experience of working with Grunt. We will not cover all the different options in the plugins we use, but there will be links to all the plugins for further documentation and reference.

What will we cover?

  • Code check with JsHint.
  • Unit test execution with Jasmine.
  • Compilation and minification of JavaScript files
  • Compilation and minification of LESS files to CSS.
  • Asset management to ensure proper cache functionality
  • Environment configuration by setting environment specific variables.
  • Versioned package ready to be deployed.
  • Deployment of our files to an Amazon AWS S3 bucket.

Let's start!