This issue helps me track changes needed to roll out hyperHTML V2.
hyperHTML.escape (useless since V0)hyperHTML.adopt (experimental, V1 too unpredictable, viperHTML has changes for it)document.importNode instead of trusting connect/attributeChanged events (Custom Elements life-cycle will be different and CE will be always upgraded)hyperHTML.adopt(...) based on viperHTML changes and as separate bundle~ will be out in another releasenode.method(...spread) causes unnecessary Babel output, use node.apply(node, spread) insteadtypeof anything causes unnecessary Babel output if preset 2015 is usedEhat about babel-env?
unnecessary, hyperHTML is easily compatible with IE9+ and Android 2+.
Target browsers will be preserved since it's a no brainer, the isue with Babel is that I want control the output and drop all the unnecessary churn.
If I use a single typeof in the code, as example, Babel pollute the bundle with checks for Symbol but I don't use a single symbol in the whole core so that's unnecessary churn.
to whom might concern ... how about the style attribute is handled in a special way?
I think the React/Preact solution is reasonable and I'm thinking about bringing it in V2.
I don't encourage the usage of inline styles, but for those that changes frequently it feels silly to not improve developer experience there.
@WebReflection are you referring to something along the lines of:
hyper(document)`<div style=${{ backgroundColor: 'blue', border: 'red' }}>馃槑</div>`
@joshgillies yes, when an object, set properties right away (with the diff dance preact does too)
I believe it is a nice to have addition, but I am not sure if it should land on the core.
Isn't there a way to add this feature (and possibly others) as a plugin or something or with a mechanism similar to hyperHTML.define?
There are only 3 kind of attributes:
hyperHTML already handles all cases so there鈥檚 no room for extension.
Within the special case though, there is the style, which has been universally created via object literals and it鈥檚 some sort of de-facto standard.
Differently from nodes , where the content might constantly change, attributes behavior is defined as one-off operation so there鈥檚 no way to change/define new behaviors later on.
This constrain grants both extreme performance in attributes handling and consistent behavior with custom elements and built ins.
I don鈥檛 think it鈥檇 be wise to lose all of that for a use case that is very rare while passing objects has been widely used already. After all, if you want to transform an attribute inline you can do so already using a callback within the interpolation.
P.S. master has V2 already. There are tons of subdole changes but beside what鈥檚 been dropped it should be fully backward compatible, faster in some case, more reliable overall.
If any of you could test it and confirm it works out of the box, that鈥檇 be ace!
Thanks
Most helpful comment
to whom might concern ... how about the
styleattribute is handled in a special way?I think the React/Preact solution is reasonable and I'm thinking about bringing it in V2.
I don't encourage the usage of inline styles, but for those that changes frequently it feels silly to not improve developer experience there.