-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[declarative-custom-elements] do we need DOM parts or any template mechanism in spec? #1090
Comments
To answer some of #1009 questions:
|
As for templating, there are ways to perform templating without special markup, just in a declarative way using CSS selectors (or any kind of selector). See existing engines:
But the HTML spec does not need to define a specific templating engine. |
There is additional discussion (and additional libraries that take that approach mentioned) in with issue 1035 |
to have the DCE viable, it have to have sufficient functionality to build full blown web app. With data retrieval layer, fully functional template (variables, conditions, loops, etc.), interactivity with browser and user (events & APIs). The "parts" is necessary peace of the data-template-logic triangle. In The subject for part content as slots as different kind of data: attributes of DCE, payload, slots, data As for shadow or not, it can be left outside of DCE proposal, there are implementations in both. Shadowless version still has CSS scoping/insulation. The DCE concept gives insulation on logic and relations layer which makes shadow absolete. |
Thinking about declarative custom elements and playing with a
load-file
custom element that does load a file using the fetch API to create a shadow DOM root, I'm wondering if we absolutely need to have DOM parts, at least initially, for declarative custom elements.My take on this is that you can have declarative custom elements without any form of templating:
slotchange
event to detect if the content of a slot is changed to adjust the DOMExample using an import link idea:
and in custom-element.html:
Here, vanilla javascript is used to perform templating, but any templating library can be used in the same way as long as the template respects standard HTML syntax.
DOM Parts can be used later to incrementally improve on this.
The text was updated successfully, but these errors were encountered: