Files
Bendik Aagaard LynghaugandClaude Fable 5 ce1ec9e4a9 rebrand: buuh — a friendly public fork under the uhhm org
Packages renamed to the @uhhm scope (@uhhm/buuh, @uhhm/buuh-html,
@uhhm/buuh-component, @uhhm/buuh-devtools, @uhhm/buuh-migrate,
@uhhm/bankai). Scoping is load-bearing twice over: npm routes registries
per scope so @uhhm/* resolves against project.uhhm.no while everything
else stays on npmjs, and it means this fork never squats upstream's
names anywhere. The codemod now migrates choo v7 apps to the @uhhm
names. README rewritten with the fork framing and full upstream credit;
the choojs RFC moves to docs/upstream-rfc-draft.md, in the drawer for if
this work ever goes home. API unchanged — choo() is still choo().

Also: Gitea Actions CI + release workflows (npm publish to the uhhm
registry on tag push, CDN bundle uploaded as a generic package),
npm run bundle producing dist-cdn/buuh.js (the whole framework as one
minified ES module for import-map use), docs/publishing.md explaining
what Gitea Packages is (a real npm registry) and is not (a CDN — serve
the bundle from a static host with module-safe MIME instead), and
onload.js constructing window.MutationObserver to match its own guard
(surfaced by smoke-testing the bundle outside a full browser).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NgfSjHE11oFpoSnLVKLXd
2026-09-08 19:55:20 +02:00

36 lines
1.1 KiB
JavaScript

// Streaming SSR demo: the shell flushes immediately, the slow section
// streams in when its promise resolves. Run it:
// node examples/streaming/server.js
//
// This page is server-rendered only (no hydration script): async holes
// stream on the server, while client-side views must be synchronous.
// Serializing streamed state for hydration is bankai v10 territory.
import choo from '@uhhm/buuh'
import html from '@uhhm/buuh-html'
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
export default function createApp ({ delay = 500 } = {}) {
const app = choo()
app.use((state) => { state.delay = delay })
app.route('/', mainView)
app.route('*', mainView)
return app
}
function mainView (state, emit) {
return html`
<body>
<h1>choo streams</h1>
<p>This shell was flushed before the slow part finished.</p>
${slowSection(state)}
</body>
`
}
async function slowSection (state) {
await wait(state.delay)
return html`<section id="slow">…and this arrived ${state.delay}ms later, same response.</section>`
}