Over the last few weeks I’ve been trying to refactor a codebase to use superclasses and inheritance more in my components. I’ve run across a very odd scenario which appears to be a bug regarding the use of
@bindable inside the superclass. Here’s the simplest reproduction I was able to do:
The setup is simple:
- I’ve got two components, X and Y. They both extend from an abstract base class, Base.
- Base has a
- I’m requiring X and Y in app.html.
If you run this example you’ll see that only X is displayed. If you comment out the line requiring X, Y will be displayed. But both seemingly can’t be required and displayed at the same time.
Now, it gets more confusing and interesting when we use
require as instead of
require. In this case we get 2 instances of X. One when we require X under an alias, and one when we require Y as an alias. Somehow, Y is being loaded as X.
If you comment out the
@bindable property in Base, everything works as it should. It appears very much that the bindable property is causing the problem.
Anyone have any ideas what might cause this?
Thanks for any and all help!