Clojurians
#hoplon
<
2015-10-24
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

levitanong08:10:50

You’ll never believe what hoplon can do to your google map...

asolovyov11:10:21

cljs-console not working for me at all

asolovyov11:10:33

clojure.lang.ExceptionInfo : failed compiling file:src/mk/fe/common/menu.cljs
clojure.lang.ExceptionInfo : No matching method found: indexOf for class clojure.lang.Symbol at line 92 src/mk/fe/common/menu.cljs
java.lang.IllegalArgumentException : No matching method found: indexOf for class clojure.lang.Symbol
Error on file src/mk/fe/common/menu.cljs, line 92, column 5

asolovyov11:10:50

that's just (log/info outs) (where outs is certainly defined)

thedavidmeister13:10:57

i'm having troubles with the hoplon "getting started"

thedavidmeister13:10:03

anyone available to help?

thedavidmeister13:10:31

(def history (cell [])) (add-watch clicks :history #(swap! history conj %3)) (cell= (print history))

thedavidmeister13:10:35

appears to do nothing in chrome?

thedavidmeister14:10:47

(def history (cell [])) (add-watch clicks :history #(swap! history conj %3)) (cell= (pr :thingy history))

thedavidmeister14:10:51

further clicks do not give extra debug

alandipert14:10:41

hi @thedavidmeister would you care to gist your whole file? i can try

levitanong14:10:19

Testing on safari, and it seems to work fine.

thedavidmeister14:10:19

lots of clicks, no debug :disappointed:

alandipert14:10:37

i want to say something very similar happened to @statonjr recently but we got to the bottom of it

alandipert14:10:59

i think it was caused by cljs repl

thedavidmeister14:10:20

the live reload thing?

alandipert14:10:22

it was trying to print to the repl connection instead of the console

alandipert14:10:30

na there's an actual repl task that you can connect

alandipert14:10:45

but it redirects output to the repl connection instead of the console

alandipert14:10:53

do you have anything about a repl in your build.boot?

thedavidmeister14:10:54

do i turn that off in build.boot

thedavidmeister14:10:06

(deftask dev "Build estimate-work for local development." [] (comp (serve :port 8000 :handler 'estimate-work.handler/app :reload true) (watch) (speak) (hoplon) (reload) (cljs-repl) (cljs)))

alandipert14:10:34

try commenting out the line that says (cljs-repl)

thedavidmeister14:10:27

glad i got on chat >.<

alandipert14:10:33

glad it worked

thedavidmeister14:10:39

so what does the repl do exactly?

alandipert14:10:07

there is a function in cljs for setting the print function.... the function things like prn and println should use

alandipert14:10:20

hoplon sets it to console log

alandipert14:10:32

but the repl machinery then also sets it, to something for piping output to the repl connection

thedavidmeister14:10:04

i mean, in a more basic sense

thedavidmeister14:10:11

how would i use the cljs repl?

thedavidmeister14:10:21

if hoplon wasn't conflicting with it

alandipert14:10:26

but basically, you connect to the running clojure repl, and run a function there that drops you into a cljs repl

alandipert14:10:31

where forms you type get evaluated in the browser

thedavidmeister14:10:53

oh, there's a boot command

alandipert14:10:01

when you run boot repl it starts a repl, but that also starts a repl server

alandipert14:10:08

that you can connect to from other terminals with boot repl -c

alandipert14:10:16

aka the 'repl client'

thedavidmeister14:10:44

i do stuff in the browser

thedavidmeister14:10:53

and it is visible in terminal?

alandipert14:10:58

the other way around

alandipert14:10:14

like yuo would type (js/alert "hi") in your terminal, and see an alert in the browser

alandipert14:10:38

personally i think it's not worth all the complexity, compared to live reload

thedavidmeister14:10:45

because i can't do that in the javascript console any more

thedavidmeister14:10:17

well, i think it's fine from my perspective

thedavidmeister14:10:19

i just didn't know about it

alandipert14:10:23

you are on a mac, right?

thedavidmeister14:10:28

really killed my buzz going through the tutorial

thedavidmeister14:10:41

spent like 3x longer on this repl thing than the actual tutorial

alandipert14:10:46

yeah that sucks

alandipert14:10:54

how did you get your initial build.boot btw?

thedavidmeister14:10:02

i just ran a lein command

thedavidmeister14:10:12

admittedly not the one it said at the start

thedavidmeister14:10:20

i wanted to get a server backing

thedavidmeister14:10:25

and the tutorial said run the client only buidl

alandipert14:10:48

would you mind adding a note about what you saw and how to fix it, at the place where it stumped you?

alandipert14:10:55

you are victim #2, sadly

thedavidmeister14:10:40

does that sound right?

thedavidmeister14:10:53

I just paraphrased my understanding of what you said @alandipert

alandipert14:10:00

:thumbsup: , thanks!

alandipert14:10:24

would also be curious to know any other ideas you might have for improving the material, i hope to build out the wiki more this weekend

thedavidmeister14:10:33

it is a little sparse

thedavidmeister14:10:40

i'm going to play around with hoplon a bit more though

thedavidmeister14:10:43

it does look really good

thedavidmeister14:10:15

it looks like it fits a use-case i have really well

alandipert14:10:46

i'm off for now, thanks again for reporting the issue

thedavidmeister14:10:54

np, thanks for fixing it!

mynomoto15:10:21

@alandipert: I will remove the cljs-repl from the hoplon-castra template too, it will cause the same kind of trouble. Or maybe add the cljs-console to the getting-started and templates. What do you think?

micha15:10:51

@mynomoto: i wonder if cljs-repl sets the *print-fn* after hoplon or before?

micha15:10:13

in hoplon we could definitely do something more subtle than just set print fn to console log

micha15:10:36

we could get the preexisting print fn if one was configured and write to it as well as to the console

micha15:10:50

that could in some cases result in multiple console logs, i guess

mynomoto15:10:45

Yeah, I'm not sure of how cljs-repl works at all, I only used it enough to make sure that if someone typed (.alert js/console "Hi") it would work :wink:

micha15:10:45

haha :thumbsup:

alandipert16:10:23

maybe we should do direct console calls in the tutorial instead of using println

alandipert16:10:28

not a bad idea to show interop anyway