Now, when extending a component, we have to redefine the static components key:
class A extends Component {
static components = { SomeComponent };
}
class B extends A {
static components = { ...A.components, SomeOtherComponent };
}
This may lead to problem in Odoo when patching components: if some code patches the A component after the definition of B, then B will not have the correct components.
We could change Owl to make it so that a subcomponent only define the additional components it needs, while keeping the components from its parent. For example:
class A extends Component {
static components = { SomeComponent }
}
class B extends A {
static components = { SomeOtherComponent };
}
Owl could make the above code work, maybe by setting the prototype of its static components key to A.components.
Now, when extending a component, we have to redefine the static components key:
This may lead to problem in Odoo when patching components: if some code patches the A component after the definition of B, then B will not have the correct components.
We could change Owl to make it so that a subcomponent only define the additional components it needs, while keeping the components from its parent. For example:
Owl could make the above code work, maybe by setting the prototype of its static components key to
A.components
.