- From: Lea Verou <notifications@github.com>
- Date: Thu, 13 Nov 2025 23:02:15 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/1029/3531203128@github.com>
LeaVerou left a comment (WICG/webcomponents#1029) It seems that the biggest tension here (and in the [Discord chat](https://discord.com/channels/767813449048260658/1438082551876161577) following the TPAC breakout) is around the tradeoff of exposing a good API with minimal hassle vs risking clashes. <details> <summary>Naturally, I do have my own opinions on this.</summary> The whole thing around clashes seems odd, given that JS already allows you to add properties to any prototype you want, so you can already clobber what's there. And when HTML adds a new global attribute, it can absolutely clash with the props you've defined for your custom element. So that ship has sailed — there's little to gain by trying to prevent clashes and a lot to lose by imposing artificial restrictions to the API to prevent them. </details> We could probably debate this forever. However, perhaps a more productive path forwards may be to meanwhile try to expose the right low-level primitives that would allow better (easier, more robust, faster) userland implementations of custom attributes, which would buy us more time (and give us more data) to design the higher level API. Ultimately, what we need for a good userland implementation is: 1. Query elements across shadow roots to find which ones already have the attribute — filed https://github.com/whatwg/dom/issues/1422 2. Monitor future changes, also across shadow roots — https://github.com/whatwg/dom/issues/1287 Then, this API becomes simple syntactic sugar on top of these. We'd still need to patch `attachShadow()` if we want to indiscriminately monitor closed roots, but I suspect the tradeoff of only monitoring open roots (+ select shadow roots) is acceptable in most cases. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/1029#issuecomment-3531203128 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/1029/3531203128@github.com>
Received on Friday, 14 November 2025 07:02:19 UTC