A journey through our stack

A journey through our stack

Some of ES6 Now

Some of ES6 Now

Works on Mac OS X and Linux using Node

Writing an AngularJS App in TypeScript



Building and Deploying using Grunt







Grunt tasks Grunt is a Javascript 'Task' runner

Tasks are defined in the Gruntfile.js

The Gruntfile.js is just a node.js script

$ grunt test $ grunt server $ grunt build $ grunt deploy

Run the tests

Unit testing with Karma and Phantom JS

End to end tests with Selenium







Configuration Config for development, QA and production

Available as an AngularJS service called 'config'

Grunt inserts the correct environment config into the service when we build

var config: Config; //@@config; angular.module('labs.common.services').constant('config', config);

Building the app Compile the TypeScript files and embeds the settings file

Compile the less files

Concat everything within blocks in the index.html file <!-- build:js({.tmp,app}) scripts/scripts.js --> < script src=" scripts/app.js "></script> < script src=" scripts/controllers/controllerA.js "></script> < script src=" scripts/services/serviceB.js "></script> <!-- endbuild --> Minify the resulting css and js files

Append the hash of the file to the name as a cache buster

Replace libraries with a CDN version

Put everything in a folder ready for deployment

Deploying to S3

Deploy into S3 folder using grunt-aws-s3

var folder=timestamp + "-" + git_commit_hash

e.g. 201401091540-fc90307



Set expiry headers for index.html

params: { Cache-Control: max-age=300 }

