If your JavaScript framework doesn’t support web components, it doesn’t support the web platform.
-
@zachleat I wonder if there's a truth to the paradigm of compilers being too [critical, necessary, vital, ???] for web developers to avoid using the DOM directly?
Using Custom Elements as Web Components inside of the popular libraries, almost all of which rely on a compilation step to convert everything to HTML, CSS, and JS, doesn't seem to provide enough benefits in those paradigms.
What incentives do JS library focused developers have to use WCs in a compile-necessary language?
-
@zachleat Said in another way, React provides everything developers need in a React environment to create custom elements, and all of that code will be compiled down to a snapshot to diff.
Trying to get in the head of devs loyal to their JS libraries and frameworks, I'm struggling to make enough arguments for Web Components for any compiled language.
-
Zach Leatherman :11ty:replied to Micah last edited by [email protected]
@asuh it’s a good thought experiment! I consider it a limitation when when a compiler is required to own everything. Especially if the goal is to accommodate use cases with limited capability for build steps (which exist whether a framework supports them or not)
-
@zachleat Strong “If your web framework doesn’t support XHTML and XSLT, it doesn’t support the web platform” vibes here.
I’m usually all for using web-native tech without intermediary tools. But that’s because it brings me benefits like easier debuggability, better performance, more control, etc. As much as I’d like to say that of web components unfortunately I can’t…
-
@mb21 you took a thing I said and changed it to be a different thing 🫠 Do you want to talk about XSLT? I have a fair bit of experience with it!
-
@zachleat I’ve had my share of experience with XSLT as well. I liked XQuery better, but that never made it into browsers. Anyway, my point was more that just because something is built into all browsers doesn’t necessarily mean it’s a good idea to use it.
-
@mb21 whew, XSLT might be the wrong tree to be barking up on this point specifically . It was wicked fast in IE8 for templating—way speedier than DOM methods. Used to love it for that
-
@zachleat Exactly. And I think we’ll see whether web components are going to feel stale like XSLT in >10 years.
-
@mb21 Maybe that’s the root of the issue here. Folks are so tied up in how something *feels* (easily influenced by blog posts) and not the value it brings to real production use cases
anyway XSLT is still working fine for real use cases—eleventy-base-blog has one for Atom feed styling: https://eleventy-base-blog-git-v9-11ty.vercel.app/feed/feed.xml
Related: https://rknight.me/blog/styling-rss-and-atom-feeds/
-
@zachleat Haha, well… beyond that one use-case, do you feel XSLT brings value to real production use cases?
-
@mb21 do we acknowledge the goal posts moving here or no