An example of what the template generates can be seen here. http://cljs-bootstrapped.herokuapp.com/
I'm doing this as more of a learning exercise to bring together a number of projects that have helped me greatly in understanding development. Having spent a great deal of time looking at the Clojurescript One source code as well as the excellent tutorials that were written for the framework. I thought the application was a fantastic and expanded my imagination of what was possible.
However, as a beginner to clojurescript, I found that 'One' had too much code to look at. In the end, I gave up. There were too many things going on for my liking and I did not dare tinker with the code for fear of breaking the app completely (which I did a number of times).
This project is my attempt to remake Clojurescript One, but instead of building everything from the grounnd up, I have used cljs-template by Chris Granger as a base. The leiningen template makes use of the excellent clojurescript libraries he has written and makes it much easier to mimic the functionality of Clojurescript One using crate (dom creation), jayq (dom selection and manipulation), waltz (application state management) and fetch (server-side calls).
Each clojurescript library is independent means that I could concentrate on learning about all the pieces seperately then try to put it all together.
Autocompile rocks and I try to avoid using the cljs-repl unless absolutely necessary
cljs-template has a much smaller code footprint and gives a blank slate for any clojurescript project.
Dealing with State
Having created simple GUI interfaces in the past using Visual Studio and Swing, I had a real hard time with application state management. After countless late nights trying to mediate disagreements between buttons, checkboxes and tabs, I gave up altogether (Shudder). Even a relatively simple state example of state changes felt nauseating.
Clojurescript One did implement a state management system but it wasn't explicit like waltz. However, there are too few examples on waltz and the example on the github page did not work because noir.fetch.lazy-store has not been implemented as of 28 May 2012. I hope that my code will add to the documentation of this awesome idea and provide some examples of how clear code can be when seperation of interface and state is achieved.
Bootstrapping CSS and JS Libraries
You'll need both lein-newnew and cljs-template-one.
lein plugin install lein-newnew 0.2.6 lein plugin install cljs-template-one 0.1.5
There's nothing to install: As of preview3, templates are automatically fetched when first used.
lein new cljs-template-one my-awesome-project cd my-awesome-project chmod +x bootstrap.sh ./bootstrap.sh lein run
You now have a complete ClojureScript One Wannabe :)
Copyright © 2012 Chris Granger, Chris Zheng
Distributed under the Eclipse Public License, the same as Clojure.