Decouple HEEx from LiveView?

While working on a Phoenix-related project, I stumbled upon an interesting issue - it is impossible to use HEEx templates without having LiveView as a dependency. The culprit is that the HTML Engine for it is inside of Phoenix LiveVIew: phoenix_live_view/html_engine.ex at v0.17.11 · phoenixframework/phoenix_live_view · GitHub

This was really annoying to me, since I would expect that HEEx is nothing more than a templating language that should work regardless if the app is using LiveView or not. For very simple apps, I don’t think it’s worth the extra work for having LiveView. So now I need to have LiveView as a dependency, even though I have 0 live views! There was a suggestion on the Elixir Slack that we could move it out of the LiveView package, but I also want to hear everyone’s thoughts here.

2 Likes

I’m using heex as a templating engine which is very nice, but

This was my expectation at first as well, see this comment in the original HEEx roadmap issue: HEEx roadmap · Issue #1506 · phoenixframework/phoenix_live_view · GitHub. I’m not sure if they are waiting for a v1 to push the dependency out of LiveView or have abandoned the plans entirely. I also think it’s kind of overkill tbh, I’d rather have it as part of phoenix_html for instance.

1 Like