3 ms·
I was down on the ergonomics of Web Components for a few years, but recent work has me actually excited for them as the present now. You can get some nice "Prog
by WorldMaker 2y ago
I was down on the ergonomics of Web Components for a few years, but recent work has me actually excited for them as the present now. You can get some nice "Progressive Enhancement" experiences with them now.
If you are starting fresh, I'd consider taking a look at one of the lightweight options like lit [0] or FAST [1] for building your own. (Later this week or this weekend, I'm going to try to document building Web Components with my Butterfloat [2] because so far it is turning out great in my current hobby project and about to the point where I'm going to recommend it to production projects.)
[0] https://lit.dev/ https://lit.dev/
[1] https://fast.design/ https://fast.design/
[2] https://worldmaker.net/butterfloat/ https://worldmaker.net/butterfloat/
(ETA: Also advice I wish was more common in Web Components documentation: You don't have to use the Shadow DOM at all. Much of the complexity and confusion in Web Components is interacting with the Shadow DOM. There's a lot of great advice on why you might want to use the Shadow DOM. There's less great advice that it can be YAGNI and it is so much easier to style Web Components when they don't use the Shadow DOM, especially in your own Web Components for your own FE using a common style template like Bootstrap or Bulma. You can just ignore the Shadow DOM and use the "real" DOM.)