keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
Ahmed Hassan 2019-07-05T10:46:24.156500Z

The required namespace "<http://keechma.toolbox.forms.app|keechma.toolbox.forms.app>' is not available, ...

Ahmed Hassan 2019-07-05T10:47:45.157200Z

The required namespace "<http://keechma.toolbox.dataloader.app|keechma.toolbox.dataloader.app>' is not available, ...

Ahmed Hassan 2019-07-05T10:47:59.157700Z

I'm facing these two errors.

Ahmed Hassan 2019-07-05T10:48:51.159100Z

Is it correct namespace to install Forms and Dataloader?

carkh 2019-07-05T12:18:16.159800Z

[<http://keechma.toolbox.dataloader.app|keechma.toolbox.dataloader.app> :as <http://dl.app|dl.app>] got that in namespace definition and it works

carkh 2019-07-05T12:19:00.160400Z

i don't use the forms thingie, i usually have personal requirements that never fit with any library

carkh 2019-07-05T12:19:52.160800Z

did you add the toolbox to your deps.edn or project.clj ?

Ahmed Hassan 2019-07-05T16:04:25.161700Z

Yeah, i added it toolbox to shadow-cljs.edn

carkh 2019-07-05T16:16:20.162500Z

are you sure your current selected build can see it? looks like a project level problem

Ahmed Hassan 2019-07-05T18:39:43.163800Z

I tried in repl, all namespaces are available which are documented here: https://keechma.com/api/keechma-toolbox/

Ahmed Hassan 2019-07-05T18:40:06.164600Z

But namespaces which I mentioned are giving same error in repl too.

Ahmed Hassan 2019-07-05T18:40:46.165Z

I'm using [keechma/toolbox "0.1.6"]

carkh 2019-07-05T18:42:33.165400Z

version 0.1.24 is the latest

✔️ 1
carkh 2019-07-05T18:43:52.165900Z

i got bitten by that too @mihaelkonjevic should maybe update that page you linked

carkh 2019-07-05T18:44:52.166800Z

and add a current version to the github project =)

mihaelkonjevic 2019-07-05T18:45:13.167Z

@carkh @ahmed1hsn yeah, will do. I got bitten by an old version in my deps yesterday too 😰

carkh 2019-07-05T18:45:24.167300Z

=)

mihaelkonjevic 2019-07-05T18:45:35.167800Z

worst part, I had linked dev version in checkouts, so it was working locally

carkh 2019-07-05T18:46:06.169100Z

you're hiding a new version from us !

Ahmed Hassan 2019-07-05T18:46:12.169500Z

Thanks @carkh and @mihaelkonjevic how can I know latest versions of Keechma and keechma/forms?

mihaelkonjevic 2019-07-05T18:46:28.170600Z

you can see it on github

Ahmed Hassan 2019-07-05T18:46:43.171500Z

And does keechma/forms have to be added separately?

mihaelkonjevic 2019-07-05T18:46:45.171600Z

and on clojars

mihaelkonjevic 2019-07-05T18:46:57.172Z

keechma toolbox depends on keechma/forms

mihaelkonjevic 2019-07-05T18:47:37.172900Z

it’s a bit weird becasue keechma/forms is developed to be used without keechma, and then keechma toolbox has alternative implementation that’s using some parts from keechma/forms but is using controllers under the hood

mihaelkonjevic 2019-07-05T18:48:29.174Z

@carkh I’d like to hear about your personal requirements for forms. I wonder if I have solutions ready 🙂 . I was able to implement various weird requirements over the years without any problems

carkh 2019-07-05T18:48:53.174400Z

well i'm more of a "multi-year projects" guy

carkh 2019-07-05T18:49:34.175200Z

so, i like to have my forms work just like i want, usually that's server validation, real time reported to the client

mihaelkonjevic 2019-07-05T18:49:47.175400Z

makes sense

carkh 2019-07-05T18:50:18.176500Z

i've been solo developing and maintaining not so many project but over many years

mihaelkonjevic 2019-07-05T18:50:37.176900Z

I used to hate forms, and wrote at least 10 different libs over the last decade, but it finally stabilized with keechma

carkh 2019-07-05T18:51:08.177500Z

i think it's ok to have specific per project implementation, when the time frames are as long as mine

mihaelkonjevic 2019-07-05T18:52:45.179200Z

