loics2
Disable HEEx debug annotations conditionnaly
Hey!
I implemented this code some time ago to compile HEEx templates and give them to MJML (it’s mostly inspired by the live view renderer).
It works great, but recently, I enabled caller annotations in phoenix, and the @ symbol seems to cause some issues with MJML, and it fails to compile.
Is there a way to disable debug anotations just for this? The only place I found a reference to the debug annotations is in here, and it seems to only look at the application configuration.
Does anyone have any ideas?
Marked As Solved
steffend
In LiveView 1.2 (no release date yet), you’ll be able to do:
defmodule MyComponentModule do
use Phoenix.Component
@debug_heex_annotations false
@debug_attributes false
# any HEEx in here won't have debug annotations or data-phx-loc applied
end
Note that any component you call from a different module will still contain the annotations.
Also Liked
josevalim
We are discussing ways to disable this per template…
garrison
Yeah, the call site is here but it looks like it’s just based off of the global config.
I guess you could wrap those templates in put_env but that’s obviously insane. Maybe send a proposal or PR?
LostKobrakai
This is global config because the eex engine usually runs at compile time. So manual put_env calls would not be helpful here.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








