Open sashafirsov opened 4 months ago
Things that may be missing:
@EisenbergEffect , can you
@sashafirsov
ElementInternals
.ElementInternals
today.slotAssignment
property. That is read-only. I'm referring to the slotAssignment
configuration setting for Shadow DOM that we have today.I have attempted to take the features we have today in the imperative API for custom elements, things that have been discussed as W3C protocols (e.g. context), ongoing W3C standards efforts (e.g. DOM Parts), ongoing TC39 efforts (e.g. Signals), and make those the foundation of a declarative model for custom elements, while avoiding things that browser implementors said they won't/can't do. I am not trying to invent a bunch of new core features. There are gaps (template expression syntax), which I am trying to fill in. But on the whole, I'm mainly trying to figure out how we support our current imperative capabilities in a declarative fashion.
Declarative Custom Elements(DCE) has various POC and ideas on architecture and individual features.
Here is a list to be compared during demo day #80. The list meant to highlight the commonality/difference on each POC. As of now most of it is part of @epa-wg/custom-element implementation.
template
as DCE declaration tagelement
andcustom-element
tag
or root attribute( tbd, shadowrootmode , etc.) as shadow is not only option discussed, the genericroot
is more appropriate IMO.tag
tag
as attribute for DCE element. Seems no disagreement.src
or other attribute for external template.img
taghidden
- enabled by default attribute to prevent declaration rendered in page, needed for legacy browserstemplate
<style>
should not be applied on page level;<script>
is not executed.parameters
Support for
Syntax
<xsl:param>
- with optionalxsl
namespace.name
- parameter name, also DCE instanve attribute nameData injection
{}
single curbed brackets<xsl:value-of>
slots
support as in<template>
, native is not working on standard level :(dataset
fromdata-xxx
attributespayload
- content of instance payload including all slotsslice
- internal elements value reflected indatadom/slice
template
slots
supportDynamic data manipulation and state change reflection
Sufficient set of functional components for simple app flows
events handling
reflect the event to state lead to UI re-render.
non-declarative syntax
<script>
for exporting DCE class