rum
rum copied to clipboard
rum does not officially support non-symbol attributes, and thus officially precludes certain classes of attributes from being generated
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 {::class "open ? '' : 'hidden'"}]
-> produces <div></div>
[: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.