Load Components from JSON #3
Comments
First Draft of the JSON. We introduced the field Open questions:
|
What's special about type that doesn't fit in meta? |
Thoughts are that |
Probably I'm missing the point of type, examples? |
Since
Where types specify which component to load from the factory |
Sorry I mean an example of a view that has same identifier but two different types. "id": "history_tab", Why is history_tab needed? Having a stack cluster is not enough? Or make history_tab a wrapper that contains a stack cluster? |
We need unique identifiers per component, there was some reason but can't remember why know. @mathiasAichinger could you elaborate? |
unique identifier is already For what I know ATM:
are already identifying a unique view (Factories can build view from a given id) |
What we need is just a way to retrieve information on how to build a We need something that given an
Then if we need multiple stack the son can of course contain multiple stack:
So |
Yup, that's exactly the current approach we have with the |
The |
I would say it should be added whenever there is a use case fit it but keep it out until it's useless |
Actually we borrowed the meaning of
The reason we suggest to use |
Oh true, we could replace id with type then? |
Yes I think for now we just need |
Cool, so we agree on removing |
Yep. Let's keep it as simple as needed. |
Should we put the component configs into own json objects to have them kind of namespaced? Like
|
@mathiasAichinger what would be the benefits? Definitely we would need more handling on the factories side so that they provide their |
@joanromano Just to make it more clear for what this meta is used. But I agree to keep it simple at the beginning. |
pretty sure it would make the materializations way harder |
I think the specs are missing wrappers that have child instead of children |
There has been recently a discussion brought by @MP0w in #7 regarding differentiation between children and child for cluster and wrapper respectively. The question being, should we keep in the JSON schema @markushi @mathiasAichinger @AndreasThenn @MP0w let me know what are your thoughts. I believe, if I am not wrong, the idea behind having always |
In my opinion we should use the E.g. in the case where you have some JSON where you want to switch from using a wrapper to a stack:
For
|
But we would break the type safety since it's an array instead of a single Component. That's not intuitive and more erro prone IMHO |
@MP0w don't really see why is less intuitive and more error prone (maybe you could elaborate) since this would be defined by a JSON schema anyway. I see also the benefits of having clear type definitions on the client side for clusters, wrappers and views, but not really on JSON itself since you should be aware of the schema anyway in order to parse it. I would also go for having always |
@MP0w @markushi @joanromano |
Concerning the |
Also we need to introduce another type of meta for the tabbar which is called
|
I don't really see why something that is not (and never will be) an array should be wrapped in an array. |
@bassemawny using the id instead of index could be valid but then the cluster needs to understand what's the index. The argument of not depending by the ordering and AB test stuff is not valid IMHO because the selectedIndex is also coming with the JSON and you would have the same problem using identifiers (if the id of children changes you need to change the selectedIndex) |
After discussion, for now we agreed on:
|
We want to be able to load the structure of an app from an external source.
We need to define a JSON schema that describes the
Component
s.The current idea is to define identifiers and the client will need to register
Component
s in a factory, with this in place we will be able to refer to aComponent
builder from an identifier in the JSON.Example:
The text was updated successfully, but these errors were encountered: