You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me there is a constant tension between using templates because:
They are fast
And not using templates because:
They are slow in context because they require the same code to be inserted into the webpage every time, and re-downloaded.
Javascript and Styling can be externalised, so it can be downloaded once (often cached in memory for while the user is browsing the site).
Not so with the HTML of templates, one has to insert all the HTML templates from all the web components used from your web components into the DOM. There used to be external HTML templates but it was deprecated, with no alternative given.
One can put the HTML in a Javascript string where one declares your component JS, which is what I see most examples on the web doing, but this means one is not using the power of templates, and you don't have HTML linting in your text editor because you are working with JS files.
The text was updated successfully, but these errors were encountered:
@mangelozzi I guess you referring to the current state of templates which is far from the origin of template meaning in programming word:
template has to be reusable, hence cache-able
template does not need to be re-instantiated. It is not injected into DOM, rater reused during render.
The image which is part of icon font is the perfect sample of such template from reusability and rendering prospective. Unfortunately it is "passive" solution without parameters and does not have much of HTML qualities.
This has been raised almost without any traction on WICG discourse:
For me there is a constant tension between using templates because:
And not using templates because:
Javascript and Styling can be externalised, so it can be downloaded once (often cached in memory for while the user is browsing the site).
Not so with the HTML of templates, one has to insert all the HTML templates from all the web components used from your web components into the DOM. There used to be external HTML templates but it was deprecated, with no alternative given.
One can put the HTML in a Javascript string where one declares your component JS, which is what I see most examples on the web doing, but this means one is not using the power of templates, and you don't have HTML linting in your text editor because you are working with JS files.
The text was updated successfully, but these errors were encountered: