← Back to release summary

Streaming declarative shadow DOM

Category
Web Components
Type
No developer-visible change
Status
Enabled by default (Chrome 111)
Intent stage
Prepare to ship

Summary

Chromium has shipped [1] a version of declarative shadow DOM in M90 which currently has 0.014% usage [2]. Mostly, that is due to the spec PR being stalled with no input from other implementers. Recently, there has been renewed interest in the feature, and discussions have resumed. As part of those discussions, two changes have been generally agreed upon: 1. Rename the `<template>` attribute from `shadowroot` to `shadowrootmode`. 2. Support streaming, by attaching the shadow root on the opening, rather than the closing, template tag. While the PR hasn't landed, and there is still an open issue (related to the DOMParser), we would like to ship the agreed upon behavior listed above. [1] https://chromestatus.com/feature/5191745052606464 [2] https://chromestatus.com/metrics/feature/timeline/popularity/3196

Motivation

Developers have always wanted declarative shadow DOM to support streaming, but other implementers were always opposed to making the required changes to the HTML parser. Recently, those concerns were changed, and other implementations proceeded with a streaming prototype.

Standards & signals

Explainers: https://github.com/whatwg/html/pull/5465 https://github.com/whatwg/dom/pull/892

View on chromestatus.com