5

Version 1.0 of Shadow DOM will completely replace the <content> tag with <slot>. There are examples on the web I cannot find a relevant discussion which justifies this change.

What was the problem with <content>, which <slot> will solve? After all the new design is completely different.

Tomasz Pluskiewicz
  • 3,622
  • 1
  • 19
  • 42

1 Answers1

4

The editor of Shadow DOM specification is here.

It would be difficult to summarize the reason here, however, the following discussions and the minutes might be helpful to understand the history and the reason:

Yeah, Google opposed to this change at first, but we had no other choice to make Shadow DOM forward. :)

I have rewritten Shadow DOM specification as "v1" so that it will be the standard on which all browser vendors could agree. That's the primary reason.

We all are aware that the API change is painful for Web developers, but I believed that "Native Shadow DOM in every browsers" is much important for the Web platform in the long term.

See also here for other changes between v0 and v1:

Hayato Ito
  • 134
  • 3
  • So, instead of `` it would be ``? Instead of `
    Name
    ` it would be `
    Name
    `?
    – Marcelo Glasberg Jul 25 '16 at 05:06
  • Hayato, do you know when (which Chrome version) `` will stop working? Also, do you know if we will have both `` and `` working together for a while, so that it makes it easier for us to migrate? – Marcelo Glasberg Jul 25 '16 at 05:09
  • Terrible change. Content was much, much better than slot. It was more semantic, it was simpler, it was less verbose. It was more like "regular" HTML. – Marcelo Glasberg Jul 25 '16 at 05:26
  • 2
    1. Yes. 2. NO ETA to deprecate Shadow DOM v0. See [Intent to Ship: Shadow DOM v1](https://groups.google.com/a/chromium.org/d/msg/blink-dev/zrZRD2ls5tw/ibbjD3cQAQAJ) for detail. 3. Please see the mentioned discussion, where you could see the similar arguments. – Hayato Ito Jul 25 '16 at 07:44
  • 1
    There you say: "Shipping v1 is the most effective way to decrease the usage counter of Shadow DOM v0, I think." I would suggest two more important approaches: 1) Update explanations at html5rocks, specially those from Eric Bidelman, since most people are learning ShadowDOM from there. 2) Go through all StackOverflow questions that relate to WebComponents, and post another answer stating the deprecation. As an example, I just did that at: http://stackoverflow.com/questions/27622605/what-is-the-content-pseudo-element-and-how-does-it-work?rq=1 – Marcelo Glasberg Jul 25 '16 at 18:00
  • 2
    Thank you for the feedback! 1) The new article is coming from Eric, as far as I know. 2) I with I could have a bandwidth. :) I appreciate if our great community of Web Components would answer the questions. That's really nice. – Hayato Ito Jul 27 '16 at 01:42
  • 2
    The Shadow DOM v1 article is up: https://developers.google.com/web/fundamentals/primers/shadowdom/. The web component articles on html5rocks will [soon](https://github.com/html5rocks/www.html5rocks.com/pull/1444) have a "deprecated" banner at the top pointing you to the new stuff – ebidel Aug 08 '16 at 17:04