Out-of-Order HTML Streaming Moves from JS Frameworks into the Browser

A new web proposal introduces out-of-order HTML streaming using the <template> element to allow for more efficient page loading. This method enables developers to define insertion points that are populated as data becomes available, improving performance and user experience.
Why it matters
This standardizes a technique previously limited to specific JavaScript frameworks, potentially improving web performance and reducing complexity for developers.
InfoQ Homepage News Out-of-Order HTML Streaming Moves from JS Frameworks into the Browser
The declarative proposal introduces out-of-order streaming with the standard <template> element via a new for attribute. Developers declare single insertion points (e.g., <?marker name="profile"> ), or wrap temporary fallback content (e.g., <?start name="profile">Loading profile...<?end> ).
When the server streams a matching <template for="profile"> later in the document, the HTML parser matches the identifier, removes the <?start> and <?end> markers along with any intermediate fallback nodes between them, and inserts the template’s contents into that DOM position. Developers may also include processing instructions in templates to allow multiple updates:
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in