[WICG/webcomponents] Templates are currently half a solution to web component HTML (Issue #994)

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.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/994
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/994@github.com>

Received on Friday, 24 March 2023 06:41:45 UTC