Open yomed opened 8 years ago
The dynamic-tag
has some logic to process tag data, and a template that looks like this:
<if test="data.type === 'renderer' || data.type === 'widgetWithoutId'">
<invoke function="data.renderer(data.model, out)" />
</if>
<else-if test="data.type === 'template'">
<include template="${data.template}" entry="$data.model" />
</else-if>
<else-if test="data.type === 'widgetWithId'">
<include template="./widget.marko" renderer="${data.renderer}" model="${data.model}" />
</else-if>
In my running use-case of using a
dynamic-tag
to dynamically include subcomponents of type template/renderer/widget, I've run into a new problem. I assume resources are client aggregated for widgets based on walking through references.Such as:
But my code actually looks like:
In this second case, is there some way for me to make sure that the compiled subcomponent is included in the client bundles? I need it's
template.marko.js
andrenderer.js
so that I could potentially rerender it's parent on the client.I could use
w-preserve
to prevent rerendering in these cases, but given that the tags are dynamic, it's a bit harder to tell which ones should be preserved (unless there would be a way to putw-preserve
on a non-widget).