Intent to Remove: Multiple Shadow Roots for Shadow DOM V0

234 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Hayato Ito

ungelesen,
21.08.2017, 08:04:4921.08.17
an blink-dev, Takayoshi Kochi
Primary eng (and PM) emails

Link to “Intent to Deprecate” thread

Summary
Remove the support of multiple shadow roots of Shadow DOM v0.
Multiple shadow roots feature enables users to put more than one shadow roots on a shadow host.
See this for an explainer of this feature.

This is a step to deprecate/remove all Shadow DOM v0 features, in favor of Shadow DOM v1.

Given that Blink now supports Shadow DOM v1 as well as Shadow DOM v0, multiple
shadow roots feature has been one of the biggest causes of code complexity. It
would be a huge win if we can remove this feature from Blink, from the DOM code
health's perspective.

Specifically:
- ShadowRoot#olderShadowRoot: Will remove this from IDL.
- Element#createShadowRoot() on a shadow host: Will throw an error.

Compatibility And Interoperability Risk
Edge/IE: Not supported
Firefox: Not supported
Safari: Not supported

Alternative implementation suggestion for web developers
No alternative.

Usage information from UseCounter
0.018% for ElementCreateShadowRootMultiple
It looks the usage decreased significantly at Apr 2017.

OWP launch tracking bug

Entry on the feature dashboard

Rune Lillesveen

ungelesen,
21.08.2017, 09:55:4121.08.17
an Hayato Ito, blink-dev, Takayoshi Kochi
In general non-owner lgtm with some questions in-line.

On Mon, Aug 21, 2017 at 2:04 PM, Hayato Ito <hay...@chromium.org> wrote:
Primary eng (and PM) emails

Link to “Intent to Deprecate” thread

Summary
Remove the support of multiple shadow roots of Shadow DOM v0.
Multiple shadow roots feature enables users to put more than one shadow roots on a shadow host.
See this for an explainer of this feature.

This is a step to deprecate/remove all Shadow DOM v0 features, in favor of Shadow DOM v1.

Given that Blink now supports Shadow DOM v1 as well as Shadow DOM v0, multiple
shadow roots feature has been one of the biggest causes of code complexity. It
would be a huge win if we can remove this feature from Blink, from the DOM code
health's perspective.

Specifically:
- ShadowRoot#olderShadowRoot: Will remove this from IDL.
- Element#createShadowRoot() on a shadow host: Will throw an error.

What's the plan for the <shadow> element? That will now be useless, right?

Compatibility And Interoperability Risk
Edge/IE: Not supported
Firefox: Not supported
Safari: Not supported

The compat risk would mostly be with Blink targeted shadow dom v0 applications using multiple roots?

What's the typical feature detection for shadow dom v0?

Did earlier versions of Polymer use multiple roots?

Alternative implementation suggestion for web developers
No alternative.

Usage information from UseCounter
0.018% for ElementCreateShadowRootMultiple
It looks the usage decreased significantly at Apr 2017.

Is that older versions of Polymer contributing most of that?

--
Rune Lillesveen

Hayato Ito

ungelesen,
21.08.2017, 10:39:4221.08.17
an Rune Lillesveen, blink-dev, Takayoshi Kochi
Replied in-line.

On Mon, Aug 21, 2017 at 10:55 PM Rune Lillesveen <ru...@opera.com> wrote:
In general non-owner lgtm with some questions in-line.

On Mon, Aug 21, 2017 at 2:04 PM, Hayato Ito <hay...@chromium.org> wrote:
Primary eng (and PM) emails

Link to “Intent to Deprecate” thread

Summary
Remove the support of multiple shadow roots of Shadow DOM v0.
Multiple shadow roots feature enables users to put more than one shadow roots on a shadow host.
See this for an explainer of this feature.

This is a step to deprecate/remove all Shadow DOM v0 features, in favor of Shadow DOM v1.

Given that Blink now supports Shadow DOM v1 as well as Shadow DOM v0, multiple
shadow roots feature has been one of the biggest causes of code complexity. It
would be a huge win if we can remove this feature from Blink, from the DOM code
health's perspective.

Specifically:
- ShadowRoot#olderShadowRoot: Will remove this from IDL.
- Element#createShadowRoot() on a shadow host: Will throw an error.

What's the plan for the <shadow> element? That will now be useless, right?

