Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Heex and Phoenix.Component support #24

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PJUllrich
Copy link

This WIP PR tries to add support for HEEX templates and Phoenix.Components to mjml_eex.

I managed to add basic support for both, but I'd like to discuss the approach with you.

Heex support

Interestingly, I could simply change the file extension from .eex to .heex and all templates were still compiled.

This doesn't activate all Heex validations though. For example, there are no compile-time validations for forgotten closing tags yet, but MJML throws an exception at runtime anyways.

Phoenix Component

I managed to render Phoenix Components that render Heex templates inside the MJML templates. They also check at runtime that all required variables are given. Again, this doesn't happen at compile-time.

Other

I added a small paragraph to the Readme, because I was blocked from committing because I didn't know I had to run mix git_hooks.install first.

@PJUllrich PJUllrich marked this pull request as draft August 30, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant