Re: [w3c/webcomponents] [declarative-custom-elements] shorter syntax (#885)

Neither of those options are feasible.

In the first variant, you can't put the `<script>` inside the `<template>`. We need the script to be run once to augment the element definition, and potentially before the first instance is created. The `<template>` would be cloned per-instance.

In the second variant, we really do need a `<template>` element to contain the potential DOM for instances. We don't want live elements there - images and iframes loading, styles applying, etc.

What's wrong with the original example? Yes, there's an outer element, but it's all very explicit and follows expectations of how the elements already behave.

-- 
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/885#issuecomment-719650411

Received on Friday, 30 October 2020 16:19:38 UTC