Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundling internal references without calling explicitly #130

Open
yomed opened this issue Mar 17, 2016 · 1 comment
Open

bundling internal references without calling explicitly #130

yomed opened this issue Mar 17, 2016 · 1 comment

Comments

@yomed
Copy link
Contributor

yomed commented Mar 17, 2016

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:

<div w-bind>
    <subcomponent />
</div>

But my code actually looks like:

<div w-bind>
    <dynamic-tag module="subcomponent" />
</div>

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 and renderer.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 put w-preserve on a non-widget).

@yomed
Copy link
Contributor Author

yomed commented Mar 17, 2016

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant