You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2019. It is now read-only.
With the recent mapping in TS of the model entities and relationships, we now can nicely tests and that's a great win.
However, much like path expressions are direct translation of the model behind it, the TS interfaces are very much coupled to cortex too. For instance, to send a DM when a Kube pod failed, this is what we need to write in the handler:
const pod: Pod = event.root()
pod.uses().isTagged().onCommit().author().of().hasChatIdentity().id()
Although this looks more readable, it's not really intuitive nor transparent:
an user doesn't know the model
some things make sense in a graph theory point of view but their reality in the TS programming model are not intuitive. I mean, you expect person.hasChatIdentity() to return a boolean but it returns an object.
the developer experience suffers from this I believe. Also, the risk is that the model cannot change without all the depending rugs to be updated.
I think we should benefit greatly if we created a TS interface that makes sense for the user and transparently map those calls to what the model requires. For instance:
pod.project().channel().id()
This really makes more sense and abstracts away the model. This can be TS only building on top of the cortex interfaces.