code-q-web-factory/neos-link

Rendering a link should become easier, not more complex…

Closed this issue · 5 comments

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…" 🤷‍♂️

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?

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).

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! ❤️

@kdambekalns Any additional feedback? :)

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