Skip to content
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

TASK: Use @private instead of nested components #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mficzel
Copy link
Member

@mficzel mficzel commented Nov 1, 2023

This required Neos 8.3 + but should improve the performance as a level of fusion objects is avoided.

@mficzel mficzel force-pushed the task/avoidNestedComponentsInFavorOfAtPrivateProps branch from 15c488d to 25e1ee2 Compare November 2, 2023 08:22
This will avoid the instantiation of a level of fusion objects and thus should improve performance
@mficzel mficzel force-pushed the task/avoidNestedComponentsInFavorOfAtPrivateProps branch from 750080b to 1acc8f6 Compare November 2, 2023 08:55
@mficzel mficzel marked this pull request as ready for review November 2, 2023 08:55
@@ -5,51 +5,50 @@ prototype(Sitegeist.Kaleidoscope:Source) < prototype(Neos.Fusion:Component) {
}

imageSource = null
[email protected] = ${value || __imageSource}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this __imageSource come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is put into context from Picture so you do not have to specify it for every source when you do write sources as children like:

image = afx<Sitegeist.Kaleidoscope:Picture imageSource={props.source}> <Sitegeist.Kaleidoscope:Source format="webp" /> <Sitegeist.Kaleidoscope:Source format="png" /> </Sitegeist.Kaleidoscope:Picture>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does Eel interpret ||? What happens if value is false or null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If value is not null (exactly php falsy) the expression will yield value otherwise __imageSource

Copy link
Contributor

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I haven't tried it in one of our projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants