5 ms·
The <template> tag really shines when used alongside <slot> and the Shadow DOM. But I really wish there were an HTML-native way to load <template> from separat
by verisimilidude 4y ago
The <template> tag really shines when used alongside <slot> and the Shadow DOM.
But I really wish there were an HTML-native way to load <template> from separate files, the same way we do with CSS and JS. Not a show-stopper, but it’d be very nice to have.
- goatlover 4y ago> But I really wish there were an HTML-native way to load <template> from separate files Seems like the JS folks blocked this from happening. It's weird to me to think we've arrived at the point where JS considerations have come to dominate for something that was built to be a document sharing platform.
- spankalee 4y agoNo one blocked it. If you're referring to HTML Imports, the problem with them is that they didn't integrate with JS modules. There's a new HTML modules proposal [1], and with JS import assertions and CSS and JSON modules landing [2], HTML modules are probably not far behind. [1]: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-proposal.md https://github.com/WICG/webcomponents/blob/gh-pages/proposal... [2]: https://web.dev/css-module-scripts/ https://web.dev/css-module-scripts/
- dmitriid 4y agogoatlover: Seems like the JS folks blocked this from happening. spankaalee: not true, they were removed because.... they were't compatible with JS --- goatlover: JS considerations have come to dominate for something that was built to be a document sharing platform. spankalee: here are two proposals which are... Javascript-only, don't work without javascript, and add more Javascript to the platform --- ¯\_(ツ)_/¯
- dmitriid 4y ago> where JS considerations have come to dominate Not JS. Chrome, and their decade-old crusade to make web components happen, no matter the cost or common sense
- cantSpellSober 4y agoYes, I thought that's what this article would be about. Respectfully, the MDN reference for <template> has more information than this post.
- deleted 4y ago[deleted]