We should be able to to detect lists automatically (and insert the start/end tags) by following the variable from the components props, down into the return.
To achieve this, we just need to declare some setup information about this prop in our templateProps definition and then start tracking it.
I think this would be a good start and allow autodetection for a good number of user cases:
follow any prop re-assignments and surround all occurences of the original var, and the new vars, with start / end list template strings - {{#list}}...{{/list}}
follow any assignments from a map() as this is the most common method to convert a list into a repeatable component
There must be some other cases I'm not thinking of?
If this is implemented, I think we should still allow for comments to manually tag lists (as a fall back) - but then we might get an issue of double tagged lists... I think this might be ok though.
At the moment, we're using comments to manually tag where a list (repeatable item) starts and ends - directly in the return of a component.
Eg:
We should be able to to detect lists automatically (and insert the start/end tags) by following the variable from the components props, down into the return.
To achieve this, we just need to declare some setup information about this prop in our
templateProps
definition and then start tracking it.I think this would be a good start and allow autodetection for a good number of user cases:
{{#list}}...{{/list}}
map()
as this is the most common method to convert a list into a repeatable componentThere must be some other cases I'm not thinking of?
If this is implemented, I think we should still allow for comments to manually tag lists (as a fall back) - but then we might get an issue of double tagged lists... I think this might be ok though.