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%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-09 17:47:23 +00:00
.github/workflows chore: drop leftover upstream and editor config 2026-10-07 11:48:24 +02:00
.zed chore: drop leftover upstream and editor config 2026-10-07 11:48:24 +02:00
bench perf(state): track a component's signal reads by position 2026-10-07 16:54:57 +02:00
docs feat(components): add a Shell layout with nav, main and context panels 2026-10-09 15:39:58 +00:00
examples feat(components): add a Shell layout with nav, main and context panels 2026-10-09 15:39:58 +00:00
scripts fix(release): check npm login before publish 2026-03-11 17:36:01 +01:00
src feat(components): add a Shell layout with nav, main and context panels 2026-10-09 15:39:58 +00:00
tests feat(components): add a Shell layout with nav, main and context panels 2026-10-09 15:39:58 +00:00
.gitattributes chore: drop leftover upstream and editor config 2026-10-07 11:48:24 +02:00
.gitignore feat(components): add a component library with a light and dark theme 2026-10-09 11:32:56 +00:00
.npmignore refactor: move the library into src/ grouped by area 2026-10-07 11:27:51 +02:00
.oxfmtrc.json chore: reformat 2026-02-19 11:45:49 +01:00
.oxlintrc.json chore: drop leftover upstream and editor config 2026-10-07 11:48:24 +02:00
.versionrc.json build(release): format release files before the release commit 2026-09-29 16:10:12 +02:00
bun.lock chore: rename to Mithril, Garage44 edition 2026-10-08 18:35:33 +00:00
bunfig.toml refactor: move the library into src/ grouped by area 2026-10-07 11:27:51 +02:00
CHANGELOG.md chore(release): 3.12.2 2026-10-07 16:58:35 +02:00
CLAUDE.md chore: rename to Mithril, Garage44 edition 2026-10-08 18:35:33 +00:00
LICENSE chore: rename to Mithril, Garage44 edition 2026-10-08 18:35:33 +00:00
package.json feat(validation): add chainable model validation, and a validation prop on fields 2026-10-09 11:45:32 +00:00
README.md feat(components): add a component library with a light and dark theme 2026-10-09 11:32:56 +00:00
tsconfig.json chore: drop leftover upstream and editor config 2026-10-07 11:48:24 +02:00

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() and watch() for direct use.
  • TypeScript — ships its source, no @types package or build step. State, JSX attributes, routes and m.route.Link are typed; the library has no any.
  • SSR — async oninit is 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.