Open thepassle opened 4 years ago
Given the following code:
export const BarMixin = klass => class BarMixin extends klass {} export const FooMixin = klass => class FooMixin extends BarMixin(klass) {} export class MyComponent extends FooMixin(HTMLElement) { }
The output custom-elements.json looks like this:
custom-elements.json
The output here seems... off:
{ "kind": "class", "mixins": [ { "name": "BarMixin", "module": "./dev/src/custom-element/MyComponent.js" } ], "name": "FooMixin" },
Maybe we should allow a mixin to have a nested mixins field? Something like:
{ "kind": "variable", "name": "FooMixin", "type": "(klass: any) => typeof FooMixin", "mixins": { "name": "BarMixin", "module": "./dev/src/custom-element/MyComponent.js" } }
Given the following code:
The output custom-elements.json looks like this:
```json { "kind": "class", "superclass": { "name": "HTMLElement" }, "mixins": [ { "name": "FooMixin", "module": "./dev/src/custom-element/MyComponent.js" } ], "name": "MyComponent", "tagName": "my-component" }, { "kind": "class", "mixins": [ { "name": "BarMixin", "module": "./dev/src/custom-element/MyComponent.js" } ], "name": "FooMixin" }, { "kind": "class", "name": "BarMixin" }, { "kind": "variable", "name": "BarMixin", "type": "(klass: any) => typeof BarMixin" }, { "kind": "variable", "name": "FooMixin", "type": "(klass: any) => typeof FooMixin" } ] ```custom-elements.json
The output here seems... off:
Maybe we should allow a mixin to have a nested mixins field? Something like: