Re: [WICG/webcomponents] Addressable comments (a very small DOM parts subset) (Issue #1116)

trusktr left a comment (WICG/webcomponents#1116)

> <input marker="$lit1">
> <div marker="$lit2" class="foo current_c1 current_c2">current_content</div>
> <style marker=$lit3>current_styles</style>
> 
>     
>   
> 
>     render(({v, c1, c2, content, styles}) => {
>         const lit1 = app_root.querySelector("[marker=$lit1]");
>         lit1.value = v;
>         const lit2 = app_root.querySelector("[marker=$lit2]");
>         lit2.setAttribute("class", `foo ${c1} ${c2}`);
>         lit2.replaceChildren(content);
>         const lit3 = app_root.querySelector("[marker=$lit3]");
>         lit3.replaceChildren(styles);
>     });

There is something missing in this example. How do do you know from `[marker=$lit1]` that you need to set an attribute, a value, or text content?

What @sorvell mentioned via tracking that info in a first-child comment, is one way to solve that. From your code snippet, there's no indication of how the `marker` attributes track what part of the DOM they track.

Basically template library authors want to easily get all the interpolation points no matter where they are.

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

Message ID: <WICG/webcomponents/issues/1116/3550310729@github.com>

Received on Wednesday, 19 November 2025 01:57:22 UTC