clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
wombawomba 2021-03-14T12:06:08.334800Z

What should I be using for CSS-in-CLJS? (I'm using Reagent to build the DOM)

nilern 2021-03-14T12:16:46.335200Z

One more https://github.com/thheller/shadow/wiki/shadow.markup

wombawomba 2021-03-14T12:33:06.335500Z

thanks 🙂

wombawomba 2021-03-14T12:33:17.335700Z

Which one to choose though? Any recommendations?

wombawomba 2021-03-14T21:56:45.339500Z

So I have a CLJ library that interns all public vars from another ns, that I need to be able to also use in CLJS. How can I make this happen? Considering that CLJS doesn't have intern. The code is basically:

(doseq [[sym var-ref] (ns-publics 'other.ns)]
  (intern *ns* (with-meta sym (meta var-ref)) @var-ref))

wombawomba 2021-03-14T21:58:15.339600Z

(and I won't take "you can't do that" as an answer 😉)

😄 1
2021-03-14T22:03:41.339800Z

You could try the following in a macro: reading in the source namespace as a string and parse that as clojure code and then find all def forms and emit them into the target namespace.

wombawomba 2021-03-14T22:14:25.340Z

yikes

wombawomba 2021-03-14T22:14:45.340200Z

worth a shot I guess

lread 2021-03-14T23:33:59.340800Z

@wombawomba Sounds like you are implementing something like https://github.com/clj-commons/potemkin#import-vars for cljs? I managed to do this for rewrite-clj v1, but decided to abandon the effort. https://github.com/clj-commons/rewrite-clj/blob/main/doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc#potemkin-import-vars.

wombawomba 2021-03-14T23:38:59.341200Z

yeah pretty much

wombawomba 2021-03-14T23:39:08.341400Z

I'll take a look, thanks