Skip to content

0.9.17

Choose a tag to compare

@github-actions github-actions released this 09 Oct 17:07
· 46 commits to master since this release

Added

  • Async work in screens, the LiveView way. Mob.Socket.start_async/3 runs
    a function in a task linked to the screen and delivers {:ok, result} or
    {:exit, reason} to the new optional handle_async/3 callback, so a screen
    can render a loading state (a spinner, or skeleton boxes) and fill it in
    when the data arrives. A crashing task does not crash the screen, and none of
    the task's messages (:DOWN, the link's :EXIT) reach handle_info/2.
    Starting a name that is still running replaces the older task and only the
    newest reports. Mob.Socket.cancel_async/3 always stops the task; its
    reason is only what handle_async/3 receives as {:exit, reason}. A
    screen's tasks stop when the screen does, including a
    stop with reason :normal. Mob.ScreenCase.render_async/2 awaits them in
    off-device tests. Mirrors LiveView's start_async/3, handle_async/3,
    cancel_async/3 and render_async/2. See decisions/2026-10-09-screen-async-tasks.md.
  • Docs for AI agents, in the package and on hexdocs. The Hex package now
    ships guides/ and a new usage-rules.md, so an app has
    deps/mob/guides/*.md and deps/mob/usage-rules.md matching its exact mob
    version (mix usage_rules.sync picks the rules file up). usage-rules.md is
    the short version: screens, async loading, lists, navigation, testing, and
    where the docs are. It is also on hexdocs as "Usage Rules for AI Agents".
    A new guide, Coming from Phoenix LiveView,
    maps assign_async, start_async, streams, phx-click, navigation and
    LiveViewTest to Mob. Guide titles name what they cover (llms.txt lists
    titles only), e.g. "Screen Lifecycle & Async Loading". The README has a "For
    AI agents" section, and guides/agentic_coding.md says where an app's agent
    finds the docs.

Fixed

  • Docs: async loading and pagination examples. The pull-to-refresh and
    infinite-scroll patterns in guides/events.md started a Task.async/1 and
    never handled its reply, so :loading/:refreshing never cleared; they now
    use start_async/3. The infinite-scroll example used on_end_reached on a
    <Scroll> and matched {:end_reached, tag}. on_end_reached is a
    <LazyList> prop, and it delivers {:tap, tag}. guides/screen_lifecycle.md
    documents handle_async/3 and that slow work in mount/3 delays the screen's
    first frame.
  • Docs: broken and wrong links. The Mob module doc linked
    guides/getting_started.html and guides/architecture.html, which 404 on
    hexdocs. guides/agentic_coding.md linked the repos' AGENTS.md on a
    main branch that doesn't exist (it's master).