declarative partial updates experiments
Experiments with the Declarative Partial Updates API and the Navigation API. As little JS as possible. Chrome 148+ behind chrome://flags/#enable-experimental-web-platform-features.
- 01. Basic marker placeholder
<?marker> + <template for> declarative replacement, zero JS.
- 02. Streaming fetch into element
streamHTML() piping a chunked fetch into the DOM.
- 03. HTMX emulation
Tiny JS that turns data-target attributes into streamed partial updates.
- 04. Navigation API + DPU
SPA routing via navigation.intercept(), content via streamHTML.
- 05. Islands architecture
Independent islands, each fetched in parallel via DPU.
- 06. Server-side rendered
Server streams the whole document with out-of-order <?marker> fills.
- 07. Streaming clock
Long-lived response that re-flushes a <template for> every second. Zero JS.
- 08. Skeleton card
Placeholder shapes that match the final layout — no layout shift on fill.
references
- Chrome blog: Declarative Partial Updates — Barry Pollard's introduction to the API.
- WICG/declarative-partial-updates — Specification repo with explainers and issues.
- Patching explainer —
<?start>/<?end>markers and<template for>. - Dynamic-markup explainer — The new
streamHTMLUnsafe()/ append / prepend / replace methods. - Chrome Status: Out of order streaming — DevTrial in 148 (behind flag), shipping target 150.
- Chrome Status: Parse processing instructions in HTML — Supporting work that makes
<?start>/<?end>parseable. - Chrome Status: setHTMLUnsafe and parseHTMLUnsafe — Chrome 124 foundation that the streaming methods extend.
- WHATWG HTML PR #11818 — The actual spec change for out-of-order streaming.
- WHATWG HTML issue #2142 — The original 2017 thread that led here.
- Mozilla standards-positions #1369 — Currently "No signal".
- WebKit standards-positions #628 — Currently "Support".
- template-for polyfill
- html-setters polyfill
- Chrome docs: Navigation API
- Jason Miller: Islands Architecture
- photo-album-server.js — A larger out-of-order streaming demo from the same team.