Mithril, Garage44 edition — Mithril.js with signals, state, SSR and a store. Forked from bitstillery/mithril.
- TypeScript 94.3%
- CSS 5.1%
- HTML 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github/workflows | ||
| .zed | ||
| bench | ||
| docs | ||
| examples | ||
| scripts | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .npmignore | ||
| .oxfmtrc.json | ||
| .oxlintrc.json | ||
| .versionrc.json | ||
| bun.lock | ||
| bunfig.toml | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Mithril, Garage44 edition
Mithril.js with signals, reactive state, server rendering and a persistent store. Strict TypeScript, developed with Bun.
A fork of Bitstillery's edition, kept for Garage44's projects. It is not published to npm; depend on it by git URL.
- Signals — components redraw when a signal they read changes; no
m.redraw().state()makes a plain object reactive, its functions become computeds.signal(),computed(),effect()andwatch()for direct use. - TypeScript — ships its source, no
@typespackage or build step. State, JSX attributes, routes andm.route.Linkare typed; the library has noany. - SSR — async
oninitis awaited on the server; HTML and state go to the client, which hydrates without refetching. Bun server helpers with sessions included. - Store — per-value persistence:
localStorage,sessionStorage, server session, or a cookie the server can render from. - Measured — batched redraws, and a benchmark suite covering render, signals, state, store, router and SSR.
Mithril v2 apps run unchanged, except m.request and streams: use fetch().
import m, {state} from '@garage44/mithril'
const $s = state({count: 0})
m.mount(document.body, {
view: () => <button onclick={() => $s.count++}>Clicked {$s.count} times</button>,
})
Getting started
bun add @garage44/mithril@git+https://code.garage44.eu/jeroen/mithril.git
Guides: setup, signals,
state, SSR,
store; the rest of docs/site/content/ covers
core Mithril. Example apps: examples/state/, examples/ssr/, and the
component library's sandbox, examples/components/.
Development
bun install
bun test # tests
bun run lint # format, lint, type-check
bun run bench # benchmarks; bench:render etc. for one topic
License
MIT — see LICENSE. Mithril was created by Leo Horie; thanks to all Mithril.js contributors.