Re: [w3c/webcomponents] Scoped Custom Element Registries (#716)

@jarrodek a nother note about the registrys at all maybe not all got it right the registry don't registers any element!!!!! It registers Element Definitions i am creator of a next generation Frontend Framework that uses only raw EMCA i call it tag-html and here are some examples how customElements is implamented you can also look into the pollyfill from webcomponents

``` js
<my-custom-element-that-is-undefined></my-custom-element-that-is-undefined>
<script>
const definition = { connectedCallback() { this.innerHTML = 'Works' } }
const script = document.currentScript
const previousElementSibling = script.previousElementSibling
definition.connectedCallback.call(previousElementSibling)
script.remove()
</script>
```


Hope that gives you some insights
```js
class ElementDefinition {
    connectedCallback() {
        this.innerHTML = 'Works'
    }
}

customElements.define('parent-is-element-definition',class ParentIsElementDefinition extends HTMLElement {
    connectedCallback() {
        const target = this.previousElementSpiebling
        ElementDefinition.prototype.connectedCallback.call(target)
    }
})

customElements.define('parent-is-element-definition',class ParentIsElementDefinition extends HTMLElement {
    connectedCallback() {
        const target = this.previousElementSpiebling
        customElements.get('my-element-version').prototype.connectedCallback.call(target)
    }
})
``` 
the conclusion is all your components and data are always accessable via the window object always there is nothing never like private vars only exempt is nativ code from the browser but even that is opensource and can be reviewed via patching the browser.


-- 
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/716#issuecomment-574515474

Received on Wednesday, 15 January 2020 06:25:47 UTC