5 ms·
I wish this existed few weeks ago. It would be awesome if there's something similar to this but with JavaScript/jQuery translations to ClojureScript/Google Clos
by sirn 15y ago
I wish this existed few weeks ago. It would be awesome if there's something similar to this but with JavaScript/jQuery translations to ClojureScript/Google Closure. In my opinion, that's the hardest part after getting the basics.
- swannodette 15y agoWe'll try to add some practical DOM & Ajax examples. Thanks for the feedback.
- spacemanaki 15y agoHave you checked out jayq or domina? They give you nice wrappers around JQuery and the Google Closure libs and are relatively self explanatory to use if you've messed with any DOM libs before... https://github.com/ibdknox/jayq https://github.com/ibdknox/jayq https://github.com/levand/domina https://github.com/levand/domina
- sirn 15y agoYes, I did. In the end I stick with Domina for DOM manipulation and Google Closure library for the rest. I decided to skip jQuery (jayq) to experiment on doing things "the ClojureScript way," it's only a personal project after all.
- oinksoft 15y agoNote that ClojureScript is only related to the Google Closure project via the compiler. So a demonstration of jQuery to Closure Library API calls would serve an unrelated purpose.
- sirn 15y agoI don't know if the initial announcement still applies today; but I think ClojureScript encourages using Google Closure library for DOM manipulation and event handling[1]: > The ClojureScript compiler emits JavaScript which follows Google Closure's code conventions, and then invokes the Google Closure compiler to generate compact, optimized JavaScript for delivery to clients. ClojureScript also makes use of the Google Closure library for capabilities such as event handling, DOM manipulation, and user interface widgets. > It is possible to use ClojureScript with JavaScript libraries other than Google Closure, but those libraries typically do not follow the conventions of the Google Closure compiler and therefore will not be able to take full advantage of its optimizations. They even have few wrappers to Google Closure Library under the `clojure.browser` namespace[1] (although from my testing, some of them, such as `clojure.browser.event`, is not compatible with ADVANCED_OPTIMIZATIONS.) [1]: http://clojure.com/blog/2011/07/22/introducing-clojurescript.html http://clojure.com/blog/2011/07/22/introducing-clojurescript... [2]: https://github.com/clojure/clojurescript/tree/master/src/cljs/clojure/browser https://github.com/clojure/clojurescript/tree/master/src/clj...