by Touche · 9y ago · 0 comments
The article makes the usual criticism that web components doesn't have a databinding spec. It's true, it's a short coming. But the lack of a databinding spec doesn't make Shadow DOM any less useful. The two are unrelated.
The author really likes JSX, but didn't bother to google "jsx web components"; if he had he might have come across this: https://skatejs.gitbooks.io/skatejs/content/
There are some real things to criticize about web components. Shadow DOM makes it hard to theme your app. Custom elements has some warts in regards to the way that some events are composed. But the article doesnt make these criticisms.
> Shadow DOM makes it hard to theme your app.
Polymer uses CSS custom properties for this and it's not even hard, it's pretty cool, it's like you're making a CSS API for theming <your-element>.
Could you please link to a reference? I've never heard of JavaScript attributes and I can't find any reference on MDN.
> Shadow DOM makes it hard to theme your app
The styling is a little different from normal but not too bad after getting the hang of it. There's usually a few components for colors, fonts, and common app styles (see paper-styles [1]). A few other components can provide CSS helper classes (e.g. Polymer's spin on flexbox [2]). CSS properties make tweaking component styles pretty easy, which makes the components more reusable. There are probably other styling tricks that'll pop up over time too.
(you don't have to use Polymer, I picked it because it's what I'm most familiar with)
[1] https://www.webcomponents.org/element/PolymerElements/paper-...
[2] https://www.webcomponents.org/element/PolymerElements/iron-f...