hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
candera 2018-03-01T12:47:12.000302Z

OK, so I have more information on the situation that makes when-dom eat CPU. I don’t think it’s specific to my application. I believe it happens when using Hoplon jquery. In jquery.cljs, there’s a default on! handler that attaches the callback. But I believe I have a situation where items are added to the DOM and then taken out (into the tpl cache, I believe) before the event loop starts properly. So the condition inside when-dom is never satisfied, or is not satisfied until much later, and CPU chompage results.

candera 2018-03-01T12:47:29.000189Z

What’s weird is that I can rewrite when-dom to give up after a while and my app still works just fine…

2018-03-01T15:28:51.000727Z

oooh

2018-03-01T15:29:05.000406Z

good sleuthing

2018-03-01T15:31:15.000219Z

@candera are you using standard tpl implementation or your custom one?

candera 2018-03-01T15:32:17.000242Z

Both, and I haven’t tracked down which one it is.

2018-03-01T15:42:31.000101Z

hopefully not mine 😉

2018-03-01T15:42:40.000052Z

if it's me i apologise

candera 2018-03-01T15:55:36.000096Z

No, I’m not using yours yet.

candera 2018-03-01T15:55:43.000638Z

I have started to move mine in that direction, though.

2018-03-01T16:01:08.000963Z

you'll need latest hoplon to use mine, the updates to merge-kids are needed

candera 2018-03-01T16:11:26.000508Z

Yeah, that’s why I haven’t moved.

2018-03-01T16:27:06.000804Z

soz, it is simpler though

candera 2018-03-01T16:35:53.000576Z

Right, and I took some of your good ideas. 🙂

candera 2018-03-01T18:36:35.000636Z

So, there’s an interesting technique where you can use CSS animations to get notified of an element being added to the DOM:

candera 2018-03-01T18:36:45.000658Z

https://github.com/naugtur/insertionQuery

candera 2018-03-01T18:38:06.000481Z

I might wind up trying that. Will let you know how it goes.