I run Phoenix (Rails-like web framework for Elixir) like so:
… then connect IEx (the Elixir REPL) using:
random=
… and connect Livebook (Jupyter for Elixir) using:
The server node (Erlang VM instance) has the name [email protected]
, and IEx nodes have names like [email protected]
.
Now I can recompile code in the server node (which is the same node that Livebook is attached to) by entering recompile
in IEx.
Sometimes it looks like Phoenix.CodeReloader even reloads the code automatically, so recompile
evaluates to :noop
, which is nice!
This means I can use Livebook to test out server functions as I iterate on them.
I tried running Livebook in its own node for a bit and including server code using:
Mix.install(
[
],
config_path:
)
This also works alright, but it’s nice to be connected to the same server node because you can e.g. look at the state of GenServer processes with :sys.get_state
.