New post:
The Good, The Bad, The Web Components
https://www.zachleat.com/web/good-bad-web-components/
A full crash course on the state of web components, where they fit in JavaScript frameworks landscape, and how to make use of them moving forward!
@zachleat The “h-i” slide cracks me up.
@khalidabuhakmeh we do what we must
@zachleat Great post. I’d like to see the aspirational idea you have come to fruition.
The biggest issue with web component approaches, even the good ones like WebC, is that they still require a build step. This limits them to folks who are comfortable with JS build chains.
I want to spread the love to Django, ASP.NET, Laravel, Rails, and all future web frameworks.
@khalidabuhakmeh Won't lie... it's what keeps me from investigating them any further than "the theory". I don't want node/npm on a live server. I have and trust PHP/Composer. Mostly because those are already my dependencies, and I don't want new ones with new exposure surfaces. @zachleat
@mattwilcox @khalidabuhakmeh sure, but the repetition issue can be “poorly” hacked together via other mechanisms in your server-rendered stack: https://www.zachleat.com/web/webc-in-eleventy/#a-history-of-component-like-things (PHP include comes to mind)
But, yeah. It’s interesting that non-JS server environments are almost their own slower pace layer in web development. (Ref to @adactio.com’s https://adactio.com/journal/19104)
@zachleat I actually find that slower pace a feature not a bug, is the thing. I *trust* PHP much more than I do Node. I *trust* Composer more than I do npm.
Is that rational? No and yes. I'm sure there are shoddy packages and all the same vectors for bad actors in Composer packages as for npm... but one has the reuptation of dodgy packages littered with dependencies, and actively abused ones, and the other doesn't.
@zachleat (Which is why I'm happy playing with 11ty locally, but do not use node on live servers) @khalidabuhakmeh @adactio.com
@mattwilcox @zachleat Yeah, I wouldn't dream of it. Any viable use of a Web Component framework or SSR with an SSR stack (Laravel and ASP.NET Core) would have to be a build step.
@mattwilcox @zachleat Welp… I got nerd-sniped. I hope you are happy now! #dotnet #aspnetcore
@zachleat @mattwilcox There is a second level here that I’m not ready to go down, but I’ll write a blog post for the adventurous among us.
But I have to ask. Can the WebC toolchain process HTML fragments one at a time?
@khalidabuhakmeh @mattwilcox For sure, it can parse fragments, that’s the example on the README: https://github.com/11ty/webc?tab=readme-ov-file#javascript-api
Might be worth looking at the test suite for more examples too:
https://github.com/11ty/webc/blob/main/test/parserTest.js
@zachleat @mattwilcox Well… I was hoping you would say no.
I might have to implement this then.