Web Components and Open Standards


If you ask developers why they chose web components for their project, you can often hear such arguments


  • This is a web standard made by an open community, not some private company.
  • Web standards do not break backward compatibility, do not have to worry about your code in the future
  • All modern browsers adhere to the standard in their behavior, fewer surprises in cross-browser testing

The arguments look logical and fair in the usual situation, but in the case of web components there are nuances that I will try to reveal in this article.


Open standard


The openness of the standard implies that it is written with the involvement of various stakeholders. The result is a satisfying result. What happened in this case? We open the document and see its authors


  • Dimitri Glazkov, Google
  • Hayato Ito, Google
  • Dominic Cooney, Google

All of them work in Google. The situation is similar in the history of commits to this repository. Try on a chart of contributors to find a person not from Google. In the first five, these are definitely not.


, 100% . , , ? .



. - CSS, . - Shadow DOM, , . , , , Javascript , try/catch.


, .


, . , .


, 6 , , . , , .



, , ? . .


- . , <button> :


customElements.define('cool-button', CoolButton, { extends: 'button' });

, Safari. webkit , , . custom-attributes custom-elements, .


Firefox - ( is=””) ,


- , , " , , "



, . .


- . - HTML-. , - .


Firefox . , Javascript- .


, Chrome, Google Polymer, . Polymer HTML-, – -.


Shadow DOM, , .


, " – " - .


, , - - . , , , - .


-


, Shadow DOM v0 .


adoptedStylesheets. . , , . -, , , "Collection of Interesting Ideas" – Editor Draft – -.


, , . , , . :


  1. ,
  2. production-ready
  3. , .

, , - Github: https://github.com/wicg. , WHATWG W3C, , WICG :


Community Groups are proposed and run by the community. Although W3C hosts these conversations, the groups do not necessarily represent the views of the W3C Membership or staff.

:


. W3C, W3C.

, "" , , , .


. . Opera Chromium, Edge. , . caniuse, 3 6 , Mozilla , .



I hope this article allows you to make an informed decision about using web technologies. The article expresses my personal opinion exclusively, but contains enough references to sources so that everyone can read them and make up their own.


If after all this you still think web components are a good solution for your project, this is great. But if the only argument β€œfor” was β€œwell, this is the web standard, they cannot be mistaken”, then it is better to revise your conclusions and stop eating this cactus.

Source: https://habr.com/ru/post/undefined/


All Articles