Re: [WICG/webcomponents] [dom-parts] Declarative API for defining DOM parts (Issue #990)

I'm remembering more of my thinking now, when I did this (quite a while ago):  https://github.com/bahrus/be-repeated#example-v----compatibility-with-server-rendered-lists

The count isn't really that critical for anything other than the last one.  All the others, it's possible to know where it begins and ends, esssentially each inner empty template acts as a  begin *and* an end.  I think I was planning to put an end marker for the last one, but I can't recall if I did (I *think* I did, but never updated the documentation):

```html
<ul>
    <li>Head Item</li>
    <template be-repeated='{
        "transform": {"li": "."},
        "list": {"observe": "obj-ml", "on": "value-changed", "vft": "value.prop1"},
        "deferRendering": true
    }'><li>...</li></template>
    <template data-cnt="2" data-idx="0"></template>
    <li>hello</li>
    <template data-cnt="2" data-idx="1"></template>
    <li>world</li>
    <li>Footer Item</li>
</ul>
```

The count is still useful to know if some element *did* create or remove one or more siblings, in which I case I reran the transform.  Something like that.

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

Message ID: <WICG/webcomponents/issues/990/1516569962@github.com>

Received on Thursday, 20 April 2023 15:52:19 UTC