neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

Feature AFX: <></> as alias for Neos.Fusion:Fragment

Open mhsdesign opened this issue 3 years ago • 4 comments

Description

proposal to introduce <></> for afx:

< @if={false}>
   <h1>bar</h1>
   foo
</>

as alias for Neos.Fusion:Fragment

<Neos.Fusion:Fragment @if=false>
   <h1>bar</h1>
   foo
<Neos.Fusion:Fragment/>

Implementation detail:

it should be discussed, if attributes on the fragment do need a leading space to make parsing easier: < @if=false></> or <@if=false></>

mhsdesign avatar Jan 23 '22 16:01 mhsdesign

it is not related to the XML/HTML syntax, .. it's looks strange

markuspfeifenberger avatar Jan 25 '22 16:01 markuspfeifenberger

hmm but jsx does it like this... (to group stuff)

mhsdesign avatar Jan 25 '22 17:01 mhsdesign

im also fine with closing this, as the fragment is not in much demand

mhsdesign avatar Sep 03 '22 10:09 mhsdesign

I like the idea and I would prefer to have it with no leading space

jonnitto avatar Sep 03 '22 11:09 jonnitto

hmm im not sure if this really justifies extending afx. Since i wrote this - i never needed to use fragment at all. So if @jonnitto doenst oppose i would lile to close this ^^ Or maybe you can show me some coll usages of fragment - who would profit from this syntax

mhsdesign avatar Oct 26 '22 16:10 mhsdesign