WICG / proposals

A home for well-formed proposed incubations for the web platform. All proposals welcome.
https://wicg.io/
Other
229 stars 14 forks source link

slot with same name within template #76

Open sashafirsov opened 1 year ago

sashafirsov commented 1 year ago

Introduction

The slot with same name in the HTML 5 TEMPLATE is not supported by current browser implementations which blocks several use cases essential for declarative HTML programming. It is also a blocker for declarative web application concept.

Use Cases

Goals

Non-goals (Optional)

Proposed Solution

Without being too prescriptive, articulate a specific way (procedurally, algorithmically, declaratively) that a new or current web technology solves an existing problem or challenge.

Examples (Recommended)

<div>
    <template shadowroot="open">
        <ol>
            <li><slot name="q">Q1</slot></li>
            <li><slot name="q">Q2</slot></li>
            <li><slot name="q">Q3</slot></li>
        </ol>
    </template>
    <i slot="q">A</i>
    <i slot="q">B</i>
    <i slot="q">C</i>
</div>
produces expected
ABC ABC
Q2 ABC
Q3 ABC

Live example: https://jsfiddle.net/suns2015/g0ukh81t

Alternate Approaches (Optional)

Not available.

Privacy & Security Considerations

N/A

Let’s Discuss

Declarative Web Application

sashafirsov commented 1 year ago

the case of reusing same slot in template is addressed in Functionally complete declarative templating proposal as a part of DCE/DWA stack.