Reluctantly realizing we need a marketing name for minimal zero-dependency Vanilla Web Components that progressively enhance from Light DOM 😬
60 replies
@zachleat "Declarative Shadow DOM"
-
@zachleat it's in the spec. ff is building it now. 5 line polyfill
@bp it is an option, yeah! Not quite what I mean though
@zachleat Yeah I know, but like... what if we built a generation of tools that *didn't* fight against current and future standards? What if we implemented ideas like HTML progressive enhancement of web components in the way in which *browser authors have recommended*? Wouldn't that be really nice? Wouldn't that let us update our tools and projects much more smoothly in the future? Wouldn't that make it so much easier to transfer knowledge between projects and prevent name conflicts?
@bp browser authors aren’t #1 on this list, which is typically what I go by https://www.w3.org/TR/html-design-principles/#priority-of-constituencies
@bp @zachleat That doesn't mean DSD is what you need every time: e.g. GitHub's relative-time element, or an element you use to wrap a table that turns it into a sortable/filterable table.
DSD won't help here as what you want is only progressively enhancing the light DOM (the elements could use a shadow tree, but a declarative one would buy you nothing)
@brianleroux @zachleat that's an opinion. GNOME web for example doesn't even *let* you disable javascript globally, because they observed that nobody does.
A few months of waiting is worth not building a generation of tools which improperly implement spec'd behaviour
@bp @zachleat gnome may not let you disable js but it will still fail and then those users will have a terrible experience. It's about professional baselines not blindly implementing specs before they are ubiquitous. Standards based dev is about including everyone not just ppl who got lucky with a page load.
```html
<c-e>
<template shadowrootmode="open">
<style>
:host:not(:defined) ::slotted(#fallback) { /* 🎉️ */ }
</style>
</template>
<div id="fallback" slot="fallback">
<noscript>fallback content</noscript>
</div>
</c-e>
```season to taste
-
-
@passle hahahaha
@zachleat VANSTACK
@jgarber Chris Farley vibes 😂
@zachleat Vanilla DOM?
Because naming things is hard.
@mahryekuh I like this one!
@zachleat Cruelty-Free DOMJobbers?
@zachleat Enhancing from the light side just makes me think of Jedis.
@ben the Force Quit is strong with this one
@zachleat Web 0
@zachleat custom elements
@zachleat WebCLD
Web Component (for) Light DOM
@zachleat Enhancers? "What we need for this is an enhancer" "I'm building an enhancer" "Enhancers are a lightweight alternative to frameworks"
@zachleat or at least some education as to why this is the best technique for working with the grain of the web. Making up terms seems to work for a while then fade into confusion.
@zachleat yes please! So often I am like “ohhhh, new article about using web components” and then I read and see it’s just an empty “app shell” that generates everything “client side” and I feel cheated
@jimniels it’s uplifting to hear support for this!
@zachleat Actually just published something this morning and gave a nod to this toot cause I called what I did "web components" but it's really just a custom element with full markup over the wire which then gets enhanced/added to by the custom element's JS (if its available). Didn't have a word for it so just said "it's a web component”
https://blog.jim-nielsen.com/2023/web-components-icon-galleries/
@jimniels ah, great—seems like a vote for “Custom Element,” maybe?
@zachleat yes, but in many cases what we really mean is ”non-empty custom element”. Or, to your point, "custom elements that enhance light DOM”.
Maybe I'll call it an “HTML component” — it's the HTML part of web components ha
@jimniels I’d sign off to that!
@zachleat @jimniels late to the conversation since I just read Jim's post but it seems like the important parts of the convention are 1) it's just light DOM 2) it's progressively enhanced HTML. With those two thoughts in mind I think either a name like "Enhanced Components" or "Progressive Tags" might work for classifying the technique.
@zachleat If tailwind’s success against all odds is anything to go by we should call them ArseParps.
-
@westbrook Fair question! Mostly I’d like a classification to help with communication and education.
@zachleat @westbrook I'd give a +1 to having a classification between the two. At this point I think "web components" has (imo) been pretty heavily marketed/discussed as being the *combination* of CEs, shadow dom, templates, and {insert other WIP APIs} whereas I usually call what Zach is describing as "wrapping markup with custom elements to declaratively define interactive UI"
@hawkticehurst @zachleat where so you specifically place the delta between the two?
@westbrook @zachleat In this case I'd say the delta is CEs versus all other WC APIs
If we formally call what Zach is describing "web components" I worry it risks muddying what that term means. Most docs/resources describe WCs as being the combo of CEs, shadow dom, and templates (+ others) but what Zach is talking about is just using the CE API
In my mind it's about being precise with wording and also thinking about all the docs/resources that already exist if that makes sense?
@westbrook @zachleat Also to be clear, I don't think it would be wrong/bad to casually or informally describe this as "web components" but for the purposes of education/docs I think being precise that this a method of building interactive UI using only custom elements and nothing else from the "web component" bucket of APIs is probably a smart move
@zachleat Slight DOM Web Components
@zachleat plug and play
@zachleat ✨ DOMponents ✨
@ashur we have a winner, pack up your things everyone
-
@d …h-t-m-elements 😅
@zachleat @mez yeah I always thought of “web components” as the entire suite of technologies (custom elements, shadow dom, es modules, <slot>, etc.)
For me personally, I would love to have a term I could use to differentiate between web components that are used in a progressively enhanced way, eg
<app-drawer>
<nav>
<a>…</a>
<a>…</a>
</nav>
<app-drawer>Instead of something like:
<app-drawer></app-drawer>
With a bunch of JS
via https://adactio.com/journal/20618
1. HTML web components
2. Element extensions (from @davatron5000)