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

@bathos I agree with your point, although I had to "twist my brain" to get the semantical differences. But still, I believe "placeholder" to at least be the closest concept so far.

Seeing `NodePlaceholder` would, personally, allow me to immediately grasp that something somewhere would need to be substituted by something else at some point or never.
Whereas other suggested options here leave me with open questions _(position, point : as in "Node" what now...?)_ or confusion with other concepts _(part : as in "oh this is related to CSS Shadow Parts, or, is it?")_.

Doing a quick reading throught the proposal again does present "placeholder" as not being too far-fetched:

> [...] a native mechanism to instantiate it [-> template element] with some parts of it substituted, conditionally included, or repeated based on JavaScript values

**Here I read**: something that can be replaced by something else

> [...] the essence of the previous proposal: `NodeTemplatePart` and `AttributeTemplatePart` which provide mechanisms to insert or replace content at a specific location in a DOM tree.

**Here I read**: something that can be replaced somewhere

> We introduce the concept of a DOM part, which represents an unit of mutable state in a DOM tree.

**Here I read**: "a unit" of something that can change

### That said

Going throught the [Ember.js](https://guides.emberjs.com/v2.16.0/templates/) and [Angular](https://angular.io/guide/template-syntax) examples provided in the proposal, a couple similarly defining terms have come up, namely: `reference` _(suggested above)_ or `marked up xxx` _(I guess we'd use `marker` here)_.

Other common and related terms:
- interpolation | `NodeInterpolation`
- expression | `NodeExpression`
- binding | `NodeBinding`
- statement | `NodeStatement`

Other common terms in the same realm:
- directive | `NodeDirective`
- component | `NodeComponent`

### Finally

In my opinion, if we're going for something that represents the concept of:
- "a thing that is to be substituted in a specific location" then: **Mutable** / **MutationLocation** / **MutationPosition** (ex.: `NodeMutable`, `NodeMutationLocation`)
- "a thing that is referencing the location of something else" then: **Reference** / **Marker** / **LocationReference** / **PositionReference** (ex.: `NodeReference`, `NodeLocationReference`, `NodeMarker`, `NodeLocationMarker`)
- "a place holder place holding something that is able to be place holded" then: **Placeholder** / **Placeholdable** (ex.: `NodePlaceholder`, `NodePlaceholdable`)

Otherwise, I'd fall into using common terminology found in userland implementations.

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

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

Received on Wednesday, 10 August 2022 14:43:03 UTC