Fork me on GitHub
#hoplon
<
2018-04-18
>
vschepik11:04:40

@thedavidmeister Your article really convinced me to give Hoplon a try. I had a look at Hoplon some time ago but I didnโ€™t realize that Hoplon works directly on the DOM as shown in your article.

thedavidmeister11:04:39

if there's anything i can help with, let me know

vschepik11:04:09

Yes, indeed ๐Ÿ˜ What is a good setup when one wants to use a cljs REPL for manipulating e.g. Javelin cells in order to see how the UI behaves? In a later step I would connect the cellโ€™s state to a backend.

vschepik11:04:23

I donโ€™t understand the relationship between running

boot dev
and boot-cljs-repl. Should I run
boot dev
and
boot repl
with
(start-repl)
of boot-cljs-repl side-by-side?

thedavidmeister11:04:53

that's a question for @alandipert or @micha i think

thedavidmeister11:04:59

i actually haven't used the repl with cells much

thedavidmeister11:04:10

i typically do that kind of thing in my cljs tests

vschepik11:04:04

Ah OK. I guess you run the cljs tests from the command line without a REPL, aren't you?

thedavidmeister11:04:15

yup, i just run my tests on "watch"

vschepik11:04:33

That's nice

thedavidmeister11:04:33

and manipulate detached DOM elements with cells in them

thedavidmeister11:04:07

by the time i get to building a UI that i'm looking at in the browser, it's a bit too high level for the type of things i need the REPL/tests for

thedavidmeister11:04:17

at that point it's more like lego ๐Ÿ˜›

vschepik11:04:01

Is there direct support for a detached DOM?

thedavidmeister11:04:29

(div) returns a detached div

vschepik11:04:48

OK. So what is the JavaScript runtime for the tests? Does it contain a DOM or is it unnecessary?

vschepik11:04:32

Thanks, I will check it out. At the first glance I have seen doo. Have used it with leiningen and cljs build before.

thedavidmeister11:04:56

you can use that

thedavidmeister11:04:13

you can use whatever pretty much

thedavidmeister11:04:31

but probably not node

thedavidmeister11:04:39

i mean, you'll need the ability to create DOM elements ๐Ÿ˜›

vschepik11:04:59

yes, i think so that node won't work

thedavidmeister11:04:12

but any browser would work

thedavidmeister11:04:20

the only thing to keep in mind is that browsers and some libs do treat detached DOM elements a little differently in some situations

thedavidmeister11:04:29

notably, events don't bubble by default

thedavidmeister11:04:42

jquery events do bubble because it normalises them to work this way

thedavidmeister11:04:08

so if you need event bubbling you should append your elements to the DOM at the start of the test

vschepik11:04:59

OK, thanks for the hint. Will save a lot of investigation time ๐Ÿ˜ƒ

thedavidmeister11:04:39

that's not anything to do with hoplon unfortunately >.<

vschepik11:04:30

I will try to find a good workflow for me. In my last project I used the ClojureScript REPL a lot when developing a UI with reagent and leiningen. Perhaps "reload" is a good alternative to a cljs REPL.

thedavidmeister11:04:09

oh i think you can use a REPL

thedavidmeister11:04:16

i just can't help you set it up ๐Ÿ˜‰

thedavidmeister11:04:58

let's see what the other guys have to say

vschepik12:04:11

Yes, I'll wait for them. Nevertheless thanks for your advice.

๐Ÿ‘ 4
alandipert14:04:24

i don't use a repl, i prefer to print cells to console

๐Ÿ‘ 4
alandipert14:04:04

the repl will always be a 2nd class thing in cljs because of the compilation model, so ive found it easier to just embrace reloading

thedavidmeister16:04:21

(j/cell= (prn some-cell)) is your friend

๐Ÿ‘ 4
thedavidmeister16:04:39

it will print whenever some-cell changes