Plushie.Dev.DevServer (Plushie v0.6.0)

Copy Markdown View Source

File watcher and recompiler for dev-mode live reload.

Watches compilation directories for .ex and .exs changes, recompiles, and tells the runtime to re-render. The UI updates without losing application state.

When native widgets are detected (via Plushie.WidgetRegistry), also watches their Rust crate directories for .rs and Cargo.toml changes. On change, runs cargo build via a Port, streams output to the dev overlay, and restarts the renderer on success.

By default, watches all directories in elixirc_paths (e.g. lib/ and examples/ in dev). Override with the :dirs option.

Requires the :file_system package. Started automatically when config :plushie, code_reloader: true is set, or via start_link:

Plushie.Dev.DevServer.start_link(runtime: runtime_pid)

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the dev server with the given options.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(opts :: keyword()) :: GenServer.on_start()

Starts the dev server with the given options.