juxt / clip

Light structure and support for dependency injection
MIT License
228 stars 15 forks source link

Clip/Aero Reference Alignment #36

Open jvia opened 1 year ago

jvia commented 1 year ago

Using Clip and Aero in combination has been a great experience so far. The only UX issue I run into on my team is the difference between how Clip and Aero refer to other pieces of the edn config. It could be nice to have alignment or a doc example on how to create align on a per-project basis.

Here are some examples, one with alignment on the Clip syntax and the other with alignment on the Aero syntax. I suspect the Aero syntax would be achievable on a per-project basis by defining custom reader tags.

clip

{:configuration
 {:port 300}

 :components
 {:database  {:start (some.ns.database/start)}
  :webserver {:start (some.ns.webserver/start
                      {:port     (aero/ref :port)
                       :database (clip/ref :database)})}}}

aero

{:configuration
 {:port 300}

 :components
 {:database  {:start (some.ns.database/start)}
  :webserver {:start (some.ns.webserver/start
                      {:port     #aero/ref :port
                       :database #clip/ref :database})}}}
SevereOverfl0w commented 1 year ago

One downside I've noticed when there's alignment is that people get confused about when to use which. Having the two syntaxes might help delineate the two kinds of reference, unsure.