I realized now that the fact that spec is not for production, this is now quite as helpful as I imagined to be π I don't understand why people always want to implement great features in development that are impossible to ship for customers in production? Makes literally no sense, even Hickey said this about datomic that it's bad. Still, spec is said to not be used in production. I am baffled
itβs still alpha software
you are free to use it in production, and many people do, but theyβre suggesting you donβt π
that's not what I meant π
"in production" like there is an unauthenticated person, filling out a form, and they are entering data on their side, I could ship code to them through browser to their mobile device where I use spec to verify/validate the data they enter and give feedback to the user, without sending back to the server the data
In my previous analysis I described an architecture where the schema is both used to describe access rights and namespaces for functions that manage the state, but also describes the UI structure (what page what to display, and if there is an interaction that results in data input, how that can happen and what data is allowed, what is not), and it also describes data that is expected by third party API servers for which I need to sanitize data
spec is just for the coder to check their own stuff, much more limited, no?
ah, yes clojure spec is probably not the most ergonomic solution for that
spec is mainly aimed at checking that data has the shape you expect and functions take in and return the values you expect
itβs not going to be a good solution for access control, UI structure, or data sanitization
"spec is mainly aimed at checking that data has the shape you expect and functions take in and return the values you expect" all 3 categories are just this π
'access control' in the sense that which frontend compnent is controlling which part of the state
not which user is allowed to which resource
That I couldn't do for a single user locally in a meaningful sense anyway.
In clojure a lot of these already exist, while in javascript I didn't have keywords and namespaces to work with.
It sounds very weird to me that the connection is not made between "spec is aimed at checking the shape of the data" and "does this data have the shape that is allowed to be written to some namespace path"? "does this data have the shape that requires validation message to pop up?" "read the shape of the data and for each shape display the predefined UI component" "does this data have the right shape to be sent to this API endpoint/method" ? To me it's clearly the same problem, requires the same solution.
So clear, that I already implemented it, so I am now just trying to convince people to not make arbitrary distinctions between software programmer and software user
π
I've found these to be very different problems, based on my experience of trying to find the one true validation library.
"validation library" of course if you are looking for that
but what I described is agnostic on that front, you can use whatever validation library because the schema just describes the shape, it's on you to interpret it and implement the interactions
In practice, not so. Forms define their shape differently from the JSON api, differently from the database storage mechanism.
@dominicm are you saying that my personal experience is not practice?
Just relaying my own experience in this space.
no, you are disagreeing with me about what I experienced and you are explicitly denying my claims that I implemented this
: (
I just wish I wouldn't speak about it before I can make it open source because now it's just empty air, but wait some more and I will show you π
I appreciate everyone discussing things that are important to app development in #helix but this is pretty off-topic and specific to #clojure-spec - please take this discussion there or into DMs if you want to continue
sorry, that was my fault. OTOH, I would be interested what you think you would need for helix components to be specced? I think that was the original subject from which we diverged?