juxt

onetom 2020-02-26T05:05:36.002600Z

I was wondering if it would make sense to call the :components key simply :parts to avoid confusing it with the stuartsierra/components. the benefit of having something shorter is also the ability to provide functions like:

(ns some.app.feature)

(defn parts [some typical params]
  {:some-part {:start `(...)}
   :other-part {:start ...}})

onetom 2020-02-26T05:08:27.004400Z

then at some entry point namespace - eg tests -, u can assemble a system, like:

(def clip 
  {:executor ... 
   :parts (merge (some.app.feature/parts 1 2 3)
                 (other.app.feature/parts :a :b :c))})

onetom 2020-02-26T05:29:58.012800Z

if im reading the description of a system from an edn file, am i supposed to specify the executor there too? i have the impression that this top-level {:executor ... :components ...} structure is unnecessary noise (at this stage at least). i could imagine that we call the "part configuration" of the various subsystems *clip*s. then we can combine multiple clips into a bigger clip. if we start a clip, we get back a system. so interaction with a bigger system would look like:

@(def clip (merge (company.feature-1/clip 1 2 3)
                    (company.sub-system-2/dummy-clip :x :y)
                    (company.db/in-mem-clip)))
  @(def sys (clip/start clip optional-executor))
  (clip/stop clip sys))
where those company.*/*clip functions would just return maps like that parts function above. i feel like the system-config is a bit ambiguous term, because by config i would expect something containing more static data

onetom 2020-02-26T05:35:28.014400Z

we can also carry the executor info with the system config map as meta data:

@(def sys (-> clip (with-meta {:executor non-default-executor}) clip/start))

dominicm 2020-02-26T07:28:32.014500Z

This seems like a good idea.

dominicm 2020-02-26T07:32:09.014700Z

I want something more visible than metadata for this. I think when you look at a system (print it, throw it, whatever) it should be very clear that something is changing the execution flow.

dominicm 2020-02-26T07:35:58.014900Z

I really want users to specify their required executor. You can merge components or parts together separately ofc.

onetom 2020-02-26T07:41:39.015100Z

what do u mean by system here, the config or the return value of (clip/start)? isn't the execution flow determined by the dependencies between parts in the 1st place? just by looking at a system, that's not super clear anyway, regardless of the executor. i was just wondering a few minutes ago how can i check who depends on what, because my system is getting hairing already.

onetom 2020-02-26T07:44:01.015600Z

this lib is pretty nice for component: https://github.com/walmartlabs/system-viz has anyone looked into adopting it for juxt/clip?

onetom 2020-02-26T07:50:37.017Z

this is a pretty clear view of the system dependencies:

(-> clip :components (#'clip/safely-derive-parts []) first)
=> {:config #{}, :aws/credentials-provider #{:config}, :aws/ssm #{:aws/credentials-provider}}
maybe that safely-derive-parts shouldn't be a private function 🙂

dominicm 2020-02-26T07:52:57.017100Z

You're right, I mean system config :) I'll blame morning brain (but really I'm just loose with the terminology). In one sense, you're right. But the sequencing between those dependencies is potentially done in a variety of ways. One major clip goal is to make the system really explicit.

dominicm 2020-02-26T07:54:08.017300Z

The temporary answer now is that you could write an executor that prints out the order which things are running. Alternatively, there's some functions in the impl namespace for creating the dependency graph.

dominicm 2020-02-26T07:54:43.017500Z

This seems like something worth exposing as a public API though.

dominicm 2020-02-26T07:55:50.018600Z

I think, but am not certain, that you could feed clip's dependency graph straight to rhizome.

dominicm 2020-02-26T07:56:02.018900Z

Maybe even to loom.

dominicm 2020-02-26T07:56:48.019600Z

Yeah, open to a dependency graph function which returns a data structure like that

2020-02-26T17:20:46.021100Z

I have a strange behaviour with bidi which I can't quite explain

2020-02-26T17:21:08.021700Z

one route works fine locally but not in prod (so after the uberjar/docker magic)

2020-02-26T17:21:41.022800Z

however if in the repl I do (bd/match-route routes "/loans") it actually returns not-found, so it would seem it doesn't work locally either

2020-02-26T17:22:28.023600Z

anyway the question is simply if anyone is aware of potential issues that can occur after uberjar but not during local dev, before I dig further to understand what's going on

dominicm 2020-02-26T17:22:52.024400Z

Bidi itself is pretty agnostic to all that.

2020-02-26T17:24:12.025800Z

mm yeah makes sense, so I think locally it works thanks to some other magic, the thing which makes it a bit more complicated is that routes are in a cljc file. SPA routes are merged with server only routes in the api.clj ns, but then the routing is done also in the SPA directliy

2020-02-26T17:24:41.026600Z

so well probably some other magic going on there, I'll have a look. if in the repl match-route doesn't work it means the route definition is just wrong I guess