Skip to content

v0.6.0 — the event-source seam

Choose a tag to compare

@thatsme thatsme released this 27 Jul 13:30

v0.6.0 — the event-source seam

Sub had one kind, :interval, and it is a timer — the runtime wakes itself.
Everything else worth subscribing to is the opposite shape: an external source
pushes, and the runtime receives without that source knowing anything about
rendering. This release is that seam, the two consumers that prove it, and the
widget that makes them worth looking at.

Added:

  • Sub.telemetry/2 — subscribe to :telemetry events. Phoenix, Ecto, Oban,
    Broadway, Finch and Bandit all already emit telemetry, so integrating with
    that one thing covers the ecosystem rather than one library.
  • Sub.logger/1 — a :logger handler, with Harlock.Sub.Logger.text/1 for
    rendering entries. Built second, and deliberately different, to test whether
    the seam generalises before four more kinds depend on it. It did: neither
    needed a change to Sub.start/2 or to the runtime's subscription diffing.
  • sparkline/1 — a one-line trend. progress/1 shows a fraction; this shows a
    history, right-aligned so the newest sample stays at the right edge.
  • box(focus_proxy: :child_id) — a container mirrors a child's focus for
    styling without joining focus traversal, which :focusable on the
    interactive widget otherwise makes impossible.
  • examples/dashboard.exs — all of the above in one screen.

Fixed:

  • A terminal reporting 0x0 no longer produces a 0x0 frame. TIOCGWINSZ
    succeeds while reporting zero on a tty that was never told its geometry (a
    serial console), and 0 || 24 is 0 in Elixir, so the fallback never fired
    and the app drew nothing — presenting as a hang.

pubsub, file, signal and port moved to v0.7. The seam they need exists,
so they are additions rather than design work, and holding a finished release
for them would have been holding it for nothing.

Full notes in CHANGELOG.md.