HTML Modules #169
Replies: 2 comments 4 replies
-
HTML Modules is a big deal for me personally. I would love to use the native If I understand it correctly, it would allow components to be |
Beta Was this translation helpful? Give feedback.
-
Yeah, I was wondering about this. There was a lot of buzz around it, but then Safari (IIRC) vetoed it and it was eventually removed even by browsers that supported it. |
Beta Was this translation helpful? Give feedback.
-
Import HTML files via JS imports and access their elements and JS exports.
Code sample
Main.html
HTML5-Element.html
Click to show
MDN URL:
No response
Specification URL:
https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-explainer.md
Any other links?
https://chromestatus.com/feature/4854408103854080
https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/HTMLModules/designDoc.md
How stable is this feature?
Future (No implementations yet)
Type of feature
JS API
What focus area does this feature fall under?
Consuming Web Components, Making Web Components, Templating
Details
HTML Modules is a big deal for me personally.
I would love to use the native
<template>
element for my Web Components/Custom Elements, without placing all the<template>
tags for different components in the website's main document itself. HTML Modules is the only native way I've found to do this.If I understand it correctly, it would allow components to be
.html
files with a<template>
,<script>
and maybe<style>
as well, and you could then easily import the whole component.Beta Was this translation helpful? Give feedback.
All reactions