HTML with Superpowers: An Introduction to Web Components
51–60 of 130 posts
Re: HTML with Superpowers: An Introduction to Web Components
#52Earlier quoted context omitted.
Thanks to React, everyone else already has Web Components support built-in.
This is wrong on so many levels :-) As of now, React is probably the only major frontend framework that doesn't interop well with web components, requiring various hacks for doing so. Proper support is hopefully coming in version 19. What you have with React is its own, React-specific way of encapsulating parts of UI into stateful functions that helps to think about them as components. And to have web components supp…
What WebComponents support in SPAs bring to the table is a migration path to native support.
Re: HTML with Superpowers: An Introduction to Web Components
#53Earlier quoted context omitted.
I’ve been working on https://webcomponents.guide/ with some fellow experts in order to improve the documentation side of things. Hoping to offer guidelines and best practices to limit the amount of searching and experimentation required. Please take a look and provide feedback if you can!
That marketing copy ugh. "New! Powerful!" It's neither "Standard JS so it works where HTML works" says a lot about your experts
Re: HTML with Superpowers: An Introduction to Web Components
#54Earlier quoted context omitted.
I’ve been working on https://webcomponents.guide/ with some fellow experts in order to improve the documentation side of things. Hoping to offer guidelines and best practices to limit the amount of searching and experimentation required. Please take a look and provide feedback if you can!
No amount of documentation will help if React keeps acting as if Web Components don't exist. Other than that, the website looks quite nice.
Re: HTML with Superpowers: An Introduction to Web Components
#55Re: HTML with Superpowers: An Introduction to Web Components
#56It obviously hasn't happened, but I hope that web components eventually make serious inroads. A UI library for React, Vue, Svelte, Solid, whatever... Imagine being able to have a component library that works with any of them (or none of them). 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…
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
Re: HTML with Superpowers: An Introduction to Web Components
#57It obviously hasn't happened, but I hope that web components eventually make serious inroads. A UI library for React, Vue, Svelte, Solid, whatever... Imagine being able to have a component library that works with any of them (or none of them). 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…
Re: HTML with Superpowers: An Introduction to Web Components
#58One of the problems with native encapsulation is that UI frameworks almost never fully satisfy the product requirements for a given application, so in some cases it’s always necessary to override either behavior or styling. If you remove that capability with a shadow DOM, you damn well better be sure that your abstraction is perfect.
That’s what CSS parts and slots are for. Your component can style its own boundaries, provide parts to allow customisation, and use slots to inject components that are styled from outside (be it another ShadowDOM or the light DOM)
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.
Re: HTML with Superpowers: An Introduction to Web Components
#59Earlier quoted context omitted.
What do you mean? There are tons of these around. Are you complaining that none of them are popular enough?
None of them are standard. It should be baked into the cake. It's been a puzzler to me since I started programming over 20 years ago. Every third-party library existed basically just to provide a usable grid because most everything else was good enough. Combo boxes and date pickers too but those were less of a pain to implement.
> The purpose of Open UI to the web platform is to allow web developers to style and extend built-in web UI controls, such as dropdowns, checkboxes, radio buttons, and date/color pickers.
> Today, component frameworks and design systems reinvent common web UI controls to give designers full control over their appearance and behavior. We hope to make it unnecessary to reinvent built-in UI controls
Re: HTML with Superpowers: An Introduction to Web Components
#60Earlier quoted context omitted.
VueJS actually fails some advanced tests for WebComponents: https://custom-elements-everywhere.com/ So, VueJS docs are actually incorrect when they say it scores 100%. The actual score is 91%. I had reported this 8 months ago.
For people too lazy to look into what the issues are: lack of support for CAPScase, camelCase, and PascalCase DOM events. Only lowercase and kebab-case work.