A place to cache linked articles (think custom and personal wayback machine)
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

5 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. title: The state of Web Components
  2. url: https://hacks.mozilla.org/2015/06/the-state-of-web-components/
  3. hash_url: d3c5f2dc3f30a43b13c8662ac468e889
  4. <p>Web Components have been on developers&#8217; radars for quite some time now. They were first introduced by <a href="http://twitter.com/slightlylate">Alex Russell</a> at<a href="https://fronteers.nl/congres/2011/sessions/web-components-and-model-driven-views-alex-russell"> Fronteers Conference 2011</a>. The concept shook the community up and became the topic of many future talks and discussions.</p>
  5. <p>In 2013 a Web Components-based framework called <em>Polymer</em> was released by <em>Google</em> to kick the tires of these new APIs, get community feedback and add some sugar and opinion.</p>
  6. <p>By now, 4 years on, Web Components <em>should</em> be everywhere, but in reality <em>Chrome</em> is the only browser with &#8216;some version&#8217; of Web Components. Even with polyfills it&#8217;s clear Web Components won&#8217;t be fully embraced by the community until the majority of browsers are on-board.</p>
  7. <h2>Why has this taken so long?</h2>
  8. <p>To cut a long story short, vendors couldn&#8217;t agree.</p>
  9. <p>Web Components were a <em>Google</em> effort and little negotiation was made with other browsers before shipping. Like most negotiations in life, parties that don&#8217;t feel involved lack enthusiasm and tend not to agree.</p>
  10. <p>Web Components were an ambitious proposal. Initial APIs were high-level and complex to implement (albeit for good reasons), which only added to contention and disagreement between vendors.</p>
  11. <p><em>Google</em> pushed forward, they sought feedback, gained community buy-in; but in hindsight, before other vendors shipped, usability was blocked.</p>
  12. <p>Polyfills meant theoretically Web Components could work on browsers that hadn&#8217;t yet implemented, but these have never been accepted as &#8216;suitable for production&#8217;.</p>
  13. <p>Aside from all this, <em>Microsoft</em> haven&#8217;t been in a position to add many new DOM APIs due to the <a href="http://www.microsoft.com/en-us/windows/browser-for-doing"><em>Edge</em></a> work (nearing completion). And <em>Apple</em>, have been focusing on alternative features for <em>Safari</em>.</p>
  14. <h2>Custom Elements</h2>
  15. <p>Of all the Web Components technologies, Custom Elements have been the least contentious. There is general agreement on the value of being able to define how a piece of UI looks and behaves and being able to distribute that piece cross-browser and cross-framework.</p>
  16. <h3>&#8216;Upgrade&#8217;</h3>
  17. <p>The term &#8216;upgrade&#8217; refers to when an element transforms from a plain old <code>HTMLElement</code> into a shiny custom element with its defined life-cycle and <code>prototype</code>. Today, when elements are upgraded, their <code>createdCallback</code> is called.</p>
  18. <pre><code class="js">var proto = Object.create(HTMLElement.prototype);
  19. proto.createdCallback = function() { ... };
  20. document.registerElement('x-foo', { prototype: proto });</code></pre>
  21. <p>There are <a href="https://wiki.whatwg.org/wiki/Custom_Elements#Upgrading">five proposals</a> so far from multiple vendors; two stand out as holding the most promise.</p>
  22. <h4>&#8216;Dmitry&#8217;</h4>
  23. <p>An evolved version of the <code>createdCallback</code> pattern that works well with ES6 classes. The <code>createdCallback</code> concept lives on, but sub-classing is more conventional.</p>
  24. <pre><code class="js">class MyEl extends HTMLElement {
  25. createdCallback() { ... }
  26. }
  27. document.registerElement("my-el", MyEl);</code></pre>
  28. <p>Like in today&#8217;s implementation, the custom element begins life as <code>HTMLUnknownElement</code> then some time later the prototype is swapped (or &#8216;swizzled&#8217;) with the registered prototype and the <code>createdCallback</code> is called.</p>
  29. <p>The downside of this approach is that it&#8217;s different from how the platform itself behaves. Elements are &#8216;unknown&#8217; at first, then transform into their final form at some point in the future, which can lead to developer confusion.</p>
  30. <h4>Synchronous constructor</h4>
  31. <p>The constructor registered by the developer is invoked by the parser at the point the custom element is created and inserted into the tree.</p>
  32. <pre><code class="js">class MyEl extends HTMLElement {
  33. constructor() { ... }
  34. }
  35. document.registerElement("my-el", MyEl);</code></pre>
  36. <p>Although this seems sensible, it means that any custom elements in the initial downloaded document will fail to upgrade if the scripts that contain their <code>registerElement</code> definition are loaded asynchronously. This is not helpful heading into a world of asynchronous ES6 modules.</p>
  37. <p>Additionally synchronous constructors come with <a href="https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0731.html">platform issues</a> related to <code>.cloneNode()</code>.</p>
  38. <p>A direction is expected to be decided by vendors at a face-to-face meeting in July 2015.</p>
  39. <h3>is=&#8221;&#8221;</h3>
  40. <p>The <code>is</code> attribute gives developers the ability to layer the behaviour of a custom element on top of a standard built-in element.</p>
  41. <pre><code class="html">&lt;input type="text" is="my-text-input"&gt;</code></pre>
  42. <h4>Arguments for</h4>
  43. <ol>
  44. <li>Allows extending the built-in features of a element that aren&#8217;t exposed as primitives (eg. accessibility characteristics, <code>&lt;form&gt;</code> controls, <code>&lt;template&gt;</code>).</li>
  45. <li>They give means to &#8216;progressively enhance&#8217; an element, so that it remains functional without JavaScript.</li>
  46. </ol>
  47. <h4>Arguments against</h4>
  48. <ol>
  49. <li>Syntax is confusing.</li>
  50. <li>It side-steps the underlying problem that we&#8217;re <a href="https://github.com/domenic/html-as-custom-elements/blob/master/docs/accessibility.md">missing many key accessibility primitives</a> in the platform.</li>
  51. <li>It side-steps the underlying problem that we don&#8217;t have a way to properly extend built-in elements.</li>
  52. <li>Use-cases are limited; as soon as developers introduce Shadow DOM, they lose all built-in accessibility features.</li>
  53. </ol>
  54. <h4>Consensus</h4>
  55. <p>It is generally agreed that <code>is</code> is a &#8216;wart&#8217; on the Custom Elements spec. <em>Google has</em> already implemented <code>is</code> and sees it as a stop-gap until lower-level primitives are exposed. Right now <em>Mozilla</em> and <em>Apple</em> would rather ship a Custom Elements V1 sooner and address this problem properly in a V2 without polluting the platform with &#8216;warts&#8217;.</p>
  56. <p><a href="https://github.com/domenic/html-as-custom-elements"><em>HTML as Custom Elements</em></a> is a project by Domenic Denicola that attempts to rebuild built-in HTML elements with custom elements in an attempt to uncover DOM primitives the platform is missing.</p>
  57. <h2>Shadow DOM</h2>
  58. <p>Shadow DOM yielded the most contention by far between vendors. So much so that features had to be split into a &#8216;V1&#8242; and &#8216;V2&#8242; agenda to help reach agreement quicker.</p>
  59. <h3>Distribution</h3>
  60. <p>Distribution is the phase whereby children of a shadow host get visually &#8216;projected&#8217; into slots inside the host&#8217;s Shadow DOM. This is the feature that enables your component to make use of content the user nests inside it.</p>
  61. <h4>Current API</h4>
  62. <p>The current API is fully declarative. Within the Shadow DOM you can use special <code>&lt;content&gt;</code> elements to define where you want the host&#8217;s children to be visually inserted.</p>
  63. <pre><code class="html">&lt;content select="header"&gt;&lt;/content&gt;</code></pre>
  64. <p>Both <em>Apple</em> and <em>Microsoft</em> pushed back on this approach due to concerns around complexity and performance.</p>
  65. <h4>A new Imperative API</h4>
  66. <p>Even at the <a href="https://www.w3.org/wiki/Webapps/WebComponentsApril2015Meeting">face-to-face meeting</a>, agreement couldn&#8217;t be made on a declarative API, so all vendors agreed to pursue an imperative solution.</p>
  67. <p>All four vendors (<em>Microsoft</em>, <em>Google</em>, <em>Apple</em> and <em>Mozilla</em>) were tasked with specifying this new API before a July 2015 deadline. So far there have been <a href="https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md">three suggestions</a>. The simplest of the three looks something like:</p>
  68. <pre><code class="js">var shadow = host.createShadowRoot({
  69. distribute: function(nodes) {
  70. var slot = shadow.querySelector('content');
  71. for (var i = 0; i &lt; nodes.length; i++) {
  72. slot.add(nodes[i]);
  73. }
  74. }
  75. });
  76. shadow.innerHTML = '&lt;content&gt;&lt;/content&gt;';
  77. // Call initially ...
  78. shadow.distribute();
  79. // then hook up to MutationObserver</code></pre>
  80. <p>The main obstacle is:<strong> timing</strong>. If the children of the host node change and we redistribute when the <code>MutationObserver</code> callback fires, asking for a layout property will return an incorrect result.</p>
  81. <pre><code class="js">myHost.appendChild(someElement);
  82. someElement.offsetTop; //=&gt; old value
  83. // distribute on mutation observer callback (async)
  84. someElement.offsetTop; //=&gt; new value</code></pre>
  85. <p>Calling offsetTop will perform a synchronous layout <em>before</em> distribution!</p>
  86. <p>This might not seems like the end of the world, but scripts and browser internals often depend on the value of <code>offsetTop</code> being correct to perform many different operations, such as: scrolling elements into view.</p>
  87. <p>If these problems can&#8217;t be solved we may see a retreat back to discussions over a declarative API. This will either be in the form of the current <code>&lt;content select&gt;</code> style, or the newly proposed <a href="https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Slots-Proposal.md">&#8216;named slots&#8217;</a> API (from <em>Apple</em>).</p>
  88. <h4>A new Declarative API &#8211; &#8216;Named Slots&#8217;</h4>
  89. <p>The &#8216;named slots&#8217; proposal is a simpler variation of the current &#8216;content select&#8217; API, whereby the component user must explicitly label their content with the slot they wish it to be distributed to.</p>
  90. <p>Shadow Root of &lt;x-page&gt;:</p>
  91. <pre><code class="html">&lt;slot name="header"&gt;&lt;/slot&gt;
  92. &lt;slot&gt;&lt;/slot&gt;
  93. &lt;slot name="footer"&gt;&lt;/slot&gt;
  94. &lt;div&gt;some shadow content&lt;/div&gt;
  95. </code></pre>
  96. <p>Usage of &lt;x-page&gt;:</p>
  97. <pre><code class="html">&lt;x-page&gt;
  98. &lt;header slot="header"&gt;header&lt;/header&gt;
  99. &lt;footer slot="footer"&gt;footer&lt;/footer&gt;
  100. &lt;h1&gt;my page title&lt;/h1&gt;
  101. &lt;p&gt;my page content&lt;p&gt;
  102. &lt;/x-page&gt;</code></pre>
  103. <p>Composed/rendered tree (what the user sees):</p>
  104. <pre><code class="html">&lt;x-page&gt;
  105. &lt;header slot="header"&gt;header&lt;/header&gt;
  106. &lt;h1&gt;my page title&lt;/h1&gt;
  107. &lt;p&gt;my page content&lt;p&gt;
  108. &lt;footer slot="footer"&gt;footer&lt;/footer&gt;
  109. &lt;div&gt;some shadow content&lt;/div&gt;
  110. &lt;/x-page&gt;</code></pre>
  111. <p>The browser has looked at the direct children of the shadow host (<code>myXPage.children</code>) and seen if any of them have a slot attribute that matches the name of a &lt;slot&gt; element in the host&#8217;s <code>shadowRoot</code>.</p>
  112. <p>When a match is found, the node is <em>visually</em> &#8216;distributed&#8217; in place of the corresponding &lt;slot&gt; element. Any children left undistributed at the end of this matching process are distributed to a default (unamed) &lt;slot&gt; element (if one exists).</p>
  113. <h5>For:</h5>
  114. <ol>
  115. <li>Distribution is more explicit, easier to understand, less &#8216;magic&#8217;.</li>
  116. <li>Distribution is simpler for the engine to compute.</li>
  117. </ol>
  118. <h5>Against:</h5>
  119. <ol>
  120. <li>Doesn&#8217;t explain how built-in elements, like &lt;select&gt;, work.</li>
  121. <li>Decorating content with slot attributes is more work for the user.</li>
  122. <li>Less expressive.</li>
  123. </ol>
  124. <h3>&#8216;closed&#8217; vs. &#8216;open&#8217;</h3>
  125. <p>When a <code>shadowRoot</code> is &#8216;closed&#8217; the it cannot be accessed via <code>myHost.shadowRoot</code>. This gives a component author <em>some</em> assurance that users won&#8217;t poke into implementation details, similar to how you can use closures to keep things private.</p>
  126. <p><em>Apple</em> felt strongly that this was an important feature that they would block on. They argued that implementation details should never be exposed to the outside world and that &#8216;closed&#8217; mode would be a required feature when <a href="https://github.com/w3c/webcomponents/wiki/Isolated-Imports-Proposal">&#8216;isolated&#8217; custom elements</a> became a thing.</p>
  127. <p><em>Google</em> on the other hand felt that &#8216;closed&#8217; shadow roots would prevent some accessibility and component tooling use-cases. They argued that it&#8217;s impossible to accidentally stumble into a <code>shadowRoot</code> and that if people want to they likely have a good reason. JS/DOM is open, let&#8217;s keep it that way.</p>
  128. <p>At the <a href="https://www.w3.org/wiki/Webapps/WebComponentsApril2015Meeting">April meeting</a> it became clear that to move forward, &#8216;mode&#8217; needed to be a feature, but vendors were struggling to reach agreement on whether this should default to &#8216;open&#8217; or &#8216;closed&#8217;. As a result, all agreed that for V1 &#8216;mode&#8217; would be a required parameter, and thus wouldn&#8217;t need a specified default.</p>
  129. <pre><code class="js">element.createShadowRoot({ mode: 'open' });
  130. element.createShadowRoot({ mode: 'closed' });</code></pre>
  131. <h3>Shadow piercing combinators</h3>
  132. <p>A &#8216;piercing combinator&#8217; is a special CSS &#8216;combinator&#8217; that can target elements inside a shadow root from the outside world. An example is /deep/ later renamed to <code>&gt;&gt;&gt;</code>:</p>
  133. <pre><code class="css">.foo &gt;&gt;&gt; div { color: red }</code></pre>
  134. <p>When Web Components were first specified it was thought that these were required, but after looking at <a href="https://github.com/KarstenB/csstransform/blob/master/bootstrap_deep.css">how they were being used</a> it seemed to only bring problems, making it too easy to break the style boundaries that make Web Components so appealing.</p>
  135. <h4>Performance</h4>
  136. <p>Style calculation can be incredibly fast inside a tightly scoped Shadow DOM if the engine doesn&#8217;t have to take into consideration any outside selectors or state. The very presence of piercing combinators forbids these kind of optimisations.</p>
  137. <h4>Alternatives</h4>
  138. <p>Dropping shadow piercing combinators doesn&#8217;t mean that users will never be able to customize the appearance of a component from the outside.</p>
  139. <h5>CSS custom-properties (variables)</h5>
  140. <p>In <em>Firefox OS</em> we&#8217;re using <a href="http://dev.w3.org/csswg/css-variables/">CSS Custom Properties</a> to expose specific style properties that can be defined (or overridden) from the outside.</p>
  141. <p>External (user):</p>
  142. <pre><code class="css">x-foo { --x-foo-border-radius: 10px; }
  143. </code></pre>
  144. <p>Internal (author):</p>
  145. <pre><code class="css">.internal-part { border-radius: var(--x-foo-border-radius, 0); }</code></pre>
  146. <h5>Custom pseudo-elements</h5>
  147. <p>We have also seen interest expressed from several vendors in reintroducing the ability to define custom pseudo selectors that would expose given internal parts to be styled (similar to how we style parts of &lt;input type=&#8221;range&#8221;&gt; today).</p>
  148. <pre class="fragment css visible current-fragment" data-fragment-index="0"><code class=" hljs " contenteditable=""><span class="hljs-tag">x-foo</span><span class="hljs-pseudo">::my-internal-part</span> <span class="hljs-rules">{ <span class="hljs-rule"><span class="hljs-attribute">... }</span></span></span></code></pre>
  149. <p>This will likely be considered for a Shadow DOM V2 specification.</p>
  150. <h5>Mixins &#8211; @extend</h5>
  151. <p>There is <a href="https://tabatkins.github.io/specs/css-extend-rule/">proposed specification</a> to bring <a href="http://sass-lang.com/documentation/file.SASS_REFERENCE.html#extend">SASS&#8217;s @extend</a> behaviour to CSS. This would be a useful tool for component authors to allow users to provide a &#8216;bag&#8217; of properties to apply to a specific internal part.</p>
  152. <p>External (user):</p>
  153. <pre class="css"><code class=" hljs " contenteditable="" data-trim=""><span class="hljs-class">.x-foo-part</span> <span class="hljs-rules">{
  154. <span class="hljs-rule"><span class="hljs-attribute">background-color</span>:<span class="hljs-value"> red</span></span>;
  155. <span class="hljs-rule"><span class="hljs-attribute">border-radius</span>:<span class="hljs-value"> <span class="hljs-number">4px</span></span></span>;
  156. <span class="hljs-rule">}</span></span></code></pre>
  157. <p>Internal (author):</p>
  158. <pre class="css"><code class=" hljs " contenteditable="" data-trim=""><span class="hljs-class">.internal-part</span> <span class="hljs-rules">{
  159. <span class="hljs-rule">@<span class="hljs-attribute">extend .x-foo-part;
  160. }</span></span></span></code></pre>
  161. <h3>Multiple shadow roots</h3>
  162. <p><em>Why would I want more than one shadow root on the same element?</em>, I hear you ask. The answer is: <strong>inheritance</strong>.</p>
  163. <p>Let&#8217;s imagine I&#8217;m writing an <code>&lt;x-dialog&gt;</code> component. Within this component I write all the markup, styling, and interactions to give me an opening and closing dialog window.</p>
  164. <pre><code class="html">&lt;x-dialog&gt;
  165. &lt;h1&gt;My title&lt;/h1&gt;
  166. &lt;p&gt;Some details&lt;/p&gt;
  167. &lt;button&gt;Cancel&lt;/button&gt;
  168. &lt;button&gt;OK&lt;/button&gt;
  169. &lt;/x-dialog&gt;</code></pre>
  170. <p>The shadow root pulls any user provided content into <code>div.inner</code> via the <code>&lt;content&gt;</code> insertion point.</p>
  171. <pre><code class="html">&lt;div class="outer"&gt;
  172. &lt;div class="inner"&gt;
  173. &lt;content&gt;&lt;/content&gt;
  174. &lt;/div&gt;
  175. &lt;/div&gt;</code></pre>
  176. <p>I also want to create <code>&lt;x-dialog-alert&gt;</code> that looks and behaves just like <code>&lt;x-dialog&gt;</code> but with a more restricted API, a bit like <code>alert('foo')</code>.</p>
  177. <pre><code class="html">&lt;x-dialog-alert&gt;foo&lt;/x-dialog-alert&gt;</code></pre>
  178. <pre><code class="js">var proto = Object.create(XDialog.prototype);
  179. proto.createdCallback = function() {
  180. XDialog.prototype.createdCallback.call(this);
  181. this.createShadowRoot();
  182. this.shadowRoot.innerHTML = templateString;
  183. };
  184. document.registerElement('x-dialog-alert', { prototype: proto });
  185. </code></pre>
  186. <p>The new component will have its own shadow root, but it&#8217;s designed to work <em>on top</em> of the parent class&#8217;s shadow root. The <code>&lt;shadow&gt;</code> represents the &#8216;older&#8217; shadow root and allows us to project content inside it.</p>
  187. <pre><code class="html">&lt;shadow&gt;
  188. &lt;h1&gt;Alert&lt;/h1&gt;
  189. &lt;content&gt;&lt;/content&gt;
  190. &lt;button&gt;OK&lt;/button&gt;
  191. &lt;/shadow&gt;</code></pre>
  192. <p>Once you get your head round multiple shadow roots, they become a powerful concept. The downside is they bring a lot of complexity and introduce a lot of edge cases.</p>
  193. <h4>Inheritance without multiple shadows</h4>
  194. <p>Inheritance is still possible without multiple shadow roots, but it involves manually mutating the super class&#8217;s shadow root.</p>
  195. <pre><code class="js">
  196. var proto = Object.create(XDialog.prototype);
  197. proto.createdCallback = function() {
  198. XDialog.prototype.createdCallback.call(this);
  199. var inner = this.shadowRoot.querySelector('.inner');
  200. var h1 = document.createElement('h1');
  201. h1.textContent = 'Alert';
  202. inner.insertBefore(h1, inner.children[0]);
  203. var button = document.createElement('button');
  204. button.textContent = 'OK';
  205. inner.appendChild(button);
  206. ...
  207. };
  208. document.registerElement('x-dialog-alert', { prototype: proto });
  209. </code></pre>
  210. <p><strong>The downsides of this approach are:</strong></p>
  211. <ol>
  212. <li>Not as elegant.</li>
  213. <li>Your sub-component is dependent on the implementation details of the super-component.</li>
  214. <li>This wouldn&#8217;t be possible if the super component&#8217;s shadow root was &#8216;closed&#8217;, as <code>this.shadowRoot</code> would be <code>undefined</code>.</li>
  215. </ol>
  216. <h2>HTML Imports</h2>
  217. <p>HTML Imports provide a way to import all assets defined in one <code>.html</code> document, into the scope of another.</p>
  218. <pre class="html"><code><span class="tag">&lt;link</span> <span class="atn">rel</span><span class="pun">=</span><span class="atv">"import"</span> <span class="atn">href</span><span class="pun">=</span><span class="atv">"/path/to/imports/stuff.html"</span><span class="tag">&gt;</span></code></pre>
  219. <p>As <a href="https://hacks.mozilla.org/2014/12/mozilla-and-web-components/">previously stated,</a> <em>Mozilla</em> is not <em>currently</em> intending to implementing HTML Imports. This is in part because we&#8217;d like to see how ES6 modules pan out before shipping another way of importing external assets, and partly because we don&#8217;t feel they enable much that isn&#8217;t already possible.</p>
  220. <p>We&#8217;ve been working with Web Components in <em>Firefox OS</em> for over a year and have found using existing module syntax (AMD or Common JS) to resolve a dependency tree, registering elements, loaded using a normal <code>&lt;script&gt;</code> tag seems to be enough to get stuff done.</p>
  221. <p>HTML Imports do lend themselves well to a simpler/more declarative workflow, such as the older <a href="https://github.com/MikeMitterer/DART-Sample-PolymerElementConsumer/blob/master/web/poly/components/CustomElements/workbench/HTMLElementElement.html"><code>&lt;element&gt;</code></a> and <a href="https://www.polymer-project.org/0.8/docs/migration.html#registration"><em>Polymer&#8217;s </em>current</a> registration syntax.</p>
  222. <p>With this simplicity has come <a href="http://tjvantoll.com/2014/08/12/the-problem-with-using-html-imports-for-dependency-management/">criticism</a> from the community that Imports don&#8217;t offer enough control to be taken seriously as a dependency management solution.</p>
  223. <p>Before the decision was made a few months ago, <em>Mozilla</em> had a working implementation behind a flag, but struggled through an incomplete specification.</p>
  224. <h3>What will happen to them?</h3>
  225. <p><em>Apple&#8217;s </em><a href="https://github.com/w3c/webcomponents/wiki/Isolated-Imports-Proposal">Isolated Custom Elements</a> proposal makes use of an HTML Imports style approach to provide custom elements with their own document scope;: Perhaps there&#8217;s a future there.</p>
  226. <p>At <em>Mozilla</em> we want to explore how importing custom element definitions can align with upcoming ES6 module APIs. We&#8217;d be prepared to implement if/when they appear to enable developers to do stuff they can&#8217;t already do.</p>
  227. <h2>To conclude</h2>
  228. <p>Web Components are a prime example of how difficult it is to get large features into the browser today. Every API added lives indefinitely and remains as an obstacle to the next.</p>
  229. <p>Comparable to picking apart a huge knotted ball of string, adding a bit more, then tangling it back up again. This knot, our platform, grows ever larger and more complex.</p>
  230. <p>Web Components have been in planning for over three years, but we&#8217;re optimistic <strong>the end is near</strong>. All major vendors are on board, enthusiastic, and investing significant time to help resolve the remaining issues.</p>
  231. <p><strong>Let&#8217;s get ready to componentize the web!</strong></p>
  232. <h4>More</h4>
  233. <ul>
  234. <li>Join the ongoing discussion on the <a href="https://lists.w3.org/Archives/Public/public-webapps/">public-webapps mailing list</a>.</li>
  235. <li>Keep an eye on the <a href="https://github.com/w3c/webcomponents/">W3C Web Components Repo</a>.</li>
  236. <li>Sign-up to the <a href="http://webcomponentsweekly.me/">Web Components Weekly</a> newsletter.</li>
  237. <li>Play with Web Components in Firefox today by turning on &#8216;dom.webcomponents.enabled&#8217; pref in about:config.</li>
  238. </ul>