{"slug": "one-ui-many-back-ends-out-of-order-html-streaming-in-autocss", "title": "One UI, Many Back-Ends: Out-of-Order HTML Streaming in AutoCSS", "summary": "A developer built AutoCSS, a presentation-layer architecture that keeps HTML, CSS, and JavaScript strictly separated so a single standards-compliant UI can render data from many different back-ends. The approach relies on out-of-order HTML streaming via named markers and <template for> patches, letting the browser place streamed HTML without JavaScript; in headless Chrome 158 testing, patching filled an AutoCSS-shaped page through load, view switch, and back while cutting data-mapping JavaScript by about 87%. The feature has shipped only in Chrome/Edge 150 (with streaming setters in 157), while Firefox and Safari have yet to implement it.", "body_md": "Nov 30, 2026 · @D7460N\n\n**AutoCSS** keeps the presentation layer air-gapped from the data layer, so one modern, secure, fully W3C/WCAG Standards and 508 A11Y compliant UI can render and adapt to, and control many various back-ends.\n\n*Out-of-order HTML streaming* lets the browser itself place delivered HTML into that UI, which moves more of the UI to one security approved CDN-served source.\n\n**AutoCSS** canon states the aim: \"not one project's UI but every project's at once — one presentation layer, served once, called remotely to render any back-end's data by that data's presence and shape alone\" ([AGENTS.md §1](https://github.com/D7460N-ai/D7460N.ai/blob/main/AGENTS.md)).\n\n| Layer | Owns | Never holds | \n|---|---|---|\n| HTML | Semantic and HTML5 custom elements: structure only | Classes, ids, `data-*` , CSS, JS | \n| CSS | Look/feel, state, visibility by data presence ( `:not(:empty);` ,```:has()``;``` , container and style queries,``` light-dark()``;``` ) | Data, JS | \n| JS | Data transport (CRUD) through one `oninput` | Presentation, HTML | \n| Data (JSON today) | Values only | HTML, styling hints | \n\nBecause CSS reacts live in real-time to whatever arrives, the UI does not need to know which back-end sent it. That is the \"one UI for many back-ends\" goal.\n\nPatching lets HTML arrive in any order and land in named spots in the page; the browser does the placing, not JS ([article](https://itnext.io/how-out-of-order-streaming-html-will-revolutionize-the-web-4978800b44af), [Chrome blog](https://developer.chrome.com/blog/declarative-partial-updates)).\n\n```\n<h1><?start name=\"h1\">Loading…<?end></h1>\n\n<template for=\"h1\">Home</template>\n```\n\n| Part | What it does | Shipped | \n|---|---|---|\n| `<?start name>` …`<?end>` ,`<?marker name>` | Named spots (processing instructions, formerly parsed as comments) | Chrome/Edge 150 ( [webstatus](https://webstatus.dev/features/template-for) ) | \n| `<template for=\"name\">` | Replaces the named spot with its content; no JS | Chrome/Edge 150 | \n| `<template for=\"name\" src=\"url\">` | Fetches the content from a URL; no JS | Experimental flag only | \n| `streamAppendHTMLUnsafe()` and other streaming setters | JS streams fetched HTML; its `<template for>` patches apply | Chrome/Edge 157 ( [webstatus](https://webstatus.dev/features/html-streaming-setters) ) | \n\nA patch can carry new markers, so the same spot can be filled again. The article's single-page demo uses that to swap page content on each navigation ([live demo](https://streaming-spa.vercel.app/)). The safe `streamAppendHTML()` drops the templates, so the demo uses the `Unsafe` variant.\n\nFirefox and Safari have not shipped it. WebKit's position is \"support\" ([#628](https://github.com/WebKit/standards-positions/issues/628)) and Mozilla's is \"positive\" ([#1369](https://github.com/mozilla/standards-positions/issues/1369)). An earlier no-JS approach used Declarative Shadow DOM and `<slot>` ([lamplightdev](https://lamplightdev.com/blog/2024/01/10/streaming-html-out-of-order-without-javascript/)); AutoCSS bans both.\n\nThe CDN would carry everything shared, shell and CSS; each back-end would send only content, which the browser places and CSS reveals.\n\n[embedded content: AutoCSS delivery map · CDN, back-ends, 4 page steps]\n\nSteps 1 to 4 run the same way on every site; only the content in step 3 differs per back-end. The CDN shell is a ruling; the generator's location is open.\n\nIn headless Chrome 158, patching filled an AutoCSS-shaped page through load, view switch and back, and cut the data-mapping JS by about 87%.\n\n| Test | Result | \n|---|---|\n| `<template for>` fills a named spot | ✅ No JS; markers and template removed after | \n| `:empty` on an element holding only markers | ✅ True, so the CSS loader logic is unchanged | \n| Patch placed inside the `<template>` pool | ❌ Never applies; template content is inert | \n| `<template for src>` | ⚠️ Flag only; normal Chrome ignores `src` and wipes the placeholder | \n| One patch file fills many spots | ✅ Limited to the target's container; a patch aimed at `header` from`main` was blocked | \n| View switch: load, switch, back | ✅ Lists went 5 → 2 → 5 items; nav radios inside labels survived | \n| One spot takes a different layout per view | ✅ `p` +`p` +`ul` ↔`figure` +`p` ,`index.html` unchanged | \n| Outer shell from another origin (CORS) | ✅ Flag on: no JS, rendered with JS off. Normal Chrome: JS fallback | \n| JSON as a patch source | ❌ Never mapped; rejected or dumped as raw text | \n| Data-mapping JS in the reference app | 3 files, 3,631 bytes → 1 file, 458 bytes | \n| `contentEditable` on a filled spot | ✅ Markers survived editing | \n\nThe method works today only in Chrome and Edge, and its data must be HTML, not JSON.\n\n| Area | Finding | Status | \n|---|---|---|\n| Browsers | Chrome/Edge only; `<template for src>` still behind a flag | Waiting on Firefox, Safari and the `src` launch | \n| Data format | Patch files are HTML. JSON needs JS or a generator outside the page; the canon (§6) says data is JSON | Open ruling | \n| Security | `Unsafe` without a sanitizer ran an`onerror` handler and let a`<style>` restyle the page. An allowlist Sanitizer stripped both but kept a`javascript:` link. A CDN shell`<script>` ran on the`src` path | Allowlist sanitizer + CSP; shell file holds no `<script>` | \n| Attributes | `src` /`alt` cannot be patched onto existing elements; the data carries the whole`<img>` | Open | \n| Frameworks | JSX errors on markers; Vue errors and drops them; Angular drops them silently. AutoCSS CSS is unaffected | Framework apps keep their own data binding | \n| Failure | A failed CDN fetch left a blank page | Pin with `integrity` , render-block with`<link rel=\"expect\">` (untested) | \n| Fallback cost | A conditional `import()` keeps fallback code off supporting browsers, but hook J3 blocks it | Open ruling | \n\nTwo rulings are recorded (Nov 30, 2026); the matching canon edits are drafted but not committed.\n\n- Central control of the outer shell from the CDN is better than per-site `index.html` ; the per-site HTML-contract rule is removed.\n- Loading HTML through JS is loosened for the shell: `<template for src>` first, a JS fallback only where it is unsupported.\n\n-  Commit canon edits: `AGENTS.md` §5 and §9,`WHITELIST.md` J,`enforce.js` ,`rules.json`\n-  Architecture Test 5: original-vs-proposed screenshots and benchmark against `inject.js`\n- Rule on data format: HTML patch files, or JSON plus a generator\n- Find and test a Firefox and Safari path\n\n- [How Out-Of-Order Streaming HTML Will Revolutionize The Web](https://itnext.io/how-out-of-order-streaming-html-will-revolutionize-the-web-4978800b44af) , Danny Moerkerke, ITNEXT, Nov 30, 2026\n- [Streaming SPA live demo](https://streaming-spa.vercel.app/) and[source](https://github.com/DannyMoerkerke/streaming-spa)\n- [Declarative partial updates](https://developer.chrome.com/blog/declarative-partial-updates) , Chrome for Developers, and its[photo album demo source](https://github.com/GoogleChromeLabs/web-perf-demos/blob/main/patching-demos/photo-album-server.js)\n- [WICG Declarative Partial Updates](https://github.com/WICG/declarative-partial-updates) :[patching explainer](https://github.com/WICG/declarative-partial-updates/blob/main/patching-explainer.md) ,[fragment include explainer](https://github.com/WICG/declarative-partial-updates/blob/main/fragment-include-explainer.md)\n- webstatus.dev: [`<template for>`](https://webstatus.dev/features/template-for) ,[HTML streaming setters](https://webstatus.dev/features/html-streaming-setters)\n- Standards positions: [WebKit #628](https://github.com/WebKit/standards-positions/issues/628) ,[Mozilla #1369](https://github.com/mozilla/standards-positions/issues/1369)\n- [Out-of-Order HTML Streaming](https://developer.chrome.com/docs/modern-web-guidance/guides/performance/out-of-order-html-streaming) , Modern Web Guidance\n- [Streaming HTML out of order without JavaScript](https://lamplightdev.com/blog/2024/01/10/streaming-html-out-of-order-without-javascript/) , lamplightdev\n- [AGENTS.md](https://github.com/D7460N-ai/D7460N.ai/blob/main/AGENTS.md) , AutoCSS canon, and the[AutoCSS CDN](https://autocss-com.github.io/cdn/)", "url": "https://wpnews.pro/news/one-ui-many-back-ends-out-of-order-html-streaming-in-autocss", "canonical_source": "https://gist.github.com/dragontheory/469f31a4a1085211011810faf2e1052e", "published_at": "2026-12-01 04:34:43+00:00", "updated_at": "2026-12-01 04:43:44.434357+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence"], "entities": ["AutoCSS", "D7460N", "Chrome", "Edge", "Firefox", "Safari", "WebKit", "Mozilla"], "also_reported_by": [], "takeaway": "Using declarative <template for> patches with named start/end markers lets the browser place streamed HTML out of order without JavaScript, cutting data-mapping JS by about 87% in a headless Chrome 158 test.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/one-ui-many-back-ends-out-of-order-html-streaming-in-autocss", "markdown": "https://wpnews.pro/news/one-ui-many-back-ends-out-of-order-html-streaming-in-autocss.md", "text": "https://wpnews.pro/news/one-ui-many-back-ends-out-of-order-html-streaming-in-autocss.txt", "jsonld": "https://wpnews.pro/news/one-ui-many-back-ends-out-of-order-html-streaming-in-autocss.jsonld"}}