Content deleted Content added
m Remove irrelevant marketing link. Undid revision 1051577033 by 125.130.120.75 (talk) |
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
||
(48 intermediate revisions by 31 users not shown) | |||
Line 1:
{{Short description|Software}}
{{distinguish|HTML Components}}
{{multiple issues|
{{original research|date=June 2021}}
{{notability|date=June 2021}}
}}
'''Web Components''' are a set of features that provide a standard component model for the
Primary technologies used to create
: APIs to define new HTML elements : encapsulated DOM and styling, with composition ; HTML Templates
|website=[[MDN Web Docs]] |publisher=[[Mozilla]] |access-date=2018-07-08}}</ref>
Line 17 ⟶ 23:
=== Shadow DOM ===
The Shadow DOM is a functionality that allows the [[web browser]] to render [[Document Object Model|DOM]] elements without putting them into the main document DOM tree. This creates a barrier between what the developer and the browser can reach; the developer cannot access the Shadow DOM in the same way they would with nested elements, while the browser can render and modify that code the same way it would with nested elements. The impact of CSS scoped within the Shadow DOM of a particular element is that [[HTML]] elements can be encapsulated without the risk of [[Cascading Style Sheets|CSS]] styles leaking and affecting elements that they were not supposed to affect. Although these elements are encapsulated with regard to HTML and CSS, they can still fire events that can be picked up by other elements in the document.<ref>{{Cite web|url=https://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/|title=What the Heck is Shadow DOM?|date=2011-01-15|website=Dimitri Glazkov|access-date=2016-12-01}}</ref><ref name=":0">{{Cite web|url=https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom|title=Shadow DOM v1: Self-Contained Web Components {{!}} Web {{!}} Google Developers|website=Google Developers|access-date=2016-12-01}}</ref>
The scoped subtree in an element is called a shadow tree. The element the shadow tree is attached to is called a shadow host.<ref name=":0" />
A Shadow DOM must always be connected to an existing element, either through attaching it as a literal element or through [[script (computer programming)|
=== HTML Template ===
A HTML template is a way to insert chunks of HTML that are
<syntaxhighlight lang="html">
Line 37 ⟶ 41:
</syntaxhighlight>
Scripts will not run, and resources that are inside a template will not be fetched until the template is
== Browser support ==
Web Components are supported by current versions of all major browsers.<ref>{{Cite web|title=webcomponents.org - Discuss & share web components|url=https://www.webcomponents.org/|access-date=2020-07-22|website=www.webcomponents.org|language=en-us}}</ref>
Backward compatibility with older browsers is implemented using [[JavaScript]]-based [[Polyfill (programming)|polyfill]]s.
== Libraries ==
There are many libraries that are built on Web Components with the aim of increasing the level of abstraction when creating custom elements. Some of these libraries are [https://x-tag.github.io/ X-Tag], [https://slimjs.com/ Slim.js], [[Polymer (library)|Polymer]], [https://bosonic.github.io/ Bosonic], [https://riot.js.org/ Riot.js], [https://developer.salesforce.com/docs/component-library/documentation/en/lwc Salesforce Lightning Web Components], [https://www.dataformsjs.com/ DataFormsJS], [https://github.com/telepathic-elements/telepathic-element/ Telepathy], and [https://wompo.dev Wompo]
== Community ==
There are numerous community efforts for the Web Components ecosystem. [https://www.webcomponents.org/ WebComponents.org]<ref>{{Cite web|url=https://www.webcomponents.org/search|title=Search available Web Components}}</ref> provides an interface to search for any existing Web Components
== History ==
In 2011, Web Components were introduced for the first time by Alex Russell at Fronteers Conference
In 2013, [[Polymer (library)|Polymer]], a library based on Web Components was released by
In 2016, RequireJS was introduced as JavaScript library and [[Asynchronous module definition|AMD]] loader plugin for custom elements.<ref>{{cite web|url=https://developer.adobe.com/commerce/frontend-core/javascript/requirejs/|title=RequireJS in Commerce}}</ref>
[[Firefox]] 63 enabled Web Components support by default and updated the developer tools to support them in 2018.<ref>{{Cite web | url=https://blog.nightly.mozilla.org/2018/09/06/developer-tools-support-for-web-components-in-firefox-63/ |title = Developer Tools support for Web Components in Firefox 63}}</ref>▼
In 2017, [[Ionic (mobile app framework)]] team built [[StencilJS]], a JavaScript compiler that generates Web Components.<ref>{{cite web|url=https://levelup.gitconnected.com/web-component-solutions-a-comparison-e2fa25c34730|title=Web Component Solutions: A Comparison}}</ref>
In 2018, [[Angular (web framework)|Angular]] 6 introduced Angular Elements that lets you package your Angular components as custom web elements, which are part of the web components set of web platform APIs.<ref>{{cite web|url=https://www.freecodecamp.org/news/how-to-create-angular-6-custom-elements-web-components-c88814dc6e0a/|title=How to create Angular 6 Custom Elements and Web Components}}</ref>
▲In 2018, [[Firefox]] 63 enabled Web Components support by default and updated the developer tools to support them
In 2018, [[LitElement]] was developed by the Google Chrome team as part of larger [[Polymer (library)|Polymer]] project. LitElement was designed to be a lightweight and easy-to-use framework for creating web components.
==See also==
* [[HTML Components]]
* [[Web framework]]
* [[Web resource]]
== References ==
Line 68 ⟶ 81:
== External links ==
*{{official website}}
{{W3C standards}}
[[Category:Web standards]]
|