Fork me on GitHub
#shadow-cljs
<
2019-07-22
>
superstructor04:07:29

@dfcarpenter try Visual Studio Code with Calva unless your really keen on Atom. Atom appears to be dieing a slow death these days.

romain09:07:10

I have setting variables depending of the environment (dev, test, prod), how can I store and import them?

romain09:07:03

I just saw these ^^' So I can make 3 files (one for each environment) and use config-merge (preferred over shadow-env) when building the project?

romain09:07:33

I wanted to store the variables in a EDN file for example

thheller09:07:50

well you probably should load that configuration file in your app then

thheller09:07:55

and not make it part of your build?

romain09:07:20

I have to differentiate the environment, for example URL of my API is different if I'm in dev env or prod env

pez09:07:57

@dfcarpenter also check in #chlorine for what you can expect to work. (If you haven't, of course)

dfcarpenter18:07:12

Thanks. I did realize where I was going wrong.

tianshu11:07:42

where the SHADOW_ENV is defined.

beders22:07:19

anyone else having trouble using the latest #fulcro with shadow-cljs?

beders22:07:25

I'm getting this:

Execution error (IllegalStateException) at com.google.common.base.Preconditions/checkState (Preconditions.java:823).
Externs must contain builtin for env BROWSER: whatwg_console.js

thheller22:07:08

looks like maybe a dependency conflict?

beders22:07:09

my dependencies (:lein true) are:

[
   [thheller/shadow-cljs "2.8.41"]
   [binaryage/devtools "0.9.7"]
   [fulcrologic/fulcro "2.8.4"]
   ]

thheller22:07:30

check lein deps :tree

beders22:07:07

ouch. a lot indeed

beders22:07:13

thanks for the hint!

beders22:07:19

also: love shadow-cljs!

beders22:07:16

I really don't need fulcro, but I wanted to use pathom which has a visualizer which uses fulcro. Oh well.

currentoor22:07:43

my code is able to compile fine the first time but when i save a file (whitespace change) i get this uncaught error in the JS console

#error {:message 
"The map literal star … ven number of forms."
, :data {:type :reader-exception, :ex-kind :reader-error}}

currentoor23:07:03

figured it out

currentoor23:07:12

this project had this poorly formatted code

currentoor23:07:14

(let [color (.hcl js/d3 color)
      color (.brighter color .9)]
  (.toString color))

currentoor23:07:32

the complier emitted a warning but still compiled

currentoor23:07:56

however the edn message shadow-cljs was pushing to the client was malformed

thheller08:07:43

hmm not sure how that would ever happen. do you have something reproducible for this?

currentoor22:07:56

the message is The map literal starting with :prefix contains 5 form(s). Map literals must contain an even number of forms.

currentoor22:07:35

the stacktrace is

shadow$cljs$devtools$client$env$process_ws_msg	@	env.cljs:168
(anonymous)	                                  @	browser.cljs:349

currentoor22:07:39

i see the shadow-cljs websocket is connected

currentoor22:07:00

i see the offending message from the websocket, it’s huge and it does indeed have a malformed map

currentoor22:07:27

but AFAIK shadow-cljs server constructs this message

currentoor22:07:35

are there certain deps that are incompatible with shadow-cljs?

romain22:07:45

@thheller --config-merge is used to override vars in shadow-cljs.edn but you cannot use it to define custom vars? I would like to do something like shadow-cljs build app --env=dev, so I have to manage it inside my app and not with shadow-cljs?