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

!!! FEATURE: Neos 9.0 compatibility #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

!!! FEATURE: Neos 9.0 compatibility #62

wants to merge 2 commits into from

Conversation

dlubitz
Copy link
Contributor

@dlubitz dlubitz commented Jan 8, 2025

The PR makes this package Neos 9.0 compatible.

This needs to be tested carefully as main parts of the package have been rewritten based on new Neos ContentRepository.

<f:link.action action="purgeCache" format="json" arguments="{node: node}" class="neos-button clear-cache" title="Clear cache" data="{node-label: node.label}"><i class="fa fa-bolt"></i></f:link.action>
<div class="neos-hide" id="{node.identifier}">
<button class="neos-button" data-toggle="modal" href="#{item.node.aggregateId}" title="Additional info" data-check-url="{f:uri.action(action: 'checkUrl', format: 'json', arguments: {url: url})}"><i class="fa fa-info-circle"></i></button>
<f:link.action action="purgeCache" format="json" arguments="{nodeAddress: item.nodeAddress}" class="neos-button clear-cache" title="Clear cache" data="{node-label: item.node.label}"><i class="fa fa-bolt"></i></f:link.action>

Choose a reason for hiding this comment

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

fyi this link generation here in combination with

NodeAddress::fromNode($node)->toJson()

in the varnishCacheController caused some discussion in https://neos-project.slack.com/archives/C04PYL8H3/p1736364381060509

Ill take care of figuring out what we want for the Neos 9 release - either having to use nodeAddress here manually or reallowing some autocasting magic in the back and passing a full node -> neos/neos-development-collection#5069

But for now, this code works and is used in other places as well. Its not wrong its just less magic and more explicit^^

@dlubitz dlubitz self-assigned this Jan 13, 2025
@dlubitz dlubitz changed the title FEATURE: Neos 9.0 compatibility !!! FEATURE: Neos 9.0 compatibility Jan 17, 2025
@dlubitz dlubitz requested a review from mhsdesign January 27, 2025 07:59
Copy link

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

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

looking good (by skimming over) – just a couple of comments re (maybe unwanted) injection behavior change

Comment on lines +27 to +30
protected LoggerInterface $logger;

/**
* @Flow\Inject
* @var LoggerInterface
*/
protected $logger;

/**
* @Flow\Inject
* @var VarnishBanService
*/
protected $varnishBanService;

/**
* @Flow\Inject
* @var CacheTagService
*/
protected $cacheTagService;
#[Flow\Inject]
protected VarnishBanService $varnishBanService;

Choose a reason for hiding this comment

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

just a FYI: This changes the behavior slightly because previously the injections were lazy

Comment on lines +34 to +44
#[Flow\Inject]
protected SiteRepository $siteRepository;

#[Flow\Inject]
protected ContentRepositoryRegistry $contentRepositoryRegistry;

#[Flow\Inject]
protected SiteNodeUtility $siteNodeUtility;

#[Flow\Inject]
protected ContentCacheFlusherService $contentCacheFlusherService;

Choose a reason for hiding this comment

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

same here: lazy => eager

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, didn't know that. Any way to use PHP Attributes and lazy injecton? Does it matter in these cases?

Choose a reason for hiding this comment

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

No, I don't think that's possible.
And no, I don't think that it's a problem really, but I just wanted to mention it

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.

3 participants