from Hacker News

ClojureScript Is Not An Island: Integrating Node Modules

by swannodette on 7/12/17, 5:38 PM with 42 comments

  • by priornix on 7/12/17, 11:12 PM

    One thing I really like about Clojure is how the language has basically stayed the same, but I can use it on the heavy server-side stuffs like working with Hadoop, Spark, ElasticSearch to the front-end stuff like React, React Native, to CLR and now into nodejs, while staying sane [1] in the process. It feels like comparing a nice tropical island paradise to a crowded, hectic, mutating market, where everyone is competing for your attention and selling their newest wares.

    [1] https://hackernoon.com/how-it-feels-to-learn-javascript-in-2...

  • by swannodette on 7/12/17, 8:24 PM

    This feature is really, really a long time coming. Myself and other ClojureScript core contributors are happy to answer any questions people may have.
  • by lilactown on 7/12/17, 9:42 PM

    This is awesome. CLJS is amazingly close to having as good host-interop with JavaScript as plain Clojure does with Java.

    Will be interesting to see how this impacts things like the React Native and Node.js service-side stories.

  • by mtnygard on 7/12/17, 8:38 PM

    This is a nice step forward for developer experience. I struggled to get NPM and Clojurescript to play nicely. Ultimately, I had two different build systems at play in one project. (Three if you count Webpack.)

    It'll be nice to have such an easy integration.

  • by nickbauman on 7/12/17, 8:53 PM

    The thing I like about Clojurescript is the ability to escape the node/NPM ecosystem entirely. It's feature, not a bug, that I don't want to interoperate with node/NPM.
  • by xiaoma on 7/13/17, 4:43 AM

    What's the best resource for learning CLJS as of mid 2017?
  • by fiatjaf on 7/12/17, 9:05 PM

    How does Clojurescript lookup for a module you declare?

    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

  • by kcorbitt on 7/12/17, 9:35 PM

    This is a great step for ClojureScript. It's extremely difficult for a compile-to-JS language to bootstrap a large enough ecosystem to stand alone. A good interop story neatly sidesteps that issue.
  • by fernandohur on 7/17/17, 7:23 PM

    I just want to thank the Clojure(Script) team for such an amazing work. It really is a joy to work in Clojure(Script) and improvements like this make it an even better tool to work with.

    Keep up the good work!

  • by curryingyou on 7/13/17, 1:05 AM

    How did clojurescript use node modules / APIs before?
  • by bribri on 7/13/17, 12:47 AM

    Do I still need externs?
  • by Scarbutt on 7/12/17, 9:42 PM

    Scary, any newbie will read this and run away.

    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.