▲ | jfagnani 2 days ago | |
There is a spec issue open for HTML Modules [1] along with a few proposals. The concept needs some motivated champions to see it through. Microsoft has shown some interested in this lately. There are userland single-file component projects, like my Heximal[2] project. Though Hexiaml specifically doesn't tackle the module format - it requires some kind of HTML Module polyfill. I don't think the current situation is so bad though. The container format should mostly be irrelevant to consumers of a component. You need to import the component defintion whether that definition is in a .js file or .html file. Once you import it you use it the same. There should be very few cases where the file format matters. Maybe for use when JS is turned off if HTML-based web components are considered safe to evaluate (their templates might expressive enough to potentially allow attacks). [1]: https://github.com/WICG/webcomponents/issues/645 [2]: https://heximal.dev/ (Sorry the site is messed up on mobile. I need to fix it!) | ||
▲ | epolanski 2 days ago | parent [-] | |
Not gonna lie, I like the design of heximal, but by the end of reading the docs I start missing simple php-like templating. |