hoplon 2019-10-21

Hey all. I’m looking into hoplon lately and really like the concept and design of the library. It’s not very active and I encountered a few bugs trying to get it to work with the latest version on master. I want to contribute, but not sure what the best tasks are to pick up atm. Any help to get started on the development is appreciated.

@dmarjenburgh what issues have you run into?

Hoplon itself is very stable, though we have a few things we could improve

I created the TodoMVC app as a tryout. I don’t want to depend on jquery, so I was trying hoplon goog and vanilla (no providers). The hoplon.goog attr providers gave throwing errors (in the latest repository version).

@dmarjenburgh ok, what issues are you encountering with goog? I can help get those fixed

For example

(defmethod on! :hoplon.core/default
  [elem event callback]
  (let [event (obj/get events/EventType (name event))]
    (events/listen elem event callback)))
This doesn’t work, with elements defined as (h/button {:click (fn [e] ...)}), since “click” is not in the events/EventType obj. This should probably just be:
(defmethod on! :hoplon.core/default
  [elem event callback]
  (events/listen elem (name event) callback))

I also got some others, though I’d have to try to reproduce those.

@dmarjenburgh what happens when you dont include :click as part of the map?

ie. (h/button :click #(...))

The event type passed to events/listen will be nil

I can also help fix things by the way, or write some test cases

looks like we might need to uppercase the event name

click is there for sure 🙂

Yeah, uppercasing works. You could uppercase it in the method: (obj/get events/EventType (.toUpperCase (name event)))

PR is welcome 🙂

@dmarjenburgh ^ patched in master

👍🏼 1