Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow createElement to return DocumentFragment? #91

Open
ungoldman opened this issue Apr 24, 2019 · 8 comments
Open

allow createElement to return DocumentFragment? #91

ungoldman opened this issue Apr 24, 2019 · 8 comments

Comments

@ungoldman
Copy link
Member

ungoldman commented Apr 24, 2019

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?

@bcomnes
Copy link
Contributor

bcomnes commented Apr 24, 2019

Open to ideas. I've been brainstorming the use of weakmaps as way to avoid having to look at the DOM too.

@bcomnes
Copy link
Contributor

bcomnes commented Apr 24, 2019

It may be easier to write a different component class to start out with. But also open to changes landing here.

@ungoldman
Copy link
Member Author

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.

@bcomnes
Copy link
Contributor

bcomnes commented Apr 24, 2019

https://github.com/hyperdivision/nanomorph-guard
https://github.com/hyperdivision/hui

Is one such start.

@ungoldman
Copy link
Member Author

yep just took a look at hui earlier today

@YerkoPalma
Copy link
Member

I have been using lit-element for a while and it is pretty cool. Also Beaker has been rebuild using lit-element

@s3ththompson
Copy link
Member

or choo-hooks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants