Fork me on GitHub
#clojurescript
<
2016-08-01
>
novakboskov17:08:54

ClojureScript compiler has started to behave weird... I have an already established clj/cljs project and today after some work CLJS compiler started to emit JS code which results in:

Uncaught TypeError: Cannot read property 'call' of undefined
at app.js line
my_app.core.init_BANG_.call(null);
What is more weird here is that when I delete target and checkout commit from few days ago, then compile it again it results in the same error. Is it posible that CLJS compiler now emits different JS code than before? Certainly, it is the same CLJS version, literally git checkout <commit_wich_undoubtedly_worked> and recompile.

akiroz17:08:40

care to share more details? what build tool(s) / system are you using? what settings are you passing to the google closure compiler?

novakboskov18:08:53

Sorry people, it was my browser caching... CLJS compiler does its job well as usual. @akiroz: (it's not relevant now) lein + cljsbuild + figwheel

dominicm18:08:15

When cloning the cljsjs project over https, does anybody else get a timeout? I had to use git/ssh to clone it.

anmonteiro18:08:38

@dominicm: I think it’s Github that’s having troubles. Just had a timeout as well pushing to a repo

anmonteiro18:08:29

https://status.github.com/

19:16 WESTWe're investigating reports of connection issues on GitHub.

mattsfrey18:08:33

leave no trace eh

urbanslug18:08:58

@mattsfrey: I want to read the docs and maybe ask again. idk what I’m missing 🙂

pbiggar18:08:47

anyone know how to disable a warning in just one place? Is there a comment-based annotation to disable it or something?

si1418:08:00

how is this even possible? (prn order-id (first (keys @orders)) (= order-id (first (keys @orders))) (get @orders order-id)) prints 1834 1834 true nil — ???

si1418:08:47

and yes, @orders is a sorted map and its first element isn't nil

si1418:08:52

@pbiggar: which kind of warning?

dominicm18:08:24

@anmonteiro: only checked status which was up at the time. I wondered if maybe size was the problem. Makes sense though.

pbiggar18:08:28

@si14: undeclared var

mattsfrey18:08:32

@si14: just because you have a key defined doesn't mean it's associated value isn't nill

mattsfrey18:08:45

which is what that last call queries

mattsfrey18:08:06

all the previous are just calling keys

si1418:08:17

@mattsfrey: yep, it can be the case, but we can check this with some "guard" value like here https://gist.github.com/si14/9cf2c9f75048124989cdfd9ef5272169

si1418:08:29

I'm probably missing something, but I can't see why exactly the key isn't found there

si1418:08:37

ah, I see

si1418:08:46

explanation here: https://gist.github.com/si14/9cf2c9f75048124989cdfd9ef5272169 apparently you can provide any function as a comparator in CLJS. If you screw up and provide e.g. keyword as a comparator, the map will be displayed properly, but all attempts to get an element from it will fail

si1418:08:19

not sure if it's a proper behaviour, it's totally unexpected

si1418:08:35

Clojure handles this properly: ClassCastException clojure.lang.Keyword cannot be cast to java.util.Comparator clojure.core/sorted-map-by

si1418:08:48

should I file this into CLJS's JIRA?

colindresj19:08:25

Asked this question last week, but didn’t really get an answer: for those using writing queries or pulls in cljs land, which then get applied server-side to datomic, how are you addressing issues around authorization, permissions, scoping, etc?

danielgrosse20:08:57

I have a js function which returns an object with some values. Now I want to merge these values with an existing js object. This object can't be transformed with js->clj. How could I realise this?

anmonteiro20:08:02

@danielgrosse: (js/Object.assign destination source)?

danielgrosse20:08:13

Ah thank you.

krchia23:08:28

how does one do recursive reference in cljs?

mathpunk23:08:03

I’m interested in doing my side project in state-of-the-art CLJS, but I can’t figure out what the right way to go about setting up my dev environment is.

mathpunk23:08:18

I was surprised to find that I couldn’t require clojure.spec in a CIDER cljs repl.

mathpunk23:08:39

I assume that’s my screw-up, ‘cause I’m pretty sure cljs has spec….

anmonteiro23:08:59

@mathpunk: until the next CLJS release you’ll have to require cljs.spec

anmonteiro23:08:35

it’s not yet up to date with Clojure 1.9 alpha 10 though