Recipes
Full applications wired together with Micra. Each recipe is the canonical answer to "how do I build <X> on Micra?" — copy the markup verbatim, adapt the state, and ship.
Todo app
Add / toggle / delete, three-way filter, localStorage,
derived counters. ~60 lines of JS.
Server-Sent Events
Native EventSource wired
into onCreate /
onDestroy — single stream,
named events, multi-stream, manual reconnect.
htmx bridge
Twelve lines of glue:
htmx:afterSettle mounts new
islands, htmx:beforeSwap
destroys old ones,
HX-Trigger bridges to the
Micra bus.
Rails + Micra
importmap pin + twelve lines of layout glue. Tasks board
with CSRF-attached
this.fetch, Turbo Drive /
Streams / Frames cleanup, and the
micra-rails gem
caveats.
Form + server validation
Sign-up form with per-field errors from a 422 response and a
submit state machine (idle / submitting / success /
error).
Search + debounce
Type-to-search input with 300 ms debounce and
AbortController so stale
responses can't overwrite a fresher list.
Optimistic updates
Mutate first, fetch second. Snapshot for rollback when the
request fails, toast to explain.
Routing + URL sync
Hash routing for SPA islands and querystring sync for
filters. Back / forward / share-link work for free.