Overview of ShopTalk — Episode 697
This episode is a wide-ranging, informal chat about recent web-platform developments, tooling, and small experiments. The hosts mix banter and sponsor talk (StudioWorks.app invoicing) with deep dives into new CSS/JS features (grid-lanes, PWA install API, scroll-driven animations, view transitions), a DIY demo of using a service worker + IndexedDB to provide declarative Shadow DOM templates, and updates to developer tooling (CodePen improvements). The tone is practical and exploratory — “let’s try this and see what it buys us.”
Key topics covered
- Sponsor: StudioWorks.app — invoicing app that integrates with Stripe and generates PDF/online invoices.
- Platform features and standardization dynamics: how Chrome/Edge vs WebKit/Apple decisions influence what ships.
- Web Install API for PWAs: simpler “install from a page” flow and the idea of small app stores of PWAs.
- CSS and layout:
- display: grid-lanes (masonry-like solution) landed naming and early WebKit support.
- text-grow / text-shrink (Chromium experiment) as a way to replace FitText-style approaches.
- container units vs viewport units and how new primitives change responsive typography.
- Animations:
- Scroll-driven animations and view-based timelines for timeline → scroll mappings.
- Animation triggers (animation-trigger + timeline-trigger) to control when animations start based on view/scroll.
- View transitions: page reveal/page swap events, and active view transition type pseudo-class for per-transition styling.
- Web Components & Shadow DOM:
- Pros/cons of Shadow DOM; new-ish primitives for importing styles into shadow roots (CSSStyleSheet, import assertions, adoptedStyleSheets).
- Lit/web components are small by bytes and have performance benefits vs heavier frameworks.
- Service worker experiment (demo): storing declarative Shadow DOM templates in IndexedDB and rewriting HTML streams in the service worker to inject templates for faster subsequent loads.
- Tooling & workflows:
- CodePen: new editor (pop-out live view without iframe), live reload improvements, one-click deploys with cached builds and shareable subdomains.
- BrowserStack and the pain of testing older browser versions and cross-device testing.
- Accessibility and cautionary notes: some new visual auto-sizing features need accessibility consideration (min font size, user preferences).
Notable technical takeaways and insights
- Web install API lowers friction for PWAs: you can trigger an install from your site directly (button → install). This opens possibilities for small curated PWA “app stores” and direct installs from pages.
- Grid-lanes (masonry) has a name and early WebKit adoption — naming and Apple involvement often shape adoption trajectories.
- text-grow / text-shrink in Chromium could make FitText and JS solutions obsolete for many use cases, but accessibility edge-cases must be handled (min font-size, user settings).
- Scroll-driven animations and animation triggers give CSS-native ways to:
- tie animation progress to scroll or viewport percentage (timeline replacement).
- delay/analyze animation start with explicit triggers (better than ad-hoc JS delays).
- View transitions expose page lifecycle events (page reveal / page swap) and allow CSS to respond to transition types via active view transition type — useful to vary animations by navigation type (back/forward, cached vs network).
- Declarative Shadow DOM combined with service-worker rewriting:
- You can store component templates in IndexedDB, intercept requests in a service worker, and inject pre-rendered declarative shadow DOM into HTML responses to speed up subsequent navigations.
- Caveats: doesn’t help initial load, can cause “double work” (client will still run JS and re-render), and brings caching/upgrade complexity (need good cache/versioning strategy).
- Styling in shadow roots is improving: import/assert and adoptedStyleSheets (and Edge proposals) aim to let you import CSS as a stylesheet and attach it to a shadow root instead of bundling styles into JS. This reduces JS bundle size and allows better caching.
Demos & examples mentioned
- Declarative Shadow DOM via Service Worker + IndexedDB: Dave Rupert demoed saving a component’s shadow template to IndexedDB, service-worker HTML rewriter injects it into responses so subsequent navigations show components instantly.
- Timani Afif’s CSS Super Mario (example of complex CSS animations/scroll tricks).
- Zach Leatherman’s “browser window” web component example (uses shadow root).
- PWAs and PWASTORE examples: browsing/installs of one-page web utilities (Squoosh, SVGOMG, etc.) as installable apps.
- CodePen editor 2.0 live pop-out and one-click deployments (deployed versions are locked and shareable).
Tools, services, and resources referenced
- StudioWorks.app — invoicing web app integrated with Stripe (sponsor).
- BrowserStack — cross-browser/device testing service.
- PWAs / Web Install API, PWASTORE (search PWASTore).
- CodePen (new editor, pop-out live view, one-click deploys, shareable pens).
- Squoosh, SVGOMG — examples of useful single-page web apps.
- Lit & web components ecosystem.
- Bruce Lawson, Leah Verou, Timani Afif, Zach Leatherman — people/resources to follow for deeper examples and experiments.
Practical recommendations / action items
- If you have any web app that could be installed, learn the Web Install API — it simplifies installing PWAs from a web page.
- Try text-grow / text-shrink (Chromium flags) and container units for responsive, no-JS large headings; but test accessibility (min font-size, user preferences).
- Experiment with scroll-driven animations, animation triggers, and view transitions to replace fragile JS-driven scroll effects with CSS-native primitives where appropriate.
- Consider smaller web components (Lit) to reduce bundle size; explore adoptedStyleSheets / import assertions to move large styles out of JavaScript bundles for better caching.
- Prototype the declarative Shadow DOM + service worker approach if you’re using web components with heavy template work — but plan caching/versioning strategies and measure initial vs subsequent load improvements.
- Use modern sharable tooling (CodePen’s new editor & deploy) to prototype and share ideas without complex local setup.
Notable quotes & phrases from the episode
- “PWAs are back, baby.”
- “Declarative Shadow DOM — hold my beer.” (refers to injection via service worker)
- “It’s like a 40-minute ad for StudioWorks” (host banter)
Closing notes
The episode is a mix of practical how-tos and speculative tinkering — good if you want to keep up with emerging platform features and small experiments that could become common patterns. If you build web apps, prioritize:
- learning the new PWA install flows,
- experimenting with CSS scroll/view transition primitives,
- and rethinking where style assets live (to reduce JS bundle sizes).
