Skip to content

Commit f2fdbb1

Browse files
committed
Bump demo library versions.
We need to periodically update these in order to do an apples-to-apples comparison of the latest offerings for other template engines. This also makes the following changes: - Unifies import patterns in demos `import @netflix/x-element/*`. - Makes React code idiomatic with `.jsx` support in demos. - Unifies demo / performance test structure. Note, React 19+ _hangs_ on the performance tests now, so that is skipped by default.
1 parent 4b6118e commit f2fdbb1

39 files changed

+2942
-348
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- run: npm ci
1414
- run: npm run lint
1515
- run: npm run type
16+
- run: npm run build-react
1617
- run: git diff --exit-code
1718
- run: npm start &
1819
- run: sleep 2

demo/chess/chess-piece.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import XElement from '../../x-element.js';
1+
import XElement from '@netflix/x-element/x-element.js';
22
import styleSheet from './chess-piece.css' with { type: 'css' };
33

44
class ChessPieceElement extends XElement {

demo/chess/index.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<meta http-equiv="content-security-policy" content="default-src 'self';">
6-
<link rel="stylesheet" href="index.css">
7-
<script type="module" blocking="render" src="chess-piece.js"></script>
5+
<meta http-equiv="content-security-policy" content="
6+
default-src 'self';
7+
script-src 'self' 'sha256-3xomsitg9ZOvQzjbbIGFzD2Xto92sDJKO5NIlRHta9Q=';">
8+
<link rel="stylesheet" href="./index.css">
9+
<script type="importmap">
10+
{
11+
"imports": {
12+
"@netflix/x-element/": "../../"
13+
}
14+
}
15+
</script>
16+
<script type="module" blocking="render" src="./index.js"></script>
817
</head>
918
<body>
1019
<div id="container">

demo/chess/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './chess-piece.js';

demo/hello-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import XElement from '../x-element.js';
1+
import XElement from '@netflix/x-element/x-element.js';
22
import styleSheet from './hello-element.css' with { type: 'css' };
33

44
const logo = `\

demo/index.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<meta http-equiv="content-security-policy" content="default-src 'self';">
6-
<link rel="stylesheet" href="index.css">
7-
<script type="module" blocking="render" src="hello-element.js"></script>
5+
<meta http-equiv="content-security-policy" content="
6+
default-src 'self';
7+
script-src 'self' 'sha256-H4VQYHRIQ3VHLHL8T+ZzoD6TOR8+4j2tM7MX6VdeJL4=';">
8+
<link rel="stylesheet" href="./index.css">
9+
<script type="importmap">
10+
{
11+
"imports": {
12+
"@netflix/x-element/": "../"
13+
}
14+
}
15+
</script>
16+
<script type="module" blocking="render" src="./index.js"></script>
817
</head>
918
<body>
1019
<div id="content">
@@ -17,7 +26,7 @@ <h2 id="tagline">A dead simple basis for custom elements.</h2>
1726
<li><a href="./uhtml">integrating with µhtml</a></li>
1827
<li><a href="./react">wrapping in react</a></li>
1928
<li><a href="../test">run tests</a></li>
20-
<li><a href="./performance">performance</a></li>
29+
<li><a href="../performance">performance</a></li>
2130
</ul>
2231
</div>
2332
<hello-element id="x"></hello-element>

demo/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './hello-element.js';

demo/lit-html/base-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import XElement from '../../x-element.js';
1+
import XElement from '@netflix/x-element/x-element.js';
22
import { asyncAppend } from 'lit-html/directives/async-append.js';
33
import { asyncReplace } from 'lit-html/directives/async-replace.js';
44
import { cache } from 'lit-html/directives/cache.js';

demo/lit-html/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5+
<!-- The “connect-src” below is required for loading source maps. -->
56
<meta http-equiv="content-security-policy" content="
67
default-src 'self';
7-
script-src 'self' 'sha256-vpd4e6Q2EYlXOAcBOCPYNRqOSK1caV1iPamby7fBE30='
8-
https://esm.sh/[email protected]/;">
8+
connect-src
9+
https://esm.sh/[email protected]/;
10+
script-src 'self' 'sha256-KNJ2teZsZtuebJx1696McEyzIK7cknoSjHtsgWd8ZvA='
11+
https://esm.sh/[email protected]/;">
912
<script type="importmap">
1013
{
1114
"imports": {
12-
"lit-html/": "https://esm.sh/[email protected]/"
15+
"@netflix/x-element/": "../../",
16+
"lit-html/": "https://esm.sh/[email protected]/"
1317
}
1418
}
1519
</script>
16-
<script type="module" blocking="render" src="./demo-lit-html.js"></script>
20+
<script type="module" blocking="render" src="./index.js"></script>
1721
</head>
1822
<body>
1923
<ol>

demo/lit-html/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './demo-lit-html.js';

0 commit comments

Comments
 (0)