Closed asvanberg closed 2 years ago
Hello @asvanberg ,
Html
used to be a regular data type, but this was changed to enable a new renderer. However, you can do all of these now easily (e.g., attributes and events are just arrays, similarly you can still use native js events on all tags of type a
, use smart constructors, etc). There are also so called managed nodes that give you the actual DOM node, if you really need it.
Having
Html a
it be a real type will enable traversing the hierarchy and make modifications to it.For example;
a
tags can be hijacked to use a custom on click handler to trigger amessage
that usespushState
and some internal routing state instead of reloading the entire pageimg
tags can be modified to add theloading="lazy"
attribute