Hi
@vincent.cantin we can continue here
Welcome in the chan, you are litterally the first one to show interest in the details of Vrac.
Yeah, I see
(for [c cars]
[car-component c])
if c
is {:car/id 1}
, maybe it is possible to do
[car-component (assoc c :some/prop some-val)]
this make the inference basically impossible imo.
in this snippet, nothing more should be assumed about cars than the template says.
It means that it is kind of generic
can you explain more about this?
Let me copy/paste some of my recent code sample …
okay.
btw, I also have some code when explore https://github.com/DogLooksGood/fullstack-explore/blob/master/src/fullstack_explore/app.cljs this is what I get for now
I don’t specify any type anywhere, no need
I only specify the fields used. That’s the same as Pathom which does not care the types
I will need to find how to have automated data normalization at some point, but I may not necessary follow the Fulcro way for that.
I hope to have the user say as little as possible and deduct evething I can from how the data is used.
so, basically when you say (:session/title session)
, you got [:session/title]
in the query?
Yes, it means {session [:session/title]}
for Pathom.
what if I use (str/upper-case (:session/title session))
?
that’s a function call, that’s not data being dereferrenced
it would not matter for the extracted data query
parsing the argument of the function call would.
how you know about the ident
, I think that is the point how you normalize data.
{:id :coscup/session}
oh i seeI also curious about the rendering strategy, will you use react?
I want Vrac templates to encode semantics and be decoupled from any rendering tool.
At the same time, I need to render things .. so my plan is to support React, then support other tools which may have a better performance. The user will have the choice.
This part is not fully defined in my head, but I may try to decouple the UI and the normalization. The state logic needs to know about normalization, not the UI.
Is that if
, for
block in template still meaningful if using react?
@doglooksgood {:id :coscup/session}
is not used for normalization. That’s just the component’s id, it is not related to the data.
the if
and the for
are meaningful for React, you need to implement their semantic when you render the template via React.
so far, Vrac only supports the if
, when
, let
and for
directives
why? you mean, for example, an if block is a react component?
That would be a overkill. a JS if
would be good enough.
I see, so for the react renderer case, the dsl can be treated as just code
but for some renderer, you can do render like svelte
I may add support for Javelin and Hoplon as renderer later (in 6~18 months?)
how do you expression initial-state
, do you think it is necessary?
no opinion for now
the component being just data, one can add a field for initial-state in their component and use it himself to build some initial data. No need to have Vrac do anything about that.
I use clojure’s spec to parse the template and the specs are open to additional data - thanks to Rich Hickey’s wisdom.
oh, great
@souenzzo if I wanted to compare vrac with existing frameworks, it would be close to vuejs for the templating and close to fulcro for the usage of eql
Hello 🙂
I'm working on inga
, that from "mainstream" libraries, looks like CakePHP Scaffolding
In practice, it's inspired on Direct2Web module from WebObjects(NeXTStep/Apple), that was used and appreciated here at the company where I work
https://gist.github.com/souenzzo/113795e3a7ce069417e5cb83c99aee9b
It aims to be declarative and dynamic. We want just to say "this page will show X Y and Z" and it should be ready.
We can extend it with 2 concepts (from D2W):
• task: task says "what I want to do". By default there is "task/query" and "task/mutation". On D2W, there is 4 tasks by default: CreateReadUpdateDelete
• ui: ui tays "how to show data". By default there is "ui/query" and "ui/mutation". You can extend and create a new "ui/my-custom-query"
Everything should be extended via resolvers
in vrac, eql queries and renderers are derived from the template
mutations are not part of the library, vrac mostly focuses on data loading and display at the moment.
it’s supposed to be used as a library, one piece in the puzzle
Nice to meet you