You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Classes decorated with @Component can not extend from a base class. Inherency is temporarily disabled for stencil components. #1127
Classes decorated with @Component can not extend from a base class. Inherency is temporarily disabled for stencil components.
Expected behavior: npm start successfully
Steps to reproduce:
Run npm start
Other information:
I went through the CHANGELOG and found out that since version 0.12.0. The compiler prevents any inheritance for @Component decorated class. I wonder why this? It seems logical for component classes to extend a base class with common non-component related logic
Unlike Prototypal inheritance with standard ES5 classes, the composition allows us to copy the properties from one object to another, without retaining a reference from the original object.
[...]
There are two immediate benefits with this approach:
The methods are reusable by other variants of the SDKs. So no more redundant or duplicate code.
The imports are tree-shakable with Webpack + Babel pipeline. [...]
Activity
Sanderand commentedon Oct 3, 2018
This is probably relates or duplicates #1060 (comment)
kael commentedon Oct 3, 2018
@gusterwoei AFAII, seems they removed inheritance because it doesn't work well with "tree shaking". Searching about it, I've come across that blog post: Concatenative Inheritance over Prototypal Inheritance:
Looks like another paradigm to learn.
adamdbradley commentedon Oct 30, 2018
We're still evaluating how to best generate components from the compiler, which is why the message is there.