5 ms·
Web components are essentially syntactic sugar. It's not so much a technology in and of itself as a way to help web developers avoid copy & paste strain.. So o
by revelation 9y ago
Web components are essentially syntactic sugar. It's not so much a technology in and of itself as a way to help web developers avoid copy & paste strain..
So of course they work with anything and are "natural". There is nothing in them! It's a macro or preprocessor system if you want..
- ergo14 9y agoNot entirely true - you get things like shadow dom with them - which means "proper" encapsulation.
- floatboth 9y agoAnd custom elements provide a way to actually create, well, your own DOM elements. Libraries like React provide their own "fake" components that are only usable from within the libraries. With Custom Elements you can actually provide a DOM API for your element, that can be used from plain JS. And HTML Imports provide deduplication. They're a solution to the "I have four copies of jQuery on my page" problem.