Currently, domtypes defines dom attributes, properties, styles, events and elements as lazy val.
Now, we use domtypes in OutWatch, where most of the things we are constructing are builders. For example, the attribute contenteditable is an AttributeBuilder to which you can assign Boolean values. So you would write something like contenteditable := true. This is evaluated into Attribute("contenteditable", "true"). Ideally, our code should be compiled into the evaluated Attribute directly. Now, our AttributeBuilder already uses inline annotations to inline most of the construction part, but the compiler cannot inline the whole expression, because contenteditable is defined as a lazy val.
I would like to evaluate whether we can use @inline def instead of lazy val for the definitions in domtypes. What do you think? What kind of tests/evaluations would you like to see?
Currently, domtypes defines dom attributes, properties, styles, events and elements as
lazy val.Now, we use domtypes in OutWatch, where most of the things we are constructing are builders. For example, the attribute
contenteditableis anAttributeBuilderto which you can assignBooleanvalues. So you would write something likecontenteditable := true. This is evaluated intoAttribute("contenteditable", "true"). Ideally, our code should be compiled into the evaluated Attribute directly. Now, ourAttributeBuilderalready usesinlineannotations to inline most of the construction part, but the compiler cannot inline the whole expression, becausecontenteditableis defined as a lazy val.I would like to evaluate whether we can use
@inline definstead oflazy valfor the definitions in domtypes. What do you think? What kind of tests/evaluations would you like to see?