This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-15
Channels
- # announcements (2)
- # babashka (137)
- # beginners (96)
- # calva (3)
- # cider (11)
- # clj-kondo (8)
- # cljs-dev (161)
- # cljsrn (21)
- # clojure (78)
- # clojure-europe (47)
- # clojure-france (1)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (24)
- # clojure-uk (9)
- # clojuredesign-podcast (4)
- # clojurescript (39)
- # conjure (2)
- # core-async (27)
- # cursive (36)
- # datomic (54)
- # emacs (6)
- # figwheel (9)
- # figwheel-main (46)
- # fulcro (25)
- # graalvm (8)
- # helix (30)
- # hoplon (6)
- # hugsql (3)
- # jobs (5)
- # leiningen (7)
- # luminus (12)
- # nrepl (20)
- # off-topic (20)
- # pedestal (16)
- # re-frame (14)
- # reagent (3)
- # reitit (3)
- # remote-jobs (5)
- # rum (25)
- # shadow-cljs (60)
- # spacemacs (10)
- # vim (2)
- # xtdb (36)
for me the reverse problem is more interesting, I don't need spec for checking dev time code, I need it to generate data
I don't think hs needs to wrap def. I think we just need some kind of spec which does {"helix/props" <spec>}
as a js obj.
I want to at least expose the cdef
because it allows helix to change the way it handles props w/o messing with people’s specs
I wouldn't say it's much more of a mouthful than the equivalent without hs: (s/fdef greeting :args (s/cat :props (hs/props map?)))
.
next thing to think about is how to compose component specs, e.g.:
;; somehow get props spec of a specific component
(s/def ::greeting-props (hs/props-of greeting))
(s/def ::greeting-container-props
(s/keys [::greeting-props]))
(s/fdef greeting-container
:args (s/cat :props (hs/props greeting-container-props)))
(defnc greeting-container
[{:keys [greeting-props]}]
($ greeting {& greeting-props}))
Fulcro has guardrails (https://github.com/fulcrologic/guardrails) * not sure if it helps spec JS object but it has a similar goal of only being for development time and not impact prod bundle size (haven’t used it though, but might be a good reference)