Arizona 0.4.0 is out on Hex o/
The big one this time: Arizona no longer ships an HTTP server. The server is now an adapter package, so Arizona itself has no dependencies beyond OTP, and you pick what it runs on.
Server adapters
- arizona_roadrunner: on roadrunner 0.11, pure Erlang, HTTP/1.1, HTTP/2 and HTTP/3.
- arizona_cowboy: on Cowboy 2.18, with TLS and WebSockets over HTTP/2. It can also serve Arizona routes on a Cowboy listener another framework owns.
Both run the same black-box conformance suite, so routes, live views, controllers, the dev reload endpoint and MCP behave the same on either.
Nova
That last bit is what arizona_nova builds on: live Arizona pages on Nova’s own listener, right next to your Nova routes. There’s a small example, a link shortener where Nova follows the links and an Arizona dashboard shows the clicks climbing live. Thanks @Taure for starting it!
MCP: let your coding agent into the running app
Arizona serves the Model Context Protocol on the same listener as the rest of your app, on either adapter. Mount the built-in dev server on your dev routes:
{mcp, ~"/mcp", arizona_dev_mcp, #{sessions => true}}
and point Claude Code, Cursor or the MCP Inspector at /mcp. The agent can then look at your running node instead of guessing from the source: the routes, a live view’s current bindings (view_state), recent logs and crash reports (get_logs), the reloader’s compile errors and stale modules, docs and source locations, and render a component with given bindings. Behind a localhost-only gate it can also force a recompile and reload, or eval Erlang in the live node as a persistent REPL.
It’s also a behaviour, arizona_mcp, so you can write your own server: three callbacks (init/1, tools/1, handle_tool/4) and a route, with resources, prompts, sessions and auth when you need them. The MCP guide has both.
Also
notify_drain/2for rolling deploys: live sessions get told to wind down while the listener keeps accepting, so reconnects land on it.- The dev reloader’s file watcher moved out too, to arizona_watcher_fs, for your dev profile only.
A new website, with no server
The website got a redesign. It’s generated by arizona_static, and there’s now a static client too: a generated page runs its browser-side commands (?local state, tabs, dialogs, copy to clipboard, Picture-in-Picture) with no server behind it. So poke around: the theme switch, the tabs and the pop-out guide are all plain event attributes, running in your browser.
Since the last post
0.1.0 was a while ago, so a quick catch-up on 0.2.0 and 0.3.0:
- Template values are HTML-escaped by default.
- Sessions (encrypted cookie, or a server-side store), flash messages and a CSRF Origin check, on by default.
patchnavigation, which keeps the view alive and ships only what changed, next tonavigate.?local: client-owned state like an open dialog or the current tab, updated in the browser with no round-trip.- Two more render targets from the same views:
?native(JSON, driving Android and iOS clients) and?terminal(over a TTY or SSH). - Native shells: the same web app can run inside Tauri or Electron, and the server drives OS features through
arizona_os(window title, fullscreen, native notifications, screen-capture protection). In a plain browser it’s a safe no-op. There’s a reference Tauri shell. arizona_js:fetch/2: submit a form over HTTP with no reload, so login, logout or a password change can set a real HttpOnly cookie while the typed fields and inline errors stay on screen.- View transitions for any change, not just navigation:
arizona_js:transition/1,2or anaz_transitionattribute, respecting reduced motion. - Any DOM event works as
az_<event>:az_toggle,az_close, or a custom element’s own events. The names are collected at compile time, so there’s no list of supported events. - A long run of fixes to the parse transform, the diff engine, streams, navigation and the client. Many templates that used to misrender or freeze now fail at compile time with an explanation instead.
Upgrading
Add an adapter next to Arizona and name it in the config:
{deps, [arizona, arizona_roadrunner]}.
[{arizona, [{server, #{adapter => arizona_roadrunner_server, routes => [...]}}]}].
Controller actions also changed shape a bit; the release notes have the full list.
Feedback, bug reports and PRs are all very welcome. Give it a try!
Cheers!
William