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
Nue JS: Fragment support <></>
#195
Labels
Comments
goblinfactory
changed the title
Should Nue's reactive components support empty parent elements
Should Nue's reactive components support empty parent fragment elements Feb 12, 2024
<></>
?<></>
?
goblinfactory
changed the title
Should Nue's reactive components support empty parent fragment elements
Should Nue's reactive components support fragment elements Feb 12, 2024
<></>
?<></>
?
nobkd
added
new feature
New feature or request
question
Further information is requested
labels
Feb 12, 2024
Yes. There are several use cases for this. I think Vue uses a |
tipiirai
added
low priority
Done later
and removed
question
Further information is requested
labels
Feb 23, 2024
tipiirai
changed the title
Should Nue's reactive components support fragment elements
Nue JS: Fragment support Feb 23, 2024
<></>
?<></>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I might be wrong, but i think that currently the parent component that get's named, must be an HTML element.
Breaks here if you try to use a fragment;
nue/packages/nuejs/src/fn.js
Line 34 in d670714
My question is, Should Nue's reactive components support fragment elements
<></>
?Advantages
instead of
something more similar to react's empty element
<></>
as followsRationale
<DIV>
for anchor purposes only.If this isn't possible then maybe just use a div, and have an attribute ( for example
render-contents-only
??) , meaning it's not rendered into the dom but it's contents are. For example;Naming stuff is hard, so please take my suggested attribute name with a pinch of salt. Only there to help this discussion.
Please note, I do appreciate that in many cases the recommended approach would be to design your system with a
and have the parent/host resposible for displaying either the dialog or the list. I do appreciate that. However, there are genuine requirements for clean controls to render different types of elements, and this is a very contrived example to limit the amount of example html to include. Having to have more nested controls for each combination of semantic parents might technically be "cleaner" but would break cohesion. So there's a trade off when your design can be too pure, too abstracted and the resulting code lacks cohesion. (that ability to easily reason about code and a system.)
The text was updated successfully, but these errors were encountered: