This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-04
Channels
- # aleph (8)
- # aws (14)
- # babashka (37)
- # beginners (30)
- # calva (5)
- # cider (4)
- # clj-kondo (21)
- # cljsrn (4)
- # clojure (234)
- # clojure-denmark (1)
- # clojure-europe (10)
- # clojure-france (10)
- # clojure-italy (4)
- # clojure-nl (17)
- # clojure-sanfrancisco (1)
- # clojure-spec (8)
- # clojure-uk (44)
- # clojurescript (20)
- # cursive (9)
- # datascript (2)
- # datomic (5)
- # emacs (9)
- # fulcro (50)
- # graalvm (32)
- # jackdaw (18)
- # leiningen (1)
- # malli (10)
- # meander (10)
- # nrepl (10)
- # off-topic (15)
- # pathom (20)
- # re-frame (14)
- # reagent (37)
- # reitit (7)
- # ring (1)
- # shadow-cljs (102)
- # test-check (6)
- # tree-sitter (15)
- # vim (4)
- # xtdb (2)
- # yada (1)
I vaguely remember talk at ClojuTRE about generating forms / UI based on Malli. Has anyone tried something like that? Any interesting pointers?
generating UIs - there are many ways to do that: 1. walk the malli schema and emit an ui-application out of that, did a quick hack of that in a project, reagent + antd 2. walk the malli schema and emit an ui-schema out of that, to be rendered somehow 3. have both malli schema (“the model”) and an ui-schema (“the layout”) and use them together to generate the ui
in 1 & 2, the malli.visitor
needs 1-2 extra args to be usefull: all walked schemas should know their place in the schema (e.g. the :in
in explain) and in the data (the :path
). This enables the ui-elements to be standalone, the ui-component knows where in the app-state the data needs to be stored.
I used formik-style custom helper to get the usability-stuff done right, dirty form state etc.
but, nothing Ready now, if someone has time and skills at making awesome forms, happy to help with that.
there is https://domino-clj.github.io/, idea was that it’s own model could be swapped with malli (just need a protocol to abstract the model and make malli-domino
wrapper). It has also a graph-engine to calculate values & other cool features.
checked the js-side form generators last year, some good things to learn from there, e.g. https://github.com/rjsf-team/react-jsonschema-form & https://jsonforms.io/