Fork me on GitHub
#clojurescript
<
2018-09-02
>
priornix07:09:23

Hi guys, when targeting nodejs would we be able to work with any cljs libraries?

priornix07:09:48

Eg: Does core.async work in nodejs, or do we need to use a library like https://github.com/mfikes/andare

henrik07:09:46

@priornix Core.async works just fine in CLJS.

priornix07:09:11

Even in nodejs?

priornix07:09:07

I was just wondering why this library exist. So that it's compatible with lumo?

priornix07:09:08

So basically, any cljs library will work with "nodejs" target. Am I correct?

henrik07:09:32

Exactly, it’s for Lumo/Planck. Core.async works in browser, on node, and on plain old JVM. Yes, CLJS libraries will work fine with Node, as long as they don’t specifically target browser tech. For example, Reagent has some stuff that relies on the DOM API, and other parts of the lib (for server-side rendering) that work fine on Node.

priornix07:09:52

That's what I love about Clojure, it can work in Java, JVM, CLR, browser, nodejs, even python (more like Lisp-like ).

👍 4
chrisps11:09:15

trying out clojure.pprint, I don`t understand how I can use the pprint-indent function, for instance:

[:pre (with-out-str  (p/pprint-indent :block 10)
                                 (p/pprint (:db @db/app-db)))]]])

chrisps11:09:29

Say I want to increase the indentation of pprint, how can I do this?

lilactown14:09:06

@priornix the reason that library exists is core.async relies on certain behavior in the compiler for ClojureScript on the JVM that can’t (or is difficult to) be reproduced when using a bootstrapped ClojureScript compiler

lilactown14:09:44

“bootstrapped” meaning that it’s a ClojureScript compiler written in ClojureScript

priornix23:09:25

@lilactown Got it. I guess not all CLJS libraries are self-hosted or bootstrapped compatible then