My comment to yesterdays Dev.to post: Web components failed. We can fix them became a full post:
TL;DR: Web Components never failed. Browser vendors have used component-based architecture for decades. Yet developers keep building apps, inventing frameworks, and adding dependencies instead of embracing the platform.
In 2006, Mozilla took its own stab at componentizing the Web with XBL, first developed for Mozilla and later proposed as a specification:
Browser vendors have been using Web Component machinery for many moons longer than we mortal developers have had today's standardized Web Components APIs.
Underneath, there may be an entire internal UI: buttons, sliders, labels, tracks, controls and state.
With the appropriate DevTools settings, browsers can expose these internal shadowDOM trees for inspection.
The browser platform itself demonstrates why encapsulated components are useful.
They give us routing, state management, rendering systems, build pipelines, dependency graphs and application architecture.
A doesn't care whether the surrounding application uses React, Vue, PHP, Django or plain HTML. Or the car is painted red.
Many developers learned one particular way of building software and then taught those patterns to coworkers, and — directly or indirectly — to AI.
So AI happily reproduces them — and teaches the next generation that this is simply how software is built.
Ask AI to build something and you'll often get an entire application architecture when what you actually needed was:
Once you've trained your tools — and your AI — to produce small, independent components instead of miniature applications, it can become a competitive advantage.
In 2022 there were already around 60 Frameworks, Libraries and BaseClasses listed in:
You discover Web Components You develop a few helper functions Then: Oh, it needs this feature... Then another feature And another Soon you've created conventions Then abstractions Then dependencies Then documentation
You're building a framework (or a Design System) And your ego just publsihed it to NPM
They don't have to become somebody else's architecture. They don't even have to be shared abstractions in your components. Duplicate your code! Something every "guru" developer told you not to do. A well trained AI is great at managing those.
Note: That "guru" developer in your team now tells you to make this a library you can import.
