The issue involves nuanced syntax changes with potential teaching challenges.
The issue addresses ambiguity between properties and attributes in custom elements, proposing a syntax change to distinguish them more naturally. While the problem and proposed solution are outlined, the implementation involves nuanced syntax changes that could be confusing to teach and may require careful handling of backward compatibility.
One of the many reasons custom elements are a pain in the neck is that it's often rather ambiguous what's supposed to be an attribute and what's supposed to be a property. Some custom elements 'reflect' attributes back to properties and vice versa, but there's no universally agreed upon convention. If you're doing low-level DOM manipulation you can decide whether you want to do element.setAttribute(name, value) or element[name] = value, but everyone stopped writing code like that a decade ago.
It's a messy, flawed design, and different frameworks deal with it in different ways. Preact and Svelte both treat something as a property if prop in node, and an attribute otherwise. Vue does the same thing but additionally gives you a way to force something to be a prop (I don't think you can force something to be an attribute) with some interesting syntax choices:
Lit leans even harder into syntax, with ? and . and @ prefixes for boolean attributes, properties and event handlers respectively:
I think the explicit control is a good thing, but I think we can provide it more naturally.
#7925 and #12479 point the way. We're moving to a world in which quoted props on components are stringified:
<script>
let object = { a: 1, b: 2, c: 3 };
</script>
<!-- in Svelte 6, this will mean `data="[object Object]"` -->
<Thing data="{object}" />
(The reason the quotes are ignored today is historical: in the distant past before Svelte editor extensions,
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!