Radian is the perfect set up for projects that need to scale fast. The AMD structure allows single developers to large teams to quickly and efficiently write and deploy great apps.
Radian comes with everything out the box, that means there’s all the minification and concatination tasks as well as a local server and even a PhantomJS web crawler to deal with SEO woes.
Testing is at the heart of Radian, so out the box it comes complete with all the unit tests you could want, here’s the proof.
Radian is better with Yeoman, use it to set up your project and use the subgenerators to quickly create your app’s code, with tests included.
Radian is highly customisable; from the offset you can start with the barebones app or reverse engineer the example code.
There are a few dependencies to install before we can get started:
Install these by running:
npm install -g grunt-cli bower
If you want to use Yeoman to generate your app, you’ll need to install it and the Radian generator:
npm install -g yo generator-radian
If you want to write your app in CoffeeScript, you’ll need to install that as well; just follow the instructions on the website.
Once you have Yeoman and the Radian generator installed, you can set up your Radian project simply by running:
Radian gives you the option of how you want to code your app. By default it will use CoffeeScript, SASS and Jade; however as you run the set up via Yeoman it will give you the options of which CSS preprocessors you want to use, if any, from the following list:
You can also choose not to use any preprocessors and instead just use vanilla JS, CSS and HTML. All the fun!
You can then make use of the built in subgenerators to create your project files, you have the choice of two types of generators, you use them by running:
yo radian:TYPE 'NAME'
This generator will create a TYPE, say controller, in
assets/coffee/TYPE and create a test spec in
test/unit/TYPE; where TYPE is one of the following:
yo radian:controller 'foo bar'
define [ 'controller/radian-controller' ], (RC) -> class extends RC @register 'FooBarController', [ '$scope' ] init: () ->
define [ 'config' 'angular' 'controller/foo-bar-controller' ], (cfg, A) -> describe 'Foo Bar controller', () -> $scope = null createController = null beforeEach module cfg.ngApp beforeEach inject ($injector) -> $controller = $injector.get '$controller' $rootScope = $injector.get '$rootScope' $scope = $rootScope.$new() createController = () -> $controller 'fooBarController', $scope: $scope it 'should load', () -> controller = createController()
This generator creates a partial and an accompanying style partial (note that the types of partial will depend on your Yeoman set up options, e.g. if you chose to use Jade and SASS, then a Jade partial with a SASS style partial would be created), e.g. running:
yo radian:partial 'my new view'
assets/partial/my-new-view-partial.jade, and finally updates
assets/css/_partials.sass to include the newly created SASS file.
All you need to have installed is git and the dependencies listed above.
To start using Radian simply download the code from github.com and set it up:
npm install grunt install grunt
grunt will generate all the JS, CSS and HTML, and it’ll also start the local server, so point your browser to http://localhost:8000 and you’re laughing.
To test your new application, you need to make sure some test dependencies are installed globally so they are available on your $PATH:
npm install -g protractor karma webdriver-manager update
You will then be able to execute all tests – unit, integration and end-to-end – by running: