choojs / choojs/nanocomponent

allow createElement to return DocumentFragment?

Open
#91 8 comments 0 reactions 0 assignees View on GitHub
enhancement question
Dominant language
JavaScript
Stars
364
Forks
29
PR merge metrics
No merged PRs in 30d

Description

`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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.