Re: [w3c/webcomponents] How to define APIs only for custom element authors (#758)

@domenic : for `createdCallback`, I'd add another con that invoking the subclass' method while executing `super()` in that subclass' constructor is a very strange programming pattern.

```js
class MyElement {
    constructor() {
        super(); // This calls createdCallback
        this._myStateObject = ~;
    }
    createdCallback(elementInternal) {
        // Can't see this. _myStateObject.
    }
}
```

We have to do this for the same reason that we can't tell the end of the constructor. An alternative is to enqueue a custom element reaction after the constructor had run but then it would mean that the constructor won't have access to `ElementInternal` even though that's the most natural place to set the default tab index, etc...


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/758#issuecomment-429203989

Received on Friday, 12 October 2018 04:55:08 UTC