yeah, definitely. I need a default implementation that is good enough and I put a lot of research / work in UX support - especially around the error reporting - here’s a blog post I wrote some years ago about that https://medium.com/wdstack/inline-validation-in-forms-designing-the-experience-123fb34088ce

Ahmed Hassan 2019-07-05T18:53:02.179800Z

Is [keechma "0.3.13"] newest Keechma version?

mihaelkonjevic 2019-07-05T18:53:06.180Z

yes

carkh 2019-07-05T18:53:29.180500Z

@mihaelkonjevic i think i already did read that, and did not agree with you !

mihaelkonjevic 2019-07-05T18:53:56.180900Z

interesting, would love to hear more

carkh 2019-07-05T18:54:08.181300Z

i think you concluded that validation after pressing ok was the best way

mihaelkonjevic 2019-07-05T18:55:10.182600Z

it goes like this: - if field is in error state - it will validate on change (keypress) - if it’s in valid state - it will validate on blur - on submit it will validate all fields (even if they are not dirty)

carkh 2019-07-05T18:55:33.183100Z

that's almost acceptable !

carkh 2019-07-05T18:56:08.184400Z

what i like is debounced, timout based on change validation, always ask the server as single source of truth

carkh 2019-07-05T18:56:38.185200Z

the password confirm case is handled by the server to only report errors when it makes sense

carkh 2019-07-05T18:57:04.186200Z

there is a state machine, when you press ok, ok button becomes unusable

mihaelkonjevic 2019-07-05T18:57:17.186800Z

In my experience at least 90% percent of validations can be performed on client (with same validations on server). The only things that require server interaction and can’t be done on client are validations that require uniqueness

carkh 2019-07-05T18:57:26.187Z

and everything needs to be revalidated, cannot post while validation is in flight

carkh 2019-07-05T18:57:52.187400Z

well, i'm with you on that, but you still need to validate on server anyways

mihaelkonjevic 2019-07-05T18:58:50.188800Z

yeah, but a lot of server side solutions have a problem with partial validations -> and you don’t want to show errors for stuff that user hasn’t touched yet

carkh 2019-07-05T18:58:59.189200Z

why then do the job twice, once you have the machinery to do real time server validation there is no overhead

mihaelkonjevic 2019-07-05T18:59:27.190Z

so, I guess it would be possible in Clojure or with custom validation lib, but defaults (like in Rails or Phoenix) are horrible

carkh 2019-07-05T18:59:30.190200Z

i had a solution on my klast project for wizard-like partial validation

carkh 2019-07-05T19:00:01.190500Z

but that wasn't very elegant i must concede

carkh 2019-07-05T19:00:33.191300Z

because then the server had to know this was a wizard

carkh 2019-07-05T19:00:40.191600Z

which is not its concern

carkh 2019-07-05T19:00:44.191800Z

or should not be

mihaelkonjevic 2019-07-05T19:00:46.191900Z

my conclusion (so far) regarding wizards are that each page should be treated as a separate form, with persistence on the last step (maybe saving draft version without validations)

mihaelkonjevic 2019-07-05T19:01:13.192600Z

I must say that I started to consider them antipattern, but designers sure do love wizards

carkh 2019-07-05T19:01:32.193300Z

mhh well when you have much data

mihaelkonjevic 2019-07-05T19:01:53.194Z

and then there is soooo much problems with going back, optional steps and similar

carkh 2019-07-05T19:02:06.194500Z

i'm in the telecom industry, adding a new professional customer to a carrier is not 3 fields and be done with it, there are equipments to add and so on

mihaelkonjevic 2019-07-05T19:02:29.195Z

yeah that makes sense, but each wizard ends being a small app in the end

carkh 2019-07-05T19:02:36.195400Z

true enough

mihaelkonjevic 2019-07-05T19:02:54.196100Z

and I was recently implementing wizards with one step per page and maybe 10 - 20 fields total

mihaelkonjevic 2019-07-05T19:03:07.196400Z

which made no sense

carkh 2019-07-05T19:03:27.196900Z

well there is an argument to be made for and against them

carkh 2019-07-05T19:03:51.197400Z

consider the average user, can't frighten him with a huge form

carkh 2019-07-05T19:04:12.198Z

a wizard gently eases him into filling much data

carkh 2019-07-05T19:04:58.199100Z

also a wizard can adapt to previous input

mihaelkonjevic 2019-07-05T19:06:12.200400Z

