Hello everyone, I tried to use Hoplon using a project build using shadow-cljs I ran into an issue but I am not sure whether it is a bug or it is expected. In my main file I only require hoplon.core; as a result multi methods defined in hoplon.jquery are not brought in and Hoplon implementation of IDeref for the jQuery event is not available. To make it work I have to require hoplon.jquery even if I am not using it directly. Now I am not sure whether it is supported to use Hoplon as a library. I was trying to do something similar to https://yogthos.net/posts/2016-06-06-WorkingWithHoplon.html. Thanks in advance for any feedback.
@mandimby.raveloarinja that's not a bug it's expected as you need to pull in the do!/on! Multimethod implementations
Seems like you're past this point but this is my skeleton project for shadow+hoplon which might be useful https://github.com/jjttjj/shadow-hoplon-starter
It's definitely supported to use as a library in this manner.
You could define you're own implementations of do!/on! And not depend on jQuery at all, or you could use the hoplon.goog version
Indeed that is what I have done. I am not sure it was not explicitly mentioned in the Hoplon wiki. Thank you very much for the feedback.
@mandimby.raveloarinja https://github.com/hoplon/hoplon/wiki/Attribute-Providers
It has a whole page in the wiki 😉
Indeed. By default boot-hoplon will auto include the hoplon.jquery attribute provider unless another provider is given to the :refers option of the (hoplon) task. This is to maintain backwards compatibility.
I certainly have jumped from https://github.com/hoplon/hoplon/wiki/Composing-HTML to https://github.com/hoplon/hoplon/wiki/HTML-Attributes-and-JS-Events. My bad.
Basic thing like do! :value was not working either: silly me for missing that
The Readme snipped has the attribute provider but I think we should comment the snippet more, it’s only clear if you can already read hoplon code but it’s easy to miss things like the attribute provider line
perhaps we can check for attribute providers via meta data in boot-hoplon
(ns hoplon.jquery
{:hoplon/attribute-provider true})
and just warn if we can’t find any