3 ms·
Just started using Vue.js and the components approach makes a lot of sense. Web Components is a not-quite-ready pure JS approach? Vue, polymer, react native..
by jacob019 8y ago
Just started using Vue.js and the components approach makes a lot of sense. Web Components is a not-quite-ready pure JS approach? Vue, polymer, react native... I feel confused every time I read "Web Components" because it means something different depending on context.
- spankalee 8y agoWeb Components means the standards of <template>, Custom Elements, and Shadow DOM. There's an overview here: https://developer.mozilla.org/en-US/docs/Web/Web_Components https://developer.mozilla.org/en-US/docs/Web/Web_Components Polymer has always been a set of helpers for making Web Components. There are others like SkateJS and Stencil. Vue is not normally Web Components, but they have an option in CLI 3 to compile to Web Components. React and React native have basically nothing to do with Web Components, though React can use Web Components because Web Components are just HTML elements.
- dmitriid 8y ago> Web Components are just HTML elements. Yup. And you can't use Polymer elements in React because React passes data as attributes whereas Polymer expects properties. And then there's the issue of event handlers etc. etc. etc. "Web Components" are now a largely non-intersecting collection of mutually incompatible frameworks and libs: https://custom-elements-everywhere.com https://custom-elements-everywhere.com Good luck using Polymer's <custom-element binding="{{a.b}}"> anywhere
- spankalee 8y ago> And you can't use Polymer elements in React because React passes data as attributes whereas Polymer expects properties This is mostly React's existing opinion that elements don't even need properties set, and is not the fault of Polymer or Web Components. Most Polymer elements are fine with simple types like strings or numbers being set as properties or attributes. > "Web Components" are now a largely non-intersecting collection of mutually incompatible frameworks and libs: https://custom-elements-everywhere.com https://custom-elements-everywhere.com That is a site that says how well _frameworks_ work with Custom Elements, ie do they make closed-world assumptions about HTML that interfere with using Custom Elements. It says nothing much about what a Web Component is, so I'm not sure how Web Components could be "non-intersecting". > Good luck using Polymer's <custom-element binding="{{a.b}}"> anywhere I know you troll every Web Components and Polymer discussion you can now, but this is just a non-sequitur. Polymer's template syntax is only used to implement elements with Polymer. `<custom-element binding="{{a.b}}">` would only ever occur in a Polymer template and is not intended to be used "everywhere", so no luck is needed, thank you.
- dmitriid 8y ago> I know you troll every Web Components and Polymer discussion you can now This is not trolling. This is called hard truths that Web Component proponents are completely blind to. Riddle me this: why is it that there are almost no resources, blog posts, projects, or comments that talk about and use vanilla Web Components? 99.9% of posts and videos about WebComponents always immediately use Polymer, or Stencil, or... or... or... The answer is easy: Web Components are crap, pure and simple. They are unusable in their present form. You need to throw in a data binding library, a templating library, a virtual DOM, a callback handling library, a..., a... etc. Better still, throw in a full framework like Polymer or Angular. Even the project we're commenting on, titled "Making Web Components Work" needs the following to make them work: "does so by providing an easy-to-use state management and rendering layer built on Virtual DOM (the basis of the core rendering technology of React). Through use of the Snabbdom Virtual DOM library and first-class support for multiple templating formats". How the hell is that "Web Components", "standards" and "work"? When you call out all these inconsistencies, half-truths and outright lies about Web Components, you're called a troll, go figure. --- As an aside. I remember saying that templating in Web Components is also crap because you have to use horrible DOM APIs or `innerHTML` to do anything useful. Obviously I was called a troll etc. However, when Apple proposed Mustache-like template instantiation [1] the same very people who called me a troll pissed themselves with joy and wonder. You know Web Components APIs and specs are crap. You chose to bury your head in the sand, turn a blind eye and preach how "WebComponents are the future". Well, it took browsers 11 years to get to two-thirds of jQuery's capabilities. It will take another 50 to maybe get one-third of capabilities of Web Component frameworks or React, or Angular, or Vue (hell, of even Snabbdom). [1] https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Template-Instantiation.md https://github.com/w3c/webcomponents/blob/gh-pages/proposals...