You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#090, Starting with 0.9.0, Rum will adopt “There’s Only One Way To Do It” policy. All attributes MUST be specified as kebab-cased keywords:. This is fine for your typical tag attribute; but results in issues with some other attributes like Alpine.js uses:
[:div {:@mouseenter "alert('Hello!')"}] gives an error
Having said all this, it would appear that giving the required attributes in string form works:
[:div {":class" "open ? '' : 'hidden'"}]
-> produces <div :class="open ? '' : 'hidden'"></div>(let's ignore the escaping of the attribute value for now)
[:div {"@mouseenter" "alert('Hello!')"}]
-> produces <div @mouseenter="alert('Hello!')"></div> (similarly let's ignore the escaping of the attribute value for now; I will file another issue for that)
I believe that officially supporting the string form for these use cases is the way to go, and if so, it would be good to note this down in the README.
The text was updated successfully, but these errors were encountered:
jf
changed the title
rum does not officially support non-symbol attributes
rum does not officially support non-symbol attributes, and thus officially precludes some attributes from being generated
Oct 1, 2024
jf
changed the title
rum does not officially support non-symbol attributes, and thus officially precludes some attributes from being generated
rum does not officially support non-symbol attributes, and thus officially precludes certain classes of attributes from being generated
Oct 1, 2024
As per https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#090,
Starting with 0.9.0, Rum will adopt “There’s Only One Way To Do It” policy. All attributes MUST be specified as kebab-cased keywords:
. This is fine for your typical tag attribute; but results in issues with some other attributes like Alpine.js uses:":"-prefixed attributes
[:div {::class "open ? '' : 'hidden'"}]
-> produces
<div></div>
"@"-prefixed attributes
[:div {:@mouseenter "alert('Hello!')"}]
gives an errorHaving said all this, it would appear that giving the required attributes in string form works:
[:div {":class" "open ? '' : 'hidden'"}]
-> produces
<div :class="open ? '' : 'hidden'"></div>
(let's ignore the escaping of the attribute value for now)[:div {"@mouseenter" "alert('Hello!')"}]
-> produces
<div @mouseenter="alert('Hello!')"></div>
(similarly let's ignore the escaping of the attribute value for now; I will file another issue for that)I believe that officially supporting the string form for these use cases is the way to go, and if so, it would be good to note this down in the README.
The text was updated successfully, but these errors were encountered: