Polymer 0.8 no custom element inheritance

239 views
Skip to first unread message

Helen Wu

unread,
Mar 12, 2015, 4:59:47 PM3/12/15
to polym...@googlegroups.com
I was wondering what the reasons behind not having custom element inheritance were. I know that it's good to prefer composition over inheritance, but there are also places where the use of inheritance is pretty obvious.

Is it possible to share the plan to update the current polymer elements to use composition over inheritance (for example the elements that use core-selector would be a good example), so that we have an idea of what changes to make in our 0.5 versions to prepare for the 0.8 release?

Thanks!

Douglas Hubler

unread,
Mar 13, 2015, 8:42:59 AM3/13/15
to polym...@googlegroups.com
I was wondering that myself.  I extended the 0.5 core-splitter with great success.  Essentially I wanted *all* the functionality from the JS plus a little extra but *none* of the HTML, I wrote my own view.

Petr Žďárský

unread,
Mar 13, 2015, 10:25:33 AM3/13/15
to polym...@googlegroups.com
It will be really hard for me to update to Polymer 0.8 because I have a lot of inheritance. I made my custom ajax element that is base on core-ajax with some aditional features and settings, another my favourite inherited element is my image from core-image.

Vote up for inheritance in 0.8 !! 

Dne čtvrtek 12. března 2015 21:59:47 UTC+1 Helen Wu napsal(a):

Robert Bjarnason

unread,
Mar 13, 2015, 1:19:40 PM3/13/15
to polym...@googlegroups.com
My apps also use inheritance, it will not be difficult to re-factor. The question for me, if added, is if inheritance is a performance issue either with native or polyfilled components?

Helen Wu

unread,
Mar 14, 2015, 11:23:34 AM3/14/15
to polym...@googlegroups.com
Without inheritance, I think i would expect to have some sort of embedding/mixins for elements. For example, I wouldn't really mind putting core-selector into the element's HTML if I didn't have to copy over all of its attributes and functions into the parent element. Actually, that would be really nice, since it wouldn't restrict core selector to the top level element (for example if you wanted selection for table rows, but you have a table header). 

In Douglas's case where he uses only the JS and not really the HTML, maybe it would be helpful to have the script in a separate js file instead of in the HTML?

Rob Dodson

unread,
Mar 17, 2015, 3:23:19 PM3/17/15
to Helen Wu, polymer-dev
My understanding is that we would like to support inheritance eventually. If I recall, the reason it is not currently supported is there are lifecycle issues that we have to sort out, and we're not sure how to fix it without taking a performance hit.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/66700736-d8ce-48ab-ab31-49f50cf3be11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages