Fork me on GitHub
#hoplon
<
2023-04-03
>
mynomoto02:04:47

I did an automatic snapshot release via github actions https://clojars.org/hoplon/versions/7.3.0-SNAPSHOT. It would be great if people tried it to see if everything is working as it should after the move from boot to deps.edn. I did some testing using the goog provider but I did not test the jquery one yet.

mynomoto02:04:28

The counters demo is using the snapshot version and the goog provider.

mynomoto02:04:13

I would like some input on the cljs.hl compiler, should we make an effort to keep it? Is anyone still using it?

dave05:04:08

My understanding is that it's not advised to use that anymore. We moved away from it a while back at Kevel.

mynomoto10:04:55

Ok, I found https://github.com/hoplon/hoplon/issues/103 that explains the reasoning.

mynomoto10:04:13

Does anyone have a clj-kondo config for Hoplon? It doesn't have to be perfect, I want to include it on Hoplon itself.

dave16:04:29

We have some things -- not perfect, but hopefully helpful as a starting point: .clj-kondo/config.edn

{:lint-as {castra.core/defrpc      clojure.core/defn
           hoplon.core/for-tpl     clojure.core/for
           javelin.core/cell-let   clojure.core/let
           javelin.core/cell-doseq clojure.core/doseq
           javelin.core/defc       clojure.core/def
           javelin.core/defc=      clojure.core/def
           javelin.core/formulet   clojure.core/let
           javelin.core/with-let   clojure.core/let}
 :hooks    {:analyze-call {hoplon.core/elem     hooks/hoplon-core-elem
                           hoplon.core/defelem  hooks/hoplon-core-defelem
                           hoplon.core/loop-tpl hooks/hoplon-core-loop-tpl}}}
.clj-kondo/hooks.clj
(ns hooks
  (:require [clj-kondo.hooks-api :as api]))

(defn hoplon-core-defelem
  [{:keys [node]}]
  (let [[_defelem name & forms]  (:children node)
        [docstr & [args & body]] (if (api/string-node? (first forms))
                                   forms
                                   (concat [""] forms))]
    {:node (api/list-node
            (list*
             (api/token-node 'defn)
             name
             docstr
             (api/vector-node
              [(api/token-node '&) args])
             body))}))

(defn hoplon-core-elem
  [{:keys [node]}]
  (let [[_elem & [args & body]] (:children node)]
    {:node (api/list-node
            (list*
             (api/token-node 'fn)
             (api/vector-node
              [(api/token-node '&) args])
             body))}))

(defn hoplon-core-loop-tpl
  [{:keys [node]}]
  (let [[_loop-tpl _bindings-kw bind & body] (:children node)]
    {:node (api/list-node
            (list*
             (api/token-node 'for)
             bind
             body))}))

mynomoto11:04:58

This is great! Would you like to create a PR with it or may I add it to Hoplon?

dave12:04:50

Thanks! You can feel free to add it. I would make a PR, but I'm a bit overwhelmed with other things at the moment