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

> If a custom elements class definition is mutated at runtime, the (JS) developer expects the instances to mutate as well, reflecting the change. Just like JS object instances change, when you change its prototype.

The contract for define() treating constructor / constructor.prototype as dictionary input is pretty misleading, yeah — but its current behavior is important. If the element’s public API were used for live lookup, invariants which are achievable today would cease to be — and production code would break, because today it’s possible (and in certain usages, essential to) delete the dictionary-members-disguised-as-methods immediately after definition.

-- 
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-550303454

Received on Wednesday, 6 November 2019 13:14:42 UTC