The websocket diff update for data-quotes={"#{@value}"} sends '123'.
data-quotes={"#{@value}"}
'123'
The websocket diff update for data-braces={@value} sends ' data-braces="123"'.
data-braces={@value}
' data-braces="123"'
value = "123" ~H""" <div data-quotes={"#{@value}"} data-braces={@value} /> """
value = "123"
~H"""
<div data-quotes={"#{@value}"} data-braces={@value} />
"""
Is there a documentation about optimizations like this?
I would guess that is a way to let you nil the value and not get the attribute?
Empty attribute string vs no attribute set.
This also isn’t actually an optimization. Boolean attributes even with empty “value” are still considered to be true or set: Boolean attribute (HTML) - Glossary | MDN
true
The only way to make them be false is by not rendering the attribute at all.
false