mix llv.install (LocalLiveView v0.1.0)

Copy Markdown View Source

Installs LocalLiveView into an existing Phoenix project.

Usage

mix phx.new my_app
cd my_app
# add {:local_live_view, ...} to mix.exs deps, then:
mix llv.install
mix setup
mix phx.server

This task will:

  • Add the LocalLiveView socket and COOP/COEP headers to your endpoint
  • Import LocalLiveView.Component in your web module html_helpers
  • Change app.js script tag to type="module"
  • Set up the JS bridge in assets/js/app.js
  • Configure esbuild to output ESM format
  • Add the LocalLiveView watcher to your endpoint config in config/dev.exs
  • Add mix llv.build to your setup alias
  • Generate a local/ project with a sample HelloLocal local live view
  • Generate a HelloLocalLive LiveView that renders it and route it at /hello_local

mix setup will then run mix llv.build which copies the LLV JS runtime files into your project's priv/static/assets/js/ and builds the WASM bundle from local/.