hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
2018-08-13T02:09:18.000015Z

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.

2018-08-13T02:47:37.000133Z

@mandimby.raveloarinja that's not a bug it's expected as you need to pull in the do!/on! Multimethod implementations

2018-08-13T02:48:38.000053Z

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

2018-08-13T02:52:48.000032Z

It's definitely supported to use as a library in this manner.

2018-08-13T02:54:07.000007Z

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

2018-08-13T02:58:06.000129Z

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.

flyboarder 2018-08-13T03:21:03.000062Z

It has a whole page in the wiki 😉

2018-08-13T03:21:33.000041Z

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.

2018-08-13T03:31:39.000024Z

Basic thing like do! :value was not working either: silly me for missing that

flyboarder 2018-08-13T14:37:06.000322Z

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

flyboarder 2018-08-13T14:39:01.000564Z

perhaps we can check for attribute providers via meta data in boot-hoplon

flyboarder 2018-08-13T14:39:15.000072Z

(ns hoplon.jquery
  {:hoplon/attribute-provider true})

flyboarder 2018-08-13T14:44:04.000405Z

and just warn if we can’t find any