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
This commit is contained in:
co-authored by
Claude Fable 5
parent
b957b02410
commit
ce1ec9e4a9
@@ -1,30 +1,33 @@
|
||||
<h1 align="center">choo</h1>
|
||||
<h1 align="center">buuh</h1>
|
||||
|
||||
<div align="center">
|
||||
<strong>🚂🚋🚋🚋🚋🚋</strong>
|
||||
<strong>🚂🚋🚋🚋🚋👻</strong>
|
||||
</div>
|
||||
<div align="center">
|
||||
The sturdy frontend framework — now with a modern engine under the same hood.
|
||||
The sturdy little frontend framework — a friendly fork of choo,
|
||||
rebuilt for the modern platform.
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
> **This is the v8 branch.** choo v7 is on `master` and stays untouched
|
||||
> until 8.0.0 ships. Everything below describes v8: same API, same
|
||||
> philosophy, rebuilt for the platform of 2026. See
|
||||
> [`docs/v8.md`](docs/v8.md) for status and the full plan.
|
||||
> **buuh is a fork of [choo](https://github.com/choojs/choo)** — same
|
||||
> API, same philosophy, modern engine. It exists because we love choo
|
||||
> and wanted it alive on today's platform; all credit for the design
|
||||
> belongs upstream (see [Credits](#credits)). Everything is MIT, and if
|
||||
> upstream ever wants this work home, the door is open
|
||||
> ([`docs/upstream-rfc-draft.md`](docs/upstream-rfc-draft.md)).
|
||||
|
||||
## What is this
|
||||
|
||||
Choo is a small framework for building frontend applications with plain
|
||||
buuh is a small framework for building frontend applications with plain
|
||||
JavaScript and HTML. State lives in stores, changes flow through an event
|
||||
emitter, views are tagged template literals, and re-renders morph the real
|
||||
DOM. The whole framework — core, html engine, morphing, hydration, router,
|
||||
event bus — is **7.97 kB min+gzip** (7.15 kB brotli), enforced by CI.
|
||||
|
||||
```js
|
||||
import choo from '@choojs/core'
|
||||
import html from '@choojs/html'
|
||||
import choo from '@uhhm/buuh'
|
||||
import html from '@uhhm/buuh-html'
|
||||
|
||||
const app = choo()
|
||||
|
||||
@@ -46,12 +49,37 @@ app.route('/', (state, emit) => html`
|
||||
app.mount('body')
|
||||
```
|
||||
|
||||
## Why v8
|
||||
## Getting it
|
||||
|
||||
From the uhhm registry (one `.npmrc` line routes the scope; everything
|
||||
else still resolves from npmjs):
|
||||
|
||||
```console
|
||||
$ echo "@uhhm:registry=https://project.uhhm.no/api/packages/uhhm/npm/" >> .npmrc
|
||||
$ npm i @uhhm/buuh @uhhm/buuh-html
|
||||
$ npm i -D @uhhm/bankai
|
||||
```
|
||||
|
||||
Or with no package manager at all — one file, one import map:
|
||||
|
||||
```html
|
||||
<script type="importmap">
|
||||
{ "imports": { "buuh": "https://cdn.uhhm.no/buuh@8.0.0.js" } }
|
||||
</script>
|
||||
<script type="module">
|
||||
import { choo, html } from 'buuh'
|
||||
</script>
|
||||
```
|
||||
|
||||
See [`docs/publishing.md`](docs/publishing.md) for how the registry and
|
||||
the CDN bundle fit together.
|
||||
|
||||
## Why this fork
|
||||
|
||||
- **No build step, anywhere.** Templates parse at runtime (cached per
|
||||
call site in a WeakMap, clone-based instantiation — as fast as the old
|
||||
compile-time transform, without the toolchain). An import map and a
|
||||
`<script type="module">` is a complete development setup:
|
||||
call site in a WeakMap, clone-based instantiation — as fast as choo's
|
||||
old compile-time transform, without the toolchain). An import map and
|
||||
a `<script type="module">` is a complete development setup:
|
||||
see [`examples/counter/index.html`](examples/counter/index.html).
|
||||
- **Isomorphic by contract.** One app module. The browser mounts it, the
|
||||
server imports the same file and calls `toString(route)` or streams it
|
||||
@@ -62,17 +90,17 @@ app.mount('body')
|
||||
`state.prefetch` promises. Hydration *adopts* the server DOM (same
|
||||
element references, form state kept) and warns precisely when server
|
||||
and client markup disagree.
|
||||
- **Async routes, finally.** `app.route('/big', lazy(() => import('./big.js')))`
|
||||
— loading view or held tree while in flight, awaited on the server.
|
||||
([choojs/choo#653](https://github.com/choojs/choo/pull/653), answered.)
|
||||
- **Async routes.** `app.route('/big', lazy(() => import('./big.js')))`
|
||||
— loading view or held tree while in flight, awaited on the server
|
||||
(the answer to [choojs/choo#653](https://github.com/choojs/choo/pull/653)).
|
||||
- **Modern platform, no shims.** ESM only, Node ≥ 24, Baseline
|
||||
Widely Available browsers. The router speaks WHATWG URL and survives
|
||||
emoji, literal `%`, and Unicode normalization differences.
|
||||
|
||||
## bankai v10
|
||||
## bankai
|
||||
|
||||
The isomorphic compiler & server, rebuilt on Vite 8 / Rolldown. Only the
|
||||
client ever bundles — v8 server code is plain ESM Node runs as-authored.
|
||||
client ever bundles — server code is plain ESM Node runs as-authored.
|
||||
|
||||
```console
|
||||
$ bankai start app.js # dev: HMR + streaming SSR on every request
|
||||
@@ -92,17 +120,17 @@ with the precache manifest injected, `<title>` follows your
|
||||
|
||||
| package | what it is |
|
||||
|---|---|
|
||||
| `@choojs/core` | the Choo class: stores, router, emitter, `toString`/`toStream`, `lazy()` |
|
||||
| `@choojs/html` | tagged templates: DOM in the browser, strings/streams on the server, `morph`, `hydrate`, `raw` |
|
||||
| `@choojs/component` | stateful components with lifecycle hooks; the hydration boundary |
|
||||
| `@choojs/devtools` | `window.choo` console tooling |
|
||||
| `@choojs/migrate` | `choo-migrate` — the v7 → v8 codemod |
|
||||
| `bankai` | the compiler & server above |
|
||||
| `@uhhm/buuh` | the app class: stores, router, emitter, `toString`/`toStream`, `lazy()` |
|
||||
| `@uhhm/buuh-html` | tagged templates: DOM in the browser, strings/streams on the server, `morph`, `hydrate`, `raw` |
|
||||
| `@uhhm/buuh-component` | stateful components with lifecycle hooks; the hydration boundary |
|
||||
| `@uhhm/buuh-devtools` | `window.choo` console tooling |
|
||||
| `@uhhm/buuh-migrate` | `buuh-migrate` — the choo v7 → buuh codemod |
|
||||
| `@uhhm/bankai` | the compiler & server above (bin: `bankai`) |
|
||||
|
||||
## Migrating from v7
|
||||
## Migrating from choo v7
|
||||
|
||||
```console
|
||||
$ npx @choojs/migrate .
|
||||
$ npx @uhhm/buuh-migrate .
|
||||
```
|
||||
|
||||
converts simple CJS, remaps every specifier, and tells you honestly what
|
||||
@@ -117,13 +145,19 @@ $ npm test # 109 tests on node:test, zero framework deps
|
||||
$ npm run test:e2e # real Chromium: hydration, streaming, bankai
|
||||
$ npm run size # the wire-size budget
|
||||
$ npm run bench # vs nanohtml v1 and µhtml
|
||||
$ npm run bundle # the single-file CDN build
|
||||
```
|
||||
|
||||
Releases: bump versions, `git tag vX.Y.Z`, push the tag — Gitea Actions
|
||||
tests, publishes every package to the uhhm registry, and uploads the CDN
|
||||
bundle ([`.gitea/workflows/release.yml`](.gitea/workflows/release.yml)).
|
||||
|
||||
## Credits
|
||||
|
||||
Choo v8 carries forward a decade of work by
|
||||
[Yoshua Wuyts](https://github.com/yoshuawuyts) and the
|
||||
[choojs contributors](https://github.com/choojs), and builds on the
|
||||
ESM groundwork of the [@pirxpilot](https://github.com/pirxpilot) fork
|
||||
line. Per-file attribution headers name the module and version each port
|
||||
came from. MIT, as always.
|
||||
buuh is choo. The design, the API, and most of the ideas are
|
||||
[Yoshua Wuyts](https://github.com/yoshuawuyts)'s and the
|
||||
[choojs contributors](https://github.com/choojs)'; the ESM groundwork
|
||||
came from the [@pirxpilot](https://github.com/pirxpilot) fork line; this
|
||||
fork modernized the engine and the toolchain around them. Per-file
|
||||
attribution headers name the module and version each port came from.
|
||||
MIT, as always.
|
||||
|
||||
Reference in New Issue
Block a user