-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Declarative custom elements - teaser
Not a proposal. Here we could outline the purpose and goals. WIGC proposal would follow.
Description
Defines the convention of defining the custom elements via HTML tags.
It is a part of declaratively defined functional web application running even with JS script disabled.
Links
- WCCG Draft report
- HTML modules
- proposal PR by Westbrook
- Initial strawman Proposal
- Single File Component Explainer
- Cross-over with HTML Modules
Status
- list
Initial API Summary/Quick API Proposal
<template element="garden-treat">
<slot name="icon">🍓</slot>
<slot>berry</slot>
</template>
<garden-treat>peach<span slot="icon">🍑</span></garden-treat>Key Scenarios
Simple template use in custom element. The template DOM reuse for same kind of data presented multiple times in UI.
Extended use is a templates library to be reused across multiple pages. This feature requires external resource reference and include into page. Like HTML include.
Live POC for inline and external template library.
Concerns
- functionality of original Custom Elements usually is defined by JavaScript which gives a full power for business logic of web application. In order to be sufficient the template concept should be extended to support explicit conditions( in current standard only positive text on slot name match is implemented), iteration over collection ( current implementation has only given order slot multiplication ) - needs order customization, transaction (TBD)
- support of page life cycle: load, (de-)hydration
Dissenting Opinion
Related Specs
Open Questions
- what is MVP. Static site?
- full implementation scope. Shopping cart app.
follow up proposals
- Functionally complete declarative templating, 2023-04
- DCE POC, 2023-03+
dominictobias
Metadata
Metadata
Assignees
Labels
No labels