It would be cool if I could just plug and play!
Granted this rules out some libraries, there are plenty of libraries written in a simple straightforward style that will work just fine. In particular I am bullish about fantastic results with ES6+ libraries written with ES6 classes with static import/export. Closure will eat that stuff up.
Is passing through the complexity, pain and all the caveats one can encounter from this really worth it for using Clojurescript? Serious question, now that with have ES6+ and today babel/webpack are solid tools.
I mean from all the modules mess, I didn't get what's the correct way to do javascript interop right now.
As a beginner, I recommend you looking at the Reagent [7] or Rum [8] React library first, than you can look at something more complex and full-featured like Om [9] later (whose author is also a ClojureScript core contributor @swannodette).
PS: You can also learn by implementing a Dashboard like this [10]. Disclaimer: I am the author of this library.
[1] http://funcool.github.io/clojurescript-unraveled/
[2] http://clojurescriptkoans.com/
[3] http://todomvc.com/examples/reagent/
[4] https://github.com/reagent-project/reagent/tree/master/examp...
[5] https://github.com/gadfly361/cljs-todomvc
[7] https://reagent-project.github.io/
[8] https://github.com/tonsky/rum
The #1 thing I'm usually looking for is something that eliminates any time-wasting hassles related to getting set up, and all the major language features in some set of working examples.
After that, I usually write little command line apps, play with graphics a bit and convert some simple games into the language.
For example, in https://github.com/omcljs/om/blob/c68e668a73cc534ecfdc71d631... (couldn't think of any Clojurescript library), you have `[om.dom`, `[cljsjs.react`, `[goog.dom`. Where does the compiler look for these things? How does it knows one is a local module and the other an external package?
I need to know this so I can implement it in https://github.com/fiatjaf/module-linker
From viewpoint of compiler, there is no much distinction between local and external packages. Clojure (and so ClojureScript compiler) is built on to of JVM and uses Maven dependencies so that is where most of the dependencies come from. From viewpoint of compiler, all files are in JVM classpath (or in directories specified in Cljs compiler options).
Om declares it's dependencies in project.clj file: https://github.com/omcljs/om/blob/master/project.clj#L13
- om.dom, based on the name, compiler will look for om/dom.cljs/cljc files in classpath, and in this case the file is local to the project
- cljsjs.react is foreign-library (https://clojurescript.org/reference/packaging-foreign-deps) provided by external cljsjs/react package. Compiler indexes all these foreign-libraries at start, so when it encounters require to one of them knows what to do
- goog.dom is Closure module provided by Google Closure library (https://github.com/google/closure-library), which is dependency of ClojureScript. Compiler will look for goog/dom.js file if no .cljs or .cljc by the name is found.
[1] https://hackernoon.com/how-it-feels-to-learn-javascript-in-2...
Will be interesting to see how this impacts things like the React Native and Node.js service-side stories.
It'll be nice to have such an easy integration.
Keep up the good work!