Fusion contains some unlucky names for prototypes that made sense at the time but
nowadays are a hurdle for new developers. An commob example is the Array prototype that returns a concatenated string, if you really mean array you have to use the RawArray prototype.
Since we cannot simply alter those names i suggest to define better names alongside the old ones for Neos 4.2.
Neos.Fusion:RawCollection -> Neos.Fusion:Mapping (also use items-attribute instead of collection)
Neos.Fusion:Collection -> Neos.Fusion:Iteration (also use items-attribute instead of collection, maybe support content in addition to itemRenderer for afx)
The old names should be deprecated but i suggest to still support them for a while. In the future we can extract them into a separate package but i suggest to wait at least until Neos 6.
In addition i suggest to seperate the MenuItem Generation from the current template based rendering.
This would add the following prototypes:
Neos.Neos:MenuGenerator
Neos.Neos:DimensionMenuGenerator
Neos.Neos:BreadcrumbMenuGenerator
The existing Prototypes Neos.Neos:Menu, Neos.Neos:DimensionMenu,
Neos.Neos:BreadcrumbMenu` would become pure FusionObjects that build upon those.
Since this adds/renames quite some prototypes i would like to get the team opinion on the big picture first. The implementation would be done separately for the Array* Collection and Menu* prototypes.
As we already talked about this, I mostly agree, but the following:
Neos.Fusion:Object as we generally talk about Fusion objects this is highly confusing. I get where you are coming from. How about (in conjunction with Mapping) we call this Neos.Fusion:Map ?
Additionally Mapping could be a Mapper ?
And Iteration could be an Iterator or even a Reducer if we wanted.
I very much agree with the renaming of the Array to something more fitting.
But Concatenation also doesn’t feel right for me yet. Reducer and Concatenation sounds so technical.
Maybe RenderableArray or something like that which shows the use?
And like Christian said, don’t use Object for the RawArray , think that will cause lots of confusion
Regarding the collection I have no problem with the current naming, therefore I’m neutral.
I like the suggestion but I agree with Christian: Object is no improvement.
And while we’re at it: I think it would be a good idea if the MenuGenerators would use a dedicated MenuItem (or similar) sub-prototype to reflect the items. Not some magic array
Strictly speaking, there’s no Reduce operation (in the sense of an Array -> Any function) in Fusion at the moment. So, Reducer might be a bit misleading, even if the current Neos.Fusion:Collection is a sort of reducer.
But I’d strongly support adding a general Reduce or even MapReduce prototype of course (and then basing Neos.Fusion:Collection on it).
Since adding Neos.Fusion:Map as better name for Neos.Fusion:RawCollection seems to be a thing we all agree on Neos.Fusion:Reduce would indeed be a nice addition.
Thanks for the feedback so far. I came to the conclusion that the new prototype names should reflect the declarative nature of fusion and thus describe the expected result.
Regarding the Menu* prototypes i now think we should deprecate them alltogether. The only non trivial one is the dimensionMenu. I hope the new CR will enable flowQuery Operations to access node-variants and make this case as trivial as the normal menus.
The only naming that seems off to me is the Concatenation. Don’t have a better name on the top of my head, but at least Concat seems a bit better in my opinion. But would hope there’s a more suiting name.