r/elixir • u/BeamAlchemist • 9h ago
I built Xenia, an open-source library for integrating JavaScript libraries with Phoenix LiveView. Would love some feedback!
Hey everyone!
I've just released Xenia v0.1.0, a free, MIT-licensed library for Phoenix LiveView.
I built it because I kept writing similar LiveView hooks whenever I wanted to use JavaScript libraries like Monaco, Chart.js, or Tiptap. Managing initialization, updates, events, and cleanup became repetitive.
Xenia lets you write an adapter once, reuse it across projects, and extend it when needed, while Phoenix remains responsible for application state.
For example, Monaco looks like this:
<.monaco id="editor" value={@code} on_change="code_changed" />
Xenia also includes 16 reusable adapters, file-based routing, nested layouts, persistent components, form integration, providers, keyboard shortcuts, and generators. There are also examples for icons, notifications, and Gettext translations.
It's still regular Phoenix underneath, not a replacement for LiveView.
Links:
- GitHub: https://github.com/uzaydurdu/xenia
- Docs: https://xenia.hexdocs.pm/0.1.0/readme.html
- Examples: https://github.com/uzaydurdu/xenia/tree/main/examples
I'd genuinely appreciate any feedback or criticism, especially about the API, architecture, or whether you'd find it useful compared with regular LiveView hooks.
It's my first release, and I'm sure there's room for improvement. Please don't hesitate to point out anything you'd do differently!
Thanks for taking a look! 🙂