This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-17
Channels
- # announcements (7)
- # architecture (12)
- # babashka (5)
- # bangalore-clj (4)
- # beginners (70)
- # biff (23)
- # calva (21)
- # clojure (130)
- # clojure-bay-area (3)
- # clojure-berlin (1)
- # clojure-brasil (1)
- # clojure-europe (55)
- # clojure-finland (4)
- # clojure-greece (5)
- # clojure-nl (3)
- # clojure-norway (10)
- # clojurescript (52)
- # code-reviews (4)
- # community-development (1)
- # data-science (7)
- # datahike (6)
- # datomic (1)
- # events (1)
- # figwheel-main (7)
- # fulcro (23)
- # helix (2)
- # honeysql (32)
- # malli (18)
- # membrane (6)
- # nbb (22)
- # nyc (1)
- # off-topic (26)
- # pathom (2)
- # polylith (34)
- # quil (13)
- # releases (1)
- # remote-jobs (4)
- # scittle (1)
- # shadow-cljs (52)
- # sql (24)
- # tools-deps (17)
- # vim (11)
- # web-security (15)
- # xtdb (6)
Interesting. What do you have in mind?
I think if I were to try to visualize this, I would start with a generic diff tool. The source and result are pretty far away from each-other in their diagram. My guess is that it would be easier to read if the changes were shown in a more compact form.
Depends. The part of expressions depending on variables is completely independent
Getting close to stretch/alignment support that I'm happy about. Some aspects that I think are neat:
ā¢ the implementation is orthogonal to the rest of the API.
ā¢ as always, all components are pure functions and views are immutable
ā¢ there's no side-effecty/procedural "layout" step.
ā¢ alignment and stretch depends on ::container-size
which is just a regular contextual property. It's not a new "type" of state. The ::container-size
property can either be passed explicitly or threaded implicitly by defui as context.
ā¢ Even though you can't measure or draw a stretch/aligned element without a container size, it's still useful to be able to represent "a center aligned element". I'm pretty happy that it didn't require any changes to support this. You can omit the container size and assoc
the container size later when it's available:
(def elem
(center-align
{:body (ui/rectangle 20 20)}))
(ui/bounds elem)
;; throws exception because bounds doesn't make sense
;; without a container size
(def sized-elem1
(assoc-in elem
[:context ::container-size] [40 100]))
(ui/bounds sized-elem1) ;; [30.0 60.0]
(def sized-elem2
(assoc-in elem
[:context ::container-size] [100 40]))
(ui/bounds sized-elem2) ;; [60.0 30.0]