Styling Costs and Shadow DOM

Nolan Lawson examines whether shadow DOM actually improves style performance. Encapsulation means styling is applied somewhat faster than when the same rules are relevant to the whole page, but the result depends on the approach: classes and IDs are faster outside the shadow DOM, so plain class/ID styling remains the better route when it fits.

Framework and Bundle Strategies

Miško Hevery describes how Qwik keeps state directly in the HTML/DOM, as in div ::app-state="./AppState" app-state:1234="{count: 321}">. The approach looks SSR-friendly, and although it reads as though it would be slow, apparently it isn't.

Ben Schwarz addresses oversized bundles: shrink them, then monitor them continuously.

Harry's CSS performance diagnostics snippet appeared on Smashing Magazine, after CSS-Tricks had covered it; it remains worth re-sharing.

Caching Standards and Priority Hints

Tim Perry covers two proposed caching headers: Cache-Status and Targeted Cache-Control.

"These are designed to update HTTP standards to match the reality of the CDN-powered web that exists today, creating specifications that formalize existing practices from popular CDNs."

On rendering, Leena Sohoni, Addy Osmani and Patrick Meenan explain Priority Hints. In practice it is an importance attribute in HTML or a JavaScript param in other APIs, with a draft spec published. Like srcset/sizes or will-change, it lets the author pass the browser information it needs to perform better.

Measuring Whether the Web Got Faster

Barry Pollard asks whether Core Web Vitals have made the web faster since their May 2020 announcement and their May 2021 role as an SEO factor. The answer is complicated because CWV measurement itself changed over that period: some measurements show improvement, while steady alternate measurements before and after look worse, depending on which slice of the web is examined.

Islands, Media Queries, and Tooling

Astro supports components such as <Sidebar client:media={"(min-width: 768px)"} />, which isn't loaded unless the media query matches. That pays off mainly for heavy components or ones requiring JavaScript: with static HTML, the extra JavaScript needed to test media conditions and conditionally fetch assets can offset the savings. Oliver Turner shows how to share media queries between JavaScript and CSS via PostCSS.

Image Optimizer is a free Electron-powered, macOS-only drag-and-drop image optimizer, comparable to ImageOptim, which is also free.