Re: [w3c/webcomponents] JavaScript bundlers, HMR and customElements.define() (#829)

> What are the invariants

The first set I was referring to concern storing the reaction functions rather than performing live lookups. If one deletes the callback hooks from the public interface, it can be guaranteed that any invocation of them is legitimate (e.g. `connectedCallback` is known to only be invoked when the element connects). This is one part of the API design which has made it possible to author elements whose internals are actually private.

The latter is that elements which instantiate elements generally have expectations about what those elements will be. Currently those can be relied on, as either definition would throw or if it succeeded you know what you’re getting.

However from a backwards compat perspective, both alternative behaviors could be introduced safely if they were opt-in via the second argument.

-- 
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/829#issuecomment-560008791

Received on Saturday, 30 November 2019 18:24:23 UTC