That HTML Blog #16: Scaling up imperative DOM APIs, utility-first CSS fails, safe DSD
Friday, February 23, 2024 Web development news seemed sluggish earlier this month (plus I spent the better part of February very sick!), but now I'm seeing things picking up again—not the least of which is that Firefox 123 is out which finally offers native support for Declarative Shadow DOM (DSD)! Now we can state with confidence that all modern browsers support DSD, and the days of reaching for a polyfill are numbered. 🎉 There's also been a ton of content and conversation floating about concerning the "future of the Jamstack" (including an upcoming interview I participated in which was very enjoyable), so we'll likely touch on that in a big way come March. For folks like me who've always felt the real promise of Jamstack approaches to web development was the intentional focus on static-first, HTML-first solutions, that should fit right in at That HTML Blog. ’Till next time, The DX Limitations of Imperative APIs ➦In this essay at Smashing Magazine, Frederik Dohr walks through some of the challenges of scaling up purely “imperative” DOM APIs inside a web component to handle complex UI state and rendering. Now I happen to think there can be a wide spectrum of approaches and third-party solutions here. Imagine vanilla JavaScript all the way on one end of the spectrum, and React all the way on the other end of the spectrum. There’s a lot of room in the middle for light-weight tools which can address low-hanging fruit. Utility-First CSS Does a Disservice to Utilities ➦In this addition to the corpus of critiques of “utility-first” CSS, Heydon Pickering does an excellent job of explaining the strange world we find ourselves in where the C of CSS is simply being thrown away for the sake of a convenience that doesn’t actually end up very convenient at all in the long run. Variable Font Face Made Easy ➦I’ve set up Well, in this example of how Michelle Barker got things set up for her site in a recent redesign, it seems very straightforward and makes a lot of sense. Practice Safe DSD with setHTMLUnsafe (It’s Complicated 😂) ➦All right, so you got your web server emitting some HTML with declarative shadow DOM (DSD). Great! You fetch a fragment of this HTML, and use Uh oh. No worries, you think to yourself. You’ll use Uh oh. Yes, I’m sorry be the bearer of bad news, but the typical DOM APIs you use to turn strings of HTML into new DOM do not parse DSD. All those Until now. That HTML Blog See also our sibling publication The Spicy Web + Discord |