JavaScript GUI library which is usable from ClojureScript?
-
12-12-2019 - |
Question
On one of my ongoing web development projects, we need to create a page (really a mini-application of its own) which will have an interactive, "Web 2.0" interface, more like a graphical desktop application than a typical web page.
I'm hoping to use a higher-level language which can compile down to JS for the client-side logic, rather than programming directly in JS, and ClojureScript is my first choice.
I'm looking for a JS GUI library which can be used from within ClojureScript, and which supports a style of programming similar to "desktop" GUI libraries like Swing, QT, wxWidgets, and so on. It should allow me to create popup <div>
"windows", put widgets such as buttons/labels/etc. in them, attach event handlers to the widgets, and so on. Do you know of one which would work?
Solution
You should consider Google Closure Library. It has all features you ask and is definitely usable from ClojuresScript, I've played around with it. See http://closure-library.googlecode.com/svn-history/r1430/docs/index.html
OTHER TIPS
Clojurescript is still young - I don't think there are mature frameworks of that caliber (yet?). Having said that, I'm building a UI using the following components:
- Twitter Bootstrap + JQuery for visuals and UI elements
- Chas Emerick's Friend for server-side authentication
- Compojure + Ring + Jetty for the server
- Crate (Clojurescript Hiccup) for html/dom generating
- Jayq for JQuery wrapping
- Fetch and/or Shoreleave's remotes for client-server RPC
- Shoreleave's pubsub mechanism or Clojure's
add-watch
for data binding
A good feature of Clojure and Clojurescript are that they favour simple functions on generic data structures. That's why you tend to see several smaller libraries that do one specific job, but work really well together, as opposed to giant monolithic frameworks with an object model that requires you to adopt one way of thinking completely.
I think ExtJS would fit the best in your case, even though this is pure JS. This is the most advanced web GUI library at the moment and it makes possible to create web applications the way similar the one using the desktop languages and IDEs. Just check out their demos. I don't think there will be something similar for the ClojureScript in the foreseen future.