3 ms·
Webcomponents should help with this. Although the current API is not as pleasant to use as react.
by thayne 7y ago
Webcomponents should help with this. Although the current API is not as pleasant to use as react.
- dmitriid 7y agoThey can't and they won't. Because they rely on DOM APIs to do anything useful. Which brings us back to the article.
- thayne 7y agoWhat does that have to do with having composable components?
- dmitriid 7y agoEverything. The only way the vanilla webcomponents are "composable" is through tons of boilerplate code using DOM APIs. You can't even re-create the example with list elements without tearing your hair out when using webcomponents. It's so bad that any examples showing "composability" immediately give up and use .innerHtml everywhere, and even then it's pretty bad. It's so bad, in fact, that people do anything to avoid writing vanilla and use lit-html (yay, programming with strings), Stencil, or even Preact (AMP switched to Preact to author components).