Fork me on GitHub
#clojurescript
<
2019-12-22
>
p-himik18:12:35

You cannot have both a cljs and a cljc file for the same namespace, right?

Alex Miller (Clojure team)18:12:24

If you have both, the cljs one will be used

👍 4
dominicm19:12:18

Clojurescript will use the cljc one for macros too

andy.fingerhut19:12:27

ClojureScript will use both the cljs and the clic one if they both exist for the same namespace, e.g. both source files in same directory, and both with same name except the suffix?

mfikes20:12:04

Not really. When loading a runtime namespace, according to the loading rules, .cljs will be preferred over .cljc . When loading a macros namespace .clj will be preferred over .cljc.

Hankstenberg19:12:11

Quick question: I'm getting a javascript object back (from react-native) that I passed in before as a cljs map (from a re-frame subscription). It's a nested something of maps and lists. Is there any way to get the original cljs datastructure back? I tried js->clj, but pretty much everything is broken afterwards (keyword tuned into strings, even if I use keywordize: true). I need to access the data using heavy desctructuring. Is there a better way to handle this problem? I'm using shadow cljs, maybe it offers something here?

p-himik22:12:28

Most likely, it's just Reagent since it's built on top of React. And React is purely JS, so it wants JS objects. If you don't need to access that CLJS map from some JS component, you can just wrap it into some object that is opaque for the clj->js function. More details and some workarounds: https://github.com/reagent-project/reagent/issues/389