Re: [w3c/webcomponents] Alternative proposal for closed shadow DOM (#499)

The shadow DOM is an amazing idea, allowing developers to package up a 'web component' in a self-contained way, so that it won't unintentionally be affected by what's outside. This is great for everyone: the component developer can develop in the knowledge that their component won't be unintentionally affected by the page, the page developer can use the component in the knowledge that it will work correctly if they use it as intended, and the component can be updated safely without breaking anything. I think we are all in agreement on this.

We seem only to hit a problem when the page developer (or a third party interacting with the page) wants to **intentionally** change the DOM within the web component. Then, we have 2 choices:
* The web component is still separate, but may be accessed by code not belonging to the component developer, via `shadowRoot`. Currently this is an "open" shadow DOM.

  The web developer can always realise their intentions by breaking into the shadow DOM if they need to, but do so at their peril, since things make break immediately or at some point in the future. Again, I think we are all in agreement that such a thing should exist.
* The web component is completely separate, and cannot be accessed by any code not belonging to the component developer. Currently this is a "closed" shadow DOM.

  This is being justified by asserting the importance that the web component always works correctly, everywhere. Implicitly, we are saying that it is more important that the web component works correctly in a developers page than the developer being able to do what they are trying to do.

Let me repeat, we are saying that **it is more important that the web component works correctly in a developer's page than the developer being able to do what they are trying to do**. This is blatantly absurd.

Add to this the fact that, in order to protect the developer from themselves, we have to create an exemption in every third-party interface that *should* have access. (This must be nearly all of them, since it is hard to reason about a page when chunks of it are locked away from view behind myriad opaque unstandardised interfaces.) And then the page developer can easily disable closed shadow DOMs anyway, even though they are the only ones we want to lock out. This takes a bad idea and inflates it into a multi-specification disaster.

I appreciate that a lot of work has gone into closed shadow DOMs, but can we please now reconsider, and begin taking steps to unwind it.


---
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/499#issuecomment-218835888

Received on Thursday, 12 May 2016 17:58:19 UTC