code-q-web-factory / neos-link

CodeQ.Links for Neos - with Atomic.Fusion & Monocle in mind
MIT License
0 stars 0 forks source link

Rendering a link should become easier, not more complex… #1

Closed kdambekalns closed 3 years ago

kdambekalns commented 3 years ago

All that to render a link?

image

Just leaving this here, feel free to ignore. ❤️

But I came across this package in a project already, when looking for reasons of excessive object instatiation during Fusion rendering and thought "oh wow, that's a lot of indirection to build a link…" 🤷‍♂️

rolandschuetz commented 3 years ago

Happy to get any tips.

There's not a lot of indirection, just different objects for different use cases.

For a link you would only use CodeQ.Link:Link for the configuration, and CodeQ.Link:Tag for rendering.

How would you simplify this?

rolandschuetz commented 3 years ago

PS: You came across a prototype of this package, which used Carbon.Link as implementation... just to try out how the API could look like... all that is gone in the stable version

So if you would create a link like this:

linkSource = CodeQ.Link:NodeLink {
    node = ${node}
    backendLink = true
}
renderer = afx`
    <CodeQ.Link:Tag link={props.link} class="link" />
`

The linkSource would create with one Object, no indirection https://github.com/code-q-web-factory/neos-link/blob/master/Resources/Private/Fusion/Prototypes/NodeLink.fusion

The tag itself is also created with one custom prototype, no indirection https://github.com/code-q-web-factory/neos-link/blob/master/Resources/Private/Fusion/Prototypes/Tag.fusion

I just want to cover all typical use cases (including menus, breadcrumbs and fixtures).

kdambekalns commented 3 years ago

I admit: I saw this being announced and wanted to "dump" my immediate thoughts, so they don't get lost. I'll check in more detail! ❤️

rolandschuetz commented 3 years ago

@kdambekalns Any additional feedback? :)

kdambekalns commented 3 years ago

Finally had another close(r) look, this is indeed way better than the prototype I saw back then. 🎉