Skip to content

Commit dbbef10

Browse files
chore: change cdn, bump deps. (#69)
1 parent c6da89a commit dbbef10

6 files changed

Lines changed: 1339 additions & 67 deletions

File tree

examples/esm-demo.html

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<title>@knighted/jsx &mdash; esm.sh demo</title>
6+
<title>@knighted/jsx &mdash; CDN demo</title>
7+
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
8+
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
9+
<link
10+
rel="modulepreload"
11+
href="https://cdn.jsdelivr.net/npm/@knighted/jsx@1.7.6/lite/+esm"
12+
/>
13+
<link
14+
rel="modulepreload"
15+
href="https://cdn.jsdelivr.net/npm/@knighted/jsx@1.7.6/react/+esm"
16+
/>
17+
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/react@19.2.4/+esm" />
18+
<link
19+
rel="modulepreload"
20+
href="https://cdn.jsdelivr.net/npm/react-dom@19.2.4/client/+esm"
21+
/>
22+
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/lit@3/+esm" />
23+
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/shiki@1.1.7/+esm" />
724
<style>
825
:root {
926
font-family:
@@ -436,7 +453,7 @@
436453
<body>
437454
<main id="app">
438455
<header>
439-
<h1>@knighted/jsx + esm.sh</h1>
456+
<h1>@knighted/jsx + CDN</h1>
440457
<p>
441458
Use @knighted/jsx in any modern runtime—browser, Node, or CDN—without a build
442459
step.
@@ -446,18 +463,22 @@ <h1>@knighted/jsx + esm.sh</h1>
446463
<div class="loading-spinner" aria-hidden="true"></div>
447464
<div>
448465
<p><strong>Loading demo modules…</strong></p>
449-
<p>esm.sh dependencies stream in on first visit.</p>
466+
<p>CDN dependencies stream in on first visit.</p>
450467
</div>
451468
</section>
452469
</main>
453470

454471
<script type="module">
455-
import { jsx } from 'https://esm.sh/@knighted/jsx@latest/lite'
456-
import { reactJsx } from 'https://esm.sh/@knighted/jsx@latest/react'
457-
import { useEffect, useRef, useState } from 'https://esm.sh/react@19'
458-
import { createRoot } from 'https://esm.sh/react-dom@19/client'
459-
import { LitElement, css, html } from 'https://esm.sh/lit@3'
460-
import { codeToHtml } from 'https://esm.sh/shiki@1.1.7'
472+
import { jsx } from 'https://cdn.jsdelivr.net/npm/@knighted/jsx@1.7.6/lite/+esm'
473+
import { reactJsx } from 'https://cdn.jsdelivr.net/npm/@knighted/jsx@1.7.6/react/+esm'
474+
import {
475+
useEffect,
476+
useRef,
477+
useState,
478+
} from 'https://cdn.jsdelivr.net/npm/react@19.2.4/+esm'
479+
import { createRoot } from 'https://cdn.jsdelivr.net/npm/react-dom@19.2.4/client/+esm'
480+
import { LitElement, css, html } from 'https://cdn.jsdelivr.net/npm/lit@3/+esm'
481+
import { codeToHtml } from 'https://cdn.jsdelivr.net/npm/shiki@1.1.7/+esm'
461482

462483
const app = document.getElementById('app')
463484
const loadingCard = document.getElementById('demo-loading')
@@ -1058,7 +1079,7 @@ <h3>Share React state with Lit</h3>
10581079
<h2>Pick the runtime that matches your target</h2>
10591080
<p>
10601081
Each subpath ships a pre-minified helper so you can import exactly what you need from
1061-
npm or esm.sh.
1082+
npm or a CDN.
10621083
</p>
10631084
</header>
10641085
<div class="lite-metric-grid">
@@ -1108,7 +1129,7 @@ <h2>Try the React runtime</h2>
11081129
</p>
11091130
</header>
11101131
<p>
1111-
The panel below mounts React 19 + react-dom directly from esm.sh and keeps state with hooks.
1132+
The panel below mounts React 19 + react-dom directly from a CDN and keeps state with hooks.
11121133
</p>
11131134
<div class="react-mount" id="react-runtime-demo"></div>
11141135
<p>
@@ -1149,7 +1170,7 @@ <h2>Lit renders React via <code>reactJsx</code></h2>
11491170
<header>
11501171
<h2>Combine Lit + React</h2>
11511172
<p>
1152-
Stream Lit from esm.sh, register a custom element, and let React drive it with shared state.
1173+
Stream Lit from a CDN, register a custom element, and let React drive it with shared state.
11531174
</p>
11541175
</header>
11551176
<p>

0 commit comments

Comments
 (0)