3 ms·
I've been learning Clojure and ClojureScript in my spare time. I can honestly say that one thing that would make adoption a lot more wide-spread is a better way
by holtalanm 9y ago
I've been learning Clojure and ClojureScript in my spare time. I can honestly say that one thing that would make adoption a lot more wide-spread is a better way to include NPM modules in the project.
I know that there is a new feature for it, but the documentation was a little cryptic. Ended up just adding some CLJSJS dependencies to my project and giving up on using the NPM module I _really_ wanted to use.
In the end, that could be because i'm just lazy, though. I'd love to hear what others think on this topic.
- typon 9y agoBeen working on a cljs project and took me a solid week to get npm integration working. The documentation is either wrong or incomplete on both the official site and the wikis for lein/boot.
- jiyinyiyong 9y agoStill, please try shadow-cljs https://news.ycombinator.com/item?id=16866085 https://news.ycombinator.com/item?id=16866085 and join us on Slack.
- typon 9y agoYep, that's what I ended up discovering and going with. However, shadow-cljs REPL integration was also pretty hard to get working with my editor (spacemacs), because most of the tutorials assume you're using lein to build your project. shadow-cljs is pretty dope though. Almost instantaneous rebuild times and basically no setup besides a small, understandable config file.
- holtalanm 9y agoi think the underlying problem is that the documentation is incomplete and/or outright incorrect. CLJSJS was a life-saver for me, at least.
- puredanger 9y agoIt's helpful to post doc problems / questions on the clojurescript-site issues so that it can be improved. https://github.com/clojure/clojurescript-site/issues https://github.com/clojure/clojurescript-site/issues
- bhurlow 9y agoSupport for NPM modules out of the box is a hot topic in the cljs community, imo things have greatly improved even in the past few months. Checkout https://github.com/anmonteiro/lumo https://github.com/anmonteiro/lumo And https://andrearichiardi.com/blog/posts/lumo-npm-dependencies.html https://andrearichiardi.com/blog/posts/lumo-npm-dependencies...
- bgorman 9y agoNPM basically does not work with the standard Clojurescript compiler. I would avoid mentioning this topic around newbies, as it will only result in frustration.
- jiyinyiyong 9y agoTry shadow-cljs https://news.ycombinator.com/item?id=16866085 https://news.ycombinator.com/item?id=16866085 you want npm modules in ClojureScript and you get npm modules in your ClojureScript. If not, then I'm quite sure you can get help from thheller who created shadow-cljs.
- holtalanm 9y agoI'll have to look at that. It may provide a solution to my problems. Does shadow-cljs integrate well into an existing figwheel/reagent project?
- jiyinyiyong 9y agoI use shadow-cljs as a replacement of figwheel. shadow-cljs is quite powerful already, in development and bundling.
- holtalanm 9y agooh, its a _replacement_ for figwheel. Gotcha. In that case, I'll take a look and get it going. Thanks!
- KingMob 9y agoWork on this is still ongoing. Clojurescript had to upstream a lot of module-handling code into Google Closure to get it going, and older, non-Node/ES6 module libs will never work under advanced-mode compilation (e.g., polyfills).
- cutler 9y agoI really had high hopes for Clojurescript but I tried many times to get my front-end finished in Reagent but the documentation was useless. In the end I turned to React and, with the help of a good, detailed video tutorial, I had it finished in a week. Ecosystem really matters and I find that Clojurescript, despite its innovations, is still too bits and pieces when it comes to just getting stuff done. I never thought I'd give-up on Clojurescript but eventually I did.