2 ms·
I'm on the Polymer team, so admittedly biased here, but I don't understand your comment about Polymer minimizing reusability. Polymer is designed to _mazimize_
by spankalee 11y ago
I'm on the Polymer team, so admittedly biased here, but I don't understand your comment about Polymer minimizing reusability.
Polymer is designed to _mazimize_ reusability and interoperability via standards. Polymer elements just elements and you use them via standard API - set properties, attributes, listen for events, add children. The only wrinkle is that Shadow DOM is a little slow to polyfill, so we're using a wrapper on the DOM API. This will eventually go away.
Polymer is also extremely small compared to other libraries, and has no external dependencies: 34k gzipped without polyfills and 42k with. This will get better as native Custom Elements arrive across browsers later this year.
My main point is that in the Web Components future, it will not matter so much what libraries are used to implement components, as long as they are standard elements on the outside. The guts can be Polymer, some future web-component supporting React, Angular, etc., or just plain JS.
- JDDunn9 11y agoUsing Polymer(...) instead of document.registerElement(...) means that for anyone to re-use a component I build, they will need Polymer as a dependency. There will likely be more web component based libraries popping up, so then I'm going to need to download half a dozen identical libraries to use different components for my site? Then there's hacked components like React that don't even use the web components spec...
- spankalee 11y agoYes, to use any component you will need that component's dependencies. That's just true of any software component. The Polymer() call has nothing to do with it, as in the end it just calls document.registerElement(). Raw elements that call into a template library in attachedCallback() will depend on that template library.