ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
865 stars 124 forks source link

fix: add quotes around attribute names which are reserved words in js #101

Closed fictitious closed 2 years ago

fictitious commented 2 years ago

Not sure if it was intended or not, but this commit removed quotes in compiled JSX output for attribute names which are reserved words in javascript, like "class".

get [class]() without quotes is invalid syntax in chrome, so I think the quotes are necessary at least for the web.

If it's ok to have quotes for all targets (ssr, universal?), the fix is pretty simple - revert t.isValidIdentifier call to the form it was before that commit - without the second false parameter.

ryansolid commented 2 years ago

Thank you.