nanocomponent
nanocomponent copied to clipboard
allow createElement to return DocumentFragment?
nanohtml now supports document fragments, which are very handy for returning a collection of siblings without having to wrap them in an arbitrary element.
However nanocomponent is not currently designed to handle this.
If we modify the el instanceof window.Element assert in _handleRender to also accept window.DocumentFragment, we encounter an error because nanocomponent is trying to brand the returned node (which isn't a node).
This also complicates proxying and many other things. I'm not sure how much of a rewrite this would require, but I do think it would be nice to support this feature.
Thoughts?
Open to ideas. I've been brainstorming the use of weakmaps as way to avoid having to look at the DOM too.
It may be easier to write a different component class to start out with. But also open to changes landing here.
I've been considering a fresh start based on things I've learned the last couple years since we started the nanocomponent journey. Maybe... the time has come.
https://github.com/hyperdivision/nanomorph-guard https://github.com/hyperdivision/hui
Is one such start.
yep just took a look at hui earlier today
A few others I've been looking at too:
https://github.com/Polymer/lit-element https://github.com/WebReflection/hyperHTML-Element https://github.com/WebReflection/wicked-elements https://github.com/WebReflection/lighterhtml#what-about-custom-elements- (Vanilla web components)
I have been using lit-element for a while and it is pretty cool. Also Beaker has been rebuild using lit-element
or choo-hooks ;)