Elixir framework that compiles to JS - just shipped npm, Web API & Web Components interop
I'm the creator of Hologram - a framework that lets you write full-stack apps entirely in Elixir by compiling it to JavaScript for the browser. I believe Elixir deserves a true full-stack story, one that doesn't cut you off from the JS ecosystem.
There are 3 million npm packages out there and a ton of Web APIs - it would be a sin not to let Elixir developers tap into that. So we just shipped JavaScript interoperability in v0.8.0: you can now call JS functions, use npm packages, interact with Web APIs, instantiate classes, and work with Web Components - all from Elixir, no server round-trips needed.
Here's what it looks like - using Chart.js from Elixir:
```elixir defmodule MyApp.DashboardPage do use Hologram.Page use Hologram.JS
js_import from: "chart.js", as: :Chart
def action(:render_chart, _params, component) do canvas = JS.call(:document, :getElementById, ["myChart"])
chart = :Chart |> JS.new([canvas, %{type: "bar", data: component.state.data}]) |> JS.call(:update, [])
put_state(component, :chart, chart) end end ```
Full details: https://hologram.page/blog/hologram-v0-8-0-javascript-interop
Website: https://hologram.page
GitHub: https://github.com/bartblast/hologram
Would love to hear what you think.