News for hackers. Stuff that matters.
Re:ClojureScript beginners' home page by holtalanm on Wednesday April 18, 2018 @09:53AM (#16867373)
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.

Re:ClojureScript beginners' home page by bhurlow on Wednesday April 18, 2018 @10:05AM (#16867465)
Support 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 And https://andrearichiardi.com/blog/posts/lumo-npm-dependencies...

Re:ClojureScript beginners' home page by bgorman on Wednesday April 18, 2018 @10:45AM (#16867780)
NPM basically does not work with the standard Clojurescript compiler. I would avoid mentioning this topic around newbies, as it will only result in frustration.
Re:ClojureScript beginners' home page by jiyinyiyong on Wednesday April 18, 2018 @10:05AM (#16867469)
Try shadow-cljs 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.
Re:ClojureScript beginners' home page by holtalanm on Wednesday April 18, 2018 @10:19AM (#16867572)
I'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?

Re:ClojureScript beginners' home page by jiyinyiyong on Wednesday April 18, 2018 @10:29AM (#16867651)
I use shadow-cljs as a replacement of figwheel. shadow-cljs is quite powerful already, in development and bundling.
Re:ClojureScript beginners' home page by holtalanm on Wednesday April 18, 2018 @10:52AM (#16867838)
oh, its a _replacement_ for figwheel. Gotcha. In that case, I'll take a look and get it going.

Thanks!

Re:ClojureScript beginners' home page by typon on Wednesday April 18, 2018 @10:01AM (#16867439)
Been 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.
Re:ClojureScript beginners' home page by jiyinyiyong on Wednesday April 18, 2018 @10:06AM (#16867476)
Still, please try shadow-cljs https://news.ycombinator.com/item?id=16866085 and join us on Slack.
Re:ClojureScript beginners' home page by typon on Wednesday April 18, 2018 @10:31AM (#16867661)
Yep, 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.

Re:ClojureScript beginners' home page by puredanger on Wednesday April 18, 2018 @10:34AM (#16867687)
It'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

Re:ClojureScript beginners' home page by holtalanm on Wednesday April 18, 2018 @10:18AM (#16867558)
i think the underlying problem is that the documentation is incomplete and/or outright incorrect.

CLJSJS was a life-saver for me, at least.

Re:ClojureScript beginners' home page by KingMob on Wednesday April 18, 2018 @12:36PM (#16868747)
Work 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).
Re:ClojureScript beginners' home page by cutler on Wednesday April 18, 2018 @01:09PM (#16869018)
I 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.