Fork me on GitHub
#clojurescript
<
2021-03-14
>
wombawomba12:03:08

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

wombawomba12:03:17

Which one to choose though? Any recommendations?

wombawomba21:03:45

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))

wombawomba21:03:15

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

😄 3
dvingo22:03:41

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.

wombawomba22:03:45

worth a shot I guess

lread23:03:59

@U15RYEQPJ 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.

wombawomba23:03:59

yeah pretty much

wombawomba23:03:08

I'll take a look, thanks