@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.
great π
if there's anything i can help with, let me know
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.
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?that's a question for @alandipert or @micha i think
i actually haven't used the repl with cells much
i typically do that kind of thing in my cljs tests
Ah OK. I guess you run the cljs tests from the command line without a REPL, aren't you?
yup, i just run my tests on "watch"
That's nice
and manipulate detached DOM elements with cells in them
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
at that point it's more like lego π
Is there direct support for a detached DOM?
yeah
(div)
returns a detached div
OK. So what is the JavaScript runtime for the tests? Does it contain a DOM or is it unnecessary?
here's some simple examples from core - https://github.com/hoplon/hoplon/blob/master/tst/src/cljs/hoplon/attribute_test.cljs
Thanks, I will check it out. At the first glance I have seen doo. Have used it with leiningen and cljs build before.
you can use that
great
you can use whatever pretty much
but probably not node
i mean, you'll need the ability to create DOM elements π
yes, i think so that node won't work
but any browser would work
the only thing to keep in mind is that browsers and some libs do treat detached DOM elements a little differently in some situations
notably, events don't bubble by default
jquery events do bubble because it normalises them to work this way
so if you need event bubbling you should append your elements to the DOM at the start of the test
OK, thanks for the hint. Will save a lot of investigation time π
yup
that's not anything to do with hoplon unfortunately >.<
yes
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.
oh i think you can use a REPL
i just can't help you set it up π
let's see what the other guys have to say
Yes, I'll wait for them. Nevertheless thanks for your advice.
i don't use a repl, i prefer to print cells to console
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
oh yeah
(j/cell= (prn some-cell))
is your friend
it will print whenever some-cell
changes