How can one render a Liveview .heex file dynamically?

I would strongly suggest using some other mechanism for dynamic templates (like mustache) other than heex. Dynamic code loading, even done by admins, is a great way to cause all kinds of trouble because, at the end of the day, you’re enabling arbitrary code execution within your application.

FWIW just that you’d be using something like mustache doesn’t mean it can’t be live as long as it’s rendered inside of a live view that knows how to trigger a re-render of the mustache content.

6 Likes