Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions patching-explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,29 @@ For example:
```html
<!-- load the document shell -->
<div id=container>
<div marker="results more">
<?start name=results>
<div marker="results">
<?start name="next-result">
Loading...
<?end>
</div>
</div>
<!-- later, as a response to navigation or a click or anything... -->
<script>
async function update_results() {
const writer = container.streamAppendHTMLUnsafe().getWriter();
await writer.write(`
<template for=result>
<?start name=results>
<template for=results#next-result>
Copy link
Collaborator Author

@tunetheweb tunetheweb Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be just results as doesn't need the named part since it's replacing the whole template anyway:

Suggested change
<template for=results#next-result>
<template for=results>

But I think it's cleaner to be the same as the next insert.

Result 1
<?marker name=more>
<?marker name="next-result">
</template>
`);
await writer.write(`
<template for=more>
<template for=results#next-result>
Result 2
<?marker name=more>
<?marker name="next-result">
</template>
`);
// Add as many more results streaming in later as you see fit.
}
</script>
```
Expand Down