It offers nothing in way of ensuring that custom elements behave like builtin HTML elements. Half the elements I've come across will break or perform no-ops when you update an attribute or set a propety after it was attached to the DOM. Nevermind detaching and reattaching to the DOM, which will break virtually all of them (including my own sad contributions to this space).
The exception to this are those built using a 3rd party library like lit-element or stenciljs, which fill in the obvious omissions of these specs. Perhaps in another 10 years, a mangled version of half of one of them can be standardized? In the meantime, each component shipping its own frontend library or inlining the same core functions over and over again does nothing in the way of interoperability. You can bundle every popular JS framework and mix their components today. The reason you don't do it then or now is bloat, not the lack of a minimally viable shared component interface.
Besides, if you're going to use a 3rd party library and associated bundler/compiler, you might as well pick a good one such as React, Vue, Svelete, Solid or even jQuery UI. Using any of these, you can design and build an entire app faster than the bikeshedding commissars from goog and aapl can agree on whether "open" or "closed" should be the default for attaching a shadow DOM (at the risk of ruining the joke: there was no agreement; the developer has to provide a value in each instance...)
You have to invent all your own wiring and passing of events, state-management et cetera if you go that route.
Because very few of the people developing web standards are web developers. And of those who are very few have done anything of note in the past 20 years or more.
They do love working on standards though.
This seems like the norm for tech now days. A lot of meeting and work and nothing major or significant really gets done. Seems like the the whole industry is about making it easier and simpler for new developers to get develop.
Regarding React, ES should just stick and simplify E4X that would just really make all these front end lib not necessary.
Unfortunately, it is the same churn that has vastly improved the ergonomics for many UI frameworks while we're stuck with the terrible workflows for authoring web components.
Is there a continuous churn?
React is 10 years this year. Vue is 9 years. Angular which feels positively ancient is 7 years (if we only count Angular 2.x).
Yes, there are newcomers like Svelte and Solid, but it's hardly a churn. Besides, they explore valuable corners that are left untouched and unexplored by other frameworks. Things like granular reactivity and removing components as a unit of UI in its entirety.
Meanwhile the "non-churn" in web components has already resulted in two deprecated standards (custom elements v0, html imports), and is rapidly churning out dozens of new standards requiring more and more javascript to paper over their egregious design (form participation, constructible stylesheets, declarative shadow dom...)
And to have web components support built-in would mean to have them in the browser anyway, not in a third-party library.
Since I really like mithril and there's one UI library, I've been playing with Shoelace and Crayons and they're pretty nice to work with, but I remain a bit puzzled why there's so few players in the space.
Svelte fully supports compiling to Web Components with 100% test coverage.
Vue fully supports Web Components as well, the only issue I've run into there is with CustomEvent.detail not being copied into the Vue event payload properly.
Web Components are widely used on the web, just under the covers sometimes.
So, VueJS docs are actually incorrect when they say it scores 100%. The actual score is 91%.
I had reported this 8 months ago.
In general, none of the major frameworks, and very few of the new frameworks use web components as a foundation for their functionality for many extensively described reasons that wc proponents literally couldn't care less about.
That seems to be a worthy goal, but I don't see that being usable in prod projects, at least not in the near future.
The closest I've seen is something like PrimeFaces, which has components for Angular, React and Vue, which is the majority of projects I've seen out there: https://www.primefaces.org (I've also used the Java JSF variety, it was... sometimes problematic)
If you need something that works the same (or as close as you can get) across multiple front end frameworks/libraries, while still having most of the components you could possibly want, I don't think there are many other options out there.
For example:
- Angular calendar: https://www.primefaces.org/primeng/calendar
- React calendar: https://www.primefaces.org/primereact/calendar/
- Vue calendar: https://www.primefaces.org/primevue/calendar
I know this might seem like a "who cares" sort of thing since the industry has standardized on the three listed, but I find all three overkill for a lot of things and, for example, keep my small projects in Mithril. But then I'm hit with either using Construct UI (which is honestly ok, this is all internal stuff), or having to make all the components myself.
What makes it such an impossibility for production? Even if, as in the case of Ionic, they provide web components but also wrap them up for React, Vue and Angular.
You don't need web components for that. You need https://open-ui.org (started, of all people, by Microsoft). Unfortunately Google et al are too busy sinking hundreds of millions of dollars and countless man-hours into web components (with no final goal in mind and increasingly arcane and complex workarounds for their deficiencies) to be interested in this.
> but I remain a bit puzzled why there's so few players in the space.
In which space?
In UI libs for the web? There are thousands, all busy re-implementing the same dozen-or-so primitive controls.
In UI libs for web components? Because they are a badly designed tech that still requires you to reinvent the same dozen-or-so primitive controls and combat the issues of styling, a11y, no SSR etc. that they bring.
That said, generally speaking, web standards really suck at offering sandboxing capabilities for third party integrations.
Just take filtering - there are so many possibilities of how filters can look like, how can they be combined (AND, OR, nested) etc.
Source: I fought with Ionic code for months over this. Really soured me on native encapsulation, but I see the benefits still. I just think it has to be approved very very very carefully.
Question: when and or if they gain in adoption, could you see them replacing react? If not, what’s the use-cases that you believe they wouldn’t work for?
I tried to get into WebComponents, but the MDN tutorial has you writing a lot of `document.createElement` and `document.appendChild`, which is the sort of imperative stuff I don't like about vanilla JS DOM manipulation.
Frameworks like react/angular/backbone/vue solve the problem of creating a single page application with a nice architecture and sharing code between components within the SPA.
Web components solve the problem of sharing code between any application.
There are opportunities to share code (eg/ data binding) and I believe that is the case (they use the same underlying browser APIs where available)
Treating the web as a low level platform that we can extense on top of, grow & further, with new, creative higher-level layers of hypermedia: that is a path to software with a soul, not just for big companies hacking out features, but genuine good for society. A malleable cohesive comprehendible connected information space.
Documentation and Google-ability of the subject isn't great so prepare to some digging and experimentation.
The current native feature set is somewhat lacking so you're definitely going to want to augment with some sort of helper framework/library. Building any significantly sized project purely native with vanillaJS would be challenging.
There are also some unique hurdles with this type of project that our org had to work through-mainly on the integration and design side of it.
And yet wc proponents keep pushing them as if they were panacea.
And "ecosystems is young" is a funny statement for something that is entering its 12th year of development (and fifth year of wide availability in browsers).
> The current native feature set is somewhat lacking so you're definitely going to want to augment with some sort of helper framework/library.
If they are lacking, have glaring unsolved issues, https://twitter.com/Rich_Harris/status/1198332398561353728), and you still need to augment them with a framework/library,... what's the point then?
If any of the existing solutions had the same amount of issues that wcs have, they would never have gotten of the ground. And yet here we are 12 years and hundreds of millions of dollars of effort later
I did have some early hopes that it would also be a good way to enable content authors to coin and style markup within their posts/articles/etc., but the JS required makes me feel like it'll be too heavy for that use-case for most.
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<!--#include virtual="/ssi/head.html" -->
<title></title>
<meta name="description" content="">
</head>
<body>
<header>
<!--#include virtual="/ssi/header.html" -->
</header>
<main>
</main>
<footer>
<!--#include virtual="/ssi/footer.html" -->
</footer>
</body>
</html>
I'll put all my favicon, CSS, and other common head data in the /ssi/head.html file. Nice and simple and good enough for me. Can make it even more minimal by moving the <header> and <footer> tags into their respective SSI files.In nearly every (marketing) agency I've worked at, the designers envisioned themselves as creatives. "Boundaries? Not us. We live outside the box..." Trying to get them to understand you can have the same underlying structure and just bend it with CSS wasn't something they've wanted to imagine. The idea of reusing (read: not creating from scratch) isn't in their DNA.
Again, this isn't all web designers. But marketing agencies do a lot of non-enterprise design and dev.
At a lot of BigCos, the designs are supposed to be standard outside of the once in a generation refresh. One of the advantages of a big brand is a consistent, known quantity, and so things have to be harmonious; Starbucks is not out there making crazy new cups for every new drink they sell, every McDonald's location looks more or less the same, etc.
A lot of the variation we've seen in the early web was because web was something that a lot of people were outsourcing, but these days web is more integral, theoretically.
- extremely light on content
- goes out of its way to not present anything more complex than non-functional pieces of code or static examples
- while advertising that they are "easy to use", the Writing section immediately skips to comparing and using frameworks and libraries
- I guess is a front to get the courses at $39/month, but the only link is on the front page
This is a horrible, bad, no good resource that offers nothing of value.