We won't remove the support of <shadow> elements at this timing because:
- Using <shadow> elements in a single shadow root is a valid usage, where <shadow> elements should behave like <content> elements (except that <shadow> doesn't support select attributes). 

I guess we can remove <shadow> elements together with entire Shadow DOM v0 APIs.


Compatibility And Interoperability Risk
Edge/IE: Not supported
Firefox: Not supported
Safari: Not supported

The compat risk would mostly be with Blink targeted shadow dom v0 applications using multiple roots?

Yes, the situation is very similar to the case of /deep/ combinator.
 

What's the typical feature detection for shadow dom v0?

We are using Element#createShadowRoot for tracking; https://www.chromestatus.com/metrics/feature/timeline/popularity/456.
 

Did earlier versions of Polymer use multiple roots?

Yes, as far as I remember, there was only *one* custom element which uses multiple shadow roots feature in earlier versions of Polymer.
 

Alternative implementation suggestion for web developers
No alternative.

Usage information from UseCounter
0.018% for ElementCreateShadowRootMultiple
It looks the usage decreased significantly at Apr 2017.

Is that older versions of Polymer contributing most of that?

Possibly, but we don't have data. We guessed that it might be due to a Chrome Extension, such as AdBlock.
I noticed this usage drop just today.

 

--
Rune Lillesveen

TAMURA, Kent

ungelesen,
22.08.2017, 23:35:0622.08.17
an Hayato Ito, blink-dev, Takayoshi Kochi
LGTM to remove.

The current deprecation message doesn't have the target removal milestone. So I recommend to add the target milestone to the deprecation message for M62 release, and remove the feature in M63 or M64 just in case.



--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_1hXkp286Qqj2dq%2B3Keiux4CjFb5m%3DGJGPBjrBd0c5e0Q%40mail.gmail.com.



--
TAMURA Kent
Software Engineer, Google


Hayato Ito

ungelesen,
23.08.2017, 01:06:5423.08.17
an TAMURA, Kent, blink-dev, Takayoshi Kochi
Yeah, that is my plan. I'll add the target milestone to the deprecation message after I get 3 LGTMs.

Jochen Eisinger

ungelesen,
23.08.2017, 09:54:4623.08.17
an Hayato Ito, TAMURA, Kent, blink-dev, Takayoshi Kochi

Dimitri Glazkov

ungelesen,
23.08.2017, 10:47:5023.08.17
an Jochen Eisinger, Hayato Ito, TAMURA, Kent, blink-dev, Takayoshi Kochi

Rick Byers

ungelesen,
23.08.2017, 11:59:1323.08.17
an Hayato Ito, Rune Lillesveen, blink-dev, Takayoshi Kochi
From our experience with the /deep/ removal the case that worries me most is sites which do feature detection for ShadowDOM v0 and fall back to a polyfill when that fails.  Such sites may currently work in all browsers today, but could conceivably break in Chrome when it supports some but not all of the ShadowDOM v0 features.

Hayato, can you verify whether some popular release of Polymer have this property for multiple shadow roots (as they do for /deep/)?  

From internal data it's interesting that this UseCounter seems to be hit exclusively on desktop platforms, it's almost 0 on Android.  Any idea why?  Perhaps there's some popular desktop-specific site dominating the metrics here?


What's the typical feature detection for shadow dom v0?

We are using Element#createShadowRoot for tracking; https://www.chromestatus.com/metrics/feature/timeline/popularity/456.
 

Did earlier versions of Polymer use multiple roots?

Yes, as far as I remember, there was only *one* custom element which uses multiple shadow roots feature in earlier versions of Polymer.
 

Alternative implementation suggestion for web developers
No alternative.

Usage information from UseCounter
0.018% for ElementCreateShadowRootMultiple
It looks the usage decreased significantly at Apr 2017.

Is that older versions of Polymer contributing most of that?

Possibly, but we don't have data. We guessed that it might be due to a Chrome Extension, such as AdBlock.
I noticed this usage drop just today.

 

--
Rune Lillesveen

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Hayato Ito

ungelesen,
23.08.2017, 23:25:3223.08.17
an Rick Byers, Rune Lillesveen, blink-dev, Takayoshi Kochi
Polymer 0.5 is the last version which uses /deep/ and multiple shadow roots internally, as far as I know.

That means once we successfully remove /deep/, there shouldn't be an issue in removing multiple shadow roots, regarding sites using Polymer.
We are removing /deep/ at M63.
 
From internal data it's interesting that this UseCounter seems to be hit exclusively on desktop platforms, it's almost 0 on Android.  Any idea why?  Perhaps there's some popular desktop-specific site dominating the metrics here?

Though I don't know any good way to isolate the effect, it is known that the popular Chrome Extensions, AdBlock or AdBlock Plus, use Shadow DOM v0, and they might contribute the desktop usage of multiple shadow roots. They might call Element.createShadowRoot() for an element even if it has already a shadow root.

I guess the most usages of multiple shadow roots today are not *intentional* for users. They would just *overwrite* the old shadow root unintentionally without using the future of multiple shadow roots.

Rick Byers

ungelesen,
24.08.2017, 11:20:1724.08.17
an Hayato Ito, Rune Lillesveen, blink-dev, Takayoshi Kochi
Thanks, LGTM to me as well (with a targetted deprecation message for at least one milestone).

Takayoshi Kochi

ungelesen,
29.08.2017, 06:08:3629.08.17
an Rick Byers, Hayato Ito, Rune Lillesveen, blink-dev
Thanks for all LGTMs!

The target milestone (M63) is now included in the message.
https://chromium-review.googlesource.com/c/chromium/src/+/640432

--
Takayoshi Kochi

Takayoshi Kochi

ungelesen,
26.10.2017, 22:44:2826.10.17
an blink-dev
Notice: The removal of multiple shadow roots slipped from M63 to M64, and it was removed as of r512017.
--
Takayoshi Kochi
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten