That HTML Blog logo

That HTML Blog

Subscribe
Archives
July 25, 2025

#29: Fun with Invoker Commands and Web Components

A huge step forward for the vanilla web feeling like it’s a bona fide application development platform.

Friday, July 25, 2025

Hello #WebDev friends! Today's newsletter is short, but hopefully illuminating for future-proofing your application architecture. Before getting into all that, I've been spending a lot of brain power not simply on how we build for the web but how we access the web in the first place. Lots to say on that front, but it's led me to venturing forth from my cozy little world of DuckDuckGo as the search engine I've used for almost a decade now and trying out Kagi. So far, I'm quite impressed. I've been a bit skeptical of that company to date, but given the absolute dumpster fire that is Google Search right now (not to mention Big AI trying to supplant Google), I figured I wouldn't let perfect be the enemy of good.

The rise of "alternative" search engines is becoming more of a given (in nerd circles at least), and I'm feeling jazzed about that because it seems like it's part of the puzzle that we're also dealing with in movements like the Indie Web, the Fediverse, etc. If that sort of conversation tickles your fancy, be sure to check out the other newsletter I write Cycles Hyped No More where this sort of thing is my main beat.

Hey, so you wanna keep learning about “vanilla” web tech and how to escape the hell of JS framework churn? Make sure you don't miss another issue of That HTML Blog:

Anyway, on with today's topic! Enjoy. ☺️


📜 The Invoker Commands API

I thought it would be fun to revisit the Invoker Commands API which is available in Chromium-based browsers and hopefully coming soon to Safari and Firefox (both are currently in testing).

I’ve talked about this API before on the blog, and I continue to feel pretty excited about it since it’s the first truly declarative “click and see something happen!!” API we’ve ever seen on the web other than forms. I mean, think about it for a moment…isn’t it quite odd that there’s never been a way to write HTML (not JavaScript!) which says “when you click this button, do that thing”?!

Now we can do that nope we can’t do that if we’re inside shadow DOM and the button being clicked is supposed to do a thing via its host component. 😡

Le sigh…

But thankfully there’s always a workaround in the Wide World of the Web, so I’ve written up that workaround and here’s a CodePen demonstrating it in action.

Read the rest of the article here:

More Fun with Invoker Commands and Web Components | That HTML Blog

This is a huge step forward for the vanilla web feeling like it’s a bona fide application development platform rather than a glorified document viewer.


Thanks for reading! See you here next week,
Jared

 
🤔🌩️ Things that make you think: 💡😃

CSS selector performance is one of those things you only need to worry about very infrequently, like terrestrial shark attacks. If you are repeatedly and frequently causing style recalculations, over a massively overpopulated DOM — made up of thousands of nodes — it is something you may want to look into, after you’ve optimised literally everything else. To put it another way: it won’t be your CSS selectors, it will probably be a JavaScript memory leak and/or a bloated DOM.

–Regarding Heydon Pickering's improved "sidebar" layout with modern CSS:


A revisit of the Every Layout sidebar with :has() and selector performance - Piccalilli

Heydon Pickering takes a fresh look the Every Layout Sidebar layout, 6 years on, to see if modern CSS selectors can improve it.

Don't miss what's next. Subscribe to That HTML Blog:
That HTML Blog Follow on Mastodon
Powered by Buttondown, the easiest way to start and grow your newsletter.