Re: [w3c/webcomponents] Anonymous custom elements 匿名自定义组件 (#842)

> I just saw this, it seems very interesting:
> https://github.com/lume/element-behaviors

Oh thanks! :)

<details><summary>More details (off topic)</summary>


That's a little tool I made which is basically an alternative to the `is=""` attribute (so basically an alternative to custom elements). It allows practically the same thing as custom elements (you write classes with the same life cycle methods), but allows you to have more than one of them associated with an element (which is convenient) without changing the original tag name of the element (for example apply them to `<tr>` or `<td>` elements without breaking the DOM parser behavior like you otherwise do with custom elements that don't use the `is=""` approach which Safari does not want to implement for various valid reasons).


</details>

---

On the main topic, how would anonymous custom elements be represented in HTML? It seems this would make things like SSR (server-side rendering) more difficult to achieve. The more difficult it is, the more specific each solution will be which can cause fragmentation between different custom element libraries that end up having very specific requirements for things like SSR to work properly.

As an example of the opposite, the [Declarative-Custom-Elements](https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Declarative-Custom-Elements-Strawman.md) proposal would bring some standardization to custom elements as far as representation in HTML, which would make it easier to create things like SSR, and make it easier for custom element libraries to have a chance at being compatible with each other (there are still issues, the community would still need to make its own standards on top of that proposal, but the community standards would simpler and smaller).

-- 
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/842#issuecomment-657272381

Received on Sunday, 12 July 2020 20:41:25 UTC