Skip to content

Commit b1d6752

Browse files
noamrtunetheweb
andauthored
Update examples for new API shape (marker names separate from marker attribute) (#93)
* Update examples * Update examples/sw.js Co-authored-by: Barry Pollard <barrypollard@google.com> --------- Co-authored-by: Barry Pollard <barrypollard@google.com>
1 parent eeb6437 commit b1d6752

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

examples/nav-with-service-worker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</nav>
1111
</header>
1212
<main>
13-
<div id="content" marker="content"><?start name=content>Loading...</div>
13+
<div id="content" marker="content"><?start>Loading...</div>
1414
</main>
1515
</body>
1616
<script>

examples/out-of-order-streaming-range.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ <h1>Out of order streaming with start/end markers</h1>
1414
<tr>
1515
<td>Before</td>
1616
</tr>
17-
<?marker name=data>
17+
<?marker>
1818
<tr>
1919
<td>After</td>
2020
</tr>
2121
</tbody>
2222
</table>
2323

2424
<template for="data">
25-
<?start name=data>
25+
<?start>
2626
<tr>
2727
<td>Data</td>
2828
</tr>
29-
<?end name=data>
29+
<?end>
3030
</template>
3131

3232
<template for="data">
3333
<tr>
3434
<td>Data 1</td>
3535
</tr>
36-
<?marker name=data>
36+
<?marker>
3737
</template>
3838

3939
<template for="data">

examples/out-of-order-streaming.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
<body>
1010
<h1>Out of order streaming</h1>
1111

12-
<div marker="placeholder"><?start name=placeholder>Loading...</div>
12+
<div marker="placeholder"><?start>Loading...</div>
1313

1414
<template for="placeholder">
1515
<p>Result 1</p>
16-
<?marker name=placeholder></template
17-
>
16+
<?marker></template>
1817

1918
<template for="placeholder">
2019
<p>Result 2</p>

examples/stream-html-with-out-of-order.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body>
1010
<h1>Stream HTML with out of order patches</h1>
11-
<div id="root" marker="data"><?start name=data>Loading...</div>
11+
<div id="root" marker="data"><?start>Loading...</div>
1212

1313
<script>
1414
const root = document.getElementById("root");
@@ -20,7 +20,7 @@ <h1>Stream HTML with out of order patches</h1>
2020
for (let i = 0; i < 100; ++i) {
2121
await new Promise((resolve) => setTimeout(resolve, 1000));
2222
await writer.write(
23-
`<template for=data><?start name=data>${i}</template>`,
23+
`<template for=data><?start>${i}</template>`,
2424
);
2525
}
2626
writer.close();

examples/sw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
self.onfetch = (e) => {
22
const url = new URL(e.request.url);
33
if (url.searchParams.get("page") && url.pathname === "/content") {
4-
e.respondWith(new Response("<template for=content><?start name=content>Page " + url.searchParams.get("page") + "</template>"));
4+
e.respondWith(new Response("<template for=content><?start>Page " + url.searchParams.get("page") + "</template>"));
55
}
6-
};
6+
};

0 commit comments

Comments
 (0)