Re: [WICG/webcomponents] Template/part proposals - Naming for DOM Parts API (#902)

> Could someone elaborate on the need to separate `AttributePart` and `ChildNodePart`?
> From API interface and implementation I could not come up with any difference. Like none.
> If that is true, why we need separate interfaces?

They need to be separate interfaces as they perform different operations on a node. `ChildNodePart` is a stand in for a child node, and so the value could be another Node such as an element, otherwise it'd be coerced to text and added as a TextNode. If you were to build this yourself ChildNode's `commit()` would likely use `.append()` or similar.

AttributePart would represent an AttributeNode's value, and as such should always be a string. If you were to build this yourself it would likely use `.setAttribute()` or similar.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/902#issuecomment-1212977332
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/902/1212977332@github.com>

Received on Friday, 12 August 2022 10:47:04 UTC