yeah, but wizards require a blend of great ux, backend and frontend solutions. UX is actually most important here, but it also requires a lot of work from both frontend and backend to work properly. Especially if you allow people to leave wizard, go back and have optional steps. There’s no one size fits all solution, and I have a feeling that sometimes the designers are not aware of gravity of the situation 😄

carkh 2019-07-05T19:07:04.201400Z

yes that's a lot of work

carkh 2019-07-05T19:08:14.202400Z

i never quite formalized a good reusable wizard thing, and you never quite make enough of these in a project to really get it all nice

carkh 2019-07-05T19:09:02.202900Z

I have a question while you're here

carkh 2019-07-05T19:09:25.203500Z

what's the reasoning behind only giving access to one controller to your components ?

carkh 2019-07-05T19:09:39.203800Z

for eventing

mihaelkonjevic 2019-07-05T19:11:03.205Z

you can go around it by using a vector signature - so (cmd&gt; ctx :cmd-name :payload) will go to the default topic and (cmd&gt; ctx [:topic :cmd-name] :payload) can send to any controller

carkh 2019-07-05T19:11:19.205500Z

!

mihaelkonjevic 2019-07-05T19:11:42.206200Z

The reason was that I used to have much more granular controllers before dataloader, so almost each component had it’s controller

carkh 2019-07-05T19:11:42.206300Z

allright, but is it good practice ?

carkh 2019-07-05T19:11:53.206700Z

oh i see

mihaelkonjevic 2019-07-05T19:12:07.207100Z

nowadays I usually have 1 controller named user-actions for most apps

mihaelkonjevic 2019-07-05T19:12:25.207500Z

and most of the state is handled either through the loader or through the forms

mihaelkonjevic 2019-07-05T19:12:52.208600Z

but it’s not a rule, it depends on the app

mihaelkonjevic 2019-07-05T19:13:36.209700Z

the reason why you would want to do it is to be able to re-map the topic from outside

carkh 2019-07-05T19:13:48.210100Z

remember i had asked about state machine, i looked at your implementation, then decided to do my own, then decided behavior trees were more expressive and could do state machine, and i'm about to release a library for that.

mihaelkonjevic 2019-07-05T19:13:56.210500Z

oh nice

carkh 2019-07-05T19:14:26.211300Z

so i'm asking about eventing, because that's a new controller and i was wondering how i would manage another controller

mihaelkonjevic 2019-07-05T19:15:18.212200Z

What I did with forms was: - used a namespaced key for controller topic - implemented ui layer that calls cmd> under the hood, but knows the topic and format of payloads

mihaelkonjevic 2019-07-05T19:15:34.212600Z

also when you install forms, form subscriptions are added to all components

mihaelkonjevic 2019-07-05T19:15:47.213Z

(they also use namespaced keys)

carkh 2019-07-05T19:16:00.213400Z

ahh i didn't look at forms at all, maybe i should

mihaelkonjevic 2019-07-05T19:16:02.213600Z

that way there is no orchestration needed before you start using forms

mihaelkonjevic 2019-07-05T19:16:45.214200Z

I usually create install function that adds everything to the app config https://github.com/keechma/keechma-toolbox/blob/master/src/cljs/keechma/toolbox/forms/app.cljs

carkh 2019-07-05T19:17:19.214600Z

yes i stole that pattern from you already =)

carkh 2019-07-05T19:18:59.215Z

you just blindly subscribe all your components to forms ?

mihaelkonjevic 2019-07-05T19:19:06.215300Z

yeah

mihaelkonjevic 2019-07-05T19:19:29.216200Z

it doesn’t really cost anything

carkh 2019-07-05T19:19:43.216800Z

right, if you don't use it

carkh 2019-07-05T19:19:45.217Z

oops

mihaelkonjevic 2019-07-05T19:20:05.217500Z

since it just adds the key to the subscription-deps, and if you don’t deref subscriptions they are dormant

mihaelkonjevic 2019-07-05T19:20:40.218200Z

yeah, I know I’m against global deps, but convenience won here

mihaelkonjevic 2019-07-05T19:21:04.218800Z

(wasn’t an easy decision to make :D)

carkh 2019-07-05T19:21:16.219100Z

that's not really global

carkh 2019-07-05T19:21:29.219500Z

global to the app

mihaelkonjevic 2019-07-05T19:21:31.219700Z

true, but still felt a bit dirty

carkh 2019-07-05T19:21:39.219900Z

