onaio/zebra — pull request #687 by prabhasp (2014-09-24 07:43:46+00:00)
Title: [MAYBE MERGE] 507 advanced compilation

I started work towards #507, but got stuck, and thought I'd commit this much up.
What this commit does is adds a `prod` build option to cljsbuild, though doesn't really hook that up to anything (eg. `deploy`), because advanced compilation isn't producing good js yet. So its okay to commit, it shouldn't break anything. However, advanced compilation is not working.

The problem is that the top-level namespaces don't seem to be output in advanced-compiled js. Interestingly, for me, `ona.home.init` gets output (just open the console and type `ona` to see what is getting output for you), but `ona.dataset.init`, `ona.tableview.init` and `ona.mapview.init` are giving issues, despite the fact that I added the same `^:export` annotations in all the places.

![screen shot 2014-09-24 at 1 27 12 pm](https://cloud.githubusercontent.com/assets/178868/4384990/60f25b32-43be-11e4-98c0-72fdfc36595e.png)

In order to test the output of advanced compilation, I was doing the following:
- run `lein cljsbuidl auto prod` in a separate window, and when that compilation is done, refreshing a view such as `http://localhost:3000/hkicameroondata/11/164#` to see whether it is working. It wasn't so far. Note that at present advanced compilation and normal compilation output to the same place (so that testing is easy), so make sure you are testing advanced-compiled code. For now, the way to know that you are testing that is to find an error in the console.