Tram-One / tram-one

🚋 Legacy View Framework For Vanilla Javascript
http://tram-one.io/
MIT License
36 stars 8 forks source link

Support components that return an Array of Elements (Fragments) #173

Closed JRJurman closed 2 years ago

JRJurman commented 3 years ago

Summary

React supports this using Fragments, we should look at doing something similar. Maybe DocumentFragments :man_shrugging: ? This may be unnaturally hard given that we attach so much data to the element being generated :thinking:

JRJurman commented 2 years ago

This may be accomplished when we update our dependencies from their original root (see https://github.com/Tram-One/nanohtml/issues/19, https://github.com/Tram-One/hyperx/issues/7, and https://github.com/Tram-One/nanomorph/issues/4)

JRJurman commented 2 years ago

Some of this work has been done here: https://github.com/Tram-One/tram-one/commit/b40f101cec87d29d747b35492e393ee2b12d2c79

This work does not rely on updates to the underlying libraries (which upon more inspection, appear to just expose interfaces for defining how to handle fragments, and don't actually offer any solutions).

JRJurman commented 2 years ago

We implemented fragments in #197, if there is a strong case we could look into supporting returning a list of elements, and wrapping that in an implicit fragment, but that would likely over-complicate the type interface.