haha

mihaelkonjevic 2019-07-05T19:22:05.220300Z

forms also forced the change that allowed vector topics in commands

mihaelkonjevic 2019-07-05T19:22:33.220900Z

because I had a situation where I had a form and wasn’t able to send commands to other controllers

carkh 2019-07-05T19:22:51.221200Z

yes exactly

carkh 2019-07-05T19:23:00.221500Z

is this documented ?

carkh 2019-07-05T19:23:16.222Z

because that's a likely stumbling block, that was to me

mihaelkonjevic 2019-07-05T19:23:16.222100Z

yes https://clojurians.slack.com/archives/C0MDSV2LW/p1562353863205000

mihaelkonjevic 2019-07-05T19:23:20.222400Z

😄

mihaelkonjevic 2019-07-05T19:23:24.222600Z

I’ll add it

carkh 2019-07-05T19:23:31.222800Z

=)

carkh 2019-07-05T19:24:29.223300Z

anyways thanks for the nice chat, and for that little gold nugget of a vector topic

mihaelkonjevic 2019-07-05T19:24:47.223700Z

no problem, looking forward to that lib you’re working on

carkh 2019-07-05T19:25:21.224400Z

might be useful for you weird html animation producing devs

mihaelkonjevic 2019-07-05T19:26:07.224900Z

I’m also working on some new stuff, but it will take some time before it’s ready for release

mihaelkonjevic 2019-07-05T19:26:29.225600Z

biggest thing I’ll release is support for something like django template blocks

carkh 2019-07-05T19:26:41.226100Z

ohyes that all takes so much time, already killed 3 weeks on this thing...trying different evaluation strategies and so on

mihaelkonjevic 2019-07-05T19:27:03.226600Z

layout components that can have slots where components can put content

carkh 2019-07-05T19:27:40.227500Z

probably not for me, i'm a simple man, with corporate customers who don't want any fancy stuff

mihaelkonjevic 2019-07-05T19:28:02.227800Z

🙂

carkh 2019-07-05T19:28:16.228300Z

i don't know the first thing about django =)

mihaelkonjevic 2019-07-05T19:29:11.229100Z

well it’s the same principle like selmer is using (from luminus)

carkh 2019-07-05T19:29:18.229300Z

isb't selmer already doing part of what you want?

carkh 2019-07-05T19:29:23.229600Z

right

mihaelkonjevic 2019-07-05T19:29:25.229700Z

yeah for html

mihaelkonjevic 2019-07-05T19:29:33.230Z

not for reagent components

carkh 2019-07-05T19:29:47.230300Z

ohhh i see

carkh 2019-07-05T19:30:44.230800Z

so for branding etc, let the customer use templates ?

carkh 2019-07-05T19:30:55.231100Z

or pretend they can do it, and do it for them =)

carkh 2019-07-05T19:32:05.231500Z

i might have a look to it after all

mihaelkonjevic 2019-07-05T19:34:13.234100Z

it’s more about situations where you have a page that needs to “break out” from the parent component’s layout. I’ve actually recently changed how I architect apps on the UI side. I’ve started using core.match in main component, and pattern match all possible pages in the app. That way each page can decide on it’s own how it will be rendered (instead of having parent components that decide). So page wraps itself in the layout -> inversion of control, and very shallow component trees

carkh 2019-07-05T19:35:39.234800Z

you always can do that though

carkh 2019-07-05T19:35:46.235200Z

or maybe i'm misunderstanding

mihaelkonjevic 2019-07-05T19:36:35.236400Z

yeah, but the problem is when you want to change things that require “wrapper” html

mihaelkonjevic 2019-07-05T19:36:45.236900Z

then each component needs to know about it

carkh 2019-07-05T19:37:00.237200Z

(i decided years ago against using core.match when i found a bug and it never was corrected, and couldn't do it myself because it's a pretty hard code base)

mihaelkonjevic 2019-07-05T19:37:47.238100Z

oh, I’m using it in a pretty simple way so hopefully I won’t hit it. Although now there are some alternative libs

carkh 2019-07-05T19:39:19.239Z

mhh i'm sure the problem you're trying to solve is real, but i guess i never encountered it

carkh 2019-07-05T19:41:25.239500Z

might be a good blog topic when you have your implementation

mihaelkonjevic 2019-07-05T19:43:00.240700Z

yeah, I have a huge list of topics already, just have to find time to write about them all