hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
vschepik 2018-04-18T11:15:40.000333Z

@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.

2018-04-18T11:23:23.000165Z

great πŸ™‚

2018-04-18T11:23:39.000045Z

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

vschepik 2018-04-18T11:38:09.000208Z

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.

vschepik 2018-04-18T11:38:23.000030Z

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?

2018-04-18T11:41:53.000044Z

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

2018-04-18T11:41:59.000145Z

i actually haven't used the repl with cells much

2018-04-18T11:42:10.000096Z

i typically do that kind of thing in my cljs tests

vschepik 2018-04-18T11:43:04.000292Z

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

2018-04-18T11:43:15.000094Z

yup, i just run my tests on "watch"

vschepik 2018-04-18T11:43:33.000469Z

That's nice

2018-04-18T11:43:33.000486Z

and manipulate detached DOM elements with cells in them

2018-04-18T11:44:07.000003Z

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

2018-04-18T11:44:17.000414Z

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

vschepik 2018-04-18T11:45:01.000167Z

Is there direct support for a detached DOM?

2018-04-18T11:45:21.000121Z

yeah

2018-04-18T11:45:29.000020Z

(div) returns a detached div

vschepik 2018-04-18T11:46:48.000232Z

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

2018-04-18T11:47:19.000191Z

up to you https://github.com/crisptrutski/boot-cljs-test

2018-04-18T11:48:00.000369Z

here's some simple examples from core - https://github.com/hoplon/hoplon/blob/master/tst/src/cljs/hoplon/attribute_test.cljs

vschepik 2018-04-18T11:48:32.000474Z

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

2018-04-18T11:48:56.000065Z

you can use that

vschepik 2018-04-18T11:49:02.000419Z

great

2018-04-18T11:49:13.000170Z

you can use whatever pretty much

2018-04-18T11:49:31.000123Z

but probably not node

2018-04-18T11:49:39.000044Z

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

vschepik 2018-04-18T11:49:59.000304Z

yes, i think so that node won't work

2018-04-18T11:50:12.000219Z

but any browser would work

2018-04-18T11:51:20.000435Z

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

2018-04-18T11:51:29.000427Z

notably, events don't bubble by default

2018-04-18T11:51:42.000467Z

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

2018-04-18T11:52:08.000114Z

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

vschepik 2018-04-18T11:52:59.000213Z

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

2018-04-18T11:53:27.000147Z

yup

2018-04-18T11:53:39.000352Z

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

vschepik 2018-04-18T11:53:49.000326Z

yes

vschepik 2018-04-18T11:55:30.000383Z

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.

2018-04-18T11:58:09.000167Z

oh i think you can use a REPL

2018-04-18T11:58:16.000389Z

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

2018-04-18T11:58:58.000293Z

let's see what the other guys have to say

vschepik 2018-04-18T12:00:11.000589Z

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

1πŸ‘
2018-04-18T14:44:24.000591Z

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

1πŸ‘
2018-04-18T14:45:04.000156Z

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

2018-04-18T16:02:11.000193Z

oh yeah

2018-04-18T16:02:21.000117Z

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

1πŸ‘
2018-04-18T16:02:39.000410Z

it will print whenever some-cell changes