- From: Joe Pea <notifications@github.com>
- Date: Fri, 29 Jul 2022 14:11:17 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 29 July 2022 21:11:30 UTC
> ```js
> customElements.define('my-el', class extends HTMLElement {
> static get disabledFeatures() { return ['internals']; }
> })
> document.createElement('my-el').attachInternals() // throws
> ```
That API seems backwards. Perhaps it should have been this:
```js
customElements.define('my-el', class extends HTMLElement {})
document.createElement('my-el').attachInternals() // throws
```
```js
customElements.define('my-el', class extends HTMLElement {
static enabledFeatures = ['internals']
})
document.createElement('my-el').attachInternals() // does not throw
```
But that's tangential anyway. Once the feature is available, protecting it is difficult.
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/962#issuecomment-1199948014
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/962/1199948014@github.com>
Received on Friday, 29 July 2022 21:11:30 UTC