Skip to content

Commit e76c7d9

Browse files
add HTML Modules entry to the report
1 parent d6d85f6 commit e76c7d9

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

reports/2022.html

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ <h3>Table of Contents</h3>
202202
</tr>
203203
<tr>
204204
<th><a href="#html-modules">HTML modules</a></th>
205+
<td><a href="https://github.com/WICG/webcomponents/issues/645">WICG/webcomponents#645</a></td>
205206
<td></td>
206-
<td></td>
207-
<td></td>
207+
<td>Partial consensus, no implementations</td>
208208
</tr>
209209
<tr>
210210
<th><a href="#custom-attributes">Custom Attributes</a></th>
@@ -1762,33 +1762,46 @@ <h3>Links</h3>
17621762
<dt>Previous WCCG Report(s)</dt>
17631763
<dd>N/A</dd>
17641764
<dt>GitHub issues:</dt>
1765-
<dd>---</dd>
1765+
<dd><a href="https://github.com/WICG/webcomponents/issues/645">HTML Modules</a></dd>
17661766
<dt>Browser positions:</dt>
1767-
<dd>---</dd>
1767+
<dd><a href="https://chromestatus.com/feature/4854408103854080">Chrome</a></dd>
1768+
<dd><a href="https://mozilla.github.io/standards-positions/#html-modules">Firefox</a></dd>
1769+
<dd><a href="https://webkit.org/status/#feature-html-import">Safari</a></dd>
17681770
</dl>
17691771
</section>
17701772
<section>
17711773
<h3>Description</h3>
1772-
<p>---</p>
1774+
<p>HTML Modules would provide a means of referencing HTML through the web's module system. For Web Components specifically, this would allow the usage of <code>import</code> to load and initialize the template of a custom element, much in the same way <a href="#css-module-scripts">CSS Modules</a> would work for an <code>adoptedStyleSheet</code>.</p>
1775+
<p>Additionally, this could open up the concept of <a href="https://github.com/WICG/webcomponents/issues/645#issuecomment-343601237">Single File Components (SFC)</a> to the web.</p>
17731776
</section>
17741777
<section>
17751778
<h3>Status</h3>
17761779
<ul>
1777-
<li>---</li>
1780+
<li>Chrome (shipped, but not aligned with ESM)</li>
17781781
</ul>
17791782
</section>
17801783
<section>
17811784
<h3>Initial API Summary/Quick API Proposal</h3>
1782-
<p>Summary or proposal based on current status; paragraph(s) and code.</p>
1785+
<pre class="javascript">
1786+
import template from 'my-template.html' as HTMLTemplateElement;
1787+
1788+
MyCustomElement extends HTMLElement {
1789+
constructor() {
1790+
const root = this.attachShadow({mode: 'closed'});
1791+
root.appendChild(document.importNode(template));
1792+
}
1793+
}
1794+
</pre>
17831795
</section>
17841796
<section>
17851797
<h3>Key Scenarios</h3>
1786-
<p>---</p>
1798+
<p>The primary motivation for HTML Modules is to round out ESM so that all of the three main web languages (HTML / CSS / JS) can be leveraged through a module system. For Web Components, this is especially helpful for scenarios related to Server Side Rendering or any form of templating, static or otherwise. Having a common mechanism in JavaScript to author and use Web Components makes for a great experience all around.</p>
1799+
<p>Additionally it will work great if you prefer to separate your technologies (e.g. <em>my-component.(js|css|html)</em> ), or your (CSS|HTML)-in-JS</p> in one file.
17871800
</section>
17881801
<section>
17891802
<h3>Concerns</h3>
17901803
<ul>
1791-
<li>---</li>
1804+
<li>Main concern is that now that ESM and Import Assertions are a thing, it is recognized that the proposal for HTML Modules needs to be re-drafted accordingly.</li>
17921805
</ul>
17931806
</section>
17941807
<section>
@@ -1800,13 +1813,18 @@ <h3>Dissenting Opinion</h3>
18001813
<section>
18011814
<h3>Related Specs</h3>
18021815
<ul>
1803-
<li>---</li>
1816+
<li><a href="#css-module-scripts">CSS Modules</a></li>
1817+
<li><a href="#declarative-shadow-dom">Declarative Shadow DOM</a></li>
1818+
<li><a href="#declarative-custom-elements">Declarative Custom Elements</a></li>
18041819
</ul>
18051820
</section>
18061821
<section>
18071822
<h3>Open Questions</h3>
18081823
<ul>
1809-
<li>---</li>
1824+
<li>What sort of "scope" should the imported HTML be allowed to have? Should it execute inline script tags?</li>
1825+
<li>What should the inline API look like for this?</li>
1826+
<li>How to treat the incoming HTML; as a <code>Document</code>? As a string? (see the scope concern above)</li>
1827+
<li>Would / should this align with the the import assertions spec, like with CSS Modules?</li>
18101828
</ul>
18111829
</section>
18121830
</section>

0 commit comments

Comments
 (0)