3 ms·
My biggest issue with WCs is that they only solve a small part of the problem. You get custom tags but without data binding and some form of reactivity these ar
by pier25 7y ago
My biggest issue with WCs is that they only solve a small part of the problem. You get custom tags but without data binding and some form of reactivity these are not very helpful.
Lit, Skate, Stencil, etc, solve those limitations, but if you are already using a complicated toolchain and third party code for doing the heavy lifting I don't see much value in WCs.
- petilon 7y agoYou don't need a complicated toolchain. This 200-line lib let you create and use Web Components using JSX syntax, just like React.js: https://github.com/wisercoder/uibuilder https://github.com/wisercoder/uibuilder
- pier25 7y agoAnd that library requires TypeScript and you probably will need to minify afterwards. Also: > Unlike React.js UIBuilder does not do incremental screen updates. Which means you now have to start worrying about which parts you have to update. So again, you probably need something like MobX.
- labrador 7y agoGood stuff. I would recommend VSCode over Visual Studio.
- derefr 7y agoIt’s a bit like having a stdlib type specifically for Sets or URIs or Rational numbers in a programming language. It’s not that any given library couldn’t make its own. It’s that having a single implementation “canonized” in the stdlib means that every library that wants this functionality will be using the stdlib’s implementation, and stdlib functions will also be able to consume or produce that type when it makes sense, and so you’ll have an ecosystem that all interoperates by passing around and transforming this shared type. Also, standardizing Web Components also means changing the semantics of DOM parsing for user-agents other than browsers. My random Python HTML crawler lib isn’t going to parse some third-party library’s implementation of Web Components; but it is going to parse standardized HTML Web Components.
- pier25 7y agoYes that is nice but performance and bloat are much more pressing issues IMO.
- danShumway 7y agoThe problem is that Web Components give you an implementation standard, but not a standard for what components are named or how they work. Your random Python HTML crawler is welcome to try and parse standardized HTML Web Components, but since every single one is going to be named differently and have separate controls and interfaces for accessing data, your crawler isn't going to get very far. I am moderately concerned that Web Components are a step backwards for the semantic web, not a step forwards. Particularly after seeing other comments on this post that the shadow DOM is only accessible through Javascript in some situations. To me, web components feel over-engineered. I'm not sure exactly what it is, but I can't help but feel like there's a simpler answer to this problem that would have worked better for everyone. Maybe a better, Javascript free implementation of HTML imports? The last spec got rejected for very good reason, but it's not like the core idea was necessarily bad. Then maybe throw out Shadow DOM entirely and replace it with some kind of more flexible/accessible scope system instead?