@marko/runtime-tags@6.1.22
·
2 commits
to main
since this release
Patch Changes
- #3281
802234eThanks @DylanPiercey! - Render native attribute values at compile time. Conditional and logical attribute values are pushed down to their branches so the literal side is serialized at build time, and a sharedname=prefix is hoisted out so only the differing value stays dynamic — e.g.title=x ? "a" : "b"compiles totitle=${x ? "a" : "b"}, andaria-hidden=x && "true"serializes the"true"side without re-evaluatingx. Becauseclass/styleomit a falsy value,class=x && "active"further simplifies tox ? " class=active" : "". Aclassobject/array with a static base is resolved up front without re-evaluating any toggle: a single toggle picks a precomputed literal, a few index a hoisted table packed from the toggles, and more concatenate the string for_attr_class— in every case the class array/object is no longer allocated and the quoting is resolved